var tX=Object.create;var HC=Object.defineProperty;var rX=Object.getOwnPropertyDescriptor;var aX=Object.getOwnPropertyNames;var iX=Object.getPrototypeOf,nX=Object.prototype.hasOwnProperty;var oX=(se,ge)=>()=>(ge||se((ge={exports:{}}).exports,ge),ge.exports);var sX=(se,ge,Ye,Pt)=>{if(ge&&typeof ge=="object"||typeof ge=="function")for(let vr of aX(ge))!nX.call(se,vr)&&vr!==Ye&&HC(se,vr,{get:()=>ge[vr],enumerable:!(Pt=rX(ge,vr))||Pt.enumerable});return se};var lX=(se,ge,Ye)=>(Ye=se!=null?tX(iX(se)):{},sX(ge||!se||!se.__esModule?HC(Ye,"default",{value:se,enumerable:!0}):Ye,se));var r7=oX((t7,u2)=>{(function(se,ge){typeof u2=="object"&&u2.exports?u2.exports=ge():se.moduleName=ge()})(typeof self<"u"?self:t7,()=>{"use strict";var se=(()=>{var ge=Object.create,Ye=Object.defineProperty,Pt=Object.defineProperties,vr=Object.getOwnPropertyDescriptor,Zr=Object.getOwnPropertyDescriptors,ka=Object.getOwnPropertyNames,oi=Object.getOwnPropertySymbols,ci=Object.getPrototypeOf,Ln=Object.prototype.hasOwnProperty,bn=Object.prototype.propertyIsEnumerable,Fn=(Z,q,d)=>q in Z?Ye(Z,q,{enumerable:!0,configurable:!0,writable:!0,value:d}):Z[q]=d,Uo=(Z,q)=>{for(var d in q||(q={}))Ln.call(q,d)&&Fn(Z,d,q[d]);if(oi)for(var d of oi(q))bn.call(q,d)&&Fn(Z,d,q[d]);return Z},ws=(Z,q)=>Pt(Z,Zr(q)),wo=(Z,q)=>function(){return Z&&(q=(0,Z[ka(Z)[0]])(Z=0)),q},Ze=(Z,q)=>function(){return q||(0,Z[ka(Z)[0]])((q={exports:{}}).exports,q),q.exports},Ws=(Z,q)=>{for(var d in q)Ye(Z,d,{get:q[d],enumerable:!0})},Yl=(Z,q,d,x)=>{if(q&&typeof q=="object"||typeof q=="function")for(let A of ka(q))!Ln.call(Z,A)&&A!==d&&Ye(Z,A,{get:()=>q[A],enumerable:!(x=vr(q,A))||x.enumerable});return Z},cu=(Z,q,d)=>(d=Z!=null?ge(ci(Z)):{},Yl(q||!Z||!Z.__esModule?Ye(d,"default",{value:Z,enumerable:!0}):d,Z)),nh=Z=>Yl(Ye({},"__esModule",{value:!0}),Z),Eh=Ze({"src/version.js"(Z){"use strict";Z.version="3.1.1"}}),Up=Ze({"node_modules/native-promise-only/lib/npo.src.js"(Z,q){(function(x,A,M){A[x]=A[x]||M(),typeof q<"u"&&q.exports&&(q.exports=A[x])})("Promise",typeof window<"u"?window:Z,function(){"use strict";var x,A,M,e=Object.prototype.toString,t=typeof setImmediate<"u"?function(_){return setImmediate(_)}:setTimeout;try{Object.defineProperty({},"x",{}),x=function(_,w,S,E){return Object.defineProperty(_,w,{value:S,writable:!0,configurable:E!==!1})}}catch{x=function(w,S,E){return w[S]=E,w}}M=function(){var _,w,S;function E(y,b){this.fn=y,this.self=b,this.next=void 0}return{add:function(b,p){S=new E(b,p),w?w.next=S:_=S,w=S,S=void 0},drain:function(){var b=_;for(_=w=A=void 0;b;)b.fn.call(b.self),b=b.next}}}();function r(l,_){M.add(l,_),A||(A=t(M.drain))}function o(l){var _,w=typeof l;return l!=null&&(w=="object"||w=="function")&&(_=l.then),typeof _=="function"?_:!1}function a(){for(var l=0;l0&&r(a,w))}catch(S){s.call(new f(w),S)}}}function s(l){var _=this;_.triggered||(_.triggered=!0,_.def&&(_=_.def),_.msg=l,_.state=2,_.chain.length>0&&r(a,_))}function c(l,_,w,S){for(var E=0;E<_.length;E++)(function(b){l.resolve(_[b]).then(function(u){w(b,u)},S)})(E)}function f(l){this.def=l,this.triggered=!1}function g(l){this.promise=l,this.state=0,this.triggered=!1,this.chain=[],this.msg=void 0}function v(l){if(typeof l!="function")throw TypeError("Not a function");if(this.__NPO__!==0)throw TypeError("Not a promise");this.__NPO__=1;var _=new g(this);this.then=function(S,E){var y={success:typeof S=="function"?S:!0,failure:typeof E=="function"?E:!1};return y.promise=new this.constructor(function(p,u){if(typeof p!="function"||typeof u!="function")throw TypeError("Not a function");y.resolve=p,y.reject=u}),_.chain.push(y),_.state!==0&&r(a,_),y.promise},this.catch=function(S){return this.then(void 0,S)};try{l.call(void 0,function(S){n.call(_,S)},function(S){s.call(_,S)})}catch(w){s.call(_,w)}}var T=x({},"constructor",v,!1);return v.prototype=T,x(T,"__NPO__",0,!1),x(v,"resolve",function(_){var w=this;return _&&typeof _=="object"&&_.__NPO__===1?_:new w(function(E,y){if(typeof E!="function"||typeof y!="function")throw TypeError("Not a function");E(_)})}),x(v,"reject",function(_){return new this(function(S,E){if(typeof S!="function"||typeof E!="function")throw TypeError("Not a function");E(_)})}),x(v,"all",function(_){var w=this;return e.call(_)!="[object Array]"?w.reject(TypeError("Not an array")):_.length===0?w.resolve([]):new w(function(E,y){if(typeof E!="function"||typeof y!="function")throw TypeError("Not a function");var b=_.length,p=Array(b),u=0;c(w,_,function(h,P){p[h]=P,++u===b&&E(p)},y)})}),x(v,"race",function(_){var w=this;return e.call(_)!="[object Array]"?w.reject(TypeError("Not an array")):new w(function(E,y){if(typeof E!="function"||typeof y!="function")throw TypeError("Not a function");c(w,_,function(p,u){E(u)},y)})}),v})}}),On=Ze({"node_modules/@plotly/d3/d3.js"(Z,q){(function(){var d={version:"3.8.2"},x=[].slice,A=function(de){return x.call(de)},M=self.document;function e(de){return de&&(de.ownerDocument||de.document||de).documentElement}function t(de){return de&&(de.ownerDocument&&de.ownerDocument.defaultView||de.document&&de||de.defaultView)}if(M)try{A(M.documentElement.childNodes)[0].nodeType}catch{A=function(De){for(var et=De.length,vt=new Array(et);et--;)vt[et]=De[et];return vt}}if(Date.now||(Date.now=function(){return+new Date}),M)try{M.createElement("DIV").style.setProperty("opacity",0,"")}catch{var r=this.Element.prototype,o=r.setAttribute,a=r.setAttributeNS,i=this.CSSStyleDeclaration.prototype,n=i.setProperty;r.setAttribute=function(De,et){o.call(this,De,et+"")},r.setAttributeNS=function(De,et,vt){a.call(this,De,et,vt+"")},i.setProperty=function(De,et,vt){n.call(this,De,et+"",vt)}}d.ascending=s;function s(de,De){return deDe?1:de>=De?0:NaN}d.descending=function(de,De){return Dede?1:De>=de?0:NaN},d.min=function(de,De){var et=-1,vt=de.length,_t,St;if(arguments.length===1){for(;++et=St){_t=St;break}for(;++etSt&&(_t=St)}else{for(;++et=St){_t=St;break}for(;++etSt&&(_t=St)}return _t},d.max=function(de,De){var et=-1,vt=de.length,_t,St;if(arguments.length===1){for(;++et=St){_t=St;break}for(;++et_t&&(_t=St)}else{for(;++et=St){_t=St;break}for(;++et_t&&(_t=St)}return _t},d.extent=function(de,De){var et=-1,vt=de.length,_t,St,ar;if(arguments.length===1){for(;++et=St){_t=ar=St;break}for(;++etSt&&(_t=St),ar=St){_t=ar=St;break}for(;++etSt&&(_t=St),ar1)return ar/(gr-1)},d.deviation=function(){var de=d.variance.apply(this,arguments);return de&&Math.sqrt(de)};function g(de){return{left:function(De,et,vt,_t){for(arguments.length<3&&(vt=0),arguments.length<4&&(_t=De.length);vt<_t;){var St=vt+_t>>>1;de(De[St],et)<0?vt=St+1:_t=St}return vt},right:function(De,et,vt,_t){for(arguments.length<3&&(vt=0),arguments.length<4&&(_t=De.length);vt<_t;){var St=vt+_t>>>1;de(De[St],et)>0?_t=St:vt=St+1}return vt}}}var v=g(s);d.bisectLeft=v.left,d.bisect=d.bisectRight=v.right,d.bisector=function(de){return g(de.length===1?function(De,et){return s(de(De),et)}:de)},d.shuffle=function(de,De,et){(vt=arguments.length)<3&&(et=de.length,vt<2&&(De=0));for(var vt=et-De,_t,St;vt;)St=Math.random()*vt--|0,_t=de[vt+De],de[vt+De]=de[St+De],de[St+De]=_t;return de},d.permute=function(de,De){for(var et=De.length,vt=new Array(et);et--;)vt[et]=de[De[et]];return vt},d.pairs=function(de){for(var De=0,et=de.length-1,vt,_t=de[0],St=new Array(et<0?0:et);De=0;)for(ar=de[De],et=ar.length;--et>=0;)St[--_t]=ar[et];return St};var l=Math.abs;d.range=function(de,De,et){if(arguments.length<3&&(et=1,arguments.length<2&&(De=de,de=0)),(De-de)/et===1/0)throw new Error("infinite range");var vt=[],_t=_(l(et)),St=-1,ar;if(de*=_t,De*=_t,et*=_t,et<0)for(;(ar=de+et*++St)>De;)vt.push(ar/_t);else for(;(ar=de+et*++St)=De.length)return _t?_t.call(de,gr):vt?gr.sort(vt):gr;for(var Wr=-1,Ta=gr.length,ya=De[Vr++],ri,ni,Ma,Na=new S,Ka;++Wr=De.length)return zt;var Vr=[],Wr=et[gr++];return zt.forEach(function(Ta,ya){Vr.push({key:Ta,values:ar(ya,gr)})}),Wr?Vr.sort(function(Ta,ya){return Wr(Ta.key,ya.key)}):Vr}return de.map=function(zt,gr){return St(gr,zt,0)},de.entries=function(zt){return ar(St(d.map,zt,0),0)},de.key=function(zt){return De.push(zt),de},de.sortKeys=function(zt){return et[De.length-1]=zt,de},de.sortValues=function(zt){return vt=zt,de},de.rollup=function(zt){return _t=zt,de},de},d.set=function(de){var De=new z;if(de)for(var et=0,vt=de.length;et=0&&(vt=de.slice(et+1),de=de.slice(0,et)),de)return arguments.length<2?this[de].on(vt):this[de].on(vt,De);if(arguments.length===2){if(De==null)for(de in this)this.hasOwnProperty(de)&&this[de].on(vt,null);return this}};function W(de){var De=[],et=new S;function vt(){for(var _t=De,St=-1,ar=_t.length,zt;++St=0&&(et=de.slice(0,De))!=="xmlns"&&(de=de.slice(De+1)),ce.hasOwnProperty(et)?{space:ce[et],local:de}:de}},ie.attr=function(de,De){if(arguments.length<2){if(typeof de=="string"){var et=this.node();return de=d.ns.qualify(de),de.local?et.getAttributeNS(de.space,de.local):et.getAttribute(de)}for(De in de)this.each(be(De,de[De]));return this}return this.each(be(de,De))};function be(de,De){de=d.ns.qualify(de);function et(){this.removeAttribute(de)}function vt(){this.removeAttributeNS(de.space,de.local)}function _t(){this.setAttribute(de,De)}function St(){this.setAttributeNS(de.space,de.local,De)}function ar(){var gr=De.apply(this,arguments);gr==null?this.removeAttribute(de):this.setAttribute(de,gr)}function zt(){var gr=De.apply(this,arguments);gr==null?this.removeAttributeNS(de.space,de.local):this.setAttributeNS(de.space,de.local,gr)}return De==null?de.local?vt:et:typeof De=="function"?de.local?zt:ar:de.local?St:_t}function Ae(de){return de.trim().replace(/\s+/g," ")}ie.classed=function(de,De){if(arguments.length<2){if(typeof de=="string"){var et=this.node(),vt=(de=Re(de)).length,_t=-1;if(De=et.classList){for(;++_t=0;)(St=et[vt])&&(_t&&_t!==St.nextSibling&&_t.parentNode.insertBefore(St,_t),_t=St);return this},ie.sort=function(de){de=Fe.apply(this,arguments);for(var De=-1,et=this.length;++De=De&&(De=_t+1);!(gr=ar[De])&&++De0&&(de=de.slice(0,_t));var ar=Vt.get(de);ar&&(de=ar,St=Sr);function zt(){var Wr=this[vt];Wr&&(this.removeEventListener(de,Wr,Wr.$),delete this[vt])}function gr(){var Wr=St(De,A(arguments));zt.call(this),this.addEventListener(de,this[vt]=Wr,Wr.$=et),Wr._=De}function Vr(){var Wr=new RegExp("^__on([^.]+)"+d.requote(de)+"$"),Ta;for(var ya in this)if(Ta=ya.match(Wr)){var ri=this[ya];this.removeEventListener(Ta[1],ri,ri.$),delete this[ya]}}return _t?De?gr:zt:De?N:Vr}var Vt=d.map({mouseenter:"mouseover",mouseleave:"mouseout"});M&&Vt.forEach(function(de){"on"+de in M&&Vt.remove(de)});function Zt(de,De){return function(et){var vt=d.event;d.event=et,De[0]=this.__data__;try{de.apply(this,De)}finally{d.event=vt}}}function Sr(de,De){var et=Zt(de,De);return function(vt){var _t=this,St=vt.relatedTarget;(!St||St!==_t&&!(St.compareDocumentPosition(_t)&8))&&et.call(_t,vt)}}var xr,jr=0;function wr(de){var De=".dragsuppress-"+ ++jr,et="click"+De,vt=d.select(t(de)).on("touchmove"+De,Q).on("dragstart"+De,Q).on("selectstart"+De,Q);if(xr==null&&(xr="onselectstart"in de?!1:O(de.style,"userSelect")),xr){var _t=e(de).style,St=_t[xr];_t[xr]="none"}return function(ar){if(vt.on(De,null),xr&&(_t[xr]=St),ar){var zt=function(){vt.on(et,null)};vt.on(et,function(){Q(),zt()},!0),setTimeout(zt,0)}}}d.mouse=function(de){return bt(de,ue())};var Ir=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;function bt(de,De){De.changedTouches&&(De=De.changedTouches[0]);var et=de.ownerSVGElement||de;if(et.createSVGPoint){var vt=et.createSVGPoint();if(Ir<0){var _t=t(de);if(_t.scrollX||_t.scrollY){et=d.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var St=et[0][0].getScreenCTM();Ir=!(St.f||St.e),et.remove()}}return Ir?(vt.x=De.pageX,vt.y=De.pageY):(vt.x=De.clientX,vt.y=De.clientY),vt=vt.matrixTransform(de.getScreenCTM().inverse()),[vt.x,vt.y]}var ar=de.getBoundingClientRect();return[De.clientX-ar.left-de.clientLeft,De.clientY-ar.top-de.clientTop]}d.touch=function(de,De,et){if(arguments.length<3&&(et=De,De=ue().changedTouches),De){for(var vt=0,_t=De.length,St;vt<_t;++vt)if((St=De[vt]).identifier===et)return bt(de,St)}},d.behavior.drag=function(){var de=le(_t,"drag","dragstart","dragend"),De=null,et=St(N,d.mouse,t,"mousemove","mouseup"),vt=St(Be,d.touch,F,"touchmove","touchend");function _t(){this.on("mousedown.drag",et).on("touchstart.drag",vt)}function St(ar,zt,gr,Vr,Wr){return function(){var Ta=this,ya=d.event.target.correspondingElement||d.event.target,ri=Ta.parentNode,ni=de.of(Ta,arguments),Ma=0,Na=ar(),Ka=".drag"+(Na==null?"":"-"+Na),vi,ui=d.select(gr(ya)).on(Vr+Ka,an).on(Wr+Ka,vn),Pa=wr(ya),sn=zt(ri,Na);De?(vi=De.apply(Ta,arguments),vi=[vi.x-sn[0],vi.y-sn[1]]):vi=[0,0],ni({type:"dragstart"});function an(){var Pn=zt(ri,Na),Zn,eo;Pn&&(Zn=Pn[0]-sn[0],eo=Pn[1]-sn[1],Ma|=Zn|eo,sn=Pn,ni({type:"drag",x:Pn[0]+vi[0],y:Pn[1]+vi[1],dx:Zn,dy:eo}))}function vn(){zt(ri,Na)&&(ui.on(Vr+Ka,null).on(Wr+Ka,null),Pa(Ma),ni({type:"dragend"}))}}}return _t.origin=function(ar){return arguments.length?(De=ar,_t):De},d.rebind(_t,de,"on")};function Be(){return d.event.changedTouches[0].identifier}d.touches=function(de,De){return arguments.length<2&&(De=ue().touches),De?A(De).map(function(et){var vt=bt(de,et);return vt.identifier=et.identifier,vt}):[]};var Ke=1e-6,Ue=Ke*Ke,Me=Math.PI,qe=2*Me,Ce=qe-Ke,Te=Me/2,Pe=Me/180,at=180/Me;function yt(de){return de>0?1:de<0?-1:0}function Tt(de,De,et){return(De[0]-de[0])*(et[1]-de[1])-(De[1]-de[1])*(et[0]-de[0])}function Ot(de){return de>1?0:de<-1?Me:Math.acos(de)}function Gt(de){return de>1?Te:de<-1?-Te:Math.asin(de)}function rr(de){return((de=Math.exp(de))-1/de)/2}function Qt(de){return((de=Math.exp(de))+1/de)/2}function Tr(de){return((de=Math.exp(2*de))-1)/(de+1)}function la(de){return(de=Math.sin(de/2))*de}var Ua=Math.SQRT2,Ba=2,Ra=4;d.interpolateZoom=function(de,De){var et=de[0],vt=de[1],_t=de[2],St=De[0],ar=De[1],zt=De[2],gr=St-et,Vr=ar-vt,Wr=gr*gr+Vr*Vr,Ta,ya;if(Wr0&&(gn=gn.transition().duration(ar)),gn.call(ui.event)}function Zn(){Na&&Na.domain(Ma.range().map(function(gn){return(gn-de.x)/de.k}).map(Ma.invert)),vi&&vi.domain(Ka.range().map(function(gn){return(gn-de.y)/de.k}).map(Ka.invert))}function eo(gn){zt++||gn({type:"zoomstart"})}function $o(gn){Zn(),gn({type:"zoom",scale:de.k,translate:[de.x,de.y]})}function io(gn){--zt||(gn({type:"zoomend"}),et=null)}function Zo(){var gn=this,vo=ni.of(gn,arguments),cs=0,ps=d.select(t(gn)).on(Vr,Tu).on(Wr,Il),Tl=Pa(d.mouse(gn)),Gl=wr(gn);Bn.call(gn),eo(vo);function Tu(){cs=1,vn(d.mouse(gn),Tl),$o(vo)}function Il(){ps.on(Vr,null).on(Wr,null),Gl(cs),io(vo)}}function ul(){var gn=this,vo=ni.of(gn,arguments),cs={},ps=0,Tl,Gl=".zoom-"+d.event.changedTouches[0].identifier,Tu="touchmove"+Gl,Il="touchend"+Gl,yc=[],nt=d.select(gn),Yt=wr(gn);ua(),eo(vo),nt.on(gr,null).on(ya,ua);function cr(){var wa=d.touches(gn);return Tl=de.k,wa.forEach(function(Ja){Ja.identifier in cs&&(cs[Ja.identifier]=Pa(Ja))}),wa}function ua(){var wa=d.event.target;d.select(wa).on(Tu,Aa).on(Il,xa),yc.push(wa);for(var Ja=d.event.changedTouches,Ai=0,bi=Ja.length;Ai1){var Oi=fi[0],ki=fi[1],qa=Oi[0]-ki[0],ea=Oi[1]-ki[1];ps=qa*qa+ea*ea}}function Aa(){var wa=d.touches(gn),Ja,Ai,bi,fi;Bn.call(gn);for(var yn=0,Oi=wa.length;yn1?1:De,et=et<0?0:et>1?1:et,_t=et<=.5?et*(1+De):et+De-et*De,vt=2*et-_t;function St(zt){return zt>360?zt-=360:zt<0&&(zt+=360),zt<60?vt+(_t-vt)*zt/60:zt<180?_t:zt<240?vt+(_t-vt)*(240-zt)/60:vt}function ar(zt){return Math.round(St(zt)*255)}return new Rr(ar(de+120),ar(de),ar(de-120))}d.hcl=Wt;function Wt(de,De,et){return this instanceof Wt?(this.h=+de,this.c=+De,void(this.l=+et)):arguments.length<2?de instanceof Wt?new Wt(de.h,de.c,de.l):de instanceof ma?xt(de.l,de.a,de.b):xt((de=fa((de=d.rgb(de)).r,de.g,de.b)).l,de.a,de.b):new Wt(de,De,et)}var Pr=Wt.prototype=new Ci;Pr.brighter=function(de){return new Wt(this.h,this.c,Math.min(100,this.l+ra*(arguments.length?de:1)))},Pr.darker=function(de){return new Wt(this.h,this.c,Math.max(0,this.l-ra*(arguments.length?de:1)))},Pr.rgb=function(){return ta(this.h,this.c,this.l).rgb()};function ta(de,De,et){return isNaN(de)&&(de=0),isNaN(De)&&(De=0),new ma(et,Math.cos(de*=Pe)*De,Math.sin(de)*De)}d.lab=ma;function ma(de,De,et){return this instanceof ma?(this.l=+de,this.a=+De,void(this.b=+et)):arguments.length<2?de instanceof ma?new ma(de.l,de.a,de.b):de instanceof Wt?ta(de.h,de.c,de.l):fa((de=Rr(de)).r,de.g,de.b):new ma(de,De,et)}var ra=18,Ia=.95047,Ha=1,$a=1.08883,ai=ma.prototype=new Ci;ai.brighter=function(de){return new ma(Math.min(100,this.l+ra*(arguments.length?de:1)),this.a,this.b)},ai.darker=function(de){return new ma(Math.max(0,this.l-ra*(arguments.length?de:1)),this.a,this.b)},ai.rgb=function(){return mi(this.l,this.a,this.b)};function mi(de,De,et){var vt=(de+16)/116,_t=vt+De/500,St=vt-et/200;return _t=ct(_t)*Ia,vt=ct(vt)*Ha,St=ct(St)*$a,new Rr(Or(3.2404542*_t-1.5371385*vt-.4985314*St),Or(-.969266*_t+1.8760108*vt+.041556*St),Or(.0556434*_t-.2040259*vt+1.0572252*St))}function xt(de,De,et){return de>0?new Wt(Math.atan2(et,De)*at,Math.sqrt(De*De+et*et),de):new Wt(NaN,NaN,de)}function ct(de){return de>.206893034?de*de*de:(de-4/29)/7.787037}function Nr(de){return de>.008856?Math.pow(de,1/3):7.787037*de+4/29}function Or(de){return Math.round(255*(de<=.00304?12.92*de:1.055*Math.pow(de,1/2.4)-.055))}d.rgb=Rr;function Rr(de,De,et){return this instanceof Rr?(this.r=~~de,this.g=~~De,void(this.b=~~et)):arguments.length<2?de instanceof Rr?new Rr(de.r,de.g,de.b):aa(""+de,Rr,Kt):new Rr(de,De,et)}function Lr(de){return new Rr(de>>16,de>>8&255,de&255)}function Gr(de){return Lr(de)+""}var Kr=Rr.prototype=new Ci;Kr.brighter=function(de){de=Math.pow(.7,arguments.length?de:1);var De=this.r,et=this.g,vt=this.b,_t=30;return!De&&!et&&!vt?new Rr(_t,_t,_t):(De&&De<_t&&(De=_t),et&&et<_t&&(et=_t),vt&&vt<_t&&(vt=_t),new Rr(Math.min(255,De/de),Math.min(255,et/de),Math.min(255,vt/de)))},Kr.darker=function(de){return de=Math.pow(.7,arguments.length?de:1),new Rr(de*this.r,de*this.g,de*this.b)},Kr.hsl=function(){return da(this.r,this.g,this.b)},Kr.toString=function(){return"#"+Ur(this.r)+Ur(this.g)+Ur(this.b)};function Ur(de){return de<16?"0"+Math.max(0,de).toString(16):Math.min(255,de).toString(16)}function aa(de,De,et){var vt=0,_t=0,St=0,ar,zt,gr;if(ar=/([a-z]+)\((.*)\)/.exec(de=de.toLowerCase()),ar)switch(zt=ar[2].split(","),ar[1]){case"hsl":return et(parseFloat(zt[0]),parseFloat(zt[1])/100,parseFloat(zt[2])/100);case"rgb":return De(dr(zt[0]),dr(zt[1]),dr(zt[2]))}return(gr=kr.get(de))?De(gr.r,gr.g,gr.b):(de!=null&&de.charAt(0)==="#"&&!isNaN(gr=parseInt(de.slice(1),16))&&(de.length===4?(vt=(gr&3840)>>4,vt=vt>>4|vt,_t=gr&240,_t=_t>>4|_t,St=gr&15,St=St<<4|St):de.length===7&&(vt=(gr&16711680)>>16,_t=(gr&65280)>>8,St=gr&255)),De(vt,_t,St))}function da(de,De,et){var vt=Math.min(de/=255,De/=255,et/=255),_t=Math.max(de,De,et),St=_t-vt,ar,zt,gr=(_t+vt)/2;return St?(zt=gr<.5?St/(_t+vt):St/(2-_t-vt),de==_t?ar=(De-et)/St+(De0&&gr<1?0:ar),new Jt(ar,zt,gr)}function fa(de,De,et){de=It(de),De=It(De),et=It(et);var vt=Nr((.4124564*de+.3575761*De+.1804375*et)/Ia),_t=Nr((.2126729*de+.7151522*De+.072175*et)/Ha),St=Nr((.0193339*de+.119192*De+.9503041*et)/$a);return ma(116*_t-16,500*(vt-_t),200*(_t-St))}function It(de){return(de/=255)<=.04045?de/12.92:Math.pow((de+.055)/1.055,2.4)}function dr(de){var De=parseFloat(de);return de.charAt(de.length-1)==="%"?Math.round(De*2.55):De}var kr=d.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});kr.forEach(function(de,De){kr.set(de,Lr(De))});function ia(de){return typeof de=="function"?de:function(){return de}}d.functor=ia,d.xhr=Ca(F);function Ca(de){return function(De,et,vt){return arguments.length===2&&typeof et=="function"&&(vt=et,et=null),Fa(De,et,de,vt)}}function Fa(de,De,et,vt){var _t={},St=d.dispatch("beforesend","progress","load","error"),ar={},zt=new XMLHttpRequest,gr=null;self.XDomainRequest&&!("withCredentials"in zt)&&/^(http(s)?:)?\/\//.test(de)&&(zt=new XDomainRequest),"onload"in zt?zt.onload=zt.onerror=Vr:zt.onreadystatechange=function(){zt.readyState>3&&Vr()};function Vr(){var Wr=zt.status,Ta;if(!Wr&&ha(zt)||Wr>=200&&Wr<300||Wr===304){try{Ta=et.call(_t,zt)}catch(ya){St.error.call(_t,ya);return}St.load.call(_t,Ta)}else St.error.call(_t,zt)}return zt.onprogress=function(Wr){var Ta=d.event;d.event=Wr;try{St.progress.call(_t,zt)}finally{d.event=Ta}},_t.header=function(Wr,Ta){return Wr=(Wr+"").toLowerCase(),arguments.length<2?ar[Wr]:(Ta==null?delete ar[Wr]:ar[Wr]=Ta+"",_t)},_t.mimeType=function(Wr){return arguments.length?(De=Wr==null?null:Wr+"",_t):De},_t.responseType=function(Wr){return arguments.length?(gr=Wr,_t):gr},_t.response=function(Wr){return et=Wr,_t},["get","post"].forEach(function(Wr){_t[Wr]=function(){return _t.send.apply(_t,[Wr].concat(A(arguments)))}}),_t.send=function(Wr,Ta,ya){if(arguments.length===2&&typeof Ta=="function"&&(ya=Ta,Ta=null),zt.open(Wr,de,!0),De!=null&&!("accept"in ar)&&(ar.accept=De+",*/*"),zt.setRequestHeader)for(var ri in ar)zt.setRequestHeader(ri,ar[ri]);return De!=null&&zt.overrideMimeType&&zt.overrideMimeType(De),gr!=null&&(zt.responseType=gr),ya!=null&&_t.on("error",ya).on("load",function(ni){ya(null,ni)}),St.beforesend.call(_t,zt),zt.send(Ta??null),_t},_t.abort=function(){return zt.abort(),_t},d.rebind(_t,St,"on"),vt==null?_t:_t.get(Ya(vt))}function Ya(de){return de.length===1?function(De,et){de(De==null?et:null)}:de}function ha(de){var De=de.responseType;return De&&De!=="text"?de.response:de.responseText}d.dsv=function(de,De){var et=new RegExp('["'+de+` ]`),vt=de.charCodeAt(0);function _t(Vr,Wr,Ta){arguments.length<3&&(Ta=Wr,Wr=null);var ya=Fa(Vr,De,Wr==null?St:ar(Wr),Ta);return ya.row=function(ri){return arguments.length?ya.response((Wr=ri)==null?St:ar(ri)):Wr},ya}function St(Vr){return _t.parse(Vr.responseText)}function ar(Vr){return function(Wr){return _t.parse(Wr.responseText,Vr)}}_t.parse=function(Vr,Wr){var Ta;return _t.parseRows(Vr,function(ya,ri){if(Ta)return Ta(ya,ri-1);var ni=function(Ma){for(var Na={},Ka=ya.length,vi=0;vi=ni)return ya;if(vi)return vi=!1,Ta;var sn=Ma;if(Vr.charCodeAt(sn)===34){for(var an=sn;an++24?(isFinite(De)&&(clearTimeout(fn),fn=setTimeout(zn,De)),Li=0):(Li=1,An(zn))}d.timer.flush=function(){Xn(),to()};function Xn(){for(var de=Date.now(),De=Da;De;)de>=De.t&&De.c(de-De.t)&&(De.c=null),De=De.n;return de}function to(){for(var de,De=Da,et=1/0;De;)De.c?(De.t=0;--zt)Ma.push(_t[Vr[Ta[zt]][2]]);for(zt=+ri;zt1&&Tt(de[et[vt-2]],de[et[vt-1]],de[_t])<=0;)--vt;et[vt++]=_t}return et.slice(0,vt)}function Xo(de,De){return de[0]-De[0]||de[1]-De[1]}d.geom.polygon=function(de){return G(de,Ts),de};var Ts=d.geom.polygon.prototype=[];Ts.area=function(){for(var de=-1,De=this.length,et,vt=this[De-1],_t=0;++deKe)zt=zt.L;else if(ar=De-uo(zt,et),ar>Ke){if(!zt.R){vt=zt;break}zt=zt.R}else{St>-Ke?(vt=zt.P,_t=zt):ar>-Ke?(vt=zt,_t=zt.N):vt=_t=zt;break}var gr=Yo(de);if(Oo.insert(vt,gr),!(!vt&&!_t)){if(vt===_t){po(vt),_t=Yo(vt.site),Oo.insert(gr,_t),gr.edge=_t.edge=zs(vt.site,gr.site),Sn(vt),Sn(_t);return}if(!_t){gr.edge=zs(vt.site,gr.site);return}po(vt),po(_t);var Vr=vt.site,Wr=Vr.x,Ta=Vr.y,ya=de.x-Wr,ri=de.y-Ta,ni=_t.site,Ma=ni.x-Wr,Na=ni.y-Ta,Ka=2*(ya*Na-ri*Ma),vi=ya*ya+ri*ri,ui=Ma*Ma+Na*Na,Pa={x:(Na*vi-ri*ui)/Ka+Wr,y:(ya*ui-Ma*vi)/Ka+Ta};fl(_t.edge,Vr,ni,Pa),gr.edge=zs(Vr,de,null,Pa),_t.edge=zs(de,ni,null,Pa),Sn(vt),Sn(_t)}}function Bs(de,De){var et=de.site,vt=et.x,_t=et.y,St=_t-De;if(!St)return vt;var ar=de.P;if(!ar)return-1/0;et=ar.site;var zt=et.x,gr=et.y,Vr=gr-De;if(!Vr)return zt;var Wr=zt-vt,Ta=1/St-1/Vr,ya=Wr/Vr;return Ta?(-ya+Math.sqrt(ya*ya-2*Ta*(Wr*Wr/(-2*Vr)-gr+Vr/2+_t-St/2)))/Ta+vt:(vt+zt)/2}function uo(de,De){var et=de.N;if(et)return Bs(et,De);var vt=de.site;return vt.y===De?vt.x:1/0}function $s(de){this.site=de,this.edges=[]}$s.prototype.prepare=function(){for(var de=this.edges,De=de.length,et;De--;)et=de[De].edge,(!et.b||!et.a)&&de.splice(De,1);return de.sort(Is),de.length};function ms(de){for(var De=de[0][0],et=de[1][0],vt=de[0][1],_t=de[1][1],St,ar,zt,gr,Vr=qo,Wr=Vr.length,Ta,ya,ri,ni,Ma,Na;Wr--;)if(Ta=Vr[Wr],!(!Ta||!Ta.prepare()))for(ri=Ta.edges,ni=ri.length,ya=0;yaKe||l(gr-ar)>Ke)&&(ri.splice(ya,0,new xu(au(Ta.site,Na,l(zt-De)Ke?{x:De,y:l(St-De)Ke?{x:l(ar-_t)Ke?{x:et,y:l(St-et)Ke?{x:l(ar-vt)=-Ue)){var ya=gr*gr+Vr*Vr,ri=Wr*Wr+Na*Na,ni=(Na*ya-Vr*ri)/Ta,Ma=(gr*ri-Wr*ya)/Ta,Na=Ma+zt,Ka=Ys.pop()||new rl;Ka.arc=de,Ka.site=_t,Ka.x=ni+ar,Ka.y=Na+Math.sqrt(ni*ni+Ma*Ma),Ka.cy=Na,de.circle=Ka;for(var vi=null,ui=os._;ui;)if(Ka.y0)){if(Ma/=ri,ri<0){if(Ma0){if(Ma>ya)return;Ma>Ta&&(Ta=Ma)}if(Ma=et-zt,!(!ri&&Ma<0)){if(Ma/=ri,ri<0){if(Ma>ya)return;Ma>Ta&&(Ta=Ma)}else if(ri>0){if(Ma0)){if(Ma/=ni,ni<0){if(Ma0){if(Ma>ya)return;Ma>Ta&&(Ta=Ma)}if(Ma=vt-gr,!(!ni&&Ma<0)){if(Ma/=ni,ni<0){if(Ma>ya)return;Ma>Ta&&(Ta=Ma)}else if(ni>0){if(Ma0&&(_t.a={x:zt+Ta*ri,y:gr+Ta*ni}),ya<1&&(_t.b={x:zt+ya*ri,y:gr+ya*ni}),_t}}}}}}function As(de){for(var De=To,et=ro(de[0][0],de[0][1],de[1][0],de[1][1]),vt=De.length,_t;vt--;)_t=De[vt],(!al(_t,de)||!et(_t)||l(_t.a.x-_t.b.x)=St)return;if(Wr>ya){if(!vt)vt={x:ni,y:ar};else if(vt.y>=zt)return;et={x:ni,y:zt}}else{if(!vt)vt={x:ni,y:zt};else if(vt.y1)if(Wr>ya){if(!vt)vt={x:(ar-Ka)/Na,y:ar};else if(vt.y>=zt)return;et={x:(zt-Ka)/Na,y:zt}}else{if(!vt)vt={x:(zt-Ka)/Na,y:zt};else if(vt.y=St)return;et={x:St,y:Na*St+Ka}}else{if(!vt)vt={x:St,y:Na*St+Ka};else if(vt.x<_t)return;et={x:_t,y:Na*_t+Ka}}return de.a=vt,de.b=et,!0}function $n(de,De){this.l=de,this.r=De,this.a=this.b=null}function zs(de,De,et,vt){var _t=new $n(de,De);return To.push(_t),et&&fl(_t,de,De,et),vt&&fl(_t,De,de,vt),qo[de.i].edges.push(new xu(_t,de,De)),qo[De.i].edges.push(new xu(_t,De,de)),_t}function au(de,De,et){var vt=new $n(de,null);return vt.a=De,vt.b=et,To.push(vt),vt}function fl(de,De,et,vt){!de.a&&!de.b?(de.a=vt,de.l=De,de.r=et):de.l===et?de.b=vt:de.a=vt}function xu(de,De,et){var vt=de.a,_t=de.b;this.edge=de,this.site=De,this.angle=et?Math.atan2(et.y-De.y,et.x-De.x):de.l===De?Math.atan2(_t.x-vt.x,vt.y-_t.y):Math.atan2(vt.x-_t.x,_t.y-vt.y)}xu.prototype={start:function(){return this.edge.l===this.site?this.edge.a:this.edge.b},end:function(){return this.edge.l===this.site?this.edge.b:this.edge.a}};function zl(){this._=null}function Ns(de){de.U=de.C=de.L=de.R=de.P=de.N=null}zl.prototype={insert:function(de,De){var et,vt,_t;if(de){if(De.P=de,De.N=de.N,de.N&&(de.N.P=De),de.N=De,de.R){for(de=de.R;de.L;)de=de.L;de.L=De}else de.R=De;et=de}else this._?(de=Bc(this._),De.P=null,De.N=de,de.P=de.L=De,et=de):(De.P=De.N=null,this._=De,et=null);for(De.L=De.R=null,De.U=et,De.C=!0,de=De;et&&et.C;)vt=et.U,et===vt.L?(_t=vt.R,_t&&_t.C?(et.C=_t.C=!1,vt.C=!0,de=vt):(de===et.R&&(iu(this,et),de=et,et=de.U),et.C=!1,vt.C=!0,Eu(this,vt))):(_t=vt.L,_t&&_t.C?(et.C=_t.C=!1,vt.C=!0,de=vt):(de===et.L&&(Eu(this,et),de=et,et=de.U),et.C=!1,vt.C=!0,iu(this,vt))),et=de.U;this._.C=!1},remove:function(de){de.N&&(de.N.P=de.P),de.P&&(de.P.N=de.N),de.N=de.P=null;var De=de.U,et,vt=de.L,_t=de.R,St,ar;if(vt?_t?St=Bc(_t):St=vt:St=_t,De?De.L===de?De.L=St:De.R=St:this._=St,vt&&_t?(ar=St.C,St.C=de.C,St.L=vt,vt.U=St,St!==_t?(De=St.U,St.U=de.U,de=St.R,De.L=de,St.R=_t,_t.U=St):(St.U=De,De=St,de=St.R)):(ar=de.C,de=St),de&&(de.U=De),!ar){if(de&&de.C){de.C=!1;return}do{if(de===this._)break;if(de===De.L){if(et=De.R,et.C&&(et.C=!1,De.C=!0,iu(this,De),et=De.R),et.L&&et.L.C||et.R&&et.R.C){(!et.R||!et.R.C)&&(et.L.C=!1,et.C=!0,Eu(this,et),et=De.R),et.C=De.C,De.C=et.R.C=!1,iu(this,De),de=this._;break}}else if(et=De.L,et.C&&(et.C=!1,De.C=!0,Eu(this,De),et=De.L),et.L&&et.L.C||et.R&&et.R.C){(!et.L||!et.L.C)&&(et.R.C=!1,et.C=!0,iu(this,et),et=De.L),et.C=De.C,De.C=et.L.C=!1,Eu(this,De),de=this._;break}et.C=!0,de=De,De=De.U}while(!de.C);de&&(de.C=!1)}}};function iu(de,De){var et=De,vt=De.R,_t=et.U;_t?_t.L===et?_t.L=vt:_t.R=vt:de._=vt,vt.U=_t,et.U=vt,et.R=vt.L,et.R&&(et.R.U=et),vt.L=et}function Eu(de,De){var et=De,vt=De.L,_t=et.U;_t?_t.L===et?_t.L=vt:_t.R=vt:de._=vt,vt.U=_t,et.U=vt,et.L=vt.R,et.L&&(et.L.U=et),vt.R=et}function Bc(de){for(;de.L;)de=de.L;return de}function Cu(de,De){var et=de.sort(Af).pop(),vt,_t,St;for(To=[],qo=new Array(de.length),Oo=new zl,os=new zl;;)if(St=Co,et&&(!St||et.y=Wr&&Ka.x<=ya&&Ka.y>=Ta&&Ka.y<=ri?[[Wr,ri],[ya,ri],[ya,Ta],[Wr,Ta]]:[];vi.point=gr[Ma]}),Vr}function zt(gr){return gr.map(function(Vr,Wr){return{x:Math.round(vt(Vr,Wr)/Ke)*Ke,y:Math.round(_t(Vr,Wr)/Ke)*Ke,i:Wr}})}return ar.links=function(gr){return Cu(zt(gr)).edges.filter(function(Vr){return Vr.l&&Vr.r}).map(function(Vr){return{source:gr[Vr.l.i],target:gr[Vr.r.i]}})},ar.triangles=function(gr){var Vr=[];return Cu(zt(gr)).cells.forEach(function(Wr,Ta){for(var ya=Wr.site,ri=Wr.edges.sort(Is),ni=-1,Ma=ri.length,Na,Ka,vi=ri[Ma-1].edge,ui=vi.l===ya?vi.r:vi.l;++niui&&(ui=Wr.x),Wr.y>Pa&&(Pa=Wr.y),ri.push(Wr.x),ni.push(Wr.y);else for(Ma=0;Maui&&(ui=sn),an>Pa&&(Pa=an),ri.push(sn),ni.push(an)}var vn=ui-Ka,Pn=Pa-vi;vn>Pn?Pa=vi+vn:ui=Ka+Pn;function Zn(io,Zo,ul,el,_l,gn,vo,cs){if(!(isNaN(ul)||isNaN(el)))if(io.leaf){var ps=io.x,Tl=io.y;if(ps!=null)if(l(ps-ul)+l(Tl-el)<.01)eo(io,Zo,ul,el,_l,gn,vo,cs);else{var Gl=io.point;io.x=io.y=io.point=null,eo(io,Gl,ps,Tl,_l,gn,vo,cs),eo(io,Zo,ul,el,_l,gn,vo,cs)}else io.x=ul,io.y=el,io.point=Zo}else eo(io,Zo,ul,el,_l,gn,vo,cs)}function eo(io,Zo,ul,el,_l,gn,vo,cs){var ps=(_l+vo)*.5,Tl=(gn+cs)*.5,Gl=ul>=ps,Tu=el>=Tl,Il=Tu<<1|Gl;io.leaf=!1,io=io.nodes[Il]||(io.nodes[Il]=nu()),Gl?_l=ps:vo=ps,Tu?gn=Tl:cs=Tl,Zn(io,Zo,ul,el,_l,gn,vo,cs)}var $o=nu();if($o.add=function(io){Zn($o,io,+Ta(io,++Ma),+ya(io,Ma),Ka,vi,ui,Pa)},$o.visit=function(io){Ll(io,$o,Ka,vi,ui,Pa)},$o.find=function(io){return ic($o,io[0],io[1],Ka,vi,ui,Pa)},Ma=-1,De==null){for(;++MaSt||ya>ar||ri=sn,Pn=et>=an,Zn=Pn<<1|vn,eo=Zn+4;Znet&&(St=De.slice(et,St),zt[ar]?zt[ar]+=St:zt[++ar]=St),(vt=vt[0])===(_t=_t[0])?zt[ar]?zt[ar]+=_t:zt[++ar]=_t:(zt[++ar]=null,gr.push({i:ar,x:vl(vt,_t)})),et=nc.lastIndex;return et=0&&!(vt=d.interpolators[et](de,De)););return vt}d.interpolators=[function(de,De){var et=typeof De;return(et==="string"?kr.has(De.toLowerCase())||/^(#|rgb\(|hsl\()/i.test(De)?Ou:gs:De instanceof Ci?Ou:Array.isArray(De)?qu:et==="object"&&isNaN(De)?il:vl)(de,De)}],d.interpolateArray=qu;function qu(de,De){var et=[],vt=[],_t=de.length,St=De.length,ar=Math.min(de.length,De.length),zt;for(zt=0;zt=0?de.slice(0,De):de,vt=De>=0?de.slice(De+1):"in";return et=yh.get(et)||cl,vt=ls.get(vt)||F,_h(vt(et.apply(null,x.call(arguments,1))))};function _h(de){return function(De){return De<=0?0:De>=1?1:de(De)}}function Ss(de){return function(De){return 1-de(1-De)}}function Qn(de){return function(De){return .5*(De<.5?de(2*De):2-de(2-2*De))}}function Gc(de){return de*de}function Vu(de){return de*de*de}function Ul(de){if(de<=0)return 0;if(de>=1)return 1;var De=de*de,et=De*de;return 4*(de<.5?et:3*(de-De)+et-.75)}function Mf(de){return function(De){return Math.pow(De,de)}}function wc(de){return 1-Math.cos(de*Te)}function rf(de){return Math.pow(2,10*(de-1))}function Kl(de){return 1-Math.sqrt(1-de*de)}function Yf(de,De){var et;return arguments.length<2&&(De=.45),arguments.length?et=De/qe*Math.asin(1/de):(de=1,et=De/4),function(vt){return 1+de*Math.pow(2,-10*vt)*Math.sin((vt-et)*qe/De)}}function zf(de){return de||(de=1.70158),function(De){return De*De*((de+1)*De-de)}}function af(de){return de<1/2.75?7.5625*de*de:de<2/2.75?7.5625*(de-=1.5/2.75)*de+.75:de<2.5/2.75?7.5625*(de-=2.25/2.75)*de+.9375:7.5625*(de-=2.625/2.75)*de+.984375}d.interpolateHcl=Nc;function Nc(de,De){de=d.hcl(de),De=d.hcl(De);var et=de.h,vt=de.c,_t=de.l,St=De.h-et,ar=De.c-vt,zt=De.l-_t;return isNaN(ar)&&(ar=0,vt=isNaN(vt)?De.c:vt),isNaN(St)?(St=0,et=isNaN(et)?De.h:et):St>180?St-=360:St<-180&&(St+=360),function(gr){return ta(et+St*gr,vt+ar*gr,_t+zt*gr)+""}}d.interpolateHsl=Ff;function Ff(de,De){de=d.hsl(de),De=d.hsl(De);var et=de.h,vt=de.s,_t=de.l,St=De.h-et,ar=De.s-vt,zt=De.l-_t;return isNaN(ar)&&(ar=0,vt=isNaN(vt)?De.s:vt),isNaN(St)?(St=0,et=isNaN(et)?De.h:et):St>180?St-=360:St<-180&&(St+=360),function(gr){return Kt(et+St*gr,vt+ar*gr,_t+zt*gr)+""}}d.interpolateLab=Of;function Of(de,De){de=d.lab(de),De=d.lab(De);var et=de.l,vt=de.a,_t=de.b,St=De.l-et,ar=De.a-vt,zt=De.b-_t;return function(gr){return mi(et+St*gr,vt+ar*gr,_t+zt*gr)+""}}d.interpolateRound=Gu;function Gu(de,De){return De-=de,function(et){return Math.round(de+De*et)}}d.transform=function(de){var De=M.createElementNS(d.ns.prefix.svg,"g");return(d.transform=function(et){if(et!=null){De.setAttribute("transform",et);var vt=De.transform.baseVal.consolidate()}return new Ef(vt?vt.matrix:Uc)})(de)};function Ef(de){var De=[de.a,de.b],et=[de.c,de.d],vt=Hc(De),_t=oc(De,et),St=Hc(Jl(et,De,-_t))||0;De[0]*et[1]180?De+=360:De-de>180&&(de+=360),vt.push({i:et.push(Tc(et)+"rotate(",null,")")-2,x:vl(de,De)})):De&&et.push(Tc(et)+"rotate("+De+")")}function lh(de,De,et,vt){de!==De?vt.push({i:et.push(Tc(et)+"skewX(",null,")")-2,x:vl(de,De)}):De&&et.push(Tc(et)+"skewX("+De+")")}function Bf(de,De,et,vt){if(de[0]!==De[0]||de[1]!==De[1]){var _t=et.push(Tc(et)+"scale(",null,",",null,")");vt.push({i:_t-4,x:vl(de[0],De[0])},{i:_t-2,x:vl(de[1],De[1])})}else(De[0]!==1||De[1]!==1)&&et.push(Tc(et)+"scale("+De+")")}function Wc(de,De){var et=[],vt=[];return de=d.transform(de),De=d.transform(De),Gs(de.translate,De.translate,et,vt),Cf(de.rotate,De.rotate,et,vt),lh(de.skew,De.skew,et,vt),Bf(de.scale,De.scale,et,vt),de=De=null,function(_t){for(var St=-1,ar=vt.length,zt;++St0?St=Pa:(et.c=null,et.t=NaN,et=null,De.end({type:"end",alpha:St=0})):Pa>0&&(De.start({type:"start",alpha:St=Pa}),et=kn(de.tick)),de):St},de.start=function(){var Pa,sn=ri.length,an=ni.length,vn=vt[0],Pn=vt[1],Zn,eo;for(Pa=0;Pa=0;)St.push(Wr=Vr[gr]),Wr.parent=zt,Wr.depth=zt.depth+1;et&&(zt.value=0),zt.children=Vr}else et&&(zt.value=+et.call(vt,zt,zt.depth)||0),delete zt.children;return vc(_t,function(Ta){var ya,ri;de&&(ya=Ta.children)&&ya.sort(de),et&&(ri=Ta.parent)&&(ri.value+=Ta.value)}),ar}return vt.sort=function(_t){return arguments.length?(de=_t,vt):de},vt.children=function(_t){return arguments.length?(De=_t,vt):De},vt.value=function(_t){return arguments.length?(et=_t,vt):et},vt.revalue=function(_t){return et&&(Sc(_t,function(St){St.children&&(St.value=0)}),vc(_t,function(St){var ar;St.children||(St.value=+et.call(vt,St,St.depth)||0),(ar=St.parent)&&(ar.value+=St.value)})),_t},vt};function Bu(de,De){return d.rebind(de,De,"sort","children","value"),de.nodes=de,de.links=Nu,de}function Sc(de,De){for(var et=[de];(de=et.pop())!=null;)if(De(de),(_t=de.children)&&(vt=_t.length))for(var vt,_t;--vt>=0;)et.push(_t[vt])}function vc(de,De){for(var et=[de],vt=[];(de=et.pop())!=null;)if(vt.push(de),(ar=de.children)&&(St=ar.length))for(var _t=-1,St,ar;++_t_t&&(_t=zt),vt.push(zt)}for(ar=0;arvt&&(et=De,vt=_t);return et}function hl(de){return de.reduce(sf,0)}function sf(de,De){return de+De[1]}d.layout.histogram=function(){var de=!0,De=Number,et=mf,vt=Mc;function _t(St,ya){for(var zt=[],gr=St.map(De,this),Vr=et.call(this,gr,ya),Wr=vt.call(this,Vr,gr,ya),Ta,ya=-1,ri=gr.length,ni=Wr.length-1,Ma=de?1:1/ri,Na;++ya0)for(ya=-1;++ya=Vr[0]&&Na<=Vr[1]&&(Ta=zt[d.bisect(Wr,Na,1,ni)-1],Ta.y+=Ma,Ta.push(St[ya]));return zt}return _t.value=function(St){return arguments.length?(De=St,_t):De},_t.range=function(St){return arguments.length?(et=ia(St),_t):et},_t.bins=function(St){return arguments.length?(vt=typeof St=="number"?function(ar){return Hu(ar,St)}:ia(St),_t):vt},_t.frequency=function(St){return arguments.length?(de=!!St,_t):de},_t};function Mc(de,De){return Hu(de,Math.ceil(Math.log(De.length)/Math.LN2+1))}function Hu(de,De){for(var et=-1,vt=+de[0],_t=(de[1]-vt)/De,St=[];++et<=De;)St[et]=_t*et+vt;return St}function mf(de){return[d.min(de),d.max(de)]}d.layout.pack=function(){var de=d.layout.hierarchy().sort(Wu),De=0,et=[1,1],vt;function _t(St,ar){var zt=de.call(this,St,ar),gr=zt[0],Vr=et[0],Wr=et[1],Ta=vt==null?Math.sqrt:typeof vt=="function"?vt:function(){return vt};if(gr.x=gr.y=0,vc(gr,function(ri){ri.r=+Ta(ri.value)}),vc(gr,jf),De){var ya=De*(vt?1:Math.max(2*gr.r/Vr,2*gr.r/Wr))/2;vc(gr,function(ri){ri.r+=ya}),vc(gr,jf),vc(gr,function(ri){ri.r-=ya})}return mc(gr,Vr/2,Wr/2,vt?1:1/Math.max(2*gr.r/Vr,2*gr.r/Wr)),zt}return _t.size=function(St){return arguments.length?(et=St,_t):et},_t.radius=function(St){return arguments.length?(vt=St==null||typeof St=="function"?St:+St,_t):vt},_t.padding=function(St){return arguments.length?(De=+St,_t):De},Bu(_t,de)};function Wu(de,De){return de.value-De.value}function Zc(de,De){var et=de._pack_next;de._pack_next=De,De._pack_prev=de,De._pack_next=et,et._pack_prev=De}function Lf(de,De){de._pack_next=De,De._pack_prev=de}function ru(de,De){var et=De.x-de.x,vt=De.y-de.y,_t=de.r+De.r;return .999*_t*_t>et*et+vt*vt}function jf(de){if(!(De=de.children)||!(ya=De.length))return;var De,et=1/0,vt=-1/0,_t=1/0,St=-1/0,ar,zt,gr,Vr,Wr,Ta,ya;function ri(Pa){et=Math.min(Pa.x-Pa.r,et),vt=Math.max(Pa.x+Pa.r,vt),_t=Math.min(Pa.y-Pa.r,_t),St=Math.max(Pa.y+Pa.r,St)}if(De.forEach(Xu),ar=De[0],ar.x=-ar.r,ar.y=0,ri(ar),ya>1&&(zt=De[1],zt.x=zt.r,zt.y=0,ri(zt),ya>2))for(gr=De[2],jl(ar,zt,gr),ri(gr),Zc(ar,gr),ar._pack_prev=gr,Zc(gr,zt),zt=ar._pack_next,Vr=3;VrNa.x&&(Na=sn),sn.depth>Ka.depth&&(Ka=sn)});var vi=De(Ma,Na)/2-Ma.x,ui=et[0]/(Na.x+De(Na,Ma)/2+vi),Pa=et[1]/(Ka.depth||1);Sc(ri,function(sn){sn.x=(sn.x+vi)*ui,sn.y=sn.depth*Pa})}return ya}function St(Wr){for(var Ta={A:null,children:[Wr]},ya=[Ta],ri;(ri=ya.pop())!=null;)for(var ni=ri.children,Ma,Na=0,Ka=ni.length;Na0&&(sc(er(Ma,Wr,ya),Wr,sn),Ka+=sn,vi+=sn),ui+=Ma.m,Ka+=ri.m,Pa+=Na.m,vi+=ni.m;Ma&&!Yc(ni)&&(ni.t=Ma,ni.m+=ui-vi),ri&&!Cc(Na)&&(Na.t=ri,Na.m+=Ka-Pa,ya=Wr)}return ya}function Vr(Wr){Wr.x*=et[0],Wr.y=Wr.depth*et[1]}return _t.separation=function(Wr){return arguments.length?(De=Wr,_t):De},_t.size=function(Wr){return arguments.length?(vt=(et=Wr)==null?Vr:null,_t):vt?null:et},_t.nodeSize=function(Wr){return arguments.length?(vt=(et=Wr)==null?null:Vr,_t):vt?et:null},Bu(_t,de)};function gu(de,De){return de.parent==De.parent?1:2}function Cc(de){var De=de.children;return De.length?De[0]:de.t}function Yc(de){var De=de.children,et;return(et=De.length)?De[et-1]:de.t}function sc(de,De,et){var vt=et/(De.i-de.i);De.c-=vt,De.s+=et,de.c+=vt,De.z+=et,De.m+=et}function kc(de){for(var De=0,et=0,vt=de.children,_t=vt.length,St;--_t>=0;)St=vt[_t],St.z+=De,St.m+=De,De+=St.s+(et+=St.c)}function er(de,De,et){return de.a.parent===De.parent?de.a:et}d.layout.cluster=function(){var de=d.layout.hierarchy().sort(null).value(null),De=gu,et=[1,1],vt=!1;function _t(St,ar){var zt=de.call(this,St,ar),gr=zt[0],Vr,Wr=0;vc(gr,function(Ma){var Na=Ma.children;Na&&Na.length?(Ma.x=na(Na),Ma.y=yr(Na)):(Ma.x=Vr?Wr+=De(Ma,Vr):0,Ma.y=0,Vr=Ma)});var Ta=$r(gr),ya=La(gr),ri=Ta.x-De(Ta,ya)/2,ni=ya.x+De(ya,Ta)/2;return vc(gr,vt?function(Ma){Ma.x=(Ma.x-gr.x)*et[0],Ma.y=(gr.y-Ma.y)*et[1]}:function(Ma){Ma.x=(Ma.x-ri)/(ni-ri)*et[0],Ma.y=(1-(gr.y?Ma.y/gr.y:1))*et[1]}),zt}return _t.separation=function(St){return arguments.length?(De=St,_t):De},_t.size=function(St){return arguments.length?(vt=(et=St)==null,_t):vt?null:et},_t.nodeSize=function(St){return arguments.length?(vt=(et=St)!=null,_t):vt?et:null},Bu(_t,de)};function yr(de){return 1+d.max(de,function(De){return De.y})}function na(de){return de.reduce(function(De,et){return De+et.x},0)/de.length}function $r(de){var De=de.children;return De&&De.length?$r(De[0]):de}function La(de){var De=de.children,et;return De&&(et=De.length)?La(De[et-1]):de}d.layout.treemap=function(){var de=d.layout.hierarchy(),De=Math.round,et=[1,1],vt=null,_t=hi,St=!1,ar,zt="squarify",gr=.5*(1+Math.sqrt(5));function Vr(Ma,Na){for(var Ka=-1,vi=Ma.length,ui,Pa;++Ka0;)vi.push(Pa=ui[Pn-1]),vi.area+=Pa.area,zt!=="squarify"||(an=ya(vi,vn))<=sn?(ui.pop(),sn=an):(vi.area-=vi.pop().area,ri(vi,vn,Ka,!1),vn=Math.min(Ka.dx,Ka.dy),vi.length=vi.area=0,sn=1/0);vi.length&&(ri(vi,vn,Ka,!0),vi.length=vi.area=0),Na.forEach(Wr)}}function Ta(Ma){var Na=Ma.children;if(Na&&Na.length){var Ka=_t(Ma),vi=Na.slice(),ui,Pa=[];for(Vr(vi,Ka.dx*Ka.dy/Ma.value),Pa.area=0;ui=vi.pop();)Pa.push(ui),Pa.area+=ui.area,ui.z!=null&&(ri(Pa,ui.z?Ka.dx:Ka.dy,Ka,!vi.length),Pa.length=Pa.area=0);Na.forEach(Ta)}}function ya(Ma,Na){for(var Ka=Ma.area,vi,ui=0,Pa=1/0,sn=-1,an=Ma.length;++snui&&(ui=vi));return Ka*=Ka,Na*=Na,Ka?Math.max(Na*ui*gr/Ka,Ka/(Na*Pa*gr)):1/0}function ri(Ma,Na,Ka,vi){var ui=-1,Pa=Ma.length,sn=Ka.x,an=Ka.y,vn=Na?De(Ma.area/Na):0,Pn;if(Na==Ka.dx){for((vi||vn>Ka.dy)&&(vn=Ka.dy);++uiKa.dx)&&(vn=Ka.dx);++ui1);return de+De*vt*Math.sqrt(-2*Math.log(St)/St)}},logNormal:function(){var de=d.random.normal.apply(d,arguments);return function(){return Math.exp(de())}},bates:function(de){var De=d.random.irwinHall(de);return function(){return De()/de}},irwinHall:function(de){return function(){for(var De=0,et=0;et2?_i:dn,Vr=vt?ku:Kf;return _t=gr(de,De,Vr,et),St=gr(De,de,Vr,Nl),zt}function zt(gr){return _t(gr)}return zt.invert=function(gr){return St(gr)},zt.domain=function(gr){return arguments.length?(de=gr.map(Number),ar()):de},zt.range=function(gr){return arguments.length?(De=gr,ar()):De},zt.rangeRound=function(gr){return zt.range(gr).interpolate(Gu)},zt.clamp=function(gr){return arguments.length?(vt=gr,ar()):vt},zt.interpolate=function(gr){return arguments.length?(et=gr,ar()):et},zt.ticks=function(gr){return co(de,gr)},zt.tickFormat=function(gr,Vr){return d3_scale_linearTickFormat(de,gr,Vr)},zt.nice=function(gr){return ao(de,gr),ar()},zt.copy=function(){return Mn(de,De,et,vt)},ar()}function Kn(de,De){return d.rebind(de,De,"range","rangeRound","interpolate","clamp")}function ao(de,De){return Ri(de,Fi(Jn(de,De)[2])),Ri(de,Fi(Jn(de,De)[2])),de}function Jn(de,De){De==null&&(De=10);var et=Zi(de),vt=et[1]-et[0],_t=Math.pow(10,Math.floor(Math.log(vt/De)/Math.LN10)),St=De/vt*_t;return St<=.15?_t*=10:St<=.35?_t*=5:St<=.75&&(_t*=2),et[0]=Math.ceil(et[0]/_t)*_t,et[1]=Math.floor(et[1]/_t)*_t+_t*.5,et[2]=_t,et}function co(de,De){return d.range.apply(d,Jn(de,De))}var wn={s:1,g:1,p:1,r:1,e:1};function un(de){return-Math.floor(Math.log(de)/Math.LN10+.01)}function _o(de,De){var et=un(De[2]);return de in wn?Math.abs(et-un(Math.max(l(De[0]),l(De[1]))))+ +(de!=="e"):et-(de==="%")*2}d.scale.log=function(){return Qo(d.scale.linear().domain([0,1]),10,!0,[1,10])};function Qo(de,De,et,vt){function _t(zt){return(et?Math.log(zt<0?0:zt):-Math.log(zt>0?0:-zt))/Math.log(De)}function St(zt){return et?Math.pow(De,zt):-Math.pow(De,-zt)}function ar(zt){return de(_t(zt))}return ar.invert=function(zt){return St(de.invert(zt))},ar.domain=function(zt){return arguments.length?(et=zt[0]>=0,de.domain((vt=zt.map(Number)).map(_t)),ar):vt},ar.base=function(zt){return arguments.length?(De=+zt,de.domain(vt.map(_t)),ar):De},ar.nice=function(){var zt=Ri(vt.map(_t),et?Math:xs);return de.domain(zt),vt=zt.map(St),ar},ar.ticks=function(){var zt=Zi(vt),gr=[],Vr=zt[0],Wr=zt[1],Ta=Math.floor(_t(Vr)),ya=Math.ceil(_t(Wr)),ri=De%1?2:De;if(isFinite(ya-Ta)){if(et){for(;Ta0;ni--)gr.push(St(Ta)*ni);for(Ta=0;gr[Ta]Wr;ya--);gr=gr.slice(Ta,ya)}return gr},ar.copy=function(){return Qo(de.copy(),De,et,vt)},Kn(ar,de)}var xs={floor:function(de){return-Math.ceil(-de)},ceil:function(de){return-Math.floor(-de)}};d.scale.pow=function(){return Qs(d.scale.linear(),1,[0,1])};function Qs(de,De,et){var vt=Rs(De),_t=Rs(1/De);function St(ar){return de(vt(ar))}return St.invert=function(ar){return _t(de.invert(ar))},St.domain=function(ar){return arguments.length?(de.domain((et=ar.map(Number)).map(vt)),St):et},St.ticks=function(ar){return co(et,ar)},St.tickFormat=function(ar,zt){return d3_scale_linearTickFormat(et,ar,zt)},St.nice=function(ar){return St.domain(ao(et,ar))},St.exponent=function(ar){return arguments.length?(vt=Rs(De=ar),_t=Rs(1/De),de.domain(et.map(vt)),St):De},St.copy=function(){return Qs(de.copy(),De,et)},Kn(St,de)}function Rs(de){return function(De){return De<0?-Math.pow(-De,de):Math.pow(De,de)}}d.scale.sqrt=function(){return d.scale.pow().exponent(.5)},d.scale.ordinal=function(){return Ks([],{t:"range",a:[[]]})};function Ks(de,De){var et,vt,_t;function St(zt){return vt[((et.get(zt)||(De.t==="range"?et.set(zt,de.push(zt)):NaN))-1)%vt.length]}function ar(zt,gr){return d.range(de.length).map(function(Vr){return zt+gr*Vr})}return St.domain=function(zt){if(!arguments.length)return de;de=[],et=new S;for(var gr=-1,Vr=zt.length,Wr;++gr0?et[St-1]:de[0],Stya?0:1;if(Wr=Ce)return gr(Wr,ni)+(Vr?gr(Vr,1-ni):"")+"Z";var Ma,Na,Ka,vi,ui=0,Pa=0,sn,an,vn,Pn,Zn,eo,$o,io,Zo=[];if((vi=(+ar.apply(this,arguments)||0)/2)&&(Ka=vt===Iu?Math.sqrt(Vr*Vr+Wr*Wr):+vt.apply(this,arguments),ni||(Pa*=-1),Wr&&(Pa=Gt(Ka/Wr*Math.sin(vi))),Vr&&(ui=Gt(Ka/Vr*Math.sin(vi)))),Wr){sn=Wr*Math.cos(Ta+Pa),an=Wr*Math.sin(Ta+Pa),vn=Wr*Math.cos(ya-Pa),Pn=Wr*Math.sin(ya-Pa);var ul=Math.abs(ya-Ta-2*Pa)<=Me?0:1;if(Pa&&gc(sn,an,vn,Pn)===ni^ul){var el=(Ta+ya)/2;sn=Wr*Math.cos(el),an=Wr*Math.sin(el),vn=Pn=null}}else sn=an=0;if(Vr){Zn=Vr*Math.cos(ya-ui),eo=Vr*Math.sin(ya-ui),$o=Vr*Math.cos(Ta+ui),io=Vr*Math.sin(Ta+ui);var _l=Math.abs(Ta-ya+2*ui)<=Me?0:1;if(ui&&gc(Zn,eo,$o,io)===1-ni^_l){var gn=(Ta+ya)/2;Zn=Vr*Math.cos(gn),eo=Vr*Math.sin(gn),$o=io=null}}else Zn=eo=0;if(ri>Ke&&(Ma=Math.min(Math.abs(Wr-Vr)/2,+et.apply(this,arguments)))>.001){Na=Vr0?0:1}function fo(de,De,et,vt,_t){var St=de[0]-De[0],ar=de[1]-De[1],zt=(_t?vt:-vt)/Math.sqrt(St*St+ar*ar),gr=zt*ar,Vr=-zt*St,Wr=de[0]+gr,Ta=de[1]+Vr,ya=De[0]+gr,ri=De[1]+Vr,ni=(Wr+ya)/2,Ma=(Ta+ri)/2,Na=ya-Wr,Ka=ri-Ta,vi=Na*Na+Ka*Ka,ui=et-vt,Pa=Wr*ri-ya*Ta,sn=(Ka<0?-1:1)*Math.sqrt(Math.max(0,ui*ui*vi-Pa*Pa)),an=(Pa*Ka-Na*sn)/vi,vn=(-Pa*Na-Ka*sn)/vi,Pn=(Pa*Ka+Na*sn)/vi,Zn=(-Pa*Na+Ka*sn)/vi,eo=an-ni,$o=vn-Ma,io=Pn-ni,Zo=Zn-Ma;return eo*eo+$o*$o>io*io+Zo*Zo&&(an=Pn,vn=Zn),[[an-gr,vn-Vr],[an*et/ui,vn*et/ui]]}function zo(){return!0}function Ic(de){var De=mo,et=pn,vt=zo,_t=Yu,St=_t.key,ar=.7;function zt(gr){var Vr=[],Wr=[],Ta=-1,ya=gr.length,ri,ni=ia(De),Ma=ia(et);function Na(){Vr.push("M",_t(de(Wr),ar))}for(;++Ta1?de.join("L"):de+"Z"}function Ne(de){return de.join("L")+"Z"}function R(de){for(var De=0,et=de.length,vt=de[0],_t=[vt[0],",",vt[1]];++De1&&_t.push("H",vt[0]),_t.join("")}function ae(de){for(var De=0,et=de.length,vt=de[0],_t=[vt[0],",",vt[1]];++De1){zt=De[1],St=de[gr],gr++,vt+="C"+(_t[0]+ar[0])+","+(_t[1]+ar[1])+","+(St[0]-zt[0])+","+(St[1]-zt[1])+","+St[0]+","+St[1];for(var Vr=2;Vr9&&(St=et*3/Math.sqrt(St),ar[zt]=St*vt,ar[zt+1]=St*_t));for(zt=-1;++zt<=gr;)St=(de[Math.min(gr,zt+1)][0]-de[Math.max(0,zt-1)][0])/(6*(1+ar[zt]*ar[zt])),De.push([St||0,ar[zt]*St||0]);return De}function ur(de){return de.length<3?Yu(de):de[0]+At(de,Dt(de))}d.svg.line.radial=function(){var de=Ic(mr);return de.radius=de.x,delete de.x,de.angle=de.y,delete de.y,de};function mr(de){for(var De,et=-1,vt=de.length,_t,St;++etMe)+",1 "+Ta}function Vr(Wr,Ta,ya,ri){return"Q 0,0 "+ri}return St.radius=function(Wr){return arguments.length?(et=ia(Wr),St):et},St.source=function(Wr){return arguments.length?(de=ia(Wr),St):de},St.target=function(Wr){return arguments.length?(De=ia(Wr),St):De},St.startAngle=function(Wr){return arguments.length?(vt=ia(Wr),St):vt},St.endAngle=function(Wr){return arguments.length?(_t=ia(Wr),St):_t},St};function ga(de){return de.radius}d.svg.diagonal=function(){var de=Br,De=Qr,et=Sa;function vt(_t,St){var ar=de.call(this,_t,St),zt=De.call(this,_t,St),gr=(ar.y+zt.y)/2,Vr=[ar,{x:ar.x,y:gr},{x:zt.x,y:gr},zt];return Vr=Vr.map(et),"M"+Vr[0]+"C"+Vr[1]+" "+Vr[2]+" "+Vr[3]}return vt.source=function(_t){return arguments.length?(de=ia(_t),vt):de},vt.target=function(_t){return arguments.length?(De=ia(_t),vt):De},vt.projection=function(_t){return arguments.length?(et=_t,vt):et},vt};function Sa(de){return[de.x,de.y]}d.svg.diagonal.radial=function(){var de=d.svg.diagonal(),De=Sa,et=de.projection;return de.projection=function(vt){return arguments.length?et(Oa(De=vt)):De},de};function Oa(de){return function(){var De=de.apply(this,arguments),et=De[0],vt=De[1]-Te;return[et*Math.cos(vt),et*Math.sin(vt)]}}d.svg.symbol=function(){var de=Wi,De=di;function et(vt,_t){return(on.get(de.call(this,vt,_t))||Gi)(De.call(this,vt,_t))}return et.type=function(vt){return arguments.length?(de=ia(vt),et):de},et.size=function(vt){return arguments.length?(De=ia(vt),et):De},et};function di(){return 64}function Wi(){return"circle"}function Gi(de){var De=Math.sqrt(de/Me);return"M0,"+De+"A"+De+","+De+" 0 1,1 0,"+-De+"A"+De+","+De+" 0 1,1 0,"+De+"Z"}var on=d.map({circle:Gi,cross:function(de){var De=Math.sqrt(de/5)/2;return"M"+-3*De+","+-De+"H"+-De+"V"+-3*De+"H"+De+"V"+-De+"H"+3*De+"V"+De+"H"+De+"V"+3*De+"H"+-De+"V"+De+"H"+-3*De+"Z"},diamond:function(de){var De=Math.sqrt(de/(2*Wn)),et=De*Wn;return"M0,"+-De+"L"+et+",0 0,"+De+" "+-et+",0Z"},square:function(de){var De=Math.sqrt(de)/2;return"M"+-De+","+-De+"L"+De+","+-De+" "+De+","+De+" "+-De+","+De+"Z"},"triangle-down":function(de){var De=Math.sqrt(de/Tn),et=De*Tn/2;return"M0,"+et+"L"+De+","+-et+" "+-De+","+-et+"Z"},"triangle-up":function(de){var De=Math.sqrt(de/Tn),et=De*Tn/2;return"M0,"+-et+"L"+De+","+et+" "+-De+","+et+"Z"}});d.svg.symbolTypes=on.keys();var Tn=Math.sqrt(3),Wn=Math.tan(30*Pe);ie.transition=function(de){for(var De=hs||++Ko,et=ts(de),vt=[],_t,St,ar=ll||{time:Date.now(),ease:Ul,delay:0,duration:250},zt=-1,gr=this.length;++zt0;)Ta[--vi].call(de,Ka);if(Na>=1)return ar.event&&ar.event.end.call(de,de.__data__,De),--St.count?delete St[vt]:delete de[et],1}ar||(zt=_t.time,gr=kn(ya,0,zt),ar=St[vt]={tween:new S,time:zt,timer:gr,delay:_t.delay,duration:_t.duration,ease:_t.ease,index:De},_t=null,++St.count)}d.svg.axis=function(){var de=d.scale.linear(),De=$l,et=6,vt=6,_t=3,St=[10],ar=null,zt;function gr(Vr){Vr.each(function(){var Wr=d.select(this),Ta=this.__chart__||de,ya=this.__chart__=de.copy(),ri=ar??(ya.ticks?ya.ticks.apply(ya,St):ya.domain()),ni=zt??(ya.tickFormat?ya.tickFormat.apply(ya,St):F),Ma=Wr.selectAll(".tick").data(ri,ya),Na=Ma.enter().insert("g",".domain").attr("class","tick").style("opacity",Ke),Ka=d.transition(Ma.exit()).style("opacity",Ke).remove(),vi=d.transition(Ma.order()).style("opacity",1),ui=Math.max(et,0)+_t,Pa,sn=tn(ya),an=Wr.selectAll(".domain").data([0]),vn=(an.enter().append("path").attr("class","domain"),d.transition(an));Na.append("line"),Na.append("text");var Pn=Na.select("line"),Zn=vi.select("line"),eo=Ma.select("text").text(ni),$o=Na.select("text"),io=vi.select("text"),Zo=De==="top"||De==="left"?-1:1,ul,el,_l,gn;if(De==="bottom"||De==="top"?(Pa=hu,ul="x",_l="y",el="x2",gn="y2",eo.attr("dy",Zo<0?"0em":".71em").style("text-anchor","middle"),vn.attr("d","M"+sn[0]+","+Zo*vt+"V0H"+sn[1]+"V"+Zo*vt)):(Pa=wl,ul="y",_l="x",el="y2",gn="x2",eo.attr("dy",".32em").style("text-anchor",Zo<0?"end":"start"),vn.attr("d","M"+Zo*vt+","+sn[0]+"H0V"+sn[1]+"H"+Zo*vt)),Pn.attr(gn,Zo*et),$o.attr(_l,Zo*ui),Zn.attr(el,0).attr(gn,Zo*et),io.attr(ul,0).attr(_l,Zo*ui),ya.rangeBand){var vo=ya,cs=vo.rangeBand()/2;Ta=ya=function(ps){return vo(ps)+cs}}else Ta.rangeBand?Ta=ya:Ka.call(Pa,ya,Ta);Na.call(Pa,Ta,ya),vi.call(Pa,ya,ya)})}return gr.scale=function(Vr){return arguments.length?(de=Vr,gr):de},gr.orient=function(Vr){return arguments.length?(De=Vr in Ru?Vr+"":$l,gr):De},gr.ticks=function(){return arguments.length?(St=A(arguments),gr):St},gr.tickValues=function(Vr){return arguments.length?(ar=Vr,gr):ar},gr.tickFormat=function(Vr){return arguments.length?(zt=Vr,gr):zt},gr.tickSize=function(Vr){var Wr=arguments.length;return Wr?(et=+Vr,vt=+arguments[Wr-1],gr):et},gr.innerTickSize=function(Vr){return arguments.length?(et=+Vr,gr):et},gr.outerTickSize=function(Vr){return arguments.length?(vt=+Vr,gr):vt},gr.tickPadding=function(Vr){return arguments.length?(_t=+Vr,gr):_t},gr.tickSubdivide=function(){return arguments.length&&gr},gr};var $l="bottom",Ru={top:1,right:1,bottom:1,left:1};function hu(de,De,et){de.attr("transform",function(vt){var _t=De(vt);return"translate("+(isFinite(_t)?_t:et(vt))+",0)"})}function wl(de,De,et){de.attr("transform",function(vt){var _t=De(vt);return"translate(0,"+(isFinite(_t)?_t:et(vt))+")"})}d.svg.brush=function(){var de=le(Wr,"brushstart","brush","brushend"),De=null,et=null,vt=[0,0],_t=[0,0],St,ar,zt=!0,gr=!0,Vr=uc[0];function Wr(Ma){Ma.each(function(){var Na=d.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",ni).on("touchstart.brush",ni),Ka=Na.selectAll(".background").data([0]);Ka.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),Na.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var vi=Na.selectAll(".resize").data(Vr,F);vi.exit().remove(),vi.enter().append("g").attr("class",function(an){return"resize "+an}).style("cursor",function(an){return su[an]}).append("rect").attr("x",function(an){return/[ew]$/.test(an)?-3:null}).attr("y",function(an){return/^[ns]/.test(an)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),vi.style("display",Wr.empty()?"none":null);var ui=d.transition(Na),Pa=d.transition(Ka),sn;De&&(sn=tn(De),Pa.attr("x",sn[0]).attr("width",sn[1]-sn[0]),ya(ui)),et&&(sn=tn(et),Pa.attr("y",sn[0]).attr("height",sn[1]-sn[0]),ri(ui)),Ta(ui)})}Wr.event=function(Ma){Ma.each(function(){var Na=de.of(this,arguments),Ka={x:vt,y:_t,i:St,j:ar},vi=this.__chart__||Ka;this.__chart__=Ka,hs?d.select(this).transition().each("start.brush",function(){St=vi.i,ar=vi.j,vt=vi.x,_t=vi.y,Na({type:"brushstart"})}).tween("brush:brush",function(){var ui=qu(vt,Ka.x),Pa=qu(_t,Ka.y);return St=ar=null,function(sn){vt=Ka.x=ui(sn),_t=Ka.y=Pa(sn),Na({type:"brush",mode:"resize"})}}).each("end.brush",function(){St=Ka.i,ar=Ka.j,Na({type:"brush",mode:"resize"}),Na({type:"brushend"})}):(Na({type:"brushstart"}),Na({type:"brush",mode:"resize"}),Na({type:"brushend"}))})};function Ta(Ma){Ma.selectAll(".resize").attr("transform",function(Na){return"translate("+vt[+/e$/.test(Na)]+","+_t[+/^s/.test(Na)]+")"})}function ya(Ma){Ma.select(".extent").attr("x",vt[0]),Ma.selectAll(".extent,.n>rect,.s>rect").attr("width",vt[1]-vt[0])}function ri(Ma){Ma.select(".extent").attr("y",_t[0]),Ma.selectAll(".extent,.e>rect,.w>rect").attr("height",_t[1]-_t[0])}function ni(){var Ma=this,Na=d.select(d.event.target),Ka=de.of(Ma,arguments),vi=d.select(Ma),ui=Na.datum(),Pa=!/^(n|s)$/.test(ui)&&De,sn=!/^(e|w)$/.test(ui)&&et,an=Na.classed("extent"),vn=wr(Ma),Pn,Zn=d.mouse(Ma),eo,$o=d.select(t(Ma)).on("keydown.brush",ul).on("keyup.brush",el);if(d.event.changedTouches?$o.on("touchmove.brush",_l).on("touchend.brush",vo):$o.on("mousemove.brush",_l).on("mouseup.brush",vo),vi.interrupt().selectAll("*").interrupt(),an)Zn[0]=vt[0]-Zn[0],Zn[1]=_t[0]-Zn[1];else if(ui){var io=+/w$/.test(ui),Zo=+/^n/.test(ui);eo=[vt[1-io]-Zn[0],_t[1-Zo]-Zn[1]],Zn[0]=vt[io],Zn[1]=_t[Zo]}else d.event.altKey&&(Pn=Zn.slice());vi.style("pointer-events","none").selectAll(".resize").style("display",null),d.select("body").style("cursor",Na.style("cursor")),Ka({type:"brushstart"}),_l();function ul(){d.event.keyCode==32&&(an||(Pn=null,Zn[0]-=vt[1],Zn[1]-=_t[1],an=2),Q())}function el(){d.event.keyCode==32&&an==2&&(Zn[0]+=vt[1],Zn[1]+=_t[1],an=0,Q())}function _l(){var cs=d.mouse(Ma),ps=!1;eo&&(cs[0]+=eo[0],cs[1]+=eo[1]),an||(d.event.altKey?(Pn||(Pn=[(vt[0]+vt[1])/2,(_t[0]+_t[1])/2]),Zn[0]=vt[+(cs[0]0))return Zt;do Zt.push(Sr=new Date(+Lt)),Fe(Lt,Vt),fe(Lt);while(Sr=kt)for(;fe(kt),!Lt(kt);)kt.setTime(kt-1)},function(kt,Vt){if(kt>=kt)if(Vt<0)for(;++Vt<=0;)for(;Fe(kt,-1),!Lt(kt););else for(;--Vt>=0;)for(;Fe(kt,1),!Lt(kt););})},rt&&(Qe.count=function(Lt,kt){return x.setTime(+Lt),A.setTime(+kt),fe(x),fe(A),Math.floor(rt(x,A))},Qe.every=function(Lt){return Lt=Math.floor(Lt),!isFinite(Lt)||!(Lt>0)?null:Lt>1?Qe.filter(st?function(kt){return st(kt)%Lt===0}:function(kt){return Qe.count(0,kt)%Lt===0}):Qe}),Qe}var e=M(function(){},function(fe,Fe){fe.setTime(+fe+Fe)},function(fe,Fe){return Fe-fe});e.every=function(fe){return fe=Math.floor(fe),!isFinite(fe)||!(fe>0)?null:fe>1?M(function(Fe){Fe.setTime(Math.floor(Fe/fe)*fe)},function(Fe,rt){Fe.setTime(+Fe+rt*fe)},function(Fe,rt){return(rt-Fe)/fe}):e};var t=e.range,r=1e3,o=6e4,a=36e5,i=864e5,n=6048e5,s=M(function(fe){fe.setTime(fe-fe.getMilliseconds())},function(fe,Fe){fe.setTime(+fe+Fe*r)},function(fe,Fe){return(Fe-fe)/r},function(fe){return fe.getUTCSeconds()}),c=s.range,f=M(function(fe){fe.setTime(fe-fe.getMilliseconds()-fe.getSeconds()*r)},function(fe,Fe){fe.setTime(+fe+Fe*o)},function(fe,Fe){return(Fe-fe)/o},function(fe){return fe.getMinutes()}),g=f.range,v=M(function(fe){fe.setTime(fe-fe.getMilliseconds()-fe.getSeconds()*r-fe.getMinutes()*o)},function(fe,Fe){fe.setTime(+fe+Fe*a)},function(fe,Fe){return(Fe-fe)/a},function(fe){return fe.getHours()}),T=v.range,l=M(function(fe){fe.setHours(0,0,0,0)},function(fe,Fe){fe.setDate(fe.getDate()+Fe)},function(fe,Fe){return(Fe-fe-(Fe.getTimezoneOffset()-fe.getTimezoneOffset())*o)/i},function(fe){return fe.getDate()-1}),_=l.range;function w(fe){return M(function(Fe){Fe.setDate(Fe.getDate()-(Fe.getDay()+7-fe)%7),Fe.setHours(0,0,0,0)},function(Fe,rt){Fe.setDate(Fe.getDate()+rt*7)},function(Fe,rt){return(rt-Fe-(rt.getTimezoneOffset()-Fe.getTimezoneOffset())*o)/n})}var S=w(0),E=w(1),y=w(2),b=w(3),p=w(4),u=w(5),m=w(6),h=S.range,P=E.range,L=y.range,z=b.range,F=p.range,B=u.range,O=m.range,I=M(function(fe){fe.setDate(1),fe.setHours(0,0,0,0)},function(fe,Fe){fe.setMonth(fe.getMonth()+Fe)},function(fe,Fe){return Fe.getMonth()-fe.getMonth()+(Fe.getFullYear()-fe.getFullYear())*12},function(fe){return fe.getMonth()}),N=I.range,U=M(function(fe){fe.setMonth(0,1),fe.setHours(0,0,0,0)},function(fe,Fe){fe.setFullYear(fe.getFullYear()+Fe)},function(fe,Fe){return Fe.getFullYear()-fe.getFullYear()},function(fe){return fe.getFullYear()});U.every=function(fe){return!isFinite(fe=Math.floor(fe))||!(fe>0)?null:M(function(Fe){Fe.setFullYear(Math.floor(Fe.getFullYear()/fe)*fe),Fe.setMonth(0,1),Fe.setHours(0,0,0,0)},function(Fe,rt){Fe.setFullYear(Fe.getFullYear()+rt*fe)})};var W=U.range,Q=M(function(fe){fe.setUTCSeconds(0,0)},function(fe,Fe){fe.setTime(+fe+Fe*o)},function(fe,Fe){return(Fe-fe)/o},function(fe){return fe.getUTCMinutes()}),ue=Q.range,le=M(function(fe){fe.setUTCMinutes(0,0,0)},function(fe,Fe){fe.setTime(+fe+Fe*a)},function(fe,Fe){return(Fe-fe)/a},function(fe){return fe.getUTCHours()}),he=le.range,G=M(function(fe){fe.setUTCHours(0,0,0,0)},function(fe,Fe){fe.setUTCDate(fe.getUTCDate()+Fe)},function(fe,Fe){return(Fe-fe)/i},function(fe){return fe.getUTCDate()-1}),$=G.range;function J(fe){return M(function(Fe){Fe.setUTCDate(Fe.getUTCDate()-(Fe.getUTCDay()+7-fe)%7),Fe.setUTCHours(0,0,0,0)},function(Fe,rt){Fe.setUTCDate(Fe.getUTCDate()+rt*7)},function(Fe,rt){return(rt-Fe)/n})}var X=J(0),oe=J(1),ie=J(2),j=J(3),ee=J(4),re=J(5),ce=J(6),be=X.range,Ae=oe.range,ze=ie.range,Re=j.range,Xe=ee.range,it=re.range,ot=ce.range,tt=M(function(fe){fe.setUTCDate(1),fe.setUTCHours(0,0,0,0)},function(fe,Fe){fe.setUTCMonth(fe.getUTCMonth()+Fe)},function(fe,Fe){return Fe.getUTCMonth()-fe.getUTCMonth()+(Fe.getUTCFullYear()-fe.getUTCFullYear())*12},function(fe){return fe.getUTCMonth()}),lt=tt.range,Ee=M(function(fe){fe.setUTCMonth(0,1),fe.setUTCHours(0,0,0,0)},function(fe,Fe){fe.setUTCFullYear(fe.getUTCFullYear()+Fe)},function(fe,Fe){return Fe.getUTCFullYear()-fe.getUTCFullYear()},function(fe){return fe.getUTCFullYear()});Ee.every=function(fe){return!isFinite(fe=Math.floor(fe))||!(fe>0)?null:M(function(Fe){Fe.setUTCFullYear(Math.floor(Fe.getUTCFullYear()/fe)*fe),Fe.setUTCMonth(0,1),Fe.setUTCHours(0,0,0,0)},function(Fe,rt){Fe.setUTCFullYear(Fe.getUTCFullYear()+rt*fe)})};var _e=Ee.range;d.timeDay=l,d.timeDays=_,d.timeFriday=u,d.timeFridays=B,d.timeHour=v,d.timeHours=T,d.timeInterval=M,d.timeMillisecond=e,d.timeMilliseconds=t,d.timeMinute=f,d.timeMinutes=g,d.timeMonday=E,d.timeMondays=P,d.timeMonth=I,d.timeMonths=N,d.timeSaturday=m,d.timeSaturdays=O,d.timeSecond=s,d.timeSeconds=c,d.timeSunday=S,d.timeSundays=h,d.timeThursday=p,d.timeThursdays=F,d.timeTuesday=y,d.timeTuesdays=L,d.timeWednesday=b,d.timeWednesdays=z,d.timeWeek=S,d.timeWeeks=h,d.timeYear=U,d.timeYears=W,d.utcDay=G,d.utcDays=$,d.utcFriday=re,d.utcFridays=it,d.utcHour=le,d.utcHours=he,d.utcMillisecond=e,d.utcMilliseconds=t,d.utcMinute=Q,d.utcMinutes=ue,d.utcMonday=oe,d.utcMondays=Ae,d.utcMonth=tt,d.utcMonths=lt,d.utcSaturday=ce,d.utcSaturdays=ot,d.utcSecond=s,d.utcSeconds=c,d.utcSunday=X,d.utcSundays=be,d.utcThursday=ee,d.utcThursdays=Xe,d.utcTuesday=ie,d.utcTuesdays=ze,d.utcWednesday=j,d.utcWednesdays=Re,d.utcWeek=X,d.utcWeeks=be,d.utcYear=Ee,d.utcYears=_e,Object.defineProperty(d,"__esModule",{value:!0})})}}),jp=Ze({"node_modules/d3-time-format/dist/d3-time-format.js"(Z,q){(function(d,x){typeof Z=="object"&&typeof q<"u"?x(Z,$p()):(d=d||self,x(d.d3=d.d3||{},d.d3))})(Z,function(d,x){"use strict";function A(Be){if(0<=Be.y&&Be.y<100){var Ke=new Date(-1,Be.m,Be.d,Be.H,Be.M,Be.S,Be.L);return Ke.setFullYear(Be.y),Ke}return new Date(Be.y,Be.m,Be.d,Be.H,Be.M,Be.S,Be.L)}function M(Be){if(0<=Be.y&&Be.y<100){var Ke=new Date(Date.UTC(-1,Be.m,Be.d,Be.H,Be.M,Be.S,Be.L));return Ke.setUTCFullYear(Be.y),Ke}return new Date(Date.UTC(Be.y,Be.m,Be.d,Be.H,Be.M,Be.S,Be.L))}function e(Be,Ke,Ue){return{y:Be,m:Ke,d:Ue,H:0,M:0,S:0,L:0}}function t(Be){var Ke=Be.dateTime,Ue=Be.date,Me=Be.time,qe=Be.periods,Ce=Be.days,Te=Be.shortDays,Pe=Be.months,at=Be.shortMonths,yt=c(qe),Tt=f(qe),Ot=c(Ce),Gt=f(Ce),rr=c(Te),Qt=f(Te),Tr=c(Pe),la=f(Pe),Ua=c(at),Ba=f(at),Ra={a:Ha,A:$a,b:ai,B:mi,c:null,d:I,e:I,f:ue,H:N,I:U,j:W,L:Q,m:le,M:he,p:xt,q:ct,Q:kt,s:Vt,S:G,u:$,U:J,V:X,w:oe,W:ie,x:null,X:null,y:j,Y:ee,Z:re,"%":Lt},ei={a:Nr,A:Or,b:Rr,B:Lr,c:null,d:ce,e:ce,f:Xe,H:be,I:Ae,j:ze,L:Re,m:it,M:ot,p:Gr,q:Kr,Q:kt,s:Vt,S:tt,u:lt,U:Ee,V:_e,w:fe,W:Fe,x:null,X:null,y:rt,Y:st,Z:Qe,"%":Lt},za={a:Kt,A:Wt,b:Pr,B:ta,c:ma,d:p,e:p,f:z,H:m,I:m,j:u,L,m:b,M:h,p:Nt,q:y,Q:B,s:O,S:P,u:v,U:T,V:l,w:g,W:_,x:ra,X:Ia,y:S,Y:w,Z:E,"%":F};Ra.x=ti(Ue,Ra),Ra.X=ti(Me,Ra),Ra.c=ti(Ke,Ra),ei.x=ti(Ue,ei),ei.X=ti(Me,ei),ei.c=ti(Ke,ei);function ti(Ur,aa){return function(da){var fa=[],It=-1,dr=0,kr=Ur.length,ia,Ca,Fa;for(da instanceof Date||(da=new Date(+da));++It53)return null;"w"in fa||(fa.w=1),"Z"in fa?(dr=M(e(fa.y,0,1)),kr=dr.getUTCDay(),dr=kr>4||kr===0?x.utcMonday.ceil(dr):x.utcMonday(dr),dr=x.utcDay.offset(dr,(fa.V-1)*7),fa.y=dr.getUTCFullYear(),fa.m=dr.getUTCMonth(),fa.d=dr.getUTCDate()+(fa.w+6)%7):(dr=A(e(fa.y,0,1)),kr=dr.getDay(),dr=kr>4||kr===0?x.timeMonday.ceil(dr):x.timeMonday(dr),dr=x.timeDay.offset(dr,(fa.V-1)*7),fa.y=dr.getFullYear(),fa.m=dr.getMonth(),fa.d=dr.getDate()+(fa.w+6)%7)}else("W"in fa||"U"in fa)&&("w"in fa||(fa.w="u"in fa?fa.u%7:"W"in fa?1:0),kr="Z"in fa?M(e(fa.y,0,1)).getUTCDay():A(e(fa.y,0,1)).getDay(),fa.m=0,fa.d="W"in fa?(fa.w+6)%7+fa.W*7-(kr+5)%7:fa.w+fa.U*7-(kr+6)%7);return"Z"in fa?(fa.H+=fa.Z/100|0,fa.M+=fa.Z%100,M(fa)):A(fa)}}function Jt(Ur,aa,da,fa){for(var It=0,dr=aa.length,kr=da.length,ia,Ca;It=kr)return-1;if(ia=aa.charCodeAt(It++),ia===37){if(ia=aa.charAt(It++),Ca=za[ia in r?aa.charAt(It++):ia],!Ca||(fa=Ca(Ur,da,fa))<0)return-1}else if(ia!=da.charCodeAt(fa++))return-1}return fa}function Nt(Ur,aa,da){var fa=yt.exec(aa.slice(da));return fa?(Ur.p=Tt[fa[0].toLowerCase()],da+fa[0].length):-1}function Kt(Ur,aa,da){var fa=rr.exec(aa.slice(da));return fa?(Ur.w=Qt[fa[0].toLowerCase()],da+fa[0].length):-1}function Wt(Ur,aa,da){var fa=Ot.exec(aa.slice(da));return fa?(Ur.w=Gt[fa[0].toLowerCase()],da+fa[0].length):-1}function Pr(Ur,aa,da){var fa=Ua.exec(aa.slice(da));return fa?(Ur.m=Ba[fa[0].toLowerCase()],da+fa[0].length):-1}function ta(Ur,aa,da){var fa=Tr.exec(aa.slice(da));return fa?(Ur.m=la[fa[0].toLowerCase()],da+fa[0].length):-1}function ma(Ur,aa,da){return Jt(Ur,Ke,aa,da)}function ra(Ur,aa,da){return Jt(Ur,Ue,aa,da)}function Ia(Ur,aa,da){return Jt(Ur,Me,aa,da)}function Ha(Ur){return Te[Ur.getDay()]}function $a(Ur){return Ce[Ur.getDay()]}function ai(Ur){return at[Ur.getMonth()]}function mi(Ur){return Pe[Ur.getMonth()]}function xt(Ur){return qe[+(Ur.getHours()>=12)]}function ct(Ur){return 1+~~(Ur.getMonth()/3)}function Nr(Ur){return Te[Ur.getUTCDay()]}function Or(Ur){return Ce[Ur.getUTCDay()]}function Rr(Ur){return at[Ur.getUTCMonth()]}function Lr(Ur){return Pe[Ur.getUTCMonth()]}function Gr(Ur){return qe[+(Ur.getUTCHours()>=12)]}function Kr(Ur){return 1+~~(Ur.getUTCMonth()/3)}return{format:function(Ur){var aa=ti(Ur+="",Ra);return aa.toString=function(){return Ur},aa},parse:function(Ur){var aa=Ci(Ur+="",!1);return aa.toString=function(){return Ur},aa},utcFormat:function(Ur){var aa=ti(Ur+="",ei);return aa.toString=function(){return Ur},aa},utcParse:function(Ur){var aa=Ci(Ur+="",!0);return aa.toString=function(){return Ur},aa}}}var r={"-":"",_:" ",0:"0"},o=/^\s*\d+/,a=/^%/,i=/[\\^$*+?|[\]().{}]/g;function n(Be,Ke,Ue){var Me=Be<0?"-":"",qe=(Me?-Be:Be)+"",Ce=qe.length;return Me+(Ce68?1900:2e3),Ue+Me[0].length):-1}function E(Be,Ke,Ue){var Me=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(Ke.slice(Ue,Ue+6));return Me?(Be.Z=Me[1]?0:-(Me[2]+(Me[3]||"00")),Ue+Me[0].length):-1}function y(Be,Ke,Ue){var Me=o.exec(Ke.slice(Ue,Ue+1));return Me?(Be.q=Me[0]*3-3,Ue+Me[0].length):-1}function b(Be,Ke,Ue){var Me=o.exec(Ke.slice(Ue,Ue+2));return Me?(Be.m=Me[0]-1,Ue+Me[0].length):-1}function p(Be,Ke,Ue){var Me=o.exec(Ke.slice(Ue,Ue+2));return Me?(Be.d=+Me[0],Ue+Me[0].length):-1}function u(Be,Ke,Ue){var Me=o.exec(Ke.slice(Ue,Ue+3));return Me?(Be.m=0,Be.d=+Me[0],Ue+Me[0].length):-1}function m(Be,Ke,Ue){var Me=o.exec(Ke.slice(Ue,Ue+2));return Me?(Be.H=+Me[0],Ue+Me[0].length):-1}function h(Be,Ke,Ue){var Me=o.exec(Ke.slice(Ue,Ue+2));return Me?(Be.M=+Me[0],Ue+Me[0].length):-1}function P(Be,Ke,Ue){var Me=o.exec(Ke.slice(Ue,Ue+2));return Me?(Be.S=+Me[0],Ue+Me[0].length):-1}function L(Be,Ke,Ue){var Me=o.exec(Ke.slice(Ue,Ue+3));return Me?(Be.L=+Me[0],Ue+Me[0].length):-1}function z(Be,Ke,Ue){var Me=o.exec(Ke.slice(Ue,Ue+6));return Me?(Be.L=Math.floor(Me[0]/1e3),Ue+Me[0].length):-1}function F(Be,Ke,Ue){var Me=a.exec(Ke.slice(Ue,Ue+1));return Me?Ue+Me[0].length:-1}function B(Be,Ke,Ue){var Me=o.exec(Ke.slice(Ue));return Me?(Be.Q=+Me[0],Ue+Me[0].length):-1}function O(Be,Ke,Ue){var Me=o.exec(Ke.slice(Ue));return Me?(Be.s=+Me[0],Ue+Me[0].length):-1}function I(Be,Ke){return n(Be.getDate(),Ke,2)}function N(Be,Ke){return n(Be.getHours(),Ke,2)}function U(Be,Ke){return n(Be.getHours()%12||12,Ke,2)}function W(Be,Ke){return n(1+x.timeDay.count(x.timeYear(Be),Be),Ke,3)}function Q(Be,Ke){return n(Be.getMilliseconds(),Ke,3)}function ue(Be,Ke){return Q(Be,Ke)+"000"}function le(Be,Ke){return n(Be.getMonth()+1,Ke,2)}function he(Be,Ke){return n(Be.getMinutes(),Ke,2)}function G(Be,Ke){return n(Be.getSeconds(),Ke,2)}function $(Be){var Ke=Be.getDay();return Ke===0?7:Ke}function J(Be,Ke){return n(x.timeSunday.count(x.timeYear(Be)-1,Be),Ke,2)}function X(Be,Ke){var Ue=Be.getDay();return Be=Ue>=4||Ue===0?x.timeThursday(Be):x.timeThursday.ceil(Be),n(x.timeThursday.count(x.timeYear(Be),Be)+(x.timeYear(Be).getDay()===4),Ke,2)}function oe(Be){return Be.getDay()}function ie(Be,Ke){return n(x.timeMonday.count(x.timeYear(Be)-1,Be),Ke,2)}function j(Be,Ke){return n(Be.getFullYear()%100,Ke,2)}function ee(Be,Ke){return n(Be.getFullYear()%1e4,Ke,4)}function re(Be){var Ke=Be.getTimezoneOffset();return(Ke>0?"-":(Ke*=-1,"+"))+n(Ke/60|0,"0",2)+n(Ke%60,"0",2)}function ce(Be,Ke){return n(Be.getUTCDate(),Ke,2)}function be(Be,Ke){return n(Be.getUTCHours(),Ke,2)}function Ae(Be,Ke){return n(Be.getUTCHours()%12||12,Ke,2)}function ze(Be,Ke){return n(1+x.utcDay.count(x.utcYear(Be),Be),Ke,3)}function Re(Be,Ke){return n(Be.getUTCMilliseconds(),Ke,3)}function Xe(Be,Ke){return Re(Be,Ke)+"000"}function it(Be,Ke){return n(Be.getUTCMonth()+1,Ke,2)}function ot(Be,Ke){return n(Be.getUTCMinutes(),Ke,2)}function tt(Be,Ke){return n(Be.getUTCSeconds(),Ke,2)}function lt(Be){var Ke=Be.getUTCDay();return Ke===0?7:Ke}function Ee(Be,Ke){return n(x.utcSunday.count(x.utcYear(Be)-1,Be),Ke,2)}function _e(Be,Ke){var Ue=Be.getUTCDay();return Be=Ue>=4||Ue===0?x.utcThursday(Be):x.utcThursday.ceil(Be),n(x.utcThursday.count(x.utcYear(Be),Be)+(x.utcYear(Be).getUTCDay()===4),Ke,2)}function fe(Be){return Be.getUTCDay()}function Fe(Be,Ke){return n(x.utcMonday.count(x.utcYear(Be)-1,Be),Ke,2)}function rt(Be,Ke){return n(Be.getUTCFullYear()%100,Ke,2)}function st(Be,Ke){return n(Be.getUTCFullYear()%1e4,Ke,4)}function Qe(){return"+0000"}function Lt(){return"%"}function kt(Be){return+Be}function Vt(Be){return Math.floor(+Be/1e3)}var Zt;Sr({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function Sr(Be){return Zt=t(Be),d.timeFormat=Zt.format,d.timeParse=Zt.parse,d.utcFormat=Zt.utcFormat,d.utcParse=Zt.utcParse,Zt}var xr="%Y-%m-%dT%H:%M:%S.%LZ";function jr(Be){return Be.toISOString()}var wr=Date.prototype.toISOString?jr:d.utcFormat(xr);function Ir(Be){var Ke=new Date(Be);return isNaN(Ke)?null:Ke}var bt=+new Date("2000-01-01T00:00:00.000Z")?Ir:d.utcParse(xr);d.isoFormat=wr,d.isoParse=bt,d.timeFormatDefaultLocale=Sr,d.timeFormatLocale=t,Object.defineProperty(d,"__esModule",{value:!0})})}}),Zy=Ze({"node_modules/d3-format/dist/d3-format.js"(Z,q){(function(d,x){typeof Z=="object"&&typeof q<"u"?x(Z):(d=typeof globalThis<"u"?globalThis:d||self,x(d.d3=d.d3||{}))})(Z,function(d){"use strict";function x(b){return Math.abs(b=Math.round(b))>=1e21?b.toLocaleString("en").replace(/,/g,""):b.toString(10)}function A(b,p){if((u=(b=p?b.toExponential(p-1):b.toExponential()).indexOf("e"))<0)return null;var u,m=b.slice(0,u);return[m.length>1?m[0]+m.slice(2):m,+b.slice(u+1)]}function M(b){return b=A(Math.abs(b)),b?b[1]:NaN}function e(b,p){return function(u,m){for(var h=u.length,P=[],L=0,z=b[0],F=0;h>0&&z>0&&(F+z+1>m&&(z=Math.max(1,m-F)),P.push(u.substring(h-=z,h+z)),!((F+=z+1)>m));)z=b[L=(L+1)%b.length];return P.reverse().join(p)}}function t(b){return function(p){return p.replace(/[0-9]/g,function(u){return b[+u]})}}var r=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function o(b){if(!(p=r.exec(b)))throw new Error("invalid format: "+b);var p;return new a({fill:p[1],align:p[2],sign:p[3],symbol:p[4],zero:p[5],width:p[6],comma:p[7],precision:p[8]&&p[8].slice(1),trim:p[9],type:p[10]})}o.prototype=a.prototype;function a(b){this.fill=b.fill===void 0?" ":b.fill+"",this.align=b.align===void 0?">":b.align+"",this.sign=b.sign===void 0?"-":b.sign+"",this.symbol=b.symbol===void 0?"":b.symbol+"",this.zero=!!b.zero,this.width=b.width===void 0?void 0:+b.width,this.comma=!!b.comma,this.precision=b.precision===void 0?void 0:+b.precision,this.trim=!!b.trim,this.type=b.type===void 0?"":b.type+""}a.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function i(b){e:for(var p=b.length,u=1,m=-1,h;u0&&(m=0);break}return m>0?b.slice(0,m)+b.slice(h+1):b}var n;function s(b,p){var u=A(b,p);if(!u)return b+"";var m=u[0],h=u[1],P=h-(n=Math.max(-8,Math.min(8,Math.floor(h/3)))*3)+1,L=m.length;return P===L?m:P>L?m+new Array(P-L+1).join("0"):P>0?m.slice(0,P)+"."+m.slice(P):"0."+new Array(1-P).join("0")+A(b,Math.max(0,p+P-1))[0]}function c(b,p){var u=A(b,p);if(!u)return b+"";var m=u[0],h=u[1];return h<0?"0."+new Array(-h).join("0")+m:m.length>h+1?m.slice(0,h+1)+"."+m.slice(h+1):m+new Array(h-m.length+2).join("0")}var f={"%":function(b,p){return(b*100).toFixed(p)},b:function(b){return Math.round(b).toString(2)},c:function(b){return b+""},d:x,e:function(b,p){return b.toExponential(p)},f:function(b,p){return b.toFixed(p)},g:function(b,p){return b.toPrecision(p)},o:function(b){return Math.round(b).toString(8)},p:function(b,p){return c(b*100,p)},r:c,s,X:function(b){return Math.round(b).toString(16).toUpperCase()},x:function(b){return Math.round(b).toString(16)}};function g(b){return b}var v=Array.prototype.map,T=["y","z","a","f","p","n","\xB5","m","","k","M","G","T","P","E","Z","Y"];function l(b){var p=b.grouping===void 0||b.thousands===void 0?g:e(v.call(b.grouping,Number),b.thousands+""),u=b.currency===void 0?"":b.currency[0]+"",m=b.currency===void 0?"":b.currency[1]+"",h=b.decimal===void 0?".":b.decimal+"",P=b.numerals===void 0?g:t(v.call(b.numerals,String)),L=b.percent===void 0?"%":b.percent+"",z=b.minus===void 0?"-":b.minus+"",F=b.nan===void 0?"NaN":b.nan+"";function B(I){I=o(I);var N=I.fill,U=I.align,W=I.sign,Q=I.symbol,ue=I.zero,le=I.width,he=I.comma,G=I.precision,$=I.trim,J=I.type;J==="n"?(he=!0,J="g"):f[J]||(G===void 0&&(G=12),$=!0,J="g"),(ue||N==="0"&&U==="=")&&(ue=!0,N="0",U="=");var X=Q==="$"?u:Q==="#"&&/[boxX]/.test(J)?"0"+J.toLowerCase():"",oe=Q==="$"?m:/[%p]/.test(J)?L:"",ie=f[J],j=/[defgprs%]/.test(J);G=G===void 0?6:/[gprs]/.test(J)?Math.max(1,Math.min(21,G)):Math.max(0,Math.min(20,G));function ee(re){var ce=X,be=oe,Ae,ze,Re;if(J==="c")be=ie(re)+be,re="";else{re=+re;var Xe=re<0||1/re<0;if(re=isNaN(re)?F:ie(Math.abs(re),G),$&&(re=i(re)),Xe&&+re==0&&W!=="+"&&(Xe=!1),ce=(Xe?W==="("?W:z:W==="-"||W==="("?"":W)+ce,be=(J==="s"?T[8+n/3]:"")+be+(Xe&&W==="("?")":""),j){for(Ae=-1,ze=re.length;++AeRe||Re>57){be=(Re===46?h+re.slice(Ae+1):re.slice(Ae))+be,re=re.slice(0,Ae);break}}}he&&!ue&&(re=p(re,1/0));var it=ce.length+re.length+be.length,ot=it>1)+ce+re+be+ot.slice(it);break;default:re=ot+ce+re+be;break}return P(re)}return ee.toString=function(){return I+""},ee}function O(I,N){var U=B((I=o(I),I.type="f",I)),W=Math.max(-8,Math.min(8,Math.floor(M(N)/3)))*3,Q=Math.pow(10,-W),ue=T[8+W/3];return function(le){return U(Q*le)+ue}}return{format:B,formatPrefix:O}}var _;w({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"});function w(b){return _=l(b),d.format=_.format,d.formatPrefix=_.formatPrefix,_}function S(b){return Math.max(0,-M(Math.abs(b)))}function E(b,p){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(M(p)/3)))*3-M(Math.abs(b)))}function y(b,p){return b=Math.abs(b),p=Math.abs(p)-b,Math.max(0,M(p)-M(b))+1}d.FormatSpecifier=a,d.formatDefaultLocale=w,d.formatLocale=l,d.formatSpecifier=o,d.precisionFixed=S,d.precisionPrefix=E,d.precisionRound=y,Object.defineProperty(d,"__esModule",{value:!0})})}}),s7=Ze({"node_modules/is-string-blank/index.js"(Z,q){"use strict";q.exports=function(d){for(var x=d.length,A,M=0;M13)&&A!==32&&A!==133&&A!==160&&A!==5760&&A!==6158&&(A<8192||A>8205)&&A!==8232&&A!==8233&&A!==8239&&A!==8287&&A!==8288&&A!==12288&&A!==65279)return!1;return!0}}}),ns=Ze({"node_modules/fast-isnumeric/index.js"(Z,q){"use strict";var d=s7();q.exports=function(x){var A=typeof x;if(A==="string"){var M=x;if(x=+x,x===0&&d(M))return!1}else if(A!=="number")return!1;return x-x<1}}}),qs=Ze({"src/constants/numerical.js"(Z,q){"use strict";q.exports={BADNUM:void 0,FP_SAFE:Number.MAX_VALUE*1e-4,ONEMAXYEAR:316224e5,ONEAVGYEAR:315576e5,ONEMINYEAR:31536e6,ONEMAXQUARTER:79488e5,ONEAVGQUARTER:78894e5,ONEMINQUARTER:76896e5,ONEMAXMONTH:26784e5,ONEAVGMONTH:26298e5,ONEMINMONTH:24192e5,ONEWEEK:6048e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,ONEMILLI:1,ONEMICROSEC:.001,EPOCHJD:24405875e-1,ALMOST_EQUAL:1-1e-6,LOG_CLIP:10,MINUS_SIGN:"\u2212"}}}),YA=Ze({"node_modules/base64-arraybuffer/dist/base64-arraybuffer.umd.js"(Z,q){(function(d,x){typeof Z=="object"&&typeof q<"u"?x(Z):(d=typeof globalThis<"u"?globalThis:d||self,x(d["base64-arraybuffer"]={}))})(Z,function(d){"use strict";for(var x="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",A=typeof Uint8Array>"u"?[]:new Uint8Array(256),M=0;M>2],n+=x[(o[a]&3)<<4|o[a+1]>>4],n+=x[(o[a+1]&15)<<2|o[a+2]>>6],n+=x[o[a+2]&63];return i%3===2?n=n.substring(0,n.length-1)+"=":i%3===1&&(n=n.substring(0,n.length-2)+"=="),n},t=function(r){var o=r.length*.75,a=r.length,i,n=0,s,c,f,g;r[r.length-1]==="="&&(o--,r[r.length-2]==="="&&o--);var v=new ArrayBuffer(o),T=new Uint8Array(v);for(i=0;i>4,T[n++]=(c&15)<<4|f>>2,T[n++]=(f&3)<<6|g&63;return v};d.decode=t,d.encode=e,Object.defineProperty(d,"__esModule",{value:!0})})}}),Xv=Ze({"src/lib/is_plain_object.js"(Z,q){"use strict";q.exports=function(x){return window&&window.process&&window.process.versions?Object.prototype.toString.call(x)==="[object Object]":Object.prototype.toString.call(x)==="[object Object]"&&Object.getPrototypeOf(x).hasOwnProperty("hasOwnProperty")}}}),xp=Ze({"src/lib/array.js"(Z){"use strict";var q=YA().decode,d=Xv(),x=Array.isArray,A=ArrayBuffer,M=DataView;function e(s){return A.isView(s)&&!(s instanceof M)}Z.isTypedArray=e;function t(s){return x(s)||e(s)}Z.isArrayOrTypedArray=t;function r(s){return!t(s[0])}Z.isArray1D=r,Z.ensureArray=function(s,c){return x(s)||(s=[]),s.length=c,s};var o={u1c:typeof Uint8ClampedArray>"u"?void 0:Uint8ClampedArray,i1:typeof Int8Array>"u"?void 0:Int8Array,u1:typeof Uint8Array>"u"?void 0:Uint8Array,i2:typeof Int16Array>"u"?void 0:Int16Array,u2:typeof Uint16Array>"u"?void 0:Uint16Array,i4:typeof Int32Array>"u"?void 0:Int32Array,u4:typeof Uint32Array>"u"?void 0:Uint32Array,f4:typeof Float32Array>"u"?void 0:Float32Array,f8:typeof Float64Array>"u"?void 0:Float64Array};o.uint8c=o.u1c,o.uint8=o.u1,o.int8=o.i1,o.uint16=o.u2,o.int16=o.i2,o.uint32=o.u4,o.int32=o.i4,o.float32=o.f4,o.float64=o.f8;function a(s){return s.constructor===ArrayBuffer}Z.isArrayBuffer=a,Z.decodeTypedArraySpec=function(s){var c=[],f=i(s),g=f.dtype,v=o[g];if(!v)throw new Error('Error in dtype: "'+g+'"');var T=v.BYTES_PER_ELEMENT,l=f.bdata;a(l)||(l=q(l));var _=f.shape===void 0?[l.byteLength/T]:(""+f.shape).split(",");_.reverse();var w=_.length,S,E,y=+_[0],b=T*y,p=0;if(w===1)c=new v(l);else if(w===2)for(S=+_[1],E=0;E2)return v[S]=v[S]|e,_.set(w,null);if(l){for(c=S;c0)return Math.log(A)/Math.LN10;var e=Math.log(Math.min(M[0],M[1]))/Math.LN10;return d(e)||(e=Math.log(Math.max(M[0],M[1]))/Math.LN10-6),e}}}),c7=Ze({"src/lib/relink_private.js"(Z,q){"use strict";var d=xp().isArrayOrTypedArray,x=Xv();q.exports=function A(M,e){for(var t in e){var r=e[t],o=M[t];if(o!==r)if(t.charAt(0)==="_"||typeof r=="function"){if(t in M)continue;M[t]=r}else if(d(r)&&d(o)&&x(r[0])){if(t==="customdata"||t==="ids")continue;for(var a=Math.min(r.length,o.length),i=0;iM/2?A-Math.round(A/M)*M:A}q.exports={mod:d,modHalf:x}}}),Ch=Ze({"node_modules/tinycolor2/tinycolor.js"(Z,q){(function(d){var x=/^\s+/,A=/\s+$/,M=0,e=d.round,t=d.min,r=d.max,o=d.random;function a(j,ee){if(j=j||"",ee=ee||{},j instanceof a)return j;if(!(this instanceof a))return new a(j,ee);var re=i(j);this._originalInput=j,this._r=re.r,this._g=re.g,this._b=re.b,this._a=re.a,this._roundA=e(100*this._a)/100,this._format=ee.format||re.format,this._gradientType=ee.gradientType,this._r<1&&(this._r=e(this._r)),this._g<1&&(this._g=e(this._g)),this._b<1&&(this._b=e(this._b)),this._ok=re.ok,this._tc_id=M++}a.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var j=this.toRgb();return(j.r*299+j.g*587+j.b*114)/1e3},getLuminance:function(){var j=this.toRgb(),ee,re,ce,be,Ae,ze;return ee=j.r/255,re=j.g/255,ce=j.b/255,ee<=.03928?be=ee/12.92:be=d.pow((ee+.055)/1.055,2.4),re<=.03928?Ae=re/12.92:Ae=d.pow((re+.055)/1.055,2.4),ce<=.03928?ze=ce/12.92:ze=d.pow((ce+.055)/1.055,2.4),.2126*be+.7152*Ae+.0722*ze},setAlpha:function(j){return this._a=I(j),this._roundA=e(100*this._a)/100,this},toHsv:function(){var j=f(this._r,this._g,this._b);return{h:j.h*360,s:j.s,v:j.v,a:this._a}},toHsvString:function(){var j=f(this._r,this._g,this._b),ee=e(j.h*360),re=e(j.s*100),ce=e(j.v*100);return this._a==1?"hsv("+ee+", "+re+"%, "+ce+"%)":"hsva("+ee+", "+re+"%, "+ce+"%, "+this._roundA+")"},toHsl:function(){var j=s(this._r,this._g,this._b);return{h:j.h*360,s:j.s,l:j.l,a:this._a}},toHslString:function(){var j=s(this._r,this._g,this._b),ee=e(j.h*360),re=e(j.s*100),ce=e(j.l*100);return this._a==1?"hsl("+ee+", "+re+"%, "+ce+"%)":"hsla("+ee+", "+re+"%, "+ce+"%, "+this._roundA+")"},toHex:function(j){return v(this._r,this._g,this._b,j)},toHexString:function(j){return"#"+this.toHex(j)},toHex8:function(j){return T(this._r,this._g,this._b,this._a,j)},toHex8String:function(j){return"#"+this.toHex8(j)},toRgb:function(){return{r:e(this._r),g:e(this._g),b:e(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+e(this._r)+", "+e(this._g)+", "+e(this._b)+")":"rgba("+e(this._r)+", "+e(this._g)+", "+e(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:e(N(this._r,255)*100)+"%",g:e(N(this._g,255)*100)+"%",b:e(N(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+e(N(this._r,255)*100)+"%, "+e(N(this._g,255)*100)+"%, "+e(N(this._b,255)*100)+"%)":"rgba("+e(N(this._r,255)*100)+"%, "+e(N(this._g,255)*100)+"%, "+e(N(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:B[v(this._r,this._g,this._b,!0)]||!1},toFilter:function(j){var ee="#"+l(this._r,this._g,this._b,this._a),re=ee,ce=this._gradientType?"GradientType = 1, ":"";if(j){var be=a(j);re="#"+l(be._r,be._g,be._b,be._a)}return"progid:DXImageTransform.Microsoft.gradient("+ce+"startColorstr="+ee+",endColorstr="+re+")"},toString:function(j){var ee=!!j;j=j||this._format;var re=!1,ce=this._a<1&&this._a>=0,be=!ee&&ce&&(j==="hex"||j==="hex6"||j==="hex3"||j==="hex4"||j==="hex8"||j==="name");return be?j==="name"&&this._a===0?this.toName():this.toRgbString():(j==="rgb"&&(re=this.toRgbString()),j==="prgb"&&(re=this.toPercentageRgbString()),(j==="hex"||j==="hex6")&&(re=this.toHexString()),j==="hex3"&&(re=this.toHexString(!0)),j==="hex4"&&(re=this.toHex8String(!0)),j==="hex8"&&(re=this.toHex8String()),j==="name"&&(re=this.toName()),j==="hsl"&&(re=this.toHslString()),j==="hsv"&&(re=this.toHsvString()),re||this.toHexString())},clone:function(){return a(this.toString())},_applyModification:function(j,ee){var re=j.apply(null,[this].concat([].slice.call(ee)));return this._r=re._r,this._g=re._g,this._b=re._b,this.setAlpha(re._a),this},lighten:function(){return this._applyModification(E,arguments)},brighten:function(){return this._applyModification(y,arguments)},darken:function(){return this._applyModification(b,arguments)},desaturate:function(){return this._applyModification(_,arguments)},saturate:function(){return this._applyModification(w,arguments)},greyscale:function(){return this._applyModification(S,arguments)},spin:function(){return this._applyModification(p,arguments)},_applyCombination:function(j,ee){return j.apply(null,[this].concat([].slice.call(ee)))},analogous:function(){return this._applyCombination(L,arguments)},complement:function(){return this._applyCombination(u,arguments)},monochromatic:function(){return this._applyCombination(z,arguments)},splitcomplement:function(){return this._applyCombination(P,arguments)},triad:function(){return this._applyCombination(m,arguments)},tetrad:function(){return this._applyCombination(h,arguments)}},a.fromRatio=function(j,ee){if(typeof j=="object"){var re={};for(var ce in j)j.hasOwnProperty(ce)&&(ce==="a"?re[ce]=j[ce]:re[ce]=he(j[ce]));j=re}return a(j,ee)};function i(j){var ee={r:0,g:0,b:0},re=1,ce=null,be=null,Ae=null,ze=!1,Re=!1;return typeof j=="string"&&(j=oe(j)),typeof j=="object"&&(X(j.r)&&X(j.g)&&X(j.b)?(ee=n(j.r,j.g,j.b),ze=!0,Re=String(j.r).substr(-1)==="%"?"prgb":"rgb"):X(j.h)&&X(j.s)&&X(j.v)?(ce=he(j.s),be=he(j.v),ee=g(j.h,ce,be),ze=!0,Re="hsv"):X(j.h)&&X(j.s)&&X(j.l)&&(ce=he(j.s),Ae=he(j.l),ee=c(j.h,ce,Ae),ze=!0,Re="hsl"),j.hasOwnProperty("a")&&(re=j.a)),re=I(re),{ok:ze,format:j.format||Re,r:t(255,r(ee.r,0)),g:t(255,r(ee.g,0)),b:t(255,r(ee.b,0)),a:re}}function n(j,ee,re){return{r:N(j,255)*255,g:N(ee,255)*255,b:N(re,255)*255}}function s(j,ee,re){j=N(j,255),ee=N(ee,255),re=N(re,255);var ce=r(j,ee,re),be=t(j,ee,re),Ae,ze,Re=(ce+be)/2;if(ce==be)Ae=ze=0;else{var Xe=ce-be;switch(ze=Re>.5?Xe/(2-ce-be):Xe/(ce+be),ce){case j:Ae=(ee-re)/Xe+(ee1&&(tt-=1),tt<1/6?it+(ot-it)*6*tt:tt<1/2?ot:tt<2/3?it+(ot-it)*(2/3-tt)*6:it}if(ee===0)ce=be=Ae=re;else{var Re=re<.5?re*(1+ee):re+ee-re*ee,Xe=2*re-Re;ce=ze(Xe,Re,j+1/3),be=ze(Xe,Re,j),Ae=ze(Xe,Re,j-1/3)}return{r:ce*255,g:be*255,b:Ae*255}}function f(j,ee,re){j=N(j,255),ee=N(ee,255),re=N(re,255);var ce=r(j,ee,re),be=t(j,ee,re),Ae,ze,Re=ce,Xe=ce-be;if(ze=ce===0?0:Xe/ce,ce==be)Ae=0;else{switch(ce){case j:Ae=(ee-re)/Xe+(ee>1)+720)%360;--ee;)ce.h=(ce.h+be)%360,Ae.push(a(ce));return Ae}function z(j,ee){ee=ee||6;for(var re=a(j).toHsv(),ce=re.h,be=re.s,Ae=re.v,ze=[],Re=1/ee;ee--;)ze.push(a({h:ce,s:be,v:Ae})),Ae=(Ae+Re)%1;return ze}a.mix=function(j,ee,re){re=re===0?0:re||50;var ce=a(j).toRgb(),be=a(ee).toRgb(),Ae=re/100,ze={r:(be.r-ce.r)*Ae+ce.r,g:(be.g-ce.g)*Ae+ce.g,b:(be.b-ce.b)*Ae+ce.b,a:(be.a-ce.a)*Ae+ce.a};return a(ze)},a.readability=function(j,ee){var re=a(j),ce=a(ee);return(d.max(re.getLuminance(),ce.getLuminance())+.05)/(d.min(re.getLuminance(),ce.getLuminance())+.05)},a.isReadable=function(j,ee,re){var ce=a.readability(j,ee),be,Ae;switch(Ae=!1,be=ie(re),be.level+be.size){case"AAsmall":case"AAAlarge":Ae=ce>=4.5;break;case"AAlarge":Ae=ce>=3;break;case"AAAsmall":Ae=ce>=7;break}return Ae},a.mostReadable=function(j,ee,re){var ce=null,be=0,Ae,ze,Re,Xe;re=re||{},ze=re.includeFallbackColors,Re=re.level,Xe=re.size;for(var it=0;itbe&&(be=Ae,ce=a(ee[it]));return a.isReadable(j,ce,{level:Re,size:Xe})||!ze?ce:(re.includeFallbackColors=!1,a.mostReadable(j,["#fff","#000"],re))};var F=a.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},B=a.hexNames=O(F);function O(j){var ee={};for(var re in j)j.hasOwnProperty(re)&&(ee[j[re]]=re);return ee}function I(j){return j=parseFloat(j),(isNaN(j)||j<0||j>1)&&(j=1),j}function N(j,ee){Q(j)&&(j="100%");var re=ue(j);return j=t(ee,r(0,parseFloat(j))),re&&(j=parseInt(j*ee,10)/100),d.abs(j-ee)<1e-6?1:j%ee/parseFloat(ee)}function U(j){return t(1,r(0,j))}function W(j){return parseInt(j,16)}function Q(j){return typeof j=="string"&&j.indexOf(".")!=-1&&parseFloat(j)===1}function ue(j){return typeof j=="string"&&j.indexOf("%")!=-1}function le(j){return j.length==1?"0"+j:""+j}function he(j){return j<=1&&(j=j*100+"%"),j}function G(j){return d.round(parseFloat(j)*255).toString(16)}function $(j){return W(j)/255}var J=function(){var j="[-\\+]?\\d+%?",ee="[-\\+]?\\d*\\.\\d+%?",re="(?:"+ee+")|(?:"+j+")",ce="[\\s|\\(]+("+re+")[,|\\s]+("+re+")[,|\\s]+("+re+")\\s*\\)?",be="[\\s|\\(]+("+re+")[,|\\s]+("+re+")[,|\\s]+("+re+")[,|\\s]+("+re+")\\s*\\)?";return{CSS_UNIT:new RegExp(re),rgb:new RegExp("rgb"+ce),rgba:new RegExp("rgba"+be),hsl:new RegExp("hsl"+ce),hsla:new RegExp("hsla"+be),hsv:new RegExp("hsv"+ce),hsva:new RegExp("hsva"+be),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function X(j){return!!J.CSS_UNIT.exec(j)}function oe(j){j=j.replace(x,"").replace(A,"").toLowerCase();var ee=!1;if(F[j])j=F[j],ee=!0;else if(j=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var re;return(re=J.rgb.exec(j))?{r:re[1],g:re[2],b:re[3]}:(re=J.rgba.exec(j))?{r:re[1],g:re[2],b:re[3],a:re[4]}:(re=J.hsl.exec(j))?{h:re[1],s:re[2],l:re[3]}:(re=J.hsla.exec(j))?{h:re[1],s:re[2],l:re[3],a:re[4]}:(re=J.hsv.exec(j))?{h:re[1],s:re[2],v:re[3]}:(re=J.hsva.exec(j))?{h:re[1],s:re[2],v:re[3],a:re[4]}:(re=J.hex8.exec(j))?{r:W(re[1]),g:W(re[2]),b:W(re[3]),a:$(re[4]),format:ee?"name":"hex8"}:(re=J.hex6.exec(j))?{r:W(re[1]),g:W(re[2]),b:W(re[3]),format:ee?"name":"hex"}:(re=J.hex4.exec(j))?{r:W(re[1]+""+re[1]),g:W(re[2]+""+re[2]),b:W(re[3]+""+re[3]),a:$(re[4]+""+re[4]),format:ee?"name":"hex8"}:(re=J.hex3.exec(j))?{r:W(re[1]+""+re[1]),g:W(re[2]+""+re[2]),b:W(re[3]+""+re[3]),format:ee?"name":"hex"}:!1}function ie(j){var ee,re;return j=j||{level:"AA",size:"small"},ee=(j.level||"AA").toUpperCase(),re=(j.size||"small").toLowerCase(),ee!=="AA"&&ee!=="AAA"&&(ee="AA"),re!=="small"&&re!=="large"&&(re="small"),{level:ee,size:re}}typeof q<"u"&&q.exports?q.exports=a:window.tinycolor=a})(Math)}}),rs=Ze({"src/lib/extend.js"(Z){"use strict";var q=Xv(),d=Array.isArray;function x(M,e){var t,r;for(t=0;t=0)))return a;if(f===3)s[f]>1&&(s[f]=1);else if(s[f]>=1)return a}var g=Math.round(s[0]*255)+", "+Math.round(s[1]*255)+", "+Math.round(s[2]*255);return c?"rgba("+g+", "+s[3]+")":"rgb("+g+")"}}}),Zm=Ze({"src/constants/interactions.js"(Z,q){"use strict";q.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}}}),Jy=Ze({"src/lib/regex.js"(Z){"use strict";Z.counter=function(q,d,x,A){var M=(d||"")+(x?"":"$"),e=A===!1?"":"^";return q==="xy"?new RegExp(e+"x([2-9]|[1-9][0-9]+)?y([2-9]|[1-9][0-9]+)?"+M):new RegExp(e+q+"([2-9]|[1-9][0-9]+)?"+M)}}}),f7=Ze({"src/lib/coerce.js"(Z){"use strict";var q=ns(),d=Ch(),x=rs().extendFlat,A=eu(),M=G0(),e=Yn(),t=Zm().DESELECTDIM,r=b_(),o=Jy().counter,a=Yy().modHalf,i=xp().isArrayOrTypedArray,n=xp().isTypedArraySpec,s=xp().decodeTypedArraySpec;Z.valObjectMeta={data_array:{coerceFunction:function(f,g,v){g.set(i(f)?f:n(f)?s(f):v)}},enumerated:{coerceFunction:function(f,g,v,T){T.coerceNumber&&(f=+f),T.values.indexOf(f)===-1?g.set(v):g.set(f)},validateFunction:function(f,g){g.coerceNumber&&(f=+f);for(var v=g.values,T=0;TT.max?g.set(v):g.set(+f)}},integer:{coerceFunction:function(f,g,v,T){if((T.extras||[]).indexOf(f)!==-1){g.set(f);return}n(f)&&(f=s(f)),f%1||!q(f)||T.min!==void 0&&fT.max?g.set(v):g.set(+f)}},string:{coerceFunction:function(f,g,v,T){if(typeof f!="string"){var l=typeof f=="number";T.strict===!0||!l?g.set(v):g.set(String(f))}else T.noBlank&&!f?g.set(v):g.set(f)}},color:{coerceFunction:function(f,g,v){n(f)&&(f=s(f)),d(f).isValid()?g.set(f):g.set(v)}},colorlist:{coerceFunction:function(f,g,v){function T(l){return d(l).isValid()}!Array.isArray(f)||!f.length?g.set(v):f.every(T)?g.set(f):g.set(v)}},colorscale:{coerceFunction:function(f,g,v){g.set(M.get(f,v))}},angle:{coerceFunction:function(f,g,v){n(f)&&(f=s(f)),f==="auto"?g.set("auto"):q(f)?g.set(a(+f,360)):g.set(v)}},subplotid:{coerceFunction:function(f,g,v,T){var l=T.regex||o(v);if(typeof f=="string"&&l.test(f)){g.set(f);return}g.set(v)},validateFunction:function(f,g){var v=g.dflt;return f===v?!0:typeof f!="string"?!1:!!o(v).test(f)}},flaglist:{coerceFunction:function(f,g,v,T){if((T.extras||[]).indexOf(f)!==-1){g.set(f);return}if(typeof f!="string"){g.set(v);return}for(var l=f.split("+"),_=0;_/g),f=0;f1){var e=["LOG:"];for(M=0;M1){var t=[];for(M=0;M"),"long")}},A.warn=function(){var M;if(d.logging>0){var e=["WARN:"];for(M=0;M0){var t=[];for(M=0;M"),"stick")}},A.error=function(){var M;if(d.logging>0){var e=["ERROR:"];for(M=0;M0){var t=[];for(M=0;M"),"stick")}}}}),h2=Ze({"src/lib/noop.js"(Z,q){"use strict";q.exports=function(){}}}),JA=Ze({"src/lib/push_unique.js"(Z,q){"use strict";q.exports=function(x,A){if(A instanceof RegExp){for(var M=A.toString(),e=0;e0){for(var o=[],a=0;a.maplibregl-ctrl-attrib.maplibregl-compact-show,.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact-show{border-radius:12px;padding:2px 8px 2px 28px}.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-inner{display:none}.maplibregl-ctrl-attrib-button{background-color:hsla(0,0%,100%,.5);background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill-rule='evenodd' viewBox='0 0 20 20'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E");border:0;border-radius:12px;box-sizing:border-box;cursor:pointer;display:none;height:24px;outline:none;position:absolute;right:0;top:0;width:24px}.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;list-style:none}.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button::-webkit-details-marker{display:none}.maplibregl-ctrl-bottom-left .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-top-left .maplibregl-ctrl-attrib-button{left:0}.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-inner{display:block}.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-button{background-color:rgb(0 0 0/5%)}.maplibregl-ctrl-bottom-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;right:0}.maplibregl-ctrl-top-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{right:0;top:0}.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{left:0;top:0}.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;left:0}}@media screen and (forced-colors:active){.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='%23fff' fill-rule='evenodd' viewBox='0 0 20 20'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E")}}@media screen and (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill-rule='evenodd' viewBox='0 0 20 20'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E")}}.maplibregl-ctrl-attrib a{color:rgba(0,0,0,.75);text-decoration:none}.maplibregl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.maplibregl-attrib-empty{display:none}.maplibregl-ctrl-scale{background-color:hsla(0,0%,100%,.75);border:2px solid #333;border-top:#333;box-sizing:border-box;color:#333;font-size:10px;padding:0 5px}.maplibregl-popup{display:flex;left:0;pointer-events:none;position:absolute;top:0;will-change:transform}.maplibregl-popup-anchor-top,.maplibregl-popup-anchor-top-left,.maplibregl-popup-anchor-top-right{flex-direction:column}.maplibregl-popup-anchor-bottom,.maplibregl-popup-anchor-bottom-left,.maplibregl-popup-anchor-bottom-right{flex-direction:column-reverse}.maplibregl-popup-anchor-left{flex-direction:row}.maplibregl-popup-anchor-right{flex-direction:row-reverse}.maplibregl-popup-tip{border:10px solid transparent;height:0;width:0;z-index:1}.maplibregl-popup-anchor-top .maplibregl-popup-tip{align-self:center;border-bottom-color:#fff;border-top:none}.maplibregl-popup-anchor-top-left .maplibregl-popup-tip{align-self:flex-start;border-bottom-color:#fff;border-left:none;border-top:none}.maplibregl-popup-anchor-top-right .maplibregl-popup-tip{align-self:flex-end;border-bottom-color:#fff;border-right:none;border-top:none}.maplibregl-popup-anchor-bottom .maplibregl-popup-tip{align-self:center;border-bottom:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip{align-self:flex-start;border-bottom:none;border-left:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip{align-self:flex-end;border-bottom:none;border-right:none;border-top-color:#fff}.maplibregl-popup-anchor-left .maplibregl-popup-tip{align-self:center;border-left:none;border-right-color:#fff}.maplibregl-popup-anchor-right .maplibregl-popup-tip{align-self:center;border-left-color:#fff;border-right:none}.maplibregl-popup-close-button{background-color:transparent;border:0;border-radius:0 3px 0 0;cursor:pointer;position:absolute;right:0;top:0}.maplibregl-popup-close-button:hover{background-color:rgb(0 0 0/5%)}.maplibregl-popup-content{background:#fff;border-radius:3px;box-shadow:0 1px 2px rgba(0,0,0,.1);padding:15px 10px;pointer-events:auto;position:relative}.maplibregl-popup-anchor-top-left .maplibregl-popup-content{border-top-left-radius:0}.maplibregl-popup-anchor-top-right .maplibregl-popup-content{border-top-right-radius:0}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-content{border-bottom-left-radius:0}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-content{border-bottom-right-radius:0}.maplibregl-popup-track-pointer{display:none}.maplibregl-popup-track-pointer *{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.maplibregl-map:hover .maplibregl-popup-track-pointer{display:flex}.maplibregl-map:active .maplibregl-popup-track-pointer{display:none}.maplibregl-marker{left:0;position:absolute;top:0;transition:opacity .2s;will-change:transform}.maplibregl-user-location-dot,.maplibregl-user-location-dot:before{background-color:#1da1f2;border-radius:50%;height:15px;width:15px}.maplibregl-user-location-dot:before{animation:maplibregl-user-location-dot-pulse 2s infinite;content:"";position:absolute}.maplibregl-user-location-dot:after{border:2px solid #fff;border-radius:50%;box-shadow:0 0 3px rgba(0,0,0,.35);box-sizing:border-box;content:"";height:19px;left:-2px;position:absolute;top:-2px;width:19px}@keyframes maplibregl-user-location-dot-pulse{0%{opacity:1;transform:scale(1)}70%{opacity:0;transform:scale(3)}to{opacity:0;transform:scale(1)}}.maplibregl-user-location-dot-stale{background-color:#aaa}.maplibregl-user-location-dot-stale:after{display:none}.maplibregl-user-location-accuracy-circle{background-color:#1da1f233;border-radius:100%;height:1px;width:1px}.maplibregl-crosshair,.maplibregl-crosshair .maplibregl-interactive,.maplibregl-crosshair .maplibregl-interactive:active{cursor:crosshair}.maplibregl-boxzoom{background:#fff;border:2px dotted #202020;height:0;left:0;opacity:.5;position:absolute;top:0;width:0}.maplibregl-cooperative-gesture-screen{align-items:center;background:rgba(0,0,0,.4);color:#fff;display:flex;font-size:1.4em;inset:0;justify-content:center;line-height:1.2;opacity:0;padding:1rem;pointer-events:none;position:absolute;transition:opacity 1s ease 1s;z-index:99999}.maplibregl-cooperative-gesture-screen.maplibregl-show{opacity:1;transition:opacity .05s}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:none}@media (hover:none),(width <= 480px){.maplibregl-cooperative-gesture-screen .maplibregl-desktop-message{display:none}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:block}}.maplibregl-pseudo-fullscreen{height:100%!important;left:0!important;position:fixed!important;top:0!important;width:100%!important;z-index:99999}`,document.head.appendChild(Z)}})()}}),oo=Ze({"src/registry.js"(Z){"use strict";var q=Ym(),d=h2(),x=JA(),A=Xv(),M=T_().addStyleRule,e=rs(),t=eu(),r=$y(),o=e.extendFlat,a=e.extendDeepAll;Z.modules={},Z.allCategories={},Z.allTypes=[],Z.subplotsRegistry={},Z.componentsRegistry={},Z.layoutArrayContainers=[],Z.layoutArrayRegexes=[],Z.traceLayoutAttributes={},Z.localeRegistry={},Z.apiMethodRegistry={},Z.collectableSubplotTypes=null,Z.register=function(w){if(Z.collectableSubplotTypes=null,w)w&&!Array.isArray(w)&&(w=[w]);else throw new Error("No argument passed to Plotly.register.");for(var S=0;S=l&&F<=_?F:e}if(typeof F!="string"&&typeof F!="number")return e;F=String(F);var U=v(B),W=F.charAt(0);U&&(W==="G"||W==="g")&&(F=F.substr(1),B="");var Q=U&&B.substr(0,7)==="chinese",ue=F.match(Q?f:c);if(!ue)return e;var le=ue[1],he=ue[3]||"1",G=Number(ue[5]||1),$=Number(ue[7]||0),J=Number(ue[9]||0),X=Number(ue[11]||0);if(U){if(le.length===2)return e;le=Number(le);var oe;try{var ie=n.getComponentMethod("calendars","getCal")(B);if(Q){var j=he.charAt(he.length-1)==="i";he=parseInt(he,10),oe=ie.newDate(le,ie.toMonthIndex(le,he,j),G)}else oe=ie.newDate(le,Number(he),G)}catch{return e}return oe?(oe.toJD()-i)*t+$*r+J*o+X*a:e}le.length===2?le=(Number(le)+2e3-g)%100+g:le=Number(le),he-=1;var ee=new Date(Date.UTC(2e3,he,G,$,J));return ee.setUTCFullYear(le),ee.getUTCMonth()!==he||ee.getUTCDate()!==G?e:ee.getTime()+X*a},l=Z.MIN_MS=Z.dateTime2ms("-9999"),_=Z.MAX_MS=Z.dateTime2ms("9999-12-31 23:59:59.9999"),Z.isDateTime=function(F,B){return Z.dateTime2ms(F,B)!==e};function w(F,B){return String(F+Math.pow(10,B)).substr(1)}var S=90*t,E=3*r,y=5*o;Z.ms2DateTime=function(F,B,O){if(typeof F!="number"||!(F>=l&&F<=_))return e;B||(B=0);var I=Math.floor(A(F+.05,1)*10),N=Math.round(F-I/10),U,W,Q,ue,le,he;if(v(O)){var G=Math.floor(N/t)+i,$=Math.floor(A(F,t));try{U=n.getComponentMethod("calendars","getCal")(O).fromJD(G).formatDate("yyyy-mm-dd")}catch{U=s("G%Y-%m-%d")(new Date(N))}if(U.charAt(0)==="-")for(;U.length<11;)U="-0"+U.substr(1);else for(;U.length<10;)U="0"+U;W=B=l+t&&F<=_-t))return e;var B=Math.floor(A(F+.05,1)*10),O=new Date(Math.round(F-B/10)),I=q("%Y-%m-%d")(O),N=O.getHours(),U=O.getMinutes(),W=O.getSeconds(),Q=O.getUTCMilliseconds()*10+B;return b(I,N,U,W,Q)};function b(F,B,O,I,N){if((B||O||I||N)&&(F+=" "+w(B,2)+":"+w(O,2),(I||N)&&(F+=":"+w(I,2),N))){for(var U=4;N%10===0;)U-=1,N/=10;F+="."+w(N,U)}return F}Z.cleanDate=function(F,B,O){if(F===e)return B;if(Z.isJSDate(F)||typeof F=="number"&&isFinite(F)){if(v(O))return x.error("JS Dates and milliseconds are incompatible with world calendars",F),B;if(F=Z.ms2DateTimeLocal(+F),!F&&B!==void 0)return B}else if(!Z.isDateTime(F,O))return x.error("unrecognized date",F),B;return F};var p=/%\d?f/g,u=/%h/g,m={1:"1",2:"1",3:"2",4:"2"};function h(F,B,O,I){F=F.replace(p,function(U){var W=Math.min(+U.charAt(1)||6,6),Q=(B/1e3%1+2).toFixed(W).substr(2).replace(/0+$/,"")||"0";return Q});var N=new Date(Math.floor(B+.05));if(F=F.replace(u,function(){return m[O("%q")(N)]}),v(I))try{F=n.getComponentMethod("calendars","worldCalFmt")(F,B,I)}catch{return"Invalid"}return O(F)(N)}var P=[59,59.9,59.99,59.999,59.9999];function L(F,B){var O=A(F+.05,t),I=w(Math.floor(O/r),2)+":"+w(A(Math.floor(O/o),60),2);if(B!=="M"){d(B)||(B=0);var N=Math.min(A(F/a,60),P[B]),U=(100+N).toFixed(B).substr(1);B>0&&(U=U.replace(/0+$/,"").replace(/[\.]$/,"")),I+=":"+U}return I}Z.formatDate=function(F,B,O,I,N,U){if(N=v(N)&&N,!B)if(O==="y")B=U.year;else if(O==="m")B=U.month;else if(O==="d")B=U.dayMonth+` `+U.year;else return L(F,O)+` `+h(U.dayMonthYear,F,I,N);return h(B,F,I,N)};var z=3*t;Z.incrementMonth=function(F,B,O){O=v(O)&&O;var I=A(F,t);if(F=Math.round(F-I),O)try{var N=Math.round(F/t)+i,U=n.getComponentMethod("calendars","getCal")(O),W=U.fromJD(N);return B%12?U.add(W,B,"m"):U.add(W,B/12,"y"),(W.toJD()-i)*t+I}catch{x.error("invalid ms "+F+" in calendar "+O)}var Q=new Date(F+z);return Q.setUTCMonth(Q.getUTCMonth()+B)+I-z},Z.findExactDates=function(F,B){for(var O=0,I=0,N=0,U=0,W,Q,ue=v(B)&&n.getComponentMethod("calendars","getCal")(B),le=0;le1?(i[c-1]-i[0])/(c-1):1,v,T;for(g>=0?T=n?e:t:T=n?o:r,a+=g*M*(n?-1:1)*(g>=0?1:-1);s90&&d.log("Long binary search..."),s-1};function e(a,i){return ai}function o(a,i){return a>=i}Z.sorterAsc=function(a,i){return a-i},Z.sorterDes=function(a,i){return i-a},Z.distinctVals=function(a){var i=a.slice();i.sort(Z.sorterAsc);var n;for(n=i.length-1;n>-1&&i[n]===A;n--);for(var s=i[n]-i[0]||1,c=s/(n||1)/1e4,f=[],g,v=0;v<=n;v++){var T=i[v],l=T-g;g===void 0?(f.push(T),g=T):l>c&&(s=Math.min(s,l),f.push(T),g=T)}return{vals:f,minDiff:s}},Z.roundUp=function(a,i,n){for(var s=0,c=i.length-1,f,g=0,v=n?0:1,T=n?1:0,l=n?Math.ceil:Math.floor;s0&&(s=1),n&&s)return a.sort(i)}return s?a:a.reverse()},Z.findIndexOfMin=function(a,i){i=i||x;for(var n=1/0,s,c=0;cM.length)&&(e=M.length),q(A)||(A=!1),d(M[0])){for(r=new Array(e),t=0;tx.length-1)return x[x.length-1];var M=A%1;return M*x[Math.ceil(A)]+(1-M)*x[Math.floor(A)]}}}),G7=Ze({"src/lib/angles.js"(Z,q){"use strict";var d=Yy(),x=d.mod,A=d.modHalf,M=Math.PI,e=2*M;function t(T){return T/180*M}function r(T){return T/M*180}function o(T){return Math.abs(T[1]-T[0])>e-1e-14}function a(T,l){return A(l-T,e)}function i(T,l){return Math.abs(a(T,l))}function n(T,l){if(o(l))return!0;var _,w;l[0]w&&(w+=e);var S=x(T,e),E=S+e;return S>=_&&S<=w||E>=_&&E<=w}function s(T,l,_,w){if(!n(l,w))return!1;var S,E;return _[0]<_[1]?(S=_[0],E=_[1]):(S=_[1],E=_[0]),T>=S&&T<=E}function c(T,l,_,w,S,E,y){S=S||0,E=E||0;var b=o([_,w]),p,u,m,h,P;b?(p=0,u=M,m=e):_1/3&&d.x<2/3},Z.isRightAnchor=function(d){return d.xanchor==="right"||d.xanchor==="auto"&&d.x>=2/3},Z.isTopAnchor=function(d){return d.yanchor==="top"||d.yanchor==="auto"&&d.y>=2/3},Z.isMiddleAnchor=function(d){return d.yanchor==="middle"||d.yanchor==="auto"&&d.y>1/3&&d.y<2/3},Z.isBottomAnchor=function(d){return d.yanchor==="bottom"||d.yanchor==="auto"&&d.y<=1/3}}}),W7=Ze({"src/lib/geometry2d.js"(Z){"use strict";var q=Yy().mod;Z.segmentsIntersect=d;function d(t,r,o,a,i,n,s,c){var f=o-t,g=i-t,v=s-i,T=a-r,l=n-r,_=c-n,w=f*_-v*T;if(w===0)return null;var S=(g*_-v*l)/w,E=(g*T-f*l)/w;return E<0||E>1||S<0||S>1?null:{x:t+f*S,y:r+T*S}}Z.segmentDistance=function(r,o,a,i,n,s,c,f){if(d(r,o,a,i,n,s,c,f))return 0;var g=a-r,v=i-o,T=c-n,l=f-s,_=g*g+v*v,w=T*T+l*l,S=Math.min(x(g,v,_,n-r,s-o),x(g,v,_,c-r,f-o),x(T,l,w,r-n,o-s),x(T,l,w,a-n,i-s));return Math.sqrt(S)};function x(t,r,o,a,i){var n=a*t+i*r;if(n<0)return a*a+i*i;if(n>o){var s=a-t,c=i-r;return s*s+c*c}else{var f=a*r-i*t;return f*f/o}}var A,M,e;Z.getTextLocation=function(r,o,a,i){if((r!==M||i!==e)&&(A={},M=r,e=i),A[a])return A[a];var n=r.getPointAtLength(q(a-i/2,o)),s=r.getPointAtLength(q(a+i/2,o)),c=Math.atan((s.y-n.y)/(s.x-n.x)),f=r.getPointAtLength(q(a,o)),g=(f.x*4+n.x+s.x)/6,v=(f.y*4+n.y+s.y)/6,T={x:g,y:v,theta:c};return A[a]=T,T},Z.clearLocationCache=function(){M=null},Z.getVisibleSegment=function(r,o,a){var i=o.left,n=o.right,s=o.top,c=o.bottom,f=0,g=r.getTotalLength(),v=g,T,l;function _(S){var E=r.getPointAtLength(S);S===0?T=E:S===g&&(l=E);var y=E.xn?E.x-n:0,b=E.yc?E.y-c:0;return Math.sqrt(y*y+b*b)}for(var w=_(f);w;){if(f+=w+a,f>v)return;w=_(f)}for(w=_(v);w;){if(v-=w+a,f>v)return;w=_(v)}return{min:f,max:v,len:v-f,total:g,isClosed:f===0&&v===g&&Math.abs(T.x-l.x)<.1&&Math.abs(T.y-l.y)<.1}},Z.findPointOnPath=function(r,o,a,i){i=i||{};for(var n=i.pathLength||r.getTotalLength(),s=i.tolerance||.001,c=i.iterationLimit||30,f=r.getPointAtLength(0)[a]>r.getPointAtLength(n)[a]?-1:1,g=0,v=0,T=n,l,_,w;g0?T=l:v=l,g++}return _}}}),g2=Ze({"src/lib/throttle.js"(Z){"use strict";var q={};Z.throttle=function(A,M,e){var t=q[A],r=Date.now();if(!t){for(var o in q)q[o].tst.ts+M){a();return}t.timer=setTimeout(function(){a(),t.timer=null},M)},Z.done=function(x){var A=q[x];return!A||!A.timer?Promise.resolve():new Promise(function(M){var e=A.onDone;A.onDone=function(){e&&e(),M(),A.onDone=null}})},Z.clear=function(x){if(x)d(q[x]),delete q[x];else for(var A in q)Z.clear(A)};function d(x){x&&x.timer!==null&&(clearTimeout(x.timer),x.timer=null)}}}),X7=Ze({"src/lib/clear_responsive.js"(Z,q){"use strict";q.exports=function(x){x._responsiveChartHandler&&(window.removeEventListener("resize",x._responsiveChartHandler),delete x._responsiveChartHandler)}}}),Z7=Ze({"node_modules/is-mobile/index.js"(Z,q){"use strict";q.exports=M,q.exports.isMobile=M,q.exports.default=M;var d=/(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,x=/CrOS/,A=/android|ipad|playbook|silk/i;function M(e){e||(e={});let t=e.ua;if(!t&&typeof navigator<"u"&&(t=navigator.userAgent),t&&t.headers&&typeof t.headers["user-agent"]=="string"&&(t=t.headers["user-agent"]),typeof t!="string")return!1;let r=d.test(t)&&!x.test(t)||!!e.tablet&&A.test(t);return!r&&e.tablet&&e.featureDetect&&navigator&&navigator.maxTouchPoints>1&&t.indexOf("Macintosh")!==-1&&t.indexOf("Safari")!==-1&&(r=!0),r}}}),Y7=Ze({"src/lib/preserve_drawing_buffer.js"(Z,q){"use strict";var d=ns(),x=Z7();q.exports=function(e){var t;if(e&&e.hasOwnProperty("userAgent")?t=e.userAgent:t=A(),typeof t!="string")return!0;var r=x({ua:{headers:{"user-agent":t}},tablet:!0,featureDetect:!1});if(!r)for(var o=t.split(" "),a=1;a-1;n--){var s=o[n];if(s.substr(0,8)==="Version/"){var c=s.substr(8).split(".")[0];if(d(c)&&(c=+c),c>=13)return!0}}}return r};function A(){var M;return typeof navigator<"u"&&(M=navigator.userAgent),M&&M.headers&&typeof M.headers["user-agent"]=="string"&&(M=M.headers["user-agent"]),M}}}),K7=Ze({"src/lib/make_trace_groups.js"(Z,q){"use strict";var d=On();q.exports=function(A,M,e){var t=A.selectAll("g."+e.replace(/\s/g,".")).data(M,function(o){return o[0].trace.uid});t.exit().remove(),t.enter().append("g").attr("class",e),t.order();var r=A.classed("rangeplot")?"nodeRangePlot3":"node3";return t.each(function(o){o[0][r]=d.select(this)}),t}}}),J7=Ze({"src/lib/localize.js"(Z,q){"use strict";var d=oo();q.exports=function(A,M){for(var e=A._context.locale,t=0;t<2;t++){for(var r=A._context.locales,o=0;o<2;o++){var a=(r[e]||{}).dictionary;if(a){var i=a[M];if(i)return i}r=d.localeRegistry}var n=e.split("-")[0];if(n===e)break;e=n}return M}}}),r5=Ze({"src/lib/filter_unique.js"(Z,q){"use strict";q.exports=function(x){for(var A={},M=[],e=0,t=0;t1?(M*x+M*A)/M:x+A,t=String(e).length;if(t>16){var r=String(A).length,o=String(x).length;if(t>=o+r){var a=parseFloat(e).toPrecision(12);a.indexOf("e+")===-1&&(e=+a)}}return e}}}),ez=Ze({"src/lib/clean_number.js"(Z,q){"use strict";var d=ns(),x=qs().BADNUM,A=/^['"%,$#\s']+|[, ]|['"%,$#\s']+$/g;q.exports=function(e){return typeof e=="string"&&(e=e.replace(A,"")),d(e)?Number(e):x}}}),ca=Ze({"src/lib/index.js"(Z,q){"use strict";var d=On(),x=jp().utcFormat,A=Zy().format,M=ns(),e=qs(),t=e.FP_SAFE,r=-t,o=e.BADNUM,a=q.exports={};a.adjustFormat=function(j){return!j||/^\d[.]\df/.test(j)||/[.]\d%/.test(j)?j:j==="0.f"?"~f":/^\d%/.test(j)?"~%":/^\ds/.test(j)?"~s":!/^[~,.0$]/.test(j)&&/[&fps]/.test(j)?"~"+j:j};var i={};a.warnBadFormat=function(ie){var j=String(ie);i[j]||(i[j]=1,a.warn('encountered bad format: "'+j+'"'))},a.noFormat=function(ie){return String(ie)},a.numberFormat=function(ie){var j;try{j=A(a.adjustFormat(ie))}catch{return a.warnBadFormat(ie),a.noFormat}return j},a.nestedProperty=b_(),a.keyedContainer=l7(),a.relativeAttr=u7(),a.isPlainObject=Xv(),a.toLogRange=f2(),a.relinkPrivateKeys=c7();var n=xp();a.isArrayBuffer=n.isArrayBuffer,a.isTypedArray=n.isTypedArray,a.isArrayOrTypedArray=n.isArrayOrTypedArray,a.isArray1D=n.isArray1D,a.ensureArray=n.ensureArray,a.concat=n.concat,a.maxRowLength=n.maxRowLength,a.minRowLength=n.minRowLength;var s=Yy();a.mod=s.mod,a.modHalf=s.modHalf;var c=f7();a.valObjectMeta=c.valObjectMeta,a.coerce=c.coerce,a.coerce2=c.coerce2,a.coerceFont=c.coerceFont,a.coercePattern=c.coercePattern,a.coerceHoverinfo=c.coerceHoverinfo,a.coerceSelectionMarkerOpacity=c.coerceSelectionMarkerOpacity,a.validate=c.validate;var f=q7();a.dateTime2ms=f.dateTime2ms,a.isDateTime=f.isDateTime,a.ms2DateTime=f.ms2DateTime,a.ms2DateTimeLocal=f.ms2DateTimeLocal,a.cleanDate=f.cleanDate,a.isJSDate=f.isJSDate,a.formatDate=f.formatDate,a.incrementMonth=f.incrementMonth,a.dateTick0=f.dateTick0,a.dfltRange=f.dfltRange,a.findExactDates=f.findExactDates,a.MIN_MS=f.MIN_MS,a.MAX_MS=f.MAX_MS;var g=m2();a.findBin=g.findBin,a.sorterAsc=g.sorterAsc,a.sorterDes=g.sorterDes,a.distinctVals=g.distinctVals,a.roundUp=g.roundUp,a.sort=g.sort,a.findIndexOfMin=g.findIndexOfMin,a.sortObjectKeys=Km();var v=V7();a.aggNums=v.aggNums,a.len=v.len,a.mean=v.mean,a.geometricMean=v.geometricMean,a.median=v.median,a.midRange=v.midRange,a.variance=v.variance,a.stdev=v.stdev,a.interp=v.interp;var T=p2();a.init2dArray=T.init2dArray,a.transposeRagged=T.transposeRagged,a.dot=T.dot,a.translationMatrix=T.translationMatrix,a.rotationMatrix=T.rotationMatrix,a.rotationXYMatrix=T.rotationXYMatrix,a.apply3DTransform=T.apply3DTransform,a.apply2DTransform=T.apply2DTransform,a.apply2DTransform2=T.apply2DTransform2,a.convertCssMatrix=T.convertCssMatrix,a.inverseTransformMatrix=T.inverseTransformMatrix;var l=G7();a.deg2rad=l.deg2rad,a.rad2deg=l.rad2deg,a.angleDelta=l.angleDelta,a.angleDist=l.angleDist,a.isFullCircle=l.isFullCircle,a.isAngleInsideSector=l.isAngleInsideSector,a.isPtInsideSector=l.isPtInsideSector,a.pathArc=l.pathArc,a.pathSector=l.pathSector,a.pathAnnulus=l.pathAnnulus;var _=H7();a.isLeftAnchor=_.isLeftAnchor,a.isCenterAnchor=_.isCenterAnchor,a.isRightAnchor=_.isRightAnchor,a.isTopAnchor=_.isTopAnchor,a.isMiddleAnchor=_.isMiddleAnchor,a.isBottomAnchor=_.isBottomAnchor;var w=W7();a.segmentsIntersect=w.segmentsIntersect,a.segmentDistance=w.segmentDistance,a.getTextLocation=w.getTextLocation,a.clearLocationCache=w.clearLocationCache,a.getVisibleSegment=w.getVisibleSegment,a.findPointOnPath=w.findPointOnPath;var S=rs();a.extendFlat=S.extendFlat,a.extendDeep=S.extendDeep,a.extendDeepAll=S.extendDeepAll,a.extendDeepNoArrays=S.extendDeepNoArrays;var E=Ym();a.log=E.log,a.warn=E.warn,a.error=E.error;var y=Jy();a.counterRegex=y.counter;var b=g2();a.throttle=b.throttle,a.throttleDone=b.done,a.clearThrottle=b.clear;var p=T_();a.getGraphDiv=p.getGraphDiv,a.isPlotDiv=p.isPlotDiv,a.removeElement=p.removeElement,a.addStyleRule=p.addStyleRule,a.addRelatedStyleRule=p.addRelatedStyleRule,a.deleteRelatedStyleRule=p.deleteRelatedStyleRule,a.setStyleOnHover=p.setStyleOnHover,a.getFullTransformMatrix=p.getFullTransformMatrix,a.getElementTransformMatrix=p.getElementTransformMatrix,a.getElementAndAncestors=p.getElementAndAncestors,a.equalDomRects=p.equalDomRects,a.clearResponsive=X7(),a.preserveDrawingBuffer=Y7(),a.makeTraceGroups=K7(),a._=J7(),a.notifier=KA(),a.filterUnique=r5(),a.filterVisible=$7(),a.pushUnique=JA(),a.increment=Q7(),a.cleanNumber=ez(),a.ensureNumber=function(j){return M(j)?(j=Number(j),j>t||j=j?!1:M(ie)&&ie>=0&&ie%1===0},a.noop=h2(),a.identity=S_(),a.repeat=function(ie,j){for(var ee=new Array(j),re=0;reee?Math.max(ee,Math.min(j,ie)):Math.max(j,Math.min(ee,ie))},a.bBoxIntersect=function(ie,j,ee){return ee=ee||0,ie.left<=j.right+ee&&j.left<=ie.right+ee&&ie.top<=j.bottom+ee&&j.top<=ie.bottom+ee},a.simpleMap=function(ie,j,ee,re,ce){for(var be=ie.length,Ae=new Array(be),ze=0;ze=Math.pow(2,ee)?ce>10?(a.warn("randstr failed uniqueness"),Ae):ie(j,ee,re,(ce||0)+1):Ae},a.OptionControl=function(ie,j){ie||(ie={}),j||(j="opt");var ee={};return ee.optionList=[],ee._newoption=function(re){re[j]=ie,ee[re.name]=re,ee.optionList.push(re)},ee["_"+j]=ie,ee},a.smooth=function(ie,j){if(j=Math.round(j)||0,j<2)return ie;var ee=ie.length,re=2*ee,ce=2*j-1,be=new Array(ce),Ae=new Array(ee),ze,Re,Xe,it;for(ze=0;ze=re&&(Xe-=re*Math.floor(Xe/re)),Xe<0?Xe=-1-Xe:Xe>=ee&&(Xe=re-1-Xe),it+=ie[Xe]*be[Re];Ae[ze]=it}return Ae},a.syncOrAsync=function(ie,j,ee){var re,ce;function be(){return a.syncOrAsync(ie,j,ee)}for(;ie.length;)if(ce=ie.splice(0,1)[0],re=ce(j),re&&re.then)return re.then(be);return ee&&ee(j)},a.stripTrailingSlash=function(ie){return ie.substr(-1)==="/"?ie.substr(0,ie.length-1):ie},a.noneOrAll=function(ie,j,ee){if(ie){var re=!1,ce=!0,be,Ae;for(be=0;be0?ce:0})},a.fillArray=function(ie,j,ee,re){if(re=re||a.identity,a.isArrayOrTypedArray(ie))for(var ce=0;ceL.test(window.navigator.userAgent);var z=/Firefox\/(\d+)\.\d+/;a.getFirefoxVersion=function(){var ie=z.exec(window.navigator.userAgent);if(ie&&ie.length===2){var j=parseInt(ie[1]);if(!isNaN(j))return j}return null},a.isD3Selection=function(ie){return ie instanceof d.selection},a.ensureSingle=function(ie,j,ee,re){var ce=ie.select(j+(ee?"."+ee:""));if(ce.size())return ce;var be=ie.append(j);return ee&&be.classed(ee,!0),re&&be.call(re),be},a.ensureSingleById=function(ie,j,ee,re){var ce=ie.select(j+"#"+ee);if(ce.size())return ce;var be=ie.append(j).attr("id",ee);return re&&be.call(re),be},a.objectFromPath=function(ie,j){for(var ee=ie.split("."),re,ce=re={},be=0;be1?ce+Ae[1]:"";if(be&&(Ae.length>1||ze.length>4||ee))for(;re.test(ze);)ze=ze.replace(re,"$1"+be+"$2");return ze+Re},a.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var I=/^\w*$/;a.templateString=function(ie,j){var ee={};return ie.replace(a.TEMPLATE_STRING_REGEX,function(re,ce){var be;return I.test(ce)?be=j[ce]:(ee[ce]=ee[ce]||a.nestedProperty(j,ce).get,be=ee[ce](!0)),be!==void 0?be:""})};var N={max:10,count:0,name:"hovertemplate"};a.hovertemplateString=function(){return he.apply(N,arguments)};var U={max:10,count:0,name:"texttemplate"};a.texttemplateString=function(){return he.apply(U,arguments)};var W=/^(\S+)([\*\/])(-?\d+(\.\d+)?)$/;function Q(ie){var j=ie.match(W);return j?{key:j[1],op:j[2],number:Number(j[3])}:{key:ie,op:null,number:null}}var ue={max:10,count:0,name:"texttemplate",parseMultDiv:!0};a.texttemplateStringForShapes=function(){return he.apply(ue,arguments)};var le=/^[:|\|]/;function he(ie,j,ee){var re=this,ce=arguments;return j||(j={}),ie.replace(a.TEMPLATE_STRING_REGEX,function(be,Ae,ze){var Re=Ae==="xother"||Ae==="yother",Xe=Ae==="_xother"||Ae==="_yother",it=Ae==="_xother_"||Ae==="_yother_",ot=Ae==="xother_"||Ae==="yother_",tt=Re||Xe||ot||it,lt=Ae;(Xe||it)&&(lt=lt.substring(1)),(ot||it)&&(lt=lt.substring(0,lt.length-1));var Ee=null,_e=null;if(re.parseMultDiv){var fe=Q(lt);lt=fe.key,Ee=fe.op,_e=fe.number}var Fe;if(tt){if(Fe=j[lt],Fe===void 0)return""}else{var rt,st;for(st=3;st=G&&Ae<=$,Xe=ze>=G&&ze<=$;if(Re&&(re=10*re+Ae-G),Xe&&(ce=10*ce+ze-G),!Re||!Xe){if(re!==ce)return re-ce;if(Ae!==ze)return Ae-ze}}return ce-re};var J=2e9;a.seedPseudoRandom=function(){J=2e9},a.pseudoRandom=function(){var ie=J;return J=(69069*J+1)%4294967296,Math.abs(J-ie)<429496729?a.pseudoRandom():J/4294967296},a.fillText=function(ie,j,ee){var re=Array.isArray(ee)?function(Ae){ee.push(Ae)}:function(Ae){ee.text=Ae},ce=a.extractOption(ie,j,"htx","hovertext");if(a.isValidTextValue(ce))return re(ce);var be=a.extractOption(ie,j,"tx","text");if(a.isValidTextValue(be))return re(be)},a.isValidTextValue=function(ie){return ie||ie===0},a.formatPercent=function(ie,j){j=j||0;for(var ee=(Math.round(100*ie*Math.pow(10,j))*Math.pow(.1,j)).toFixed(j)+"%",re=0;re1&&(Xe=1):Xe=0,a.strTranslate(ce-Xe*(ee+Ae),be-Xe*(re+ze))+a.strScale(Xe)+(Re?"rotate("+Re+(j?"":" "+ee+" "+re)+")":"")},a.setTransormAndDisplay=function(ie,j){ie.attr("transform",a.getTextTransform(j)),ie.style("display",j.scale?null:"none")},a.ensureUniformFontSize=function(ie,j){var ee=a.extendFlat({},j);return ee.size=Math.max(j.size,ie._fullLayout.uniformtext.minsize||0),ee},a.join2=function(ie,j,ee){var re=ie.length;return re>1?ie.slice(0,-1).join(j)+ee+ie[re-1]:ie.join(j)},a.bigFont=function(ie){return Math.round(1.2*ie)};var X=a.getFirefoxVersion(),oe=X!==null&&X<86;a.getPositionFromD3Event=function(){return oe?[d.event.layerX,d.event.layerY]:[d.event.offsetX,d.event.offsetY]}}}),tz=Ze({"build/plotcss.js"(){"use strict";var Z=ca(),q={"X,X div":'direction:ltr;font-family:"Open Sans",verdana,arial,sans-serif;margin:0;padding:0;',"X input,X button":'font-family:"Open Sans",verdana,arial,sans-serif;',"X input:focus,X button:focus":"outline:none;","X a":"text-decoration:none;","X a:hover":"text-decoration:none;","X .crisp":"shape-rendering:crispEdges;","X .user-select-none":"-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;","X svg a":"fill:#447adb;","X svg a:hover":"fill:#3c6dc5;","X .main-svg":"position:absolute;top:0;left:0;pointer-events:none;","X .main-svg .draglayer":"pointer-events:all;","X .cursor-default":"cursor:default;","X .cursor-pointer":"cursor:pointer;","X .cursor-crosshair":"cursor:crosshair;","X .cursor-move":"cursor:move;","X .cursor-col-resize":"cursor:col-resize;","X .cursor-row-resize":"cursor:row-resize;","X .cursor-ns-resize":"cursor:ns-resize;","X .cursor-ew-resize":"cursor:ew-resize;","X .cursor-sw-resize":"cursor:sw-resize;","X .cursor-s-resize":"cursor:s-resize;","X .cursor-se-resize":"cursor:se-resize;","X .cursor-w-resize":"cursor:w-resize;","X .cursor-e-resize":"cursor:e-resize;","X .cursor-nw-resize":"cursor:nw-resize;","X .cursor-n-resize":"cursor:n-resize;","X .cursor-ne-resize":"cursor:ne-resize;","X .cursor-grab":"cursor:-webkit-grab;cursor:grab;","X .modebar":"position:absolute;top:2px;right:2px;","X .ease-bg":"-webkit-transition:background-color .3s ease 0s;-moz-transition:background-color .3s ease 0s;-ms-transition:background-color .3s ease 0s;-o-transition:background-color .3s ease 0s;transition:background-color .3s ease 0s;","X .modebar--hover>:not(.watermark)":"opacity:0;-webkit-transition:opacity .3s ease 0s;-moz-transition:opacity .3s ease 0s;-ms-transition:opacity .3s ease 0s;-o-transition:opacity .3s ease 0s;transition:opacity .3s ease 0s;","X:hover .modebar--hover .modebar-group":"opacity:1;","X:focus-within .modebar--hover .modebar-group":"opacity:1;","X .modebar-group":"float:left;display:inline-block;box-sizing:border-box;padding-left:8px;position:relative;vertical-align:middle;white-space:nowrap;","X .modebar-group a":"display:grid;place-content:center;","X .modebar-btn":"position:relative;font-size:16px;padding:3px 4px;height:22px;cursor:pointer;line-height:normal;box-sizing:border-box;border:none;background:rgba(0,0,0,0);","X .modebar-btn svg":"position:relative;","X .modebar-btn:focus-visible":"outline:1px solid #000;outline-offset:1px;border-radius:3px;","X .modebar.vertical":"display:flex;flex-direction:column;flex-wrap:wrap;align-content:flex-end;max-height:100%;","X .modebar.vertical svg":"top:-1px;","X .modebar.vertical .modebar-group":"display:block;float:none;padding-left:0px;padding-bottom:8px;","X .modebar.vertical .modebar-group .modebar-btn":"display:block;text-align:center;","X [data-title]:before,X [data-title]:after":"position:absolute;-webkit-transform:translate3d(0, 0, 0);-moz-transform:translate3d(0, 0, 0);-ms-transform:translate3d(0, 0, 0);-o-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);display:none;opacity:0;z-index:1001;pointer-events:none;top:110%;right:50%;","X [data-title]:hover:before,X [data-title]:hover:after":"display:block;opacity:1;","X [data-title]:before":'content:"";position:absolute;background:rgba(0,0,0,0);border:6px solid rgba(0,0,0,0);z-index:1002;margin-top:-12px;border-bottom-color:#69738a;margin-right:-6px;',"X [data-title]:after":"content:attr(data-title);background:#69738a;color:#fff;padding:8px 10px;font-size:12px;line-height:12px;white-space:nowrap;margin-right:-18px;border-radius:2px;","X .vertical [data-title]:before,X .vertical [data-title]:after":"top:0%;right:200%;","X .vertical [data-title]:before":"border:6px solid rgba(0,0,0,0);border-left-color:#69738a;margin-top:8px;margin-right:-30px;",Y:'font-family:"Open Sans",verdana,arial,sans-serif;position:fixed;top:50px;right:20px;z-index:10000;font-size:10pt;max-width:180px;',"Y p":"margin:0;","Y .notifier-note":"min-width:180px;max-width:250px;border:1px solid #fff;z-index:3000;margin:0;background-color:#8c97af;background-color:rgba(140,151,175,.9);color:#fff;padding:10px;overflow-wrap:break-word;word-wrap:break-word;-ms-hyphens:auto;-webkit-hyphens:auto;hyphens:auto;","Y .notifier-close":"color:#fff;opacity:.8;float:right;padding:0 5px;background:none;border:none;font-size:20px;font-weight:bold;line-height:20px;","Y .notifier-close:hover":"color:#444;text-decoration:none;cursor:pointer;"};for(x in q)d=x.replace(/^,/," ,").replace(/X/g,".js-plotly-plot .plotly").replace(/Y/g,".plotly-notifier"),Z.addStyleRule(d,q[x]);var d,x}}),a5=Ze({"node_modules/is-browser/client.js"(Z,q){q.exports=!0}}),i5=Ze({"node_modules/has-hover/index.js"(Z,q){"use strict";var d=a5(),x;typeof window.matchMedia=="function"?x=!window.matchMedia("(hover: none)").matches:x=d,q.exports=x}}),W0=Ze({"node_modules/events/events.js"(Z,q){"use strict";var d=typeof Reflect=="object"?Reflect:null,x=d&&typeof d.apply=="function"?d.apply:function(E,y,b){return Function.prototype.apply.call(E,y,b)},A;d&&typeof d.ownKeys=="function"?A=d.ownKeys:Object.getOwnPropertySymbols?A=function(E){return Object.getOwnPropertyNames(E).concat(Object.getOwnPropertySymbols(E))}:A=function(E){return Object.getOwnPropertyNames(E)};function M(S){console&&console.warn&&console.warn(S)}var e=Number.isNaN||function(E){return E!==E};function t(){t.init.call(this)}q.exports=t,q.exports.once=l,t.EventEmitter=t,t.prototype._events=void 0,t.prototype._eventsCount=0,t.prototype._maxListeners=void 0;var r=10;function o(S){if(typeof S!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof S)}Object.defineProperty(t,"defaultMaxListeners",{enumerable:!0,get:function(){return r},set:function(S){if(typeof S!="number"||S<0||e(S))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+S+".");r=S}}),t.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},t.prototype.setMaxListeners=function(E){if(typeof E!="number"||E<0||e(E))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+E+".");return this._maxListeners=E,this};function a(S){return S._maxListeners===void 0?t.defaultMaxListeners:S._maxListeners}t.prototype.getMaxListeners=function(){return a(this)},t.prototype.emit=function(E){for(var y=[],b=1;b0&&(m=y[0]),m instanceof Error)throw m;var h=new Error("Unhandled error."+(m?" ("+m.message+")":""));throw h.context=m,h}var P=u[E];if(P===void 0)return!1;if(typeof P=="function")x(P,this,y);else for(var L=P.length,z=g(P,L),b=0;b0&&m.length>p&&!m.warned){m.warned=!0;var h=new Error("Possible EventEmitter memory leak detected. "+m.length+" "+String(E)+" listeners added. Use emitter.setMaxListeners() to increase limit");h.name="MaxListenersExceededWarning",h.emitter=S,h.type=E,h.count=m.length,M(h)}return S}t.prototype.addListener=function(E,y){return i(this,E,y,!1)},t.prototype.on=t.prototype.addListener,t.prototype.prependListener=function(E,y){return i(this,E,y,!0)};function n(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function s(S,E,y){var b={fired:!1,wrapFn:void 0,target:S,type:E,listener:y},p=n.bind(b);return p.listener=y,b.wrapFn=p,p}t.prototype.once=function(E,y){return o(y),this.on(E,s(this,E,y)),this},t.prototype.prependOnceListener=function(E,y){return o(y),this.prependListener(E,s(this,E,y)),this},t.prototype.removeListener=function(E,y){var b,p,u,m,h;if(o(y),p=this._events,p===void 0)return this;if(b=p[E],b===void 0)return this;if(b===y||b.listener===y)--this._eventsCount===0?this._events=Object.create(null):(delete p[E],p.removeListener&&this.emit("removeListener",E,b.listener||y));else if(typeof b!="function"){for(u=-1,m=b.length-1;m>=0;m--)if(b[m]===y||b[m].listener===y){h=b[m].listener,u=m;break}if(u<0)return this;u===0?b.shift():v(b,u),b.length===1&&(p[E]=b[0]),p.removeListener!==void 0&&this.emit("removeListener",E,h||y)}return this},t.prototype.off=t.prototype.removeListener,t.prototype.removeAllListeners=function(E){var y,b,p;if(b=this._events,b===void 0)return this;if(b.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):b[E]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete b[E]),this;if(arguments.length===0){var u=Object.keys(b),m;for(p=0;p=0;p--)this.removeListener(E,y[p]);return this};function c(S,E,y){var b=S._events;if(b===void 0)return[];var p=b[E];return p===void 0?[]:typeof p=="function"?y?[p.listener||p]:[p]:y?T(p):g(p,p.length)}t.prototype.listeners=function(E){return c(this,E,!0)},t.prototype.rawListeners=function(E){return c(this,E,!1)},t.listenerCount=function(S,E){return typeof S.listenerCount=="function"?S.listenerCount(E):f.call(S,E)},t.prototype.listenerCount=f;function f(S){var E=this._events;if(E!==void 0){var y=E[S];if(typeof y=="function")return 1;if(y!==void 0)return y.length}return 0}t.prototype.eventNames=function(){return this._eventsCount>0?A(this._events):[]};function g(S,E){for(var y=new Array(E),b=0;b{},{passive:!0}),A},triggerHandler:function(A,M,e){var t,r=A._ev;if(!r)return;var o=r._events[M];if(!o)return;function a(n){if(n.listener){if(r.removeListener(M,n.listener),!n.fired)return n.fired=!0,n.listener.apply(r,[e])}else return n.apply(r,[e])}o=Array.isArray(o)?o:[o];var i;for(i=0;ix.queueLength&&(e.undoQueue.queue.shift(),e.undoQueue.index--)},M.startSequence=function(e){e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},e.undoQueue.sequence=!0,e.undoQueue.beginSequence=!0},M.stopSequence=function(e){e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},e.undoQueue.sequence=!1,e.undoQueue.beginSequence=!1},M.undo=function(t){var r,o;if(!(t.undoQueue===void 0||isNaN(t.undoQueue.index)||t.undoQueue.index<=0)){for(t.undoQueue.index--,r=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,o=0;o=t.undoQueue.queue.length)){for(r=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,o=0;o=I.length)return!1;if(L.dimensions===2){if(F++,z.length===F)return L;var N=z[F];if(!w(N))return!1;L=I[O][N]}else L=I[O]}else L=I}}return L}function w(L){return L===Math.round(L)&&L>=0}function S(L){var z,F;z=q.modules[L]._module,F=z.basePlotModule;var B={};B.type=null;var O=o({},x),I=o({},z.attributes);Z.crawl(I,function(W,Q,ue,le,he){n(O,he).set(void 0),W===void 0&&n(I,he).set(void 0)}),o(B,O),q.traceIs(L,"noOpacity")&&delete B.opacity,q.traceIs(L,"showLegend")||(delete B.showlegend,delete B.legendgroup),q.traceIs(L,"noHover")&&(delete B.hoverinfo,delete B.hoverlabel),z.selectPoints||delete B.selectedpoints,o(B,I),F.attributes&&o(B,F.attributes),B.type=L;var N={meta:z.meta||{},categories:z.categories||{},animatable:!!z.animatable,type:L,attributes:b(B)};if(z.layoutAttributes){var U={};o(U,z.layoutAttributes),N.layoutAttributes=b(U)}return z.animatable||Z.crawl(N,function(W){Z.isValObject(W)&&"anim"in W&&delete W.anim}),N}function E(){var L={},z,F;o(L,A);for(z in q.subplotsRegistry)if(F=q.subplotsRegistry[z],!!F.layoutAttributes)if(Array.isArray(F.attr))for(var B=0;B=a&&(o._input||{})._templateitemname;n&&(i=a);var s=r+"["+i+"]",c;function f(){c={},n&&(c[s]={},c[s][x]=n)}f();function g(_,w){c[_]=w}function v(_,w){n?q.nestedProperty(c[s],_).set(w):c[s+"."+_]=w}function T(){var _=c;return f(),_}function l(_,w){_&&v(_,w);var S=T();for(var E in S)q.nestedProperty(t,E).set(S[E])}return{modifyBase:g,modifyItem:v,getUpdateObj:T,applyUpdate:l}}}}),kh=Ze({"src/plots/cartesian/constants.js"(Z,q){"use strict";var d=Jy().counter;q.exports={idRegex:{x:d("x","( domain)?"),y:d("y","( domain)?")},attrRegex:d("[xy]axis"),xAxisMatch:d("xaxis"),yAxisMatch:d("yaxis"),AX_ID_PATTERN:/^[xyz][0-9]*( domain)?$/,AX_NAME_PATTERN:/^[xyz]axis[0-9]*$/,SUBPLOT_PATTERN:/^x([0-9]*)y([0-9]*)$/,HOUR_PATTERN:"hour",WEEKDAY_PATTERN:"day of week",MINDRAG:8,MINZOOM:20,DRAGGERSIZE:20,REDRAWDELAY:50,DFLTRANGEX:[-1,6],DFLTRANGEY:[-1,4],traceLayerClasses:["imagelayer","heatmaplayer","contourcarpetlayer","contourlayer","funnellayer","waterfalllayer","barlayer","carpetlayer","violinlayer","boxlayer","ohlclayer","scattercarpetlayer","scatterlayer"],clipOnAxisFalseQuery:[".scatterlayer",".barlayer",".funnellayer",".waterfalllayer"],layerValue2layerClass:{"above traces":"above","below traces":"below"},zindexSeparator:"z"}}}),$c=Ze({"src/plots/cartesian/axis_ids.js"(Z){"use strict";var q=oo(),d=kh();Z.id2name=function(M){if(!(typeof M!="string"||!M.match(d.AX_ID_PATTERN))){var e=M.split(" ")[0].substr(1);return e==="1"&&(e=""),M.charAt(0)+"axis"+e}},Z.name2id=function(M){if(M.match(d.AX_NAME_PATTERN)){var e=M.substr(5);return e==="1"&&(e=""),M.charAt(0)+e}},Z.cleanId=function(M,e,t){var r=/( domain)$/.test(M);if(!(typeof M!="string"||!M.match(d.AX_ID_PATTERN))&&!(e&&M.charAt(0)!==e)&&!(r&&!t)){var o=M.split(" ")[0].substr(1).replace(/^0+/,"");return o==="1"&&(o=""),M.charAt(0)+o+(r&&t?" domain":"")}},Z.list=function(A,M,e){var t=A._fullLayout;if(!t)return[];var r=Z.listIds(A,M),o=new Array(r.length),a;for(a=0;at?1:-1:+(A.substr(1)||1)-+(M.substr(1)||1)},Z.ref2id=function(A){return/^[xyz]/.test(A)?A.split(" ")[0]:!1};function x(A,M){if(M&&M.length){for(var e=0;e0?".":"")+n;d.isPlainObject(s)?t(s,o,c,i+1):o(c,n,s)}})}}}),xc=Ze({"src/plots/plots.js"(Z,q){"use strict";var d=On(),x=jp().timeFormatLocale,A=Zy().formatLocale,M=ns(),e=YA(),t=oo(),r=e1(),o=Dl(),a=ca(),i=Yn(),n=qs().BADNUM,s=$c(),c=Jm().clearOutline,f=y2(),g=A_(),v=n5(),T=Hh().getModuleCalcData,l=a.relinkPrivateKeys,_=a._,w=q.exports={};a.extendFlat(w,t),w.attributes=eu(),w.attributes.type.values=w.allTypes,w.fontAttrs=tc(),w.layoutAttributes=$y();var S=az();w.executeAPICommand=S.executeAPICommand,w.computeAPICommandBindings=S.computeAPICommandBindings,w.manageCommandObserver=S.manageCommandObserver,w.hasSimpleAPICommandBindings=S.hasSimpleAPICommandBindings,w.redrawText=function(G){return G=a.getGraphDiv(G),new Promise(function($){setTimeout(function(){G._fullLayout&&(t.getComponentMethod("annotations","draw")(G),t.getComponentMethod("legend","draw")(G),t.getComponentMethod("colorbar","draw")(G),$(w.previousPromises(G)))},300)})},w.resize=function(G){G=a.getGraphDiv(G);var $,J=new Promise(function(X,oe){(!G||a.isHidden(G))&&oe(new Error("Resize must be passed a displayed plot div element.")),G._redrawTimer&&clearTimeout(G._redrawTimer),G._resolveResize&&($=G._resolveResize),G._resolveResize=X,G._redrawTimer=setTimeout(function(){if(!G.layout||G.layout.width&&G.layout.height||a.isHidden(G)){X(G);return}delete G.layout.width,delete G.layout.height;var ie=G.changed;G.autoplay=!0,t.call("relayout",G,{autosize:!0}).then(function(){G.changed=ie,G._resolveResize===X&&(delete G._resolveResize,X(G))})},100)});return $&&$(J),J},w.previousPromises=function(G){if((G._promises||[]).length)return Promise.all(G._promises).then(function(){G._promises=[]})},w.addLinks=function(G){if(!(!G._context.showLink&&!G._context.showSources)){var $=G._fullLayout,J=a.ensureSingle($._paper,"text","js-plot-link-container",function(re){re.style({"font-family":'"Open Sans", Arial, sans-serif',"font-size":"12px",fill:i.defaultLine,"pointer-events":"all"}).each(function(){var ce=d.select(this);ce.append("tspan").classed("js-link-to-tool",!0),ce.append("tspan").classed("js-link-spacer",!0),ce.append("tspan").classed("js-sourcelinks",!0)})}),X=J.node(),oe={y:$._paper.attr("height")-9};document.body.contains(X)&&X.getComputedTextLength()>=$.width-20?(oe["text-anchor"]="start",oe.x=5):(oe["text-anchor"]="end",oe.x=$._paper.attr("width")-7),J.attr(oe);var ie=J.select(".js-link-to-tool"),j=J.select(".js-link-spacer"),ee=J.select(".js-sourcelinks");G._context.showSources&&G._context.showSources(G),G._context.showLink&&E(G,ie),j.text(ie.text()&&ee.text()?" - ":"")}};function E(G,$){$.text("");var J=$.append("a").attr({"xlink:xlink:href":"#",class:"link--impt link--embedview","font-weight":"bold"}).text(G._context.linkText+" \xBB");if(G._context.sendData)J.on("click",function(){w.sendDataToCloud(G)});else{var X=window.location.pathname.split("/"),oe=window.location.search;J.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+X[2].split(".")[0]+"/"+X[1]+oe})}}w.sendDataToCloud=function(G){var $=(window.PLOTLYENV||{}).BASE_URL||G._context.plotlyServerURL;if($){G.emit("plotly_beforeexport");var J=d.select(G).append("div").attr("id","hiddenform").style("display","none"),X=J.append("form").attr({action:$+"/external",method:"post",target:"_blank"}),oe=X.append("input").attr({type:"text",name:"data"});return oe.node().value=w.graphJson(G,!1,"keepdata"),X.node().submit(),J.remove(),G.emit("plotly_afterexport"),!1}};var y=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],b=["year","month","dayMonth","dayMonthYear"];w.supplyDefaults=function(G,$){var J=$&&$.skipUpdateCalc,X=G._fullLayout||{};if(X._skipDefaults){delete X._skipDefaults;return}var oe=G._fullLayout={},ie=G.layout||{},j=G._fullData||[],ee=G._fullData=[],re=G.data||[],ce=G.calcdata||[],be=G._context||{},Ae;G._transitionData||w.createTransitionData(G),oe._dfltTitle={plot:_(G,"Click to enter Plot title"),subtitle:_(G,"Click to enter Plot subtitle"),x:_(G,"Click to enter X axis title"),y:_(G,"Click to enter Y axis title"),colorbar:_(G,"Click to enter Colorscale title"),annotation:_(G,"new text")},oe._traceWord=_(G,"trace");var ze=m(G,y);if(oe._mapboxAccessToken=be.mapboxAccessToken,X._initialAutoSizeIsDone){var Re=X.width,Xe=X.height;w.supplyLayoutGlobalDefaults(ie,oe,ze),ie.width||(oe.width=Re),ie.height||(oe.height=Xe),w.sanitizeMargins(oe)}else{w.supplyLayoutGlobalDefaults(ie,oe,ze);var it=!ie.width||!ie.height,ot=oe.autosize,tt=be.autosizable,lt=it&&(ot||tt);lt?w.plotAutoSize(G,ie,oe):it&&w.sanitizeMargins(oe),!ot&&it&&(ie.width=oe.width,ie.height=oe.height)}oe._d3locale=h(ze,oe.separators),oe._extraFormat=m(G,b),oe._initialAutoSizeIsDone=!0,oe._dataLength=re.length,oe._modules=[],oe._visibleModules=[],oe._basePlotModules=[];var Ee=oe._subplots=u(),_e=oe._splomAxes={x:{},y:{}},fe=oe._splomSubplots={};oe._splomGridDflt={},oe._scatterStackOpts={},oe._firstScatter={},oe._alignmentOpts={},oe._colorAxes={},oe._requestRangeslider={},oe._traceUids=p(j,re),w.supplyDataDefaults(re,ee,ie,oe);var Fe=Object.keys(_e.x),rt=Object.keys(_e.y);if(Fe.length>1&&rt.length>1){for(t.getComponentMethod("grid","sizeDefaults")(ie,oe),Ae=0;Ae15&&rt.length>15&&oe.shapes.length===0&&oe.images.length===0,w.linkSubplots(ee,oe,j,X),w.cleanPlot(ee,oe,j,X);var Vt=!!(X._has&&X._has("cartesian")),Zt=!!(oe._has&&oe._has("cartesian")),Sr=Vt,xr=Zt;Sr&&!xr?X._bgLayer.remove():xr&&!Sr&&(oe._shouldCreateBgLayer=!0),X._zoomlayer&&!G._dragging&&c({_fullLayout:X}),P(ee,oe),l(oe,X),t.getComponentMethod("colorscale","crossTraceDefaults")(ee,oe),oe._preGUI||(oe._preGUI={}),oe._tracePreGUI||(oe._tracePreGUI={});var jr=oe._tracePreGUI,wr={},Ir;for(Ir in jr)wr[Ir]="old";for(Ae=0;Ae0){var be=1-2*ie;j=Math.round(be*j),ee=Math.round(be*ee)}}var Ae=w.layoutAttributes.width.min,ze=w.layoutAttributes.height.min;j1,Xe=!J.height&&Math.abs(X.height-ee)>1;(Xe||Re)&&(Re&&(X.width=j),Xe&&(X.height=ee)),$._initialAutoSize||($._initialAutoSize={width:j,height:ee}),w.sanitizeMargins(X)},w.supplyLayoutModuleDefaults=function(G,$,J,X){var oe=t.componentsRegistry,ie=$._basePlotModules,j,ee,re,ce=t.subplotsRegistry.cartesian;for(j in oe)re=oe[j],re.includeBasePlot&&re.includeBasePlot(G,$);ie.length||ie.push(ce),$._has("cartesian")&&(t.getComponentMethod("grid","contentDefaults")(G,$),ce.finalizeSubplots(G,$));for(var be in $._subplots)$._subplots[be].sort(a.subplotSort);for(ee=0;ee1&&(J.l/=ot,J.r/=ot)}if(ze){var tt=(J.t+J.b)/ze;tt>1&&(J.t/=tt,J.b/=tt)}var lt=J.xl!==void 0?J.xl:J.x,Ee=J.xr!==void 0?J.xr:J.x,_e=J.yt!==void 0?J.yt:J.y,fe=J.yb!==void 0?J.yb:J.y;Re[$]={l:{val:lt,size:J.l+it},r:{val:Ee,size:J.r+it},b:{val:fe,size:J.b+it},t:{val:_e,size:J.t+it}},Xe[$]=1}if(!X._replotting)return w.doAutoMargin(G)}};function I(G){if("_redrawFromAutoMarginCount"in G._fullLayout)return!1;var $=s.list(G,"",!0);for(var J in $)if($[J].autoshift||$[J].shift)return!0;return!1}w.doAutoMargin=function(G){var $=G._fullLayout,J=$.width,X=$.height;$._size||($._size={}),F($);var oe=$._size,ie=$.margin,j={t:0,b:0,l:0,r:0},ee=a.extendFlat({},oe),re=ie.l,ce=ie.r,be=ie.t,Ae=ie.b,ze=$._pushmargin,Re=$._pushmarginIds,Xe=$.minreducedwidth,it=$.minreducedheight;if(ie.autoexpand!==!1){for(var ot in ze)Re[ot]||delete ze[ot];var tt=G._fullLayout._reservedMargin;for(var lt in tt)for(var Ee in tt[lt]){var _e=tt[lt][Ee];j[Ee]=Math.max(j[Ee],_e)}ze.base={l:{val:0,size:re},r:{val:1,size:ce},t:{val:1,size:be},b:{val:0,size:Ae}};for(var fe in j){var Fe=0;for(var rt in ze)rt!=="base"&&M(ze[rt][fe].size)&&(Fe=ze[rt][fe].size>Fe?ze[rt][fe].size:Fe);var st=Math.max(0,ie[fe]-Fe);j[fe]=Math.max(0,j[fe]-st)}for(var Qe in ze){var Lt=ze[Qe].l||{},kt=ze[Qe].b||{},Vt=Lt.val,Zt=Lt.size,Sr=kt.val,xr=kt.size,jr=J-j.r-j.l,wr=X-j.t-j.b;for(var Ir in ze){if(M(Zt)&&ze[Ir].r){var bt=ze[Ir].r.val,Be=ze[Ir].r.size;if(bt>Vt){var Ke=(Zt*bt+(Be-jr)*Vt)/(bt-Vt),Ue=(Be*(1-Vt)+(Zt-jr)*(1-bt))/(bt-Vt);Ke+Ue>re+ce&&(re=Ke,ce=Ue)}}if(M(xr)&&ze[Ir].t){var Me=ze[Ir].t.val,qe=ze[Ir].t.size;if(Me>Sr){var Ce=(xr*Me+(qe-wr)*Sr)/(Me-Sr),Te=(qe*(1-Sr)+(xr-wr)*(1-Me))/(Me-Sr);Ce+Te>Ae+be&&(Ae=Ce,be=Te)}}}}}var Pe=a.constrain(J-ie.l-ie.r,B,Xe),at=a.constrain(X-ie.t-ie.b,O,it),yt=Math.max(0,J-Pe),Tt=Math.max(0,X-at);if(yt){var Ot=(re+ce)/yt;Ot>1&&(re/=Ot,ce/=Ot)}if(Tt){var Gt=(Ae+be)/Tt;Gt>1&&(Ae/=Gt,be/=Gt)}if(oe.l=Math.round(re)+j.l,oe.r=Math.round(ce)+j.r,oe.t=Math.round(be)+j.t,oe.b=Math.round(Ae)+j.b,oe.p=Math.round(ie.pad),oe.w=Math.round(J)-oe.l-oe.r,oe.h=Math.round(X)-oe.t-oe.b,!$._replotting&&(w.didMarginChange(ee,oe)||I(G))){"_redrawFromAutoMarginCount"in $?$._redrawFromAutoMarginCount++:$._redrawFromAutoMarginCount=1;var rr=3*(1+Object.keys(Re).length);if($._redrawFromAutoMarginCount1)return!0}return!1},w.graphJson=function(G,$,J,X,oe,ie){(oe&&$&&!G._fullData||oe&&!$&&!G._fullLayout)&&w.supplyDefaults(G);var j=oe?G._fullData:G.data,ee=oe?G._fullLayout:G.layout,re=(G._transitionData||{})._frames;function ce(ze,Re){if(typeof ze=="function")return Re?"_function_":null;if(a.isPlainObject(ze)){var Xe={},it;return Object.keys(ze).sort().forEach(function(Ee){if(["_","["].indexOf(Ee.charAt(0))===-1){if(typeof ze[Ee]=="function"){Re&&(Xe[Ee]="_function");return}if(J==="keepdata"){if(Ee.substr(Ee.length-3)==="src")return}else if(J==="keepstream"){if(it=ze[Ee+"src"],typeof it=="string"&&it.indexOf(":")>0&&!a.isPlainObject(ze.stream))return}else if(J!=="keepall"&&(it=ze[Ee+"src"],typeof it=="string"&&it.indexOf(":")>0))return;Xe[Ee]=ce(ze[Ee],Re)}}),Xe}var ot=Array.isArray(ze),tt=a.isTypedArray(ze);if((ot||tt)&&ze.dtype&&ze.shape){var lt=ze.bdata;return ce({dtype:ze.dtype,shape:ze.shape,bdata:a.isArrayBuffer(lt)?e.encode(lt):lt},Re)}return ot?ze.map(function(Ee){return ce(Ee,Re)}):tt?a.simpleMap(ze,a.identity):a.isJSDate(ze)?a.ms2DateTimeLocal(+ze):ze}var be={data:(j||[]).map(function(ze){var Re=ce(ze);return $&&delete Re.fit,Re})};if(!$&&(be.layout=ce(ee),oe)){var Ae=ee._size;be.layout.computed={margin:{b:Ae.b,l:Ae.l,r:Ae.r,t:Ae.t}}}return re&&(be.frames=ce(re)),ie&&(be.config=ce(G._context,!0)),X==="object"?be:JSON.stringify(be)},w.modifyFrames=function(G,$){var J,X,oe,ie=G._transitionData._frames,j=G._transitionData._frameHash;for(J=0;J<$.length;J++)switch(X=$[J],X.type){case"replace":oe=X.value;var ee=(ie[X.index]||{}).name,re=oe.name;ie[X.index]=j[re]=oe,re!==ee&&(delete j[ee],j[re]=oe);break;case"insert":oe=X.value,j[oe.name]=oe,ie.splice(X.index,0,oe);break;case"delete":oe=ie[X.index],delete j[oe.name],ie.splice(X.index,1);break}return Promise.resolve()},w.computeFrame=function(G,$){var J=G._transitionData._frameHash,X,oe,ie,j;if(!$)throw new Error("computeFrame must be given a string frame name");var ee=J[$.toString()];if(!ee)return!1;for(var re=[ee],ce=[ee.name];ee.baseframe&&(ee=J[ee.baseframe.toString()])&&ce.indexOf(ee.name)===-1;)re.push(ee),ce.push(ee.name);for(var be={};ee=re.pop();)if(ee.layout&&(be.layout=w.extendLayout(be.layout,ee.layout)),ee.data){if(be.data||(be.data=[]),oe=ee.traces,!oe)for(oe=[],X=0;X0&&(G._transitioningWithDuration=!0),G._transitionData._interruptCallbacks.push(function(){X=!0}),J.redraw&&G._transitionData._interruptCallbacks.push(function(){return t.call("redraw",G)}),G._transitionData._interruptCallbacks.push(function(){G.emit("plotly_transitioninterrupted",[])});var ze=0,Re=0;function Xe(){return ze++,function(){Re++,!X&&Re===ze&&ee(Ae)}}J.runFn(Xe),setTimeout(Xe())})}function ee(Ae){if(G._transitionData)return ie(G._transitionData._interruptCallbacks),Promise.resolve().then(function(){if(J.redraw)return t.call("redraw",G)}).then(function(){G._transitioning=!1,G._transitioningWithDuration=!1,G.emit("plotly_transitioned",[])}).then(Ae)}function re(){if(G._transitionData)return G._transitioning=!1,oe(G._transitionData._interruptCallbacks)}var ce=[w.previousPromises,re,J.prepareFn,w.rehover,w.reselect,j],be=a.syncOrAsync(ce,G);return(!be||!be.then)&&(be=Promise.resolve()),be.then(function(){return G})}w.doCalcdata=function(G,$){var J=s.list(G),X=G._fullData,oe=G._fullLayout,ie,j,ee,re,ce=new Array(X.length),be=(G.calcdata||[]).slice();for(G.calcdata=ce,oe._numBoxes=0,oe._numViolins=0,oe._violinScaleGroupStats={},G._hmpixcount=0,G._hmlumcount=0,oe._piecolormap={},oe._sunburstcolormap={},oe._treemapcolormap={},oe._iciclecolormap={},oe._funnelareacolormap={},ee=0;ee=0;re--)if(fe[re].enabled){ie._indexToPoints=fe[re]._indexToPoints;break}j&&j.calc&&(_e=j.calc(G,ie))}(!Array.isArray(_e)||!_e[0])&&(_e=[{x:n,y:n}]),_e[0].t||(_e[0].t={}),_e[0].trace=ie,ce[lt]=_e}}for(le(J,X,oe),ee=0;eeee||Re>re)&&(ie.style("overflow","hidden"),Ae=ie.node().getBoundingClientRect(),ze=Ae.width,Re=Ae.height);var Xe=+O.attr("x"),it=+O.attr("y"),ot=G||O.node().getBoundingClientRect().height,tt=-ot/4;if(ue[0]==="y")j.attr({transform:"rotate("+[-90,Xe,it]+")"+x(-ze/2,tt-Re/2)});else if(ue[0]==="l")it=tt-Re/2;else if(ue[0]==="a"&&ue.indexOf("atitle")!==0)Xe=0,it=tt;else{var lt=O.attr("text-anchor");Xe=Xe-ze*(lt==="middle"?.5:lt==="end"?1:0),it=it+tt-Re/2}ie.attr({x:Xe,y:it}),N&&N.call(O,j),he(j)})})):le(),O};var t=/(<|<|<)/g,r=/(>|>|>)/g;function o(O){return O.replace(t,"\\lt ").replace(r,"\\gt ")}var a=[["$","$"],["\\(","\\)"]];function i(O,I,N){var U=parseInt((MathJax.version||"").split(".")[0]);if(U!==2&&U!==3){d.warn("No MathJax version:",MathJax.version);return}var W,Q,ue,le,he=function(){return Q=d.extendDeepAll({},MathJax.Hub.config),ue=MathJax.Hub.processSectionDelay,MathJax.Hub.processSectionDelay!==void 0&&(MathJax.Hub.processSectionDelay=0),MathJax.Hub.Config({messageStyle:"none",tex2jax:{inlineMath:a},displayAlign:"left"})},G=function(){Q=d.extendDeepAll({},MathJax.config),MathJax.config.tex||(MathJax.config.tex={}),MathJax.config.tex.inlineMath=a},$=function(){if(W=MathJax.Hub.config.menuSettings.renderer,W!=="SVG")return MathJax.Hub.setRenderer("SVG")},J=function(){W=MathJax.config.startup.output,W!=="svg"&&(MathJax.config.startup.output="svg")},X=function(){var ce="math-output-"+d.randstr({},64);le=q.select("body").append("div").attr({id:ce}).style({visibility:"hidden",position:"absolute","font-size":I.fontSize+"px"}).text(o(O));var be=le.node();return U===2?MathJax.Hub.Typeset(be):MathJax.typeset([be])},oe=function(){var ce=le.select(U===2?".MathJax_SVG":".MathJax"),be=!ce.empty()&&le.select("svg").node();if(!be)d.log("There was an error in the tex syntax.",O),N();else{var Ae=be.getBoundingClientRect(),ze;U===2?ze=q.select("body").select("#MathJax_SVG_glyphs"):ze=ce.select("defs"),N(ce,ze,Ae)}le.remove()},ie=function(){if(W!=="SVG")return MathJax.Hub.setRenderer(W)},j=function(){W!=="svg"&&(MathJax.config.startup.output=W)},ee=function(){return ue!==void 0&&(MathJax.Hub.processSectionDelay=ue),MathJax.Hub.Config(Q)},re=function(){MathJax.config=Q};U===2?MathJax.Hub.Queue(he,$,X,oe,ie,ee):U===3&&(G(),J(),MathJax.startup.defaultReady(),MathJax.startup.promise.then(function(){X(),oe(),j(),re()}))}var n={sup:"font-size:70%",sub:"font-size:70%",s:"text-decoration:line-through",u:"text-decoration:underline",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},s={sub:"0.3em",sup:"-0.6em"},c={sub:"-0.21em",sup:"0.42em"},f="\u200B",g=["http:","https:","mailto:","",void 0,":"],v=Z.NEWLINES=/(\r\n?|\n)/g,T=/(<[^<>]*>)/,l=/<(\/?)([^ >]*)(\s+(.*))?>/i,_=//i;Z.BR_TAG_ALL=//gi;var w=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,S=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,E=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,y=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function b(O,I){if(!O)return null;var N=O.match(I),U=N&&(N[3]||N[4]);return U&&h(U)}var p=/(^|;)\s*color:/;Z.plainText=function(O,I){I=I||{};for(var N=I.len!==void 0&&I.len!==-1?I.len:1/0,U=I.allowedTags!==void 0?I.allowedTags:["br"],W="...",Q=W.length,ue=O.split(T),le=[],he="",G=0,$=0;$Q?le.push(J.substr(0,j-Q)+W):le.push(J.substr(0,j));break}he=""}}return le.join("")};var u={mu:"\u03BC",amp:"&",lt:"<",gt:">",nbsp:"\xA0",times:"\xD7",plusmn:"\xB1",deg:"\xB0"},m=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function h(O){return O.replace(m,function(I,N){var U;return N.charAt(0)==="#"?U=P(N.charAt(1)==="x"?parseInt(N.substr(2),16):parseInt(N.substr(1),10)):U=u[N],U||I})}Z.convertEntities=h;function P(O){if(!(O>1114111)){var I=String.fromCodePoint;if(I)return I(O);var N=String.fromCharCode;return O<=65535?N(O):N((O>>10)+55232,O%1024+56320)}}function L(O,I){I=I.replace(v," ");var N=!1,U=[],W,Q=-1;function ue(){Q++;var Re=document.createElementNS(A.svg,"tspan");q.select(Re).attr({class:"line",dy:Q*M+"em"}),O.appendChild(Re),W=Re;var Xe=U;if(U=[{node:Re}],Xe.length>1)for(var it=1;it.",I);return}var Xe=U.pop();Re!==Xe.type&&d.log("Start tag <"+Xe.type+"> doesnt match end tag <"+Re+">. Pretending it did match.",I),W=U[U.length-1].node}var $=_.test(I);$?ue():(W=O,U=[{node:O}]);for(var J=I.split(T),X=0;X=0;_--,w++){var S=v[_];l[w]=[1-S[0],S[1]]}return l}function c(v,T){T=T||{};for(var l=v.domain,_=v.range,w=_.length,S=new Array(w),E=0;Ev-f?f=v-(g-v):g-v=0?_=o.colorscale.sequential:_=o.colorscale.sequentialminus,s._sync("colorscale",_)}}}}),rc=Ze({"src/components/colorscale/index.js"(Z,q){"use strict";var d=G0(),x=bp();q.exports={moduleType:"component",name:"colorscale",attributes:Mu(),layoutAttributes:o5(),supplyLayoutDefaults:iz(),handleDefaults:gh(),crossTraceDefaults:nz(),calc:wp(),scales:d.scales,defaultScale:d.defaultScale,getScale:d.get,isValidScale:d.isValid,hasColorscale:x.hasColorscale,extractOpts:x.extractOpts,extractScale:x.extractScale,flipScale:x.flipScale,makeColorScaleFunc:x.makeColorScaleFunc,makeColorScaleFuncFromTrace:x.makeColorScaleFuncFromTrace}}}),Fu=Ze({"src/traces/scatter/subtypes.js"(Z,q){"use strict";var d=ca(),x=xp().isTypedArraySpec;q.exports={hasLines:function(A){return A.visible&&A.mode&&A.mode.indexOf("lines")!==-1},hasMarkers:function(A){return A.visible&&(A.mode&&A.mode.indexOf("markers")!==-1||A.type==="splom")},hasText:function(A){return A.visible&&A.mode&&A.mode.indexOf("text")!==-1},isBubble:function(A){var M=A.marker;return d.isPlainObject(M)&&(d.isArrayOrTypedArray(M.size)||x(M.size))}}}}),r1=Ze({"src/traces/scatter/make_bubble_size_func.js"(Z,q){"use strict";var d=ns();q.exports=function(A,M){M||(M=2);var e=A.marker,t=e.sizeref||1,r=e.sizemin||0,o=e.sizemode==="area"?function(a){return Math.sqrt(a/t)}:function(a){return a/t};return function(a){var i=o(a/M);return d(i)&&i>0?Math.max(i,r):0}}}}),Qp=Ze({"src/components/fx/helpers.js"(Z){"use strict";var q=ca();Z.getSubplot=function(t){return t.subplot||t.xaxis+t.yaxis||t.geo},Z.isTraceInSubplots=function(t,r){if(t.type==="splom"){for(var o=t.xaxes||[],a=t.yaxes||[],i=0;i=0&&o.index2&&(r.push([a].concat(i.splice(0,2))),n="l",a=a=="m"?"l":"L");;){if(i.length==d[n])return i.unshift(a),r.push(i);if(i.length0&&(_e=100,Ee=Ee.replace("-open","")),Ee.indexOf("-dot")>0&&(_e+=200,Ee=Ee.replace("-dot","")),Ee=l.symbolNames.indexOf(Ee),Ee>=0&&(Ee+=_e)}return Ee%100>=p||Ee>=400?0:Math.floor(Math.max(Ee,0))};function m(Ee,_e,fe,Fe){var rt=Ee%100;return l.symbolFuncs[rt](_e,fe,Fe)+(Ee>=200?u:"")}var h=A("~f"),P={radial:{type:"radial"},radialreversed:{type:"radial",reversed:!0},horizontal:{type:"linear",start:{x:1,y:0},stop:{x:0,y:0}},horizontalreversed:{type:"linear",start:{x:1,y:0},stop:{x:0,y:0},reversed:!0},vertical:{type:"linear",start:{x:0,y:1},stop:{x:0,y:0}},verticalreversed:{type:"linear",start:{x:0,y:1},stop:{x:0,y:0},reversed:!0}};l.gradient=function(Ee,_e,fe,Fe,rt,st){var Qe=P[Fe];return L(Ee,_e,fe,Qe.type,rt,st,Qe.start,Qe.stop,!1,Qe.reversed)};function L(Ee,_e,fe,Fe,rt,st,Qe,Lt,kt,Vt){var Zt=rt.length,Sr;Fe==="linear"?Sr={node:"linearGradient",attrs:{x1:Qe.x,y1:Qe.y,x2:Lt.x,y2:Lt.y,gradientUnits:kt?"userSpaceOnUse":"objectBoundingBox"},reversed:Vt}:Fe==="radial"&&(Sr={node:"radialGradient",reversed:Vt});for(var xr=new Array(Zt),jr=0;jr=0&&Ee.i===void 0&&(Ee.i=st.i),_e.style("opacity",Fe.selectedOpacityFn?Fe.selectedOpacityFn(Ee):Ee.mo===void 0?Qe.opacity:Ee.mo),Fe.ms2mrc){var kt;Ee.ms==="various"||Qe.size==="various"?kt=3:kt=Fe.ms2mrc(Ee.ms),Ee.mrc=kt,Fe.selectedSizeFn&&(kt=Ee.mrc=Fe.selectedSizeFn(Ee));var Vt=l.symbolNumber(Ee.mx||Qe.symbol)||0;Ee.om=Vt%200>=100;var Zt=lt(Ee,fe),Sr=ee(Ee,fe);_e.attr("d",m(Vt,kt,Zt,Sr))}var xr=!1,jr,wr,Ir;if(Ee.so)Ir=Lt.outlierwidth,wr=Lt.outliercolor,jr=Qe.outliercolor;else{var bt=(Lt||{}).width;Ir=(Ee.mlw+1||bt+1||(Ee.trace?(Ee.trace.marker.line||{}).width:0)+1)-1||0,"mlc"in Ee?wr=Ee.mlcc=Fe.lineScale(Ee.mlc):x.isArrayOrTypedArray(Lt.color)?wr=r.defaultLine:wr=Lt.color,x.isArrayOrTypedArray(Qe.color)&&(jr=r.defaultLine,xr=!0),"mc"in Ee?jr=Ee.mcc=Fe.markerScale(Ee.mc):jr=Qe.color||Qe.colors||"rgba(0,0,0,0)",Fe.selectedColorFn&&(jr=Fe.selectedColorFn(Ee))}if(Ee.om)_e.call(r.stroke,jr).style({"stroke-width":(Ir||1)+"px",fill:"none"});else{_e.style("stroke-width",(Ee.isBlank?0:Ir)+"px");var Be=Qe.gradient,Ke=Ee.mgt;Ke?xr=!0:Ke=Be&&Be.type,x.isArrayOrTypedArray(Ke)&&(Ke=Ke[0],P[Ke]||(Ke=0));var Ue=Qe.pattern,Me=l.getPatternAttr,qe=Ue&&(Me(Ue.shape,Ee.i,"")||Me(Ue.path,Ee.i,""));if(Ke&&Ke!=="none"){var Ce=Ee.mgc;Ce?xr=!0:Ce=Be.color;var Te=fe.uid;xr&&(Te+="-"+Ee.i),l.gradient(_e,rt,Te,Ke,[[0,Ce],[1,jr]],"fill")}else if(qe){var Pe=!1,at=Ue.fgcolor;!at&&st&&st.color&&(at=st.color,Pe=!0);var yt=Me(at,Ee.i,st&&st.color||null),Tt=Me(Ue.bgcolor,Ee.i,null),Ot=Ue.fgopacity,Gt=Me(Ue.size,Ee.i,8),rr=Me(Ue.solidity,Ee.i,.3);Pe=Pe||Ee.mcc||x.isArrayOrTypedArray(Ue.shape)||x.isArrayOrTypedArray(Ue.path)||x.isArrayOrTypedArray(Ue.bgcolor)||x.isArrayOrTypedArray(Ue.fgcolor)||x.isArrayOrTypedArray(Ue.size)||x.isArrayOrTypedArray(Ue.solidity);var Qt=fe.uid;Pe&&(Qt+="-"+Ee.i),l.pattern(_e,"point",rt,Qt,qe,Gt,rr,Ee.mcc,Ue.fillmode,Tt,yt,Ot)}else x.isArrayOrTypedArray(jr)?r.fill(_e,jr[Ee.i]):r.fill(_e,jr);Ir&&r.stroke(_e,wr)}},l.makePointStyleFns=function(Ee){var _e={},fe=Ee.marker;return _e.markerScale=l.tryColorscale(fe,""),_e.lineScale=l.tryColorscale(fe,"line"),t.traceIs(Ee,"symbols")&&(_e.ms2mrc=g.isBubble(Ee)?v(Ee):function(){return(fe.size||6)/2}),Ee.selectedpoints&&x.extendFlat(_e,l.makeSelectedPointStyleFns(Ee)),_e},l.makeSelectedPointStyleFns=function(Ee){var _e={},fe=Ee.selected||{},Fe=Ee.unselected||{},rt=Ee.marker||{},st=fe.marker||{},Qe=Fe.marker||{},Lt=rt.opacity,kt=st.opacity,Vt=Qe.opacity,Zt=kt!==void 0,Sr=Vt!==void 0;(x.isArrayOrTypedArray(Lt)||Zt||Sr)&&(_e.selectedOpacityFn=function(Me){var qe=Me.mo===void 0?rt.opacity:Me.mo;return Me.selected?Zt?kt:qe:Sr?Vt:f*qe});var xr=rt.color,jr=st.color,wr=Qe.color;(jr||wr)&&(_e.selectedColorFn=function(Me){var qe=Me.mcc||xr;return Me.selected?jr||qe:wr||qe});var Ir=rt.size,bt=st.size,Be=Qe.size,Ke=bt!==void 0,Ue=Be!==void 0;return t.traceIs(Ee,"symbols")&&(Ke||Ue)&&(_e.selectedSizeFn=function(Me){var qe=Me.mrc||Ir/2;return Me.selected?Ke?bt/2:qe:Ue?Be/2:qe}),_e},l.makeSelectedTextStyleFns=function(Ee){var _e={},fe=Ee.selected||{},Fe=Ee.unselected||{},rt=Ee.textfont||{},st=fe.textfont||{},Qe=Fe.textfont||{},Lt=rt.color,kt=st.color,Vt=Qe.color;return _e.selectedTextColorFn=function(Zt){var Sr=Zt.tc||Lt;return Zt.selected?kt||Sr:Vt||(kt?Sr:r.addOpacity(Sr,f))},_e},l.selectedPointStyle=function(Ee,_e){if(!(!Ee.size()||!_e.selectedpoints)){var fe=l.makeSelectedPointStyleFns(_e),Fe=_e.marker||{},rt=[];fe.selectedOpacityFn&&rt.push(function(st,Qe){st.style("opacity",fe.selectedOpacityFn(Qe))}),fe.selectedColorFn&&rt.push(function(st,Qe){r.fill(st,fe.selectedColorFn(Qe))}),fe.selectedSizeFn&&rt.push(function(st,Qe){var Lt=Qe.mx||Fe.symbol||0,kt=fe.selectedSizeFn(Qe);st.attr("d",m(l.symbolNumber(Lt),kt,lt(Qe,_e),ee(Qe,_e))),Qe.mrc2=kt}),rt.length&&Ee.each(function(st){for(var Qe=d.select(this),Lt=0;Lt0?fe:0}l.textPointStyle=function(Ee,_e,fe){if(Ee.size()){var Fe;if(_e.selectedpoints){var rt=l.makeSelectedTextStyleFns(_e);Fe=rt.selectedTextColorFn}var st=_e.texttemplate,Qe=fe._fullLayout;Ee.each(function(Lt){var kt=d.select(this),Vt=st?x.extractOption(Lt,_e,"txt","texttemplate"):x.extractOption(Lt,_e,"tx","text");if(!Vt&&Vt!==0){kt.remove();return}if(st){var Zt=_e._module.formatLabels,Sr=Zt?Zt(Lt,_e,Qe):{},xr={};T(xr,_e,Lt.i);var jr=_e._meta||{};Vt=x.texttemplateString(Vt,Sr,Qe._d3locale,xr,Lt,jr)}var wr=Lt.tp||_e.textposition,Ir=B(Lt,_e),bt=Fe?Fe(Lt):Lt.tc||_e.textfont.color;kt.call(l.font,{family:Lt.tf||_e.textfont.family,weight:Lt.tw||_e.textfont.weight,style:Lt.ty||_e.textfont.style,variant:Lt.tv||_e.textfont.variant,textcase:Lt.tC||_e.textfont.textcase,lineposition:Lt.tE||_e.textfont.lineposition,shadow:Lt.tS||_e.textfont.shadow,size:Ir,color:bt}).text(Vt).call(i.convertToTspans,fe).call(F,wr,Ir,Lt.mrc)})}},l.selectedTextStyle=function(Ee,_e){if(!(!Ee.size()||!_e.selectedpoints)){var fe=l.makeSelectedTextStyleFns(_e);Ee.each(function(Fe){var rt=d.select(this),st=fe.selectedTextColorFn(Fe),Qe=Fe.tp||_e.textposition,Lt=B(Fe,_e);r.fill(rt,st);var kt=t.traceIs(_e,"bar-like");F(rt,Qe,Lt,Fe.mrc2||Fe.mrc,kt)})}};var O=.5;l.smoothopen=function(Ee,_e){if(Ee.length<3)return"M"+Ee.join("L");var fe="M"+Ee[0],Fe=[],rt;for(rt=1;rt=kt||Me>=Zt&&Me<=kt)&&(qe<=Sr&&qe>=Vt||qe>=Sr&&qe<=Vt)&&(Ee=[Me,qe])}return Ee}l.applyBackoff=G,l.makeTester=function(){var Ee=x.ensureSingleById(d.select("body"),"svg","js-plotly-tester",function(fe){fe.attr(n.svgAttrs).style({position:"absolute",left:"-10000px",top:"-10000px",width:"9000px",height:"9000px","z-index":"1"})}),_e=x.ensureSingle(Ee,"path","js-reference-point",function(fe){fe.attr("d","M0,0H1V1H0Z").style({"stroke-width":0,fill:"black"})});l.tester=Ee,l.testref=_e},l.savedBBoxes={};var $=0,J=1e4;l.bBox=function(Ee,_e,fe){fe||(fe=X(Ee));var Fe;if(fe){if(Fe=l.savedBBoxes[fe],Fe)return x.extendFlat({},Fe)}else if(Ee.childNodes.length===1){var rt=Ee.childNodes[0];if(fe=X(rt),fe){var st=+rt.getAttribute("x")||0,Qe=+rt.getAttribute("y")||0,Lt=rt.getAttribute("transform");if(!Lt){var kt=l.bBox(rt,!1,fe);return st&&(kt.left+=st,kt.right+=st),Qe&&(kt.top+=Qe,kt.bottom+=Qe),kt}if(fe+="~"+st+"~"+Qe+"~"+Lt,Fe=l.savedBBoxes[fe],Fe)return x.extendFlat({},Fe)}}var Vt,Zt;_e?Vt=Ee:(Zt=l.tester.node(),Vt=Ee.cloneNode(!0),Zt.appendChild(Vt)),d.select(Vt).attr("transform",null).call(i.positionText,0,0);var Sr=Vt.getBoundingClientRect(),xr=l.testref.node().getBoundingClientRect();_e||Zt.removeChild(Vt);var jr={height:Sr.height,width:Sr.width,left:Sr.left-xr.left,top:Sr.top-xr.top,right:Sr.right-xr.left,bottom:Sr.bottom-xr.top};return $>=J&&(l.savedBBoxes={},$=0),fe&&(l.savedBBoxes[fe]=jr),$++,x.extendFlat({},jr)};function X(Ee){var _e=Ee.getAttribute("data-unformatted");if(_e!==null)return _e+Ee.getAttribute("data-math")+Ee.getAttribute("text-anchor")+Ee.getAttribute("style")}l.setClipUrl=function(Ee,_e,fe){Ee.attr("clip-path",oe(_e,fe))};function oe(Ee,_e){if(!Ee)return null;var fe=_e._context,Fe=fe._exportedPlot?"":fe._baseUrl||"";return Fe?"url('"+Fe+"#"+Ee+"')":"url(#"+Ee+")"}l.getTranslate=function(Ee){var _e=/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,fe=Ee.attr?"attr":"getAttribute",Fe=Ee[fe]("transform")||"",rt=Fe.replace(_e,function(st,Qe,Lt){return[Qe,Lt].join(" ")}).split(" ");return{x:+rt[0]||0,y:+rt[1]||0}},l.setTranslate=function(Ee,_e,fe){var Fe=/(\btranslate\(.*?\);?)/,rt=Ee.attr?"attr":"getAttribute",st=Ee.attr?"attr":"setAttribute",Qe=Ee[rt]("transform")||"";return _e=_e||0,fe=fe||0,Qe=Qe.replace(Fe,"").trim(),Qe+=a(_e,fe),Qe=Qe.trim(),Ee[st]("transform",Qe),Qe},l.getScale=function(Ee){var _e=/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,fe=Ee.attr?"attr":"getAttribute",Fe=Ee[fe]("transform")||"",rt=Fe.replace(_e,function(st,Qe,Lt){return[Qe,Lt].join(" ")}).split(" ");return{x:+rt[0]||1,y:+rt[1]||1}},l.setScale=function(Ee,_e,fe){var Fe=/(\bscale\(.*?\);?)/,rt=Ee.attr?"attr":"getAttribute",st=Ee.attr?"attr":"setAttribute",Qe=Ee[rt]("transform")||"";return _e=_e||1,fe=fe||1,Qe=Qe.replace(Fe,"").trim(),Qe+="scale("+_e+","+fe+")",Qe=Qe.trim(),Ee[st]("transform",Qe),Qe};var ie=/\s*sc.*/;l.setPointGroupScale=function(Ee,_e,fe){if(_e=_e||1,fe=fe||1,!!Ee){var Fe=_e===1&&fe===1?"":"scale("+_e+","+fe+")";Ee.each(function(){var rt=(this.getAttribute("transform")||"").replace(ie,"");rt+=Fe,rt=rt.trim(),this.setAttribute("transform",rt)})}};var j=/translate\([^)]*\)\s*$/;l.setTextPointsScale=function(Ee,_e,fe){Ee&&Ee.each(function(){var Fe,rt=d.select(this),st=rt.select("text");if(st.node()){var Qe=parseFloat(st.attr("x")||0),Lt=parseFloat(st.attr("y")||0),kt=(rt.attr("transform")||"").match(j);_e===1&&fe===1?Fe=[]:Fe=[a(Qe,Lt),"scale("+_e+","+fe+")",a(-Qe,-Lt)],kt&&Fe.push(kt),rt.attr("transform",Fe.join(""))}})};function ee(Ee,_e){var fe;return Ee&&(fe=Ee.mf),fe===void 0&&(fe=_e.marker&&_e.marker.standoff||0),!_e._geo&&!_e._xA?-fe:fe}l.getMarkerStandoff=ee;var re=Math.atan2,ce=Math.cos,be=Math.sin;function Ae(Ee,_e){var fe=_e[0],Fe=_e[1];return[fe*ce(Ee)-Fe*be(Ee),fe*be(Ee)+Fe*ce(Ee)]}var ze,Re,Xe,it,ot,tt;function lt(Ee,_e){var fe=Ee.ma;fe===void 0&&(fe=_e.marker.angle,(!fe||x.isArrayOrTypedArray(fe))&&(fe=0));var Fe,rt,st=_e.marker.angleref;if(st==="previous"||st==="north"){if(_e._geo){var Qe=_e._geo.project(Ee.lonlat);Fe=Qe[0],rt=Qe[1]}else{var Lt=_e._xA,kt=_e._yA;if(Lt&&kt)Fe=Lt.c2p(Ee.x),rt=kt.c2p(Ee.y);else return 90}if(_e._geo){var Vt=Ee.lonlat[0],Zt=Ee.lonlat[1],Sr=_e._geo.project([Vt,Zt+1e-5]),xr=_e._geo.project([Vt+1e-5,Zt]),jr=re(xr[1]-rt,xr[0]-Fe),wr=re(Sr[1]-rt,Sr[0]-Fe),Ir;if(st==="north")Ir=fe/180*Math.PI;else if(st==="previous"){var bt=Vt/180*Math.PI,Be=Zt/180*Math.PI,Ke=ze/180*Math.PI,Ue=Re/180*Math.PI,Me=Ke-bt,qe=ce(Ue)*be(Me),Ce=be(Ue)*ce(Be)-ce(Ue)*be(Be)*ce(Me);Ir=-re(qe,Ce)-Math.PI,ze=Vt,Re=Zt}var Te=Ae(jr,[ce(Ir),0]),Pe=Ae(wr,[be(Ir),0]);fe=re(Te[1]+Pe[1],Te[0]+Pe[0])/Math.PI*180,st==="previous"&&!(tt===_e.uid&&Ee.i===ot+1)&&(fe=null)}if(st==="previous"&&!_e._geo)if(tt===_e.uid&&Ee.i===ot+1&&M(Fe)&&M(rt)){var at=Fe-Xe,yt=rt-it,Tt=_e.line&&_e.line.shape||"",Ot=Tt.slice(Tt.length-1);Ot==="h"&&(yt=0),Ot==="v"&&(at=0),fe+=re(yt,at)/Math.PI*180+90}else fe=null}return Xe=Fe,it=rt,ot=Ee.i,tt=_e.uid,fe}l.getMarkerAngle=lt}}),Z0=Ze({"src/components/titles/index.js"(Z,q){"use strict";var d=On(),x=ns(),A=xc(),M=oo(),e=ca(),t=e.strTranslate,r=as(),o=Yn(),a=fu(),i=Zm(),n=mh().OPPOSITE_SIDE,s=/ [XY][0-9]* /,c=1.6,f=1.6;function g(v,T,l){var _=v._fullLayout,w=l.propContainer,S=l.propName,E=l.placeholder,y=l.traceIndex,b=l.avoid||{},p=l.attributes,u=l.transform,m=l.containerGroup,h=1,P=w.title,L=(P&&P.text?P.text:"").trim(),z=!1,F=P&&P.font?P.font:{},B=F.family,O=F.size,I=F.color,N=F.weight,U=F.style,W=F.variant,Q=F.textcase,ue=F.lineposition,le=F.shadow,he=l.subtitlePropName,G=!!he,$=l.subtitlePlaceholder,J=(w.title||{}).subtitle||{text:"",font:{}},X=J.text.trim(),oe=!1,ie=1,j=J.font,ee=j.family,re=j.size,ce=j.color,be=j.weight,Ae=j.style,ze=j.variant,Re=j.textcase,Xe=j.lineposition,it=j.shadow,ot;S==="title.text"?ot="titleText":S.indexOf("axis")!==-1?ot="axisTitleText":S.indexOf("colorbar")!==-1&&(ot="colorbarTitleText");var tt=v._context.edits[ot];function lt(xr,jr){return xr===void 0||jr===void 0?!1:xr.replace(s," % ")===jr.replace(s," % ")}L===""?h=0:lt(L,E)&&(tt||(L=""),h=.2,z=!0),G&&(X===""?ie=0:lt(X,$)&&(tt||(X=""),ie=.2,oe=!0)),l._meta?L=e.templateString(L,l._meta):_._meta&&(L=e.templateString(L,_._meta));var Ee=L||X||tt,_e;m||(m=e.ensureSingle(_._infolayer,"g","g-"+T),_e=_._hColorbarMoveTitle);var fe=m.selectAll("text."+T).data(Ee?[0]:[]);fe.enter().append("text"),fe.text(L).attr("class",T),fe.exit().remove();var Fe=null,rt=T+"-subtitle",st=X||tt;if(G&&st&&(Fe=m.selectAll("text."+rt).data(st?[0]:[]),Fe.enter().append("text"),Fe.text(X).attr("class",rt),Fe.exit().remove()),!Ee)return m;function Qe(xr,jr){e.syncOrAsync([Lt,kt],{title:xr,subtitle:jr})}function Lt(xr){var jr=xr.title,wr=xr.subtitle,Ir;!u&&_e&&(u={}),u?(Ir="",u.rotate&&(Ir+="rotate("+[u.rotate,p.x,p.y]+")"),(u.offset||_e)&&(Ir+=t(0,(u.offset||0)-(_e||0)))):Ir=null,jr.attr("transform",Ir);function bt(Ce){if(Ce){var Te=d.select(Ce.node().parentNode).select("."+rt);if(!Te.empty()){var Pe=Ce.node().getBBox();if(Pe.height){var at=Pe.y+Pe.height+c*re;Te.attr("y",at)}}}}if(jr.style("opacity",h*o.opacity(I)).call(r.font,{color:o.rgb(I),size:d.round(O,2),family:B,weight:N,style:U,variant:W,textcase:Q,shadow:le,lineposition:ue}).attr(p).call(a.convertToTspans,v,bt),wr){var Be=m.select("."+T+"-math-group"),Ke=jr.node().getBBox(),Ue=Be.node()?Be.node().getBBox():void 0,Me=Ue?Ue.y+Ue.height+c*re:Ke.y+Ke.height+f*re,qe=e.extendFlat({},p,{y:Me});wr.attr("transform",Ir),wr.style("opacity",ie*o.opacity(ce)).call(r.font,{color:o.rgb(ce),size:d.round(re,2),family:ee,weight:be,style:Ae,variant:ze,textcase:Re,shadow:it,lineposition:Xe}).attr(qe).call(a.convertToTspans,v)}return A.previousPromises(v)}function kt(xr){var jr=xr.title,wr=d.select(jr.node().parentNode);if(b&&b.selection&&b.side&&L){wr.attr("transform",null);var Ir=n[b.side],bt=b.side==="left"||b.side==="top"?-1:1,Be=x(b.pad)?b.pad:2,Ke=r.bBox(wr.node()),Ue={t:0,b:0,l:0,r:0},Me=v._fullLayout._reservedMargin;for(var qe in Me)for(var Ce in Me[qe]){var Te=Me[qe][Ce];Ue[Ce]=Math.max(Ue[Ce],Te)}var Pe={left:Ue.l,top:Ue.t,right:_.width-Ue.r,bottom:_.height-Ue.b},at=b.maxShift||bt*(Pe[b.side]-Ke[b.side]),yt=0;if(at<0)yt=at;else{var Tt=b.offsetLeft||0,Ot=b.offsetTop||0;Ke.left-=Tt,Ke.right-=Tt,Ke.top-=Ot,Ke.bottom-=Ot,b.selection.each(function(){var rr=r.bBox(this);e.bBoxIntersect(Ke,rr,Be)&&(yt=Math.max(yt,bt*(rr[b.side]-Ke[Ir])+Be))}),yt=Math.min(at,yt),w._titleScoot=Math.abs(yt)}if(yt>0||at<0){var Gt={left:[-yt,0],right:[yt,0],top:[0,-yt],bottom:[0,yt]}[b.side];wr.attr("transform",t(Gt[0],Gt[1]))}}}fe.call(Qe,Fe);function Vt(xr,jr){xr.text(jr).on("mouseover.opacity",function(){d.select(this).transition().duration(i.SHOW_PLACEHOLDER).style("opacity",1)}).on("mouseout.opacity",function(){d.select(this).transition().duration(i.HIDE_PLACEHOLDER).style("opacity",0)})}if(tt&&(L?fe.on(".opacity",null):(Vt(fe,E),z=!0),fe.call(a.makeEditable,{gd:v}).on("edit",function(xr){y!==void 0?M.call("_guiRestyle",v,S,xr,y):M.call("_guiRelayout",v,S,xr)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(Qe)}).on("input",function(xr){this.text(xr||" ").call(a.positionText,p.x,p.y)}),G)){if(G&&!L){var Zt=fe.node().getBBox(),Sr=Zt.y+Zt.height+f*re;Fe.attr("y",Sr)}X?Fe.on(".opacity",null):(Vt(Fe,$),oe=!0),Fe.call(a.makeEditable,{gd:v}).on("edit",function(xr){M.call("_guiRelayout",v,"title.subtitle.text",xr)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(Qe)}).on("input",function(xr){this.text(xr||" ").call(a.positionText,Fe.attr("x"),Fe.attr("y"))})}return fe.classed("js-placeholder",z),Fe&&Fe.classed("js-placeholder",oe),m}q.exports={draw:g,SUBTITLE_PADDING_EM:f,SUBTITLE_PADDING_MATHJAX_EM:c}}}),wv=Ze({"src/plots/cartesian/set_convert.js"(Z,q){"use strict";var d=On(),x=jp().utcFormat,A=ca(),M=A.numberFormat,e=ns(),t=A.cleanNumber,r=A.ms2DateTime,o=A.dateTime2ms,a=A.ensureNumber,i=A.isArrayOrTypedArray,n=qs(),s=n.FP_SAFE,c=n.BADNUM,f=n.LOG_CLIP,g=n.ONEWEEK,v=n.ONEDAY,T=n.ONEHOUR,l=n.ONEMIN,_=n.ONESEC,w=$c(),S=kh(),E=S.HOUR_PATTERN,y=S.WEEKDAY_PATTERN;function b(u){return Math.pow(10,u)}function p(u){return u!=null}q.exports=function(m,h){h=h||{};var P=m._id||"x",L=P.charAt(0);function z(X,oe){if(X>0)return Math.log(X)/Math.LN10;if(X<=0&&oe&&m.range&&m.range.length===2){var ie=m.range[0],j=m.range[1];return .5*(ie+j-2*f*Math.abs(ie-j))}else return c}function F(X,oe,ie,j){if((j||{}).msUTC&&e(X))return+X;var ee=o(X,ie||m.calendar);if(ee===c)if(e(X)){X=+X;var re=Math.floor(A.mod(X+.05,1)*10),ce=Math.round(X-re/10);ee=o(new Date(ce))+re/10}else return c;return ee}function B(X,oe,ie){return r(X,oe,ie||m.calendar)}function O(X){return m._categories[Math.round(X)]}function I(X){if(p(X)){if(m._categoriesMap===void 0&&(m._categoriesMap={}),m._categoriesMap[X]!==void 0)return m._categoriesMap[X];m._categories.push(typeof X=="number"?String(X):X);var oe=m._categories.length-1;return m._categoriesMap[X]=oe,oe}return c}function N(X,oe){for(var ie=new Array(oe),j=0;jm.range[1]&&(ie=!ie);for(var j=ie?-1:1,ee=j*X,re=0,ce=0;ceAe)re=ce+1;else{re=ee<(be+Ae)/2?ce:ce+1;break}}var ze=m._B[re]||0;return isFinite(ze)?ue(X,m._m2,ze):0},G=function(X){var oe=m._rangebreaks.length;if(!oe)return le(X,m._m,m._b);for(var ie=0,j=0;jm._rangebreaks[j].pmax&&(ie=j+1);return le(X,m._m2,m._B[ie])}}m.c2l=m.type==="log"?z:a,m.l2c=m.type==="log"?b:a,m.l2p=he,m.p2l=G,m.c2p=m.type==="log"?function(X,oe){return he(z(X,oe))}:he,m.p2c=m.type==="log"?function(X){return b(G(X))}:G,["linear","-"].indexOf(m.type)!==-1?(m.d2r=m.r2d=m.d2c=m.r2c=m.d2l=m.r2l=t,m.c2d=m.c2r=m.l2d=m.l2r=a,m.d2p=m.r2p=function(X){return m.l2p(t(X))},m.p2d=m.p2r=G,m.cleanPos=a):m.type==="log"?(m.d2r=m.d2l=function(X,oe){return z(t(X),oe)},m.r2d=m.r2c=function(X){return b(t(X))},m.d2c=m.r2l=t,m.c2d=m.l2r=a,m.c2r=z,m.l2d=b,m.d2p=function(X,oe){return m.l2p(m.d2r(X,oe))},m.p2d=function(X){return b(G(X))},m.r2p=function(X){return m.l2p(t(X))},m.p2r=G,m.cleanPos=a):m.type==="date"?(m.d2r=m.r2d=A.identity,m.d2c=m.r2c=m.d2l=m.r2l=F,m.c2d=m.c2r=m.l2d=m.l2r=B,m.d2p=m.r2p=function(X,oe,ie){return m.l2p(F(X,0,ie))},m.p2d=m.p2r=function(X,oe,ie){return B(G(X),oe,ie)},m.cleanPos=function(X){return A.cleanDate(X,c,m.calendar)}):m.type==="category"?(m.d2c=m.d2l=I,m.r2d=m.c2d=m.l2d=O,m.d2r=m.d2l_noadd=W,m.r2c=function(X){var oe=Q(X);return oe!==void 0?oe:m.fraction2r(.5)},m.l2r=m.c2r=a,m.r2l=Q,m.d2p=function(X){return m.l2p(m.r2c(X))},m.p2d=function(X){return O(G(X))},m.r2p=m.d2p,m.p2r=G,m.cleanPos=function(X){return typeof X=="string"&&X!==""?X:a(X)}):m.type==="multicategory"&&(m.r2d=m.c2d=m.l2d=O,m.d2r=m.d2l_noadd=W,m.r2c=function(X){var oe=W(X);return oe!==void 0?oe:m.fraction2r(.5)},m.r2c_just_indices=U,m.l2r=m.c2r=a,m.r2l=W,m.d2p=function(X){return m.l2p(m.r2c(X))},m.p2d=function(X){return O(G(X))},m.r2p=m.d2p,m.p2r=G,m.cleanPos=function(X){return Array.isArray(X)||typeof X=="string"&&X!==""?X:a(X)},m.setupMultiCategory=function(X){var oe=m._traceIndices,ie,j,ee=m._matchGroup;if(ee&&m._categories.length===0){for(var re in ee)if(re!==P){var ce=h[w.id2name(re)];oe=oe.concat(ce._traceIndices)}}var be=[[0,{}],[0,{}]],Ae=[];for(ie=0;iece[1]&&(j[re?0:1]=ie),j[0]===j[1]){var be=m.l2r(oe),Ae=m.l2r(ie);if(oe!==void 0){var ze=be+1;ie!==void 0&&(ze=Math.min(ze,Ae)),j[re?1:0]=ze}if(ie!==void 0){var Re=Ae+1;oe!==void 0&&(Re=Math.max(Re,be)),j[re?0:1]=Re}}}},m.cleanRange=function(X,oe){m._cleanRange(X,oe),m.limitRange(X)},m._cleanRange=function(X,oe){oe||(oe={}),X||(X="range");var ie=A.nestedProperty(m,X).get(),j,ee;if(m.type==="date"?ee=A.dfltRange(m.calendar):L==="y"?ee=S.DFLTRANGEY:m._name==="realaxis"?ee=[0,1]:ee=oe.dfltRange||S.DFLTRANGEX,ee=ee.slice(),(m.rangemode==="tozero"||m.rangemode==="nonnegative")&&(ee[0]=0),!ie||ie.length!==2){A.nestedProperty(m,X).set(ee);return}var re=ie[0]===null,ce=ie[1]===null;for(m.type==="date"&&!m.autorange&&(ie[0]=A.cleanDate(ie[0],c,m.calendar),ie[1]=A.cleanDate(ie[1],c,m.calendar)),j=0;j<2;j++)if(m.type==="date"){if(!A.isDateTime(ie[j],m.calendar)){m[X]=ee;break}if(m.r2l(ie[0])===m.r2l(ie[1])){var be=A.constrain(m.r2l(ie[0]),A.MIN_MS+1e3,A.MAX_MS-1e3);ie[0]=m.l2r(be-1e3),ie[1]=m.l2r(be+1e3);break}}else{if(!e(ie[j]))if(!(re||ce)&&e(ie[1-j]))ie[j]=ie[1-j]*(j?10:.1);else{m[X]=ee;break}if(ie[j]<-s?ie[j]=-s:ie[j]>s&&(ie[j]=s),ie[0]===ie[1]){var Ae=Math.max(1,Math.abs(ie[0]*1e-6));ie[0]-=Ae,ie[1]+=Ae}}},m.setScale=function(X){var oe=h._size;if(m.overlaying){var ie=w.getFromId({_fullLayout:h},m.overlaying);m.domain=ie.domain}var j=X&&m._r?"_r":"range",ee=m.calendar;m.cleanRange(j);var re=m.r2l(m[j][0],ee),ce=m.r2l(m[j][1],ee),be=L==="y";if(be?(m._offset=oe.t+(1-m.domain[1])*oe.h,m._length=oe.h*(m.domain[1]-m.domain[0]),m._m=m._length/(re-ce),m._b=-m._m*ce):(m._offset=oe.l+m.domain[0]*oe.w,m._length=oe.w*(m.domain[1]-m.domain[0]),m._m=m._length/(ce-re),m._b=-m._m*re),m._rangebreaks=[],m._lBreaks=0,m._m2=0,m._B=[],m.rangebreaks){var Ae,ze;if(m._rangebreaks=m.locateBreaks(Math.min(re,ce),Math.max(re,ce)),m._rangebreaks.length){for(Ae=0;Aece&&(Re=!Re),Re&&m._rangebreaks.reverse();var Xe=Re?-1:1;for(m._m2=Xe*m._length/(Math.abs(ce-re)-m._lBreaks),m._B.push(-m._m2*(be?ce:re)),Ae=0;Aeee&&(ee+=7,reee&&(ee+=24,re=j&&re=j&&X=Qe.min&&(feQe.max&&(Qe.max=Fe),rt=!1)}rt&&ce.push({min:fe,max:Fe})}};for(ie=0;ie_*2}function n(f){return Math.max(1,(f-1)/1e3)}function s(f,g){for(var v=f.length,T=n(v),l=0,_=0,w={},S=0;Sl*2}function c(f){return M(f[0])&&M(f[1])}}}),Yd=Ze({"src/plots/cartesian/autorange.js"(Z,q){"use strict";var d=On(),x=ns(),A=ca(),M=qs().FP_SAFE,e=oo(),t=as(),r=$c(),o=r.getFromId,a=r.isLinked;q.exports={applyAutorangeOptions:m,getAutoRange:i,makePadFn:s,doAutoRange:v,findExtremes:T,concatExtremes:g};function i(h,P){var L,z,F=[],B=h._fullLayout,O=s(B,P,0),I=s(B,P,1),N=g(h,P),U=N.min,W=N.max;if(U.length===0||W.length===0)return A.simpleMap(P.range,P.r2l);var Q=U[0].val,ue=W[0].val;for(L=1;L0&&(Ae=oe-O(ee)-I(re),Ae>ie?ze/Ae>j&&(ce=ee,be=re,j=ze/Ae):ze/oe>j&&(ce={val:ee.val,nopad:1},be={val:re.val,nopad:1},j=ze/oe));function Re(lt,Ee){return Math.max(lt,I(Ee))}if(Q===ue){var Xe=Q-1,it=Q+1;if(J)if(Q===0)F=[0,1];else{var ot=(Q>0?W:U).reduce(Re,0),tt=Q/(1-Math.min(.5,ot/oe));F=Q>0?[0,tt]:[tt,0]}else X?F=[Math.max(0,Xe),Math.max(1,it)]:F=[Xe,it]}else J?(ce.val>=0&&(ce={val:0,nopad:1}),be.val<=0&&(be={val:0,nopad:1})):X&&(ce.val-j*O(ce)<0&&(ce={val:0,nopad:1}),be.val<=0&&(be={val:1,nopad:1})),j=(be.val-ce.val-n(P,ee.val,re.val))/(oe-O(ce)-I(be)),F=[ce.val-j*O(ce),be.val+j*I(be)];return F=m(F,P),P.limitRange&&P.limitRange(),he&&F.reverse(),A.simpleMap(F,P.l2r||Number)}function n(h,P,L){var z=0;if(h.rangebreaks)for(var F=h.locateBreaks(P,L),B=0;B0?L.ppadplus:L.ppadminus)||L.ppad||0),ee=ie((h._m>0?L.ppadminus:L.ppadplus)||L.ppad||0),re=ie(L.vpadplus||L.vpad),ce=ie(L.vpadminus||L.vpad);if(!U){if(X=1/0,oe=-1/0,N)for(Q=0;Q0&&(X=ue),ue>oe&&ue-M&&(X=ue),ue>oe&&ue=ze;Q--)Ae(Q);return{min:z,max:F,opts:L}}function l(h,P,L,z){w(h,P,L,z,E)}function _(h,P,L,z){w(h,P,L,z,y)}function w(h,P,L,z,F){for(var B=z.tozero,O=z.extrapad,I=!0,N=0;N=L&&(U.extrapad||!O)){I=!1;break}else F(P,U.val)&&U.pad<=L&&(O||!U.extrapad)&&(h.splice(N,1),N--)}if(I){var W=B&&P===0;h.push({val:P,pad:W?0:L,extrapad:W?!1:O})}}function S(h){return x(h)&&Math.abs(h)=P}function b(h,P){var L=P.autorangeoptions;return L&&L.minallowed!==void 0&&u(P,L.minallowed,L.maxallowed)?L.minallowed:L&&L.clipmin!==void 0&&u(P,L.clipmin,L.clipmax)?Math.max(h,P.d2l(L.clipmin)):h}function p(h,P){var L=P.autorangeoptions;return L&&L.maxallowed!==void 0&&u(P,L.minallowed,L.maxallowed)?L.maxallowed:L&&L.clipmax!==void 0&&u(P,L.clipmin,L.clipmax)?Math.min(h,P.d2l(L.clipmax)):h}function u(h,P,L){return P!==void 0&&L!==void 0?(P=h.d2l(P),L=h.d2l(L),P=N&&(B=N,L=N),O<=N&&(O=N,z=N)}}return L=b(L,P),z=p(z,P),[L,z]}}}),Wo=Ze({"src/plots/cartesian/axes.js"(Z,q){"use strict";var d=On(),x=ns(),A=xc(),M=oo(),e=ca(),t=e.strTranslate,r=fu(),o=Z0(),a=Yn(),i=as(),n=Wh(),s=l5(),c=qs(),f=c.ONEMAXYEAR,g=c.ONEAVGYEAR,v=c.ONEMINYEAR,T=c.ONEMAXQUARTER,l=c.ONEAVGQUARTER,_=c.ONEMINQUARTER,w=c.ONEMAXMONTH,S=c.ONEAVGMONTH,E=c.ONEMINMONTH,y=c.ONEWEEK,b=c.ONEDAY,p=b/2,u=c.ONEHOUR,m=c.ONEMIN,h=c.ONESEC,P=c.ONEMILLI,L=c.ONEMICROSEC,z=c.MINUS_SIGN,F=c.BADNUM,B={K:"zeroline"},O={K:"gridline",L:"path"},I={K:"minor-gridline",L:"path"},N={K:"tick",L:"path"},U={K:"tick",L:"text"},W={width:["x","r","l","xl","xr"],height:["y","t","b","yt","yb"],right:["r","xr"],left:["l","xl"],top:["t","yt"],bottom:["b","yb"]},Q=mh(),ue=Q.MID_SHIFT,le=Q.CAP_SHIFT,he=Q.LINE_SPACING,G=Q.OPPOSITE_SIDE,$=3,J=q.exports={};J.setConvert=wv();var X=a1(),oe=$c(),ie=oe.idSort,j=oe.isLinked;J.id2name=oe.id2name,J.name2id=oe.name2id,J.cleanId=oe.cleanId,J.list=oe.list,J.listIds=oe.listIds,J.getFromId=oe.getFromId,J.getFromTrace=oe.getFromTrace;var ee=Yd();J.getAutoRange=ee.getAutoRange,J.findExtremes=ee.findExtremes;var re=1e-4;function ce(xt){var ct=(xt[1]-xt[0])*re;return[xt[0]-ct,xt[1]+ct]}J.coerceRef=function(xt,ct,Nr,Or,Rr,Lr){var Gr=Or.charAt(Or.length-1),Kr=Nr._fullLayout._subplots[Gr+"axis"],Ur=Or+"ref",aa={};return Rr||(Rr=Kr[0]||(typeof Lr=="string"?Lr:Lr[0])),Lr||(Lr=Rr),Kr=Kr.concat(Kr.map(function(da){return da+" domain"})),aa[Ur]={valType:"enumerated",values:Kr.concat(Lr?typeof Lr=="string"?[Lr]:Lr:[]),dflt:Rr},e.coerce(xt,ct,aa,Ur)},J.getRefType=function(xt){return xt===void 0?xt:xt==="paper"?"paper":xt==="pixel"?"pixel":/( domain)$/.test(xt)?"domain":"range"},J.coercePosition=function(xt,ct,Nr,Or,Rr,Lr){var Gr,Kr,Ur=J.getRefType(Or);if(Ur!=="range")Gr=e.ensureNumber,Kr=Nr(Rr,Lr);else{var aa=J.getFromId(ct,Or);Lr=aa.fraction2r(Lr),Kr=Nr(Rr,Lr),Gr=aa.cleanPos}xt[Rr]=Gr(Kr)},J.cleanPosition=function(xt,ct,Nr){var Or=Nr==="paper"||Nr==="pixel"?e.ensureNumber:J.getFromId(ct,Nr).cleanPos;return Or(xt)},J.redrawComponents=function(xt,ct){ct=ct||J.listIds(xt);var Nr=xt._fullLayout;function Or(Rr,Lr,Gr,Kr){for(var Ur=M.getComponentMethod(Rr,Lr),aa={},da=0;da2e-6||((Nr-xt._forceTick0)/xt._minDtick%1+1.000001)%1>2e-6)&&(xt._minDtick=0))},J.saveRangeInitial=function(xt,ct){for(var Nr=J.list(xt,"",!0),Or=!1,Rr=0;Rrfa*.3||aa(Or)||aa(Rr))){var It=Nr.dtick/2;xt+=xt+ItGr){var Kr=Number(Nr.substr(1));Lr.exactYears>Gr&&Kr%12===0?xt=J.tickIncrement(xt,"M6","reverse")+b*1.5:Lr.exactMonths>Gr?xt=J.tickIncrement(xt,"M1","reverse")+b*15.5:xt-=p;var Ur=J.tickIncrement(xt,Nr);if(Ur<=Or)return Ur}return xt}J.prepMinorTicks=function(xt,ct,Nr){if(!ct.minor.dtick){delete xt.dtick;var Or=ct.dtick&&x(ct._tmin),Rr;if(Or){var Lr=J.tickIncrement(ct._tmin,ct.dtick,!0);Rr=[ct._tmin,Lr*.99+ct._tmin*.01]}else{var Gr=e.simpleMap(ct.range,ct.r2l);Rr=[Gr[0],.8*Gr[0]+.2*Gr[1]]}if(xt.range=e.simpleMap(Rr,ct.l2r),xt._isMinor=!0,J.prepTicks(xt,Nr),Or){var Kr=x(ct.dtick),Ur=x(xt.dtick),aa=Kr?ct.dtick:+ct.dtick.substring(1),da=Ur?xt.dtick:+xt.dtick.substring(1);Kr&&Ur?it(aa,da)?aa===2*y&&da===2*b&&(xt.dtick=y):aa===2*y&&da===3*b?xt.dtick=y:aa===y&&!(ct._input.minor||{}).nticks?xt.dtick=b:ot(aa/da,2.5)?xt.dtick=aa/2:xt.dtick=aa:String(ct.dtick).charAt(0)==="M"?Ur?xt.dtick="M1":it(aa,da)?aa>=12&&da===2&&(xt.dtick="M3"):xt.dtick=ct.dtick:String(xt.dtick).charAt(0)==="L"?String(ct.dtick).charAt(0)==="L"?it(aa,da)||(xt.dtick=ot(aa/da,2.5)?ct.dtick/2:ct.dtick):xt.dtick="D1":xt.dtick==="D2"&&+ct.dtick>1&&(xt.dtick=1)}xt.range=ct.range}ct.minor._tick0Init===void 0&&(xt.tick0=ct.tick0)};function it(xt,ct){return Math.abs((xt/ct+.5)%1-.5)<.001}function ot(xt,ct){return Math.abs(xt/ct-1)<.001}J.prepTicks=function(xt,ct){var Nr=e.simpleMap(xt.range,xt.r2l,void 0,void 0,ct);if(xt.tickmode==="auto"||!xt.dtick){var Or=xt.nticks,Rr;Or||(xt.type==="category"||xt.type==="multicategory"?(Rr=xt.tickfont?e.bigFont(xt.tickfont.size||12):15,Or=xt._length/Rr):(Rr=xt._id.charAt(0)==="y"?40:80,Or=e.constrain(xt._length/Rr,4,9)+1),xt._name==="radialaxis"&&(Or*=2)),xt.minor&&xt.minor.tickmode!=="array"||xt.tickmode==="array"&&(Or*=100),xt._roughDTick=Math.abs(Nr[1]-Nr[0])/Or,J.autoTicks(xt,xt._roughDTick),xt._minDtick>0&&xt.dtick0?(Lr=Or-1,Gr=Or):(Lr=Or,Gr=Or);var Kr=xt[Lr].value,Ur=xt[Gr].value,aa=Math.abs(Ur-Kr),da=Nr||aa,fa=0;da>=v?aa>=v&&aa<=f?fa=aa:fa=g:Nr===l&&da>=_?aa>=_&&aa<=T?fa=aa:fa=l:da>=E?aa>=E&&aa<=w?fa=aa:fa=S:Nr===y&&da>=y?fa=y:da>=b?fa=b:Nr===p&&da>=p?fa=p:Nr===u&&da>=u&&(fa=u);var It;fa>=aa&&(fa=aa,It=!0);var dr=Rr+fa;if(ct.rangebreaks&&fa>0){for(var kr=84,ia=0,Ca=0;Cay&&(fa=aa)}(fa>0||Or===0)&&(xt[Or].periodX=Rr+fa/2)}}J.calcTicks=function(ct,Nr){for(var Or=ct.type,Rr=ct.calendar,Lr=ct.ticklabelstep,Gr=ct.ticklabelmode==="period",Kr=ct.range[0]>ct.range[1],Ur=!ct.ticklabelindex||e.isArrayOrTypedArray(ct.ticklabelindex)?ct.ticklabelindex:[ct.ticklabelindex],aa=e.simpleMap(ct.range,ct.r2l,void 0,void 0,Nr),da=aa[1]=(ha?0:1);Da--){var Xi=!Da;Da?(ct._dtickInit=ct.dtick,ct._tick0Init=ct.tick0):(ct.minor._dtickInit=ct.minor.dtick,ct.minor._tick0Init=ct.minor.tick0);var Li=Da?ct:e.extendFlat({},ct,ct.minor);if(Xi?J.prepMinorTicks(Li,ct,Nr):J.prepTicks(Li,Nr),Li.tickmode==="array"){Da?(Ca=[],kr=Fe(ct,!Xi)):(Fa=[],ia=Fe(ct,!Xi));continue}if(Li.tickmode==="sync"){Ca=[],kr=fe(ct);continue}var fn=ce(aa),An=fn[0],kn=fn[1],zn=x(Li.dtick),Xn=Or==="log"&&!(zn||Li.dtick.charAt(0)==="L"),to=J.tickFirst(Li,Nr);if(Da){if(ct._tmin=to,to=kn:pn<=kn;pn=J.tickIncrement(pn,Ts,da,Rr)){if(Da&&Jo++,Li.rangebreaks&&!da){if(pn=It)break}if(Ca.length>dr||pn===mo)break;mo=pn;var Po={value:pn};Da?(Xn&&pn!==(pn|0)&&(Po.simpleLabel=!0),Lr>1&&Jo%Lr&&(Po.skipLabel=!0),Ca.push(Po)):(Po.minor=!0,Fa.push(Po))}}if(!Fa||Fa.length<2)Ur=!1;else{var so=(Fa[1].value-Fa[0].value)*(Kr?-1:1);mi(so,ct.tickformat)||(Ur=!1)}if(!Ur)Ya=Ca;else{var Vn=Ca.concat(Fa);Gr&&Ca.length&&(Vn=Vn.slice(1)),Vn=Vn.sort(function(ro,As){return ro.value-As.value}).filter(function(ro,As,al){return As===0||ro.value!==al[As-1].value});var To=Vn.map(function(ro,As){return ro.minor===void 0&&!ro.skipLabel?As:null}).filter(function(ro){return ro!==null});To.forEach(function(ro){Ur.map(function(As){var al=ro+As;al>=0&&al-1;Ui--){if(Ca[Ui].drop){Ca.splice(Ui,1);continue}Ca[Ui].value=ra(Ca[Ui].value,ct);var uo=ct.c2p(Ca[Ui].value);(Cn?Bs>uo-tl:BsIt||$nIt&&(al.periodX=It),$nRr&&Itg)ct/=g,Or=Rr(10),xt.dtick="M"+12*Sr(ct,Or,rt);else if(Lr>S)ct/=S,xt.dtick="M"+Sr(ct,1,st);else if(Lr>b){if(xt.dtick=Sr(ct,b,xt._hasDayOfWeekBreaks?[1,2,7,14]:Lt),!Nr){var Gr=J.getTickFormat(xt),Kr=xt.ticklabelmode==="period";Kr&&(xt._rawTick0=xt.tick0),/%[uVW]/.test(Gr)?xt.tick0=e.dateTick0(xt.calendar,2):xt.tick0=e.dateTick0(xt.calendar,1),Kr&&(xt._dowTick0=xt.tick0)}}else Lr>u?xt.dtick=Sr(ct,u,st):Lr>m?xt.dtick=Sr(ct,m,Qe):Lr>h?xt.dtick=Sr(ct,h,Qe):(Or=Rr(10),xt.dtick=Sr(ct,Or,rt))}else if(xt.type==="log"){xt.tick0=0;var Ur=e.simpleMap(xt.range,xt.r2l);if(xt._isMinor&&(ct*=1.5),ct>.7)xt.dtick=Math.ceil(ct);else if(Math.abs(Ur[1]-Ur[0])<1){var aa=1.5*Math.abs((Ur[1]-Ur[0])/ct);ct=Math.abs(Math.pow(10,Ur[1])-Math.pow(10,Ur[0]))/aa,Or=Rr(10),xt.dtick="L"+Sr(ct,Or,rt)}else xt.dtick=ct>.3?"D2":"D1"}else xt.type==="category"||xt.type==="multicategory"?(xt.tick0=0,xt.dtick=Math.ceil(Math.max(ct,1))):ma(xt)?(xt.tick0=0,Or=1,xt.dtick=Sr(ct,Or,Zt)):(xt.tick0=0,Or=Rr(10),xt.dtick=Sr(ct,Or,rt));if(xt.dtick===0&&(xt.dtick=1),!x(xt.dtick)&&typeof xt.dtick!="string"){var da=xt.dtick;throw xt.dtick=1,"ax.dtick error: "+String(da)}};function xr(xt){var ct=xt.dtick;if(xt._tickexponent=0,!x(ct)&&typeof ct!="string"&&(ct=1),(xt.type==="category"||xt.type==="multicategory")&&(xt._tickround=null),xt.type==="date"){var Nr=xt.r2l(xt.tick0),Or=xt.l2r(Nr).replace(/(^-|i)/g,""),Rr=Or.length;if(String(ct).charAt(0)==="M")Rr>10||Or.substr(5)!=="01-01"?xt._tickround="d":xt._tickround=+ct.substr(1)%12===0?"y":"m";else if(ct>=b&&Rr<=10||ct>=b*15)xt._tickround="d";else if(ct>=m&&Rr<=16||ct>=u)xt._tickround="M";else if(ct>=h&&Rr<=19||ct>=m)xt._tickround="S";else{var Lr=xt.l2r(Nr+ct).replace(/^-/,"").length;xt._tickround=Math.max(Rr,Lr)-20,xt._tickround<0&&(xt._tickround=4)}}else if(x(ct)||ct.charAt(0)==="L"){var Gr=xt.range.map(xt.r2d||Number);x(ct)||(ct=Number(ct.substr(1))),xt._tickround=2-Math.floor(Math.log(ct)/Math.LN10+.01);var Kr=Math.max(Math.abs(Gr[0]),Math.abs(Gr[1])),Ur=Math.floor(Math.log(Kr)/Math.LN10+.01),aa=xt.minexponent===void 0?3:xt.minexponent;Math.abs(Ur)>aa&&(Ce(xt.exponentformat)&&!Te(Ur)?xt._tickexponent=3*Math.round((Ur-1)/3):xt._tickexponent=Ur)}else xt._tickround=null}J.tickIncrement=function(xt,ct,Nr,Or){var Rr=Nr?-1:1;if(x(ct))return e.increment(xt,Rr*ct);var Lr=ct.charAt(0),Gr=Rr*Number(ct.substr(1));if(Lr==="M")return e.incrementMonth(xt,Gr,Or);if(Lr==="L")return Math.log(Math.pow(10,xt)+Gr)/Math.LN10;if(Lr==="D"){var Kr=ct==="D2"?Vt:kt,Ur=xt+Rr*.01,aa=e.roundUp(e.mod(Ur,1),Kr,Nr);return Math.floor(Ur)+Math.log(d.round(Math.pow(10,aa),1))/Math.LN10}throw"unrecognized dtick "+String(ct)},J.tickFirst=function(xt,ct){var Nr=xt.r2l||Number,Or=e.simpleMap(xt.range,Nr,void 0,void 0,ct),Rr=Or[1]=0&&Fa<=xt._length?Ca:null};if(Lr&&e.isArrayOrTypedArray(xt.ticktext)){var fa=e.simpleMap(xt.range,xt.r2l),It=(Math.abs(fa[1]-fa[0])-(xt._lBreaks||0))/1e4;for(aa=0;aa"+Kr;else{var aa=Ia(xt),da=xt._trueSide||xt.side;(!aa&&da==="top"||aa&&da==="bottom")&&(Gr+="
")}ct.text=Gr}function Ir(xt,ct,Nr,Or,Rr){var Lr=xt.dtick,Gr=ct.x,Kr=xt.tickformat,Ur=typeof Lr=="string"&&Lr.charAt(0);if(Rr==="never"&&(Rr=""),Or&&Ur!=="L"&&(Lr="L3",Ur="L"),Kr||Ur==="L")ct.text=Pe(Math.pow(10,Gr),xt,Rr,Or);else if(x(Lr)||Ur==="D"&&(xt.minorloglabels==="complete"||e.mod(Gr+.01,1)<.1)){var aa;xt.minorloglabels==="complete"&&!(e.mod(Gr+.01,1)<.1)&&(aa=!0,ct.fontSize*=.75);var da=Math.pow(10,Gr).toExponential(0),fa=da.split("e"),It=+fa[1],dr=Math.abs(It),kr=xt.exponentformat;kr==="power"||Ce(kr)&&Te(It)?(ct.text=fa[0],dr>0&&(ct.text+="x10"),ct.text==="1x10"&&(ct.text="10"),It!==0&&It!==1&&(ct.text+=""+(It>0?"":z)+dr+""),ct.fontSize*=1.25):(kr==="e"||kr==="E")&&dr>2?ct.text=fa[0]+kr+(It>0?"+":z)+dr:(ct.text=Pe(Math.pow(10,Gr),xt,"","fakehover"),Lr==="D1"&&xt._id.charAt(0)==="y"&&(ct.dy-=ct.fontSize/6))}else if(Ur==="D")ct.text=xt.minorloglabels==="none"?"":String(Math.round(Math.pow(10,e.mod(Gr,1)))),ct.fontSize*=.75;else throw"unrecognized dtick "+String(Lr);if(xt.dtick==="D1"){var ia=String(ct.text).charAt(0);(ia==="0"||ia==="1")&&(xt._id.charAt(0)==="y"?ct.dx-=ct.fontSize/4:(ct.dy+=ct.fontSize/2,ct.dx+=(xt.range[1]>xt.range[0]?1:-1)*ct.fontSize*(Gr<0?.5:.25)))}}function bt(xt,ct){var Nr=xt._categories[Math.round(ct.x)];Nr===void 0&&(Nr=""),ct.text=String(Nr)}function Be(xt,ct,Nr){var Or=Math.round(ct.x),Rr=xt._categories[Or]||[],Lr=Rr[1]===void 0?"":String(Rr[1]),Gr=Rr[0]===void 0?"":String(Rr[0]);Nr?ct.text=Gr+" - "+Lr:(ct.text=Lr,ct.text2=Gr)}function Ke(xt,ct,Nr,Or,Rr){Rr==="never"?Rr="":xt.showexponent==="all"&&Math.abs(ct.x/xt.dtick)<1e-6&&(Rr="hide"),ct.text=Pe(ct.x,xt,Rr,Or)}function Ue(xt,ct,Nr,Or,Rr){if(xt.thetaunit==="radians"&&!Nr){var Lr=ct.x/180;if(Lr===0)ct.text="0";else{var Gr=Me(Lr);if(Gr[1]>=100)ct.text=Pe(e.deg2rad(ct.x),xt,Rr,Or);else{var Kr=ct.x<0;Gr[1]===1?Gr[0]===1?ct.text="\u03C0":ct.text=Gr[0]+"\u03C0":ct.text=["",Gr[0],"","\u2044","",Gr[1],"","\u03C0"].join(""),Kr&&(ct.text=z+ct.text)}}}else ct.text=Pe(ct.x,xt,Rr,Or)}function Me(xt){function ct(Kr,Ur){return Math.abs(Kr-Ur)<=1e-6}function Nr(Kr,Ur){return ct(Ur,0)?Kr:Nr(Ur,Kr%Ur)}function Or(Kr){for(var Ur=1;!ct(Math.round(Kr*Ur)/Ur,Kr);)Ur*=10;return Ur}var Rr=Or(xt),Lr=xt*Rr,Gr=Math.abs(Nr(Lr,Rr));return[Math.round(Lr/Gr),Math.round(Rr/Gr)]}var qe=["f","p","n","\u03BC","m","","k","M","G","T"];function Ce(xt){return xt==="SI"||xt==="B"}function Te(xt){return xt>14||xt<-15}function Pe(xt,ct,Nr,Or){var Rr=xt<0,Lr=ct._tickround,Gr=Nr||ct.exponentformat||"B",Kr=ct._tickexponent,Ur=J.getTickFormat(ct),aa=ct.separatethousands;if(Or){var da={exponentformat:Gr,minexponent:ct.minexponent,dtick:ct.showexponent==="none"?ct.dtick:x(xt)&&Math.abs(xt)||1,range:ct.showexponent==="none"?ct.range.map(ct.r2d):[0,xt||1]};xr(da),Lr=(Number(da._tickround)||0)+4,Kr=da._tickexponent,ct.hoverformat&&(Ur=ct.hoverformat)}if(Ur)return ct._numFormat(Ur)(xt).replace(/-/g,z);var fa=Math.pow(10,-Lr)/2;if(Gr==="none"&&(Kr=0),xt=Math.abs(xt),xt"+kr+"":Gr==="B"&&Kr===9?xt+="B":Ce(Gr)&&(xt+=qe[Kr/3+5])}return Rr?z+xt:xt}J.getTickFormat=function(xt){var ct;function Nr(Ur){return typeof Ur!="string"?Ur:Number(Ur.replace("M",""))*S}function Or(Ur,aa){var da=["L","D"];if(typeof Ur==typeof aa){if(typeof Ur=="number")return Ur-aa;var fa=da.indexOf(Ur.charAt(0)),It=da.indexOf(aa.charAt(0));return fa===It?Number(Ur.replace(/(L|D)/g,""))-Number(aa.replace(/(L|D)/g,"")):fa-It}else return typeof Ur=="number"?1:-1}function Rr(Ur,aa,da){var fa=da||function(kr){return kr},It=aa[0],dr=aa[1];return(!It&&typeof It!="number"||fa(It)<=fa(Ur))&&(!dr&&typeof dr!="number"||fa(dr)>=fa(Ur))}function Lr(Ur,aa){var da=aa[0]===null,fa=aa[1]===null,It=Or(Ur,aa[0])>=0,dr=Or(Ur,aa[1])<=0;return(da||It)&&(fa||dr)}var Gr,Kr;if(xt.tickformatstops&&xt.tickformatstops.length>0)switch(xt.type){case"date":case"linear":{for(ct=0;ct=0&&Rr.unshift(Rr.splice(da,1).shift())}});var Kr={false:{left:0,right:0}};return e.syncOrAsync(Rr.map(function(Ur){return function(){if(Ur){var aa=J.getFromId(xt,Ur);Nr||(Nr={}),Nr.axShifts=Kr,Nr.overlayingShiftedAx=Gr;var da=J.drawOne(xt,aa,Nr);return aa._shiftPusher&&$a(aa,aa._fullDepth||0,Kr,!0),aa._r=aa.range.slice(),aa._rl=e.simpleMap(aa._r,aa.r2l),da}}}))},J.drawOne=function(xt,ct,Nr){Nr=Nr||{};var Or=Nr.axShifts||{},Rr=Nr.overlayingShiftedAx||[],Lr,Gr,Kr;ct.setScale();var Ur=xt._fullLayout,aa=ct._id,da=aa.charAt(0),fa=J.counterLetter(aa),It=Ur._plots[ct._mainSubplot],dr=ct.zerolinelayer==="above traces";if(!It)return;if(ct._shiftPusher=ct.autoshift||Rr.indexOf(ct._id)!==-1||Rr.indexOf(ct.overlaying)!==-1,ct._shiftPusher&ct.anchor==="free"){var kr=ct.linewidth/2||0;ct.ticks==="inside"&&(kr+=ct.ticklen),$a(ct,kr,Or,!0),$a(ct,ct.shift||0,Or,!1)}(Nr.skipTitle!==!0||ct._shift===void 0)&&(ct._shift=ai(ct,Or));var ia=It[da+"axislayer"],Ca=ct._mainLinePosition,Fa=Ca+=ct._shift,Ya=ct._mainMirrorPosition,ha=ct._vals=J.calcTicks(ct),Da=[ct.mirror,Fa,Ya].join("_");for(Lr=0;Lr0?$n.bottom-As:0,al))));var xu=0,zl=0;if(ct._shiftPusher&&(xu=Math.max(al,$n.height>0?po==="l"?As-$n.left:$n.right-As:0),ct.title.text!==Ur._dfltTitle[da]&&(zl=(ct._titleStandoff||0)+(ct._titleScoot||0),po==="l"&&(zl+=Ua(ct))),ct._fullDepth=Math.max(xu,zl)),ct.automargin){zs={x:0,y:0,r:0,l:0,t:0,b:0};var Ns=[0,1],iu=typeof ct._shift=="number"?ct._shift:0;if(da==="x"){if(po==="b"?zs[po]=ct._depth:(zs[po]=ct._depth=Math.max($n.width>0?As-$n.top:0,al),Ns.reverse()),$n.width>0){var Eu=$n.right-(ct._offset+ct._length);Eu>0&&(zs.xr=1,zs.r=Eu);var Bc=ct._offset-$n.left;Bc>0&&(zs.xl=0,zs.l=Bc)}}else if(po==="l"?(ct._depth=Math.max($n.height>0?As-$n.left:0,al),zs[po]=ct._depth-iu):(ct._depth=Math.max($n.height>0?$n.right-As:0,al),zs[po]=ct._depth+iu,Ns.reverse()),$n.height>0){var Cu=$n.bottom-(ct._offset+ct._length);Cu>0&&(zs.yb=0,zs.b=Cu);var Af=ct._offset-$n.top;Af>0&&(zs.yt=1,zs.t=Af)}zs[fa]=ct.anchor==="free"?ct.position:ct._anchorAxis.domain[Ns[0]],ct.title.text!==Ur._dfltTitle[da]&&(zs[po]+=Ua(ct)+(ct.title.standoff||0)),ct.mirror&&ct.anchor!=="free"&&(au={x:0,y:0,r:0,l:0,t:0,b:0},au[ro]=ct.linewidth,ct.mirror&&ct.mirror!==!0&&(au[ro]+=al),ct.mirror===!0||ct.mirror==="ticks"?au[fa]=ct._anchorAxis.domain[Ns[1]]:(ct.mirror==="all"||ct.mirror==="allticks")&&(au[fa]=[ct._counterDomainMin,ct._counterDomainMax][Ns[1]]))}Sn&&(fl=M.getComponentMethod("rangeslider","autoMarginOpts")(xt,ct)),typeof ct.automargin=="string"&&(at(zs,ct.automargin),at(au,ct.automargin)),A.autoMargin(xt,Ci(ct),zs),A.autoMargin(xt,Jt(ct),au),A.autoMargin(xt,Nt(ct),fl)}),e.syncOrAsync(Is)}};function at(xt,ct){if(xt){var Nr=Object.keys(W).reduce(function(Or,Rr){return ct.indexOf(Rr)!==-1&&W[Rr].forEach(function(Lr){Or[Lr]=1}),Or},{});Object.keys(xt).forEach(function(Or){Nr[Or]||(Or.length===1?xt[Or]=0:delete xt[Or])})}}function yt(xt,ct){var Nr=[],Or,Rr=function(Lr,Gr){var Kr=Lr.xbnd[Gr];Kr!==null&&Nr.push(e.extendFlat({},Lr,{x:Kr}))};if(ct.length){for(Or=0;Orxt.range[1],Kr=xt.ticklabelposition&&xt.ticklabelposition.indexOf("inside")!==-1,Ur=!Kr;if(Nr){var aa=Gr?-1:1;Nr=Nr*aa}if(Or){var da=xt.side,fa=Kr&&(da==="top"||da==="left")||Ur&&(da==="bottom"||da==="right")?1:-1;Or=Or*fa}return xt._id.charAt(0)==="x"?function(It){return t(Rr+xt._offset+xt.l2p(rr(It))+Nr,Lr+Or)}:function(It){return t(Lr+Or,Rr+xt._offset+xt.l2p(rr(It))+Nr)}};function rr(xt){return xt.periodX!==void 0?xt.periodX:xt.x}function Qt(xt){var ct=xt.ticklabelposition||"",Nr=xt.tickson||"",Or=function(kr){return ct.indexOf(kr)!==-1},Rr=Or("top"),Lr=Or("left"),Gr=Or("right"),Kr=Or("bottom"),Ur=Or("inside"),aa=Nr!=="boundaries"&&(Kr||Lr||Rr||Gr);if(!aa&&!Ur)return[0,0];var da=xt.side,fa=aa?(xt.tickwidth||0)/2:0,It=$,dr=xt.tickfont?xt.tickfont.size:12;return(Kr||Rr)&&(fa+=dr*le,It+=(xt.linewidth||0)/2),(Lr||Gr)&&(fa+=(xt.linewidth||0)/2,It+=$),Ur&&da==="top"&&(It-=dr*(1-le)),(Lr||Rr)&&(fa=-fa),(da==="bottom"||da==="right")&&(It=-It),[aa?fa:0,Ur?It:0]}J.makeTickPath=function(xt,ct,Nr,Or){Or||(Or={});var Rr=Or.minor;if(Rr&&!xt.minor)return"";var Lr=Or.len!==void 0?Or.len:Rr?xt.minor.ticklen:xt.ticklen,Gr=xt._id.charAt(0),Kr=(xt.linewidth||1)/2;return Gr==="x"?"M0,"+(ct+Kr*Nr)+"v"+Lr*Nr:"M"+(ct+Kr*Nr)+",0h"+Lr*Nr},J.makeLabelFns=function(xt,ct,Nr){var Or=xt.ticklabelposition||"",Rr=xt.tickson||"",Lr=function(mo){return Or.indexOf(mo)!==-1},Gr=Lr("top"),Kr=Lr("left"),Ur=Lr("right"),aa=Lr("bottom"),da=Rr!=="boundaries"&&(aa||Kr||Gr||Ur),fa=Lr("inside"),It=Or==="inside"&&xt.ticks==="inside"||!fa&&xt.ticks==="outside"&&Rr!=="boundaries",dr=0,kr=0,ia=It?xt.ticklen:0;if(fa?ia*=-1:da&&(ia=0),It&&(dr+=ia,Nr)){var Ca=e.deg2rad(Nr);dr=ia*Math.cos(Ca)+1,kr=ia*Math.sin(Ca)}xt.showticklabels&&(It||xt.showline)&&(dr+=.2*xt.tickfont.size),dr+=(xt.linewidth||1)/2*(fa?-1:1);var Fa={labelStandoff:dr,labelShift:kr},Ya,ha,Da,Xi,Li=0,fn=xt.side,An=xt._id.charAt(0),kn=xt.tickangle,zn;if(An==="x")zn=!fa&&fn==="bottom"||fa&&fn==="top",Xi=zn?1:-1,fa&&(Xi*=-1),Ya=kr*Xi,ha=ct+dr*Xi,Da=zn?1:-.2,Math.abs(kn)===90&&(fa?Da+=ue:kn===-90&&fn==="bottom"?Da=le:kn===90&&fn==="top"?Da=ue:Da=.5,Li=ue/2*(kn/90)),Fa.xFn=function(mo){return mo.dx+Ya+Li*mo.fontSize},Fa.yFn=function(mo){return mo.dy+ha+mo.fontSize*Da},Fa.anchorFn=function(mo,pn){if(da){if(Kr)return"end";if(Ur)return"start"}return!x(pn)||pn===0||pn===180?"middle":pn*Xi<0!==fa?"end":"start"},Fa.heightFn=function(mo,pn,Jo){return pn<-60||pn>60?-.5*Jo:xt.side==="top"!==fa?-Jo:0};else if(An==="y"){if(zn=!fa&&fn==="left"||fa&&fn==="right",Xi=zn?1:-1,fa&&(Xi*=-1),Ya=dr,ha=kr*Xi,Da=0,!fa&&Math.abs(kn)===90&&(kn===-90&&fn==="left"||kn===90&&fn==="right"?Da=le:Da=.5),fa){var Xn=x(kn)?+kn:0;if(Xn!==0){var to=e.deg2rad(Xn);Li=Math.abs(Math.sin(to))*le*Xi,Da=0}}Fa.xFn=function(mo){return mo.dx+ct-(Ya+mo.fontSize*Da)*Xi+Li*mo.fontSize},Fa.yFn=function(mo){return mo.dy+ha+mo.fontSize*ue},Fa.anchorFn=function(mo,pn){return x(pn)&&Math.abs(pn)===90?"middle":zn?"end":"start"},Fa.heightFn=function(mo,pn,Jo){return xt.side==="right"&&(pn*=-1),pn<-30?-Jo:pn<30?-.5*Jo:0}}return Fa};function Tr(xt){return[xt.text,xt.x,xt.axInfo,xt.font,xt.fontSize,xt.fontColor].join("_")}J.drawTicks=function(xt,ct,Nr){Nr=Nr||{};var Or=ct._id+"tick",Rr=[].concat(ct.minor&&ct.minor.ticks?Nr.vals.filter(function(Gr){return Gr.minor&&!Gr.noTick}):[]).concat(ct.ticks?Nr.vals.filter(function(Gr){return!Gr.minor&&!Gr.noTick}):[]),Lr=Nr.layer.selectAll("path."+Or).data(Rr,Tr);Lr.exit().remove(),Lr.enter().append("path").classed(Or,1).classed("ticks",1).classed("crisp",Nr.crisp!==!1).each(function(Gr){return a.stroke(d.select(this),Gr.minor?ct.minor.tickcolor:ct.tickcolor)}).style("stroke-width",function(Gr){return i.crispRound(xt,Gr.minor?ct.minor.tickwidth:ct.tickwidth,1)+"px"}).attr("d",Nr.path).style("display",null),Ha(ct,[N]),Lr.attr("transform",Nr.transFn)},J.drawGrid=function(xt,ct,Nr){if(Nr=Nr||{},ct.tickmode!=="sync"){var Or=ct._id+"grid",Rr=ct.minor&&ct.minor.showgrid,Lr=Rr?Nr.vals.filter(function(Fa){return Fa.minor}):[],Gr=ct.showgrid?Nr.vals.filter(function(Fa){return!Fa.minor}):[],Kr=Nr.counterAxis;if(Kr&&J.shouldShowZeroLine(xt,ct,Kr))for(var Ur=ct.tickmode==="array",aa=0;aa=0;kr--){var ia=kr?It:dr;if(ia){var Ca=ia.selectAll("path."+Or).data(kr?Gr:Lr,Tr);Ca.exit().remove(),Ca.enter().append("path").classed(Or,1).classed("crisp",Nr.crisp!==!1),Ca.attr("transform",Nr.transFn).attr("d",Nr.path).each(function(Fa){return a.stroke(d.select(this),Fa.minor?ct.minor.gridcolor:ct.gridcolor||"#ddd")}).style("stroke-dasharray",function(Fa){return i.dashStyle(Fa.minor?ct.minor.griddash:ct.griddash,Fa.minor?ct.minor.gridwidth:ct.gridwidth)}).style("stroke-width",function(Fa){return(Fa.minor?fa:ct._gw)+"px"}).style("display",null),typeof Nr.path=="function"&&Ca.attr("d",Nr.path)}}Ha(ct,[O,I])}},J.drawZeroLine=function(xt,ct,Nr){Nr=Nr||Nr;var Or=ct._id+"zl",Rr=J.shouldShowZeroLine(xt,ct,Nr.counterAxis),Lr=Nr.layer.selectAll("path."+Or).data(Rr?[{x:0,id:ct._id}]:[]);Lr.exit().remove(),Lr.enter().append("path").classed(Or,1).classed("zl",1).classed("crisp",Nr.crisp!==!1).each(function(){Nr.layer.selectAll("path").sort(function(Gr,Kr){return ie(Gr.id,Kr.id)})}),Lr.attr("transform",Nr.transFn).attr("d",Nr.path).call(a.stroke,ct.zerolinecolor||a.defaultLine).style("stroke-width",i.crispRound(xt,ct.zerolinewidth,ct._gw||1)+"px").style("display",null),Ha(ct,[B])},J.drawLabels=function(xt,ct,Nr){Nr=Nr||{};var Or=xt._fullLayout,Rr=ct._id,Lr=ct.zerolinelayer==="above traces",Gr=Nr.cls||Rr+"tick",Kr=Nr.vals.filter(function(so){return so.text}),Ur=Nr.labelFns,aa=Nr.secondary?0:ct.tickangle,da=(ct._prevTickAngles||{})[Gr],fa=Nr.layer.selectAll("g."+Gr).data(ct.showticklabels?Kr:[],Tr),It=[];fa.enter().append("g").classed(Gr,1).append("text").attr("text-anchor","middle").each(function(so){var Vn=d.select(this),To=xt._promises.length;Vn.call(r.positionText,Ur.xFn(so),Ur.yFn(so)).call(i.font,{family:so.font,size:so.fontSize,color:so.fontColor,weight:so.fontWeight,style:so.fontStyle,variant:so.fontVariant,textcase:so.fontTextcase,lineposition:so.fontLineposition,shadow:so.fontShadow}).text(so.text).call(r.convertToTspans,xt),xt._promises[To]?It.push(xt._promises.pop().then(function(){dr(Vn,aa)})):dr(Vn,aa)}),Ha(ct,[U]),fa.exit().remove(),Nr.repositionOnUpdate&&fa.each(function(so){d.select(this).select("text").call(r.positionText,Ur.xFn(so),Ur.yFn(so))});function dr(so,Vn){so.each(function(To){var qo=d.select(this),Oo=qo.select(".text-math-group"),lo=Ur.anchorFn(To,Vn),Co=Nr.transFn.call(qo.node(),To)+(x(Vn)&&+Vn!=0?" rotate("+Vn+","+Ur.xFn(To)+","+(Ur.yFn(To)-To.fontSize/2)+")":""),os=r.lineCount(qo),Ys=he*To.fontSize,Os=Ur.heightFn(To,x(Vn)?+Vn:0,(os-1)*Ys);if(Os&&(Co+=t(0,Os)),Oo.empty()){var Yo=qo.select("text");Yo.attr({transform:Co,"text-anchor":lo}),Yo.style("display",null),ct._adjustTickLabelsOverflow&&ct._adjustTickLabelsOverflow()}else{var Ui=i.bBox(Oo.node()).width,Cn=Ui*{end:-.5,start:.5}[lo];Oo.attr("transform",Co+t(Cn,0))}})}ct._adjustTickLabelsOverflow=function(){var so=ct.ticklabeloverflow;if(!(!so||so==="allow")){var Vn=so.indexOf("hide")!==-1,To=ct._id.charAt(0)==="x",qo=0,Oo=To?xt._fullLayout.width:xt._fullLayout.height;if(so.indexOf("domain")!==-1){var lo=e.simpleMap(ct.range,ct.r2l);qo=ct.l2p(lo[0])+ct._offset,Oo=ct.l2p(lo[1])+ct._offset}var Co=Math.min(qo,Oo),os=Math.max(qo,Oo),Ys=ct.side,Os=1/0,Yo=-1/0;fa.each(function(Bs){var uo=d.select(this),$s=uo.select(".text-math-group");if($s.empty()){var ms=i.bBox(uo.node()),Is=0;To?(ms.right>os||ms.leftos||ms.top+(ct.tickangle?0:Bs.fontSize/4)ct["_visibleLabelMin_"+lo._id]?uo.style("display","none"):os.K==="tick"&&!Co&&uo.node().style.display!=="none"&&uo.style("display",null)})})})})},dr(fa,da+1?da:aa);function kr(){return It.length&&Promise.all(It)}var ia=null;function Ca(){if(dr(fa,aa),Kr.length&&ct.autotickangles&&(ct.type!=="log"||String(ct.dtick).charAt(0)!=="D")){ia=ct.autotickangles[0];var so=0,Vn=[],To,qo=1;fa.each(function(zs){so=Math.max(so,zs.fontSize);var au=ct.l2p(zs.x),fl=ti(this),xu=i.bBox(fl.node());qo=Math.max(qo,r.lineCount(fl)),Vn.push({top:0,bottom:10,height:10,left:au-xu.width/2,right:au+xu.width/2+2,width:xu.width+2})});var Oo=(ct.tickson==="boundaries"||ct.showdividers)&&!Nr.secondary,lo=Kr.length,Co=Math.abs((Kr[lo-1].x-Kr[0].x)*ct._m)/(lo-1),os=Oo?Co/2:Co,Ys=Oo?ct.ticklen:so*1.25*qo,Os=Math.sqrt(Math.pow(os,2)+Math.pow(Ys,2)),Yo=os/Os,Ui=ct.autotickangles.map(function(zs){return zs*Math.PI/180}),Cn=Ui.find(function(zs){return Math.abs(Math.cos(zs))<=Yo});Cn===void 0&&(Cn=Ui.reduce(function(zs,au){return Math.abs(Math.cos(zs))Xo*Jo&&(to=Jo,kn[An]=zn[An]=mo[An])}var Ts=Math.abs(to-Xn);Ts-Xi>0?(Ts-=Xi,Xi*=1+Xi/Ts):Xi=0,ct._id.charAt(0)!=="y"&&(Xi=-Xi),kn[fn]=ha.p2r(ha.r2p(zn[fn])+Li*Xi),ha.autorange==="min"||ha.autorange==="max reversed"?(kn[0]=null,ha._rangeInitial0=void 0,ha._rangeInitial1=void 0):(ha.autorange==="max"||ha.autorange==="min reversed")&&(kn[1]=null,ha._rangeInitial0=void 0,ha._rangeInitial1=void 0),Or._insideTickLabelsUpdaterange[ha._name+".range"]=kn}var Po=e.syncOrAsync(Fa);return Po&&Po.then&&xt._promises.push(Po),Po};function la(xt,ct,Nr){var Or=ct._id+"divider",Rr=Nr.vals,Lr=Nr.layer.selectAll("path."+Or).data(Rr,Tr);Lr.exit().remove(),Lr.enter().insert("path",":first-child").classed(Or,1).classed("crisp",1).call(a.stroke,ct.dividercolor).style("stroke-width",i.crispRound(xt,ct.dividerwidth,1)+"px"),Lr.attr("transform",Nr.transFn).attr("d",Nr.path)}J.getPxPosition=function(xt,ct){var Nr=xt._fullLayout._size,Or=ct._id.charAt(0),Rr=ct.side,Lr;if(ct.anchor!=="free"?Lr=ct._anchorAxis:Or==="x"?Lr={_offset:Nr.t+(1-(ct.position||0))*Nr.h,_length:0}:Or==="y"&&(Lr={_offset:Nr.l+(ct.position||0)*Nr.w+ct._shift,_length:0}),Rr==="top"||Rr==="left")return Lr._offset;if(Rr==="bottom"||Rr==="right")return Lr._offset+Lr._length};function Ua(xt){var ct=xt.title.font.size,Nr=(xt.title.text.match(r.BR_TAG_ALL)||[]).length;return xt.title.hasOwnProperty("standoff")?ct*(le+Nr*he):Nr?ct*(Nr+1)*he:ct}function Ba(xt,ct){var Nr=xt._fullLayout,Or=ct._id,Rr=Or.charAt(0),Lr=ct.title.font.size,Gr,Kr=(ct.title.text.match(r.BR_TAG_ALL)||[]).length;if(ct.title.hasOwnProperty("standoff"))ct.side==="bottom"||ct.side==="right"?Gr=ct._depth+ct.title.standoff+Lr*le:(ct.side==="top"||ct.side==="left")&&(Gr=ct._depth+ct.title.standoff+Lr*(ue+Kr*he));else{var Ur=Ia(ct);if(ct.type==="multicategory")Gr=ct._depth;else{var aa=1.5*Lr;Ur&&(aa=.5*Lr,ct.ticks==="outside"&&(aa+=ct.ticklen)),Gr=10+aa+(ct.linewidth?ct.linewidth-1:0)}Ur||(Rr==="x"?Gr+=ct.side==="top"?Lr*(ct.showticklabels?1:0):Lr*(ct.showticklabels?1.5:.5):Gr+=ct.side==="right"?Lr*(ct.showticklabels?1:.5):Lr*(ct.showticklabels?.5:0))}var da=J.getPxPosition(xt,ct),fa,It,dr;Rr==="x"?(It=ct._offset+ct._length/2,dr=ct.side==="top"?da-Gr:da+Gr):(dr=ct._offset+ct._length/2,It=ct.side==="right"?da+Gr:da-Gr,fa={rotate:"-90",offset:0});var kr;if(ct.type!=="multicategory"){var ia=ct._selections[ct._id+"tick"];if(kr={selection:ia,side:ct.side},ia&&ia.node()&&ia.node().parentNode){var Ca=i.getTranslate(ia.node().parentNode);kr.offsetLeft=Ca.x,kr.offsetTop=Ca.y}ct.title.hasOwnProperty("standoff")&&(kr.pad=0)}return ct._titleStandoff=Gr,o.draw(xt,Or+"title",{propContainer:ct,propName:ct._name+".title.text",placeholder:Nr._dfltTitle[Rr],avoid:kr,transform:fa,attributes:{x:It,y:dr,"text-anchor":"middle"}})}J.shouldShowZeroLine=function(xt,ct,Nr){var Or=e.simpleMap(ct.range,ct.r2l);return Or[0]*Or[1]<=0&&ct.zeroline&&(ct.type==="linear"||ct.type==="-")&&!(ct.rangebreaks&&ct.maskBreaks(0)===F)&&(Ra(ct,0)||!ei(xt,ct,Nr,Or)||za(xt,ct))},J.clipEnds=function(xt,ct){return ct.filter(function(Nr){return Ra(xt,Nr.x)})};function Ra(xt,ct){var Nr=xt.l2p(ct);return Nr>1&&Nr1)for(Rr=1;Rr=Rr.min&&xt=L:/%L/.test(ct)?xt>=P:/%[SX]/.test(ct)?xt>=h:/%M/.test(ct)?xt>=m:/%[HI]/.test(ct)?xt>=u:/%p/.test(ct)?xt>=p:/%[Aadejuwx]/.test(ct)?xt>=b:/%[UVW]/.test(ct)?xt>=y:/%[Bbm]/.test(ct)?xt>=E:/%[q]/.test(ct)?xt>=_:/%[Yy]/.test(ct)?xt>=v:!0}}}),f5=Ze({"src/plots/cartesian/autorange_options_defaults.js"(Z,q){"use strict";q.exports=function(x,A,M){var e,t;if(M){var r=A==="reversed"||A==="min reversed"||A==="max reversed";e=M[r?1:0],t=M[r?0:1]}var o=x("autorangeoptions.minallowed",t===null?e:void 0),a=x("autorangeoptions.maxallowed",e===null?t:void 0);o===void 0&&x("autorangeoptions.clipmin"),a===void 0&&x("autorangeoptions.clipmax"),x("autorangeoptions.include")}}}),h5=Ze({"src/plots/cartesian/range_defaults.js"(Z,q){"use strict";var d=f5();q.exports=function(A,M,e,t){var r=M._template||{},o=M.type||r.type||"-";e("minallowed"),e("maxallowed");var a=e("range");if(!a){var i;!t.noInsiderange&&o!=="log"&&(i=e("insiderange"),i&&(i[0]===null||i[1]===null)&&(M.insiderange=!1,i=void 0),i&&(a=e("range",i)))}var n=M.getAutorangeDflt(a,t),s=e("autorange",n),c;a&&(a[0]===null&&a[1]===null||(a[0]===null||a[1]===null)&&(s==="reversed"||s===!0)||a[0]!==null&&(s==="min"||s==="max reversed")||a[1]!==null&&(s==="max"||s==="min reversed"))&&(a=void 0,delete M.range,M.autorange=!0,c=!0),c||(n=M.getAutorangeDflt(a,t),s=e("autorange",n)),s&&(d(e,s,a),(o==="linear"||o==="-")&&e("rangemode")),M.cleanRange()}}}),sz=Ze({"node_modules/mouse-event-offset/index.js"(Z,q){var d={left:0,top:0};q.exports=x;function x(M,e,t){e=e||M.currentTarget||M.srcElement,Array.isArray(t)||(t=[0,0]);var r=M.clientX||0,o=M.clientY||0,a=A(e);return t[0]=r-a.left,t[1]=o-a.top,t}function A(M){return M===window||M===document||M===document.body?d:M.getBoundingClientRect()}}}),x2=Ze({"node_modules/has-passive-events/index.js"(Z,q){"use strict";var d=a5();function x(){var A=!1;try{var M=Object.defineProperty({},"passive",{get:function(){A=!0}});window.addEventListener("test",null,M),window.removeEventListener("test",null,M)}catch{A=!1}return A}q.exports=d&&x()}}),lz=Ze({"src/components/dragelement/align.js"(Z,q){"use strict";q.exports=function(x,A,M,e,t){var r=(x-M)/(e-M),o=r+A/(e-M),a=(r+o)/2;return t==="left"||t==="bottom"?r:t==="center"||t==="middle"?a:t==="right"||t==="top"?o:r<2/3-a?r:o>4/3-a?o:a}}}),uz=Ze({"src/components/dragelement/cursor.js"(Z,q){"use strict";var d=ca(),x=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];q.exports=function(M,e,t,r){return t==="left"?M=0:t==="center"?M=1:t==="right"?M=2:M=d.constrain(Math.floor(M*3),0,2),r==="bottom"?e=0:r==="middle"?e=1:r==="top"?e=2:e=d.constrain(Math.floor(e*3),0,2),x[e][M]}}}),cz=Ze({"src/components/dragelement/unhover.js"(Z,q){"use strict";var d=Qy(),x=g2(),A=T_().getGraphDiv,M=w_(),e=q.exports={};e.wrapped=function(t,r,o){t=A(t),t._fullLayout&&x.clear(t._fullLayout._uid+M.HOVERID),e.raw(t,r,o)},e.raw=function(r,o){var a=r._fullLayout,i=r._hoverdata;o||(o={}),!(o.target&&!r._dragged&&d.triggerHandler(r,"plotly_beforehover",o)===!1)&&(a._hoverlayer.selectAll("g").remove(),a._hoverlayer.selectAll("line").remove(),a._hoverlayer.selectAll("circle").remove(),r._hoverdata=void 0,o.target&&i&&r.emit("plotly_unhover",{event:o,points:i}))}}}),Tp=Ze({"src/components/dragelement/index.js"(Z,q){"use strict";var d=sz(),x=i5(),A=x2(),M=ca().removeElement,e=kh(),t=q.exports={};t.align=lz(),t.getCursor=uz();var r=cz();t.unhover=r.wrapped,t.unhoverRaw=r.raw,t.init=function(n){var s=n.gd,c=1,f=s._context.doubleClickDelay,g=n.element,v,T,l,_,w,S,E,y;s._mouseDownTime||(s._mouseDownTime=0),g.style.pointerEvents="all",g.onmousedown=u,A?(g._ontouchstart&&g.removeEventListener("touchstart",g._ontouchstart),g._ontouchstart=u,g.addEventListener("touchstart",u,{passive:!1})):g.ontouchstart=u;function b(P,L,z){return Math.abs(P)"u"&&typeof P.clientY>"u"&&(P.clientX=v,P.clientY=T),l=new Date().getTime(),l-s._mouseDownTimef&&(c=Math.max(c-1,1)),s._dragged)n.doneFn&&n.doneFn();else{var L;S.target===E?L=S:(L={target:E,srcElement:E,toElement:E},Object.keys(S).concat(Object.keys(S.__proto__)).forEach(z=>{var F=S[z];!L[z]&&typeof F!="function"&&(L[z]=F)})),n.clickFn&&n.clickFn(c,L),y||E.dispatchEvent(new MouseEvent("click",P))}s._dragging=!1,s._dragged=!1}};function o(){var i=document.createElement("div");i.className="dragcover";var n=i.style;return n.position="fixed",n.left=0,n.right=0,n.top=0,n.bottom=0,n.zIndex=999999999,n.background="none",document.body.appendChild(i),i}t.coverSlip=o;function a(i){return d(i.changedTouches?i.changedTouches[0]:i,document.body)}}}),Kd=Ze({"src/lib/setcursor.js"(Z,q){"use strict";q.exports=function(x,A){(x.attr("class")||"").split(" ").forEach(function(M){M.indexOf("cursor-")===0&&x.classed(M,!1)}),A&&x.classed("cursor-"+A,!0)}}}),fz=Ze({"src/lib/override_cursor.js"(Z,q){"use strict";var d=Kd(),x="data-savedcursor",A="!!";q.exports=function(e,t){var r=e.attr(x);if(t){if(!r){for(var o=(e.attr("class")||"").split(" "),a=0;a(a==="legend"?1:0));if(P===!1&&(n[a]=void 0),!(P===!1&&!c.uirevision)&&(g("uirevision",n.uirevision),P!==!1)){g("borderwidth");var L=g("orientation"),z=g("yref"),F=g("xref"),B=L==="h",O=z==="paper",I=F==="paper",N,U,W,Q="left";B?(N=0,d.getComponentMethod("rangeslider","isVisible")(i.xaxis)?O?(U=1.1,W="bottom"):(U=1,W="top"):O?(U=-.1,W="top"):(U=0,W="bottom")):(U=1,W="auto",I?N=1.02:(N=1,Q="right")),x.coerce(c,f,{x:{valType:"number",editType:"legend",min:I?-2:0,max:I?3:1,dflt:N}},"x"),x.coerce(c,f,{y:{valType:"number",editType:"legend",min:O?-2:0,max:O?3:1,dflt:U}},"y"),g("traceorder",b),r.isGrouped(n[a])&&g("tracegroupgap"),g("entrywidth"),g("entrywidthmode"),g("indentation"),g("itemsizing"),g("itemwidth"),g("itemclick"),g("itemdoubleclick"),g("groupclick"),g("xanchor",Q),g("yanchor",W),g("maxheight"),g("valign"),x.noneOrAll(c,f,["x","y"]);var ue=g("title.text");if(ue){g("title.side",B?"left":"top");var le=x.extendFlat({},v,{size:x.bigFont(v.size)});x.coerceFont(g,"title.font",le)}}}}q.exports=function(i,n,s){var c,f=s.slice(),g=n.shapes;if(g)for(c=0;cP&&(h=P)}u[v][0]._groupMinRank=h,u[v][0]._preGroupSort=v}var L=function(N,U){return N[0]._groupMinRank-U[0]._groupMinRank||N[0]._preGroupSort-U[0]._preGroupSort},z=function(N,U){return N.trace.legendrank-U.trace.legendrank||N._preSort-U._preSort};for(u.forEach(function(N,U){N[0]._preGroupSort=U}),u.sort(L),v=0;v0)oe=$.width;else return 0;return p?X:Math.min(oe,J)};S.each(function(G){var $=d.select(this),J=A.ensureSingle($,"g","layers");J.style("opacity",G[0].trace.opacity);var X=y.indentation,oe=y.valign,ie=G[0].lineHeight,j=G[0].height;if(oe==="middle"&&X===0||!ie||!j)J.attr("transform",null);else{var ee={top:1,bottom:-1}[oe],re=ee*(.5*(ie-j+3))||0,ce=y.indentation;J.attr("transform",M(ce,re))}var be=J.selectAll("g.legendfill").data([G]);be.enter().append("g").classed("legendfill",!0);var Ae=J.selectAll("g.legendlines").data([G]);Ae.enter().append("g").classed("legendlines",!0);var ze=J.selectAll("g.legendsymbols").data([G]);ze.enter().append("g").classed("legendsymbols",!0),ze.selectAll("g.legendpoints").data([G]).enter().append("g").classed("legendpoints",!0)}).each(he).each(F).each(O).each(B).each(N).each(ue).each(Q).each(L).each(z).each(U).each(W);function L(G){var $=l(G),J=$.showFill,X=$.showLine,oe=$.showGradientLine,ie=$.showGradientFill,j=$.anyFill,ee=$.anyLine,re=G[0],ce=re.trace,be,Ae,ze=r(ce),Re=ze.colorscale,Xe=ze.reversescale,it=function(Fe){if(Fe.size())if(J)e.fillGroupStyle(Fe,E,!0);else{var rt="legendfill-"+ce.uid;e.gradient(Fe,E,rt,T(Xe),Re,"fill")}},ot=function(Fe){if(Fe.size()){var rt="legendline-"+ce.uid;e.lineGroupStyle(Fe),e.gradient(Fe,E,rt,T(Xe),Re,"stroke")}},tt=o.hasMarkers(ce)||!j?"M5,0":ee?"M5,-2":"M5,-3",lt=d.select(this),Ee=lt.select(".legendfill").selectAll("path").data(J||ie?[G]:[]);if(Ee.enter().append("path").classed("js-fill",!0),Ee.exit().remove(),Ee.attr("d",tt+"h"+u+"v6h-"+u+"z").call(it),X||oe){var _e=P(void 0,ce.line,g,c);Ae=A.minExtend(ce,{line:{width:_e}}),be=[A.minExtend(re,{trace:Ae})]}var fe=lt.select(".legendlines").selectAll("path").data(X||oe?[be]:[]);fe.enter().append("path").classed("js-line",!0),fe.exit().remove(),fe.attr("d",tt+(oe?"l"+u+",0.0001":"h"+u)).call(X?e.lineGroupStyle:ot)}function z(G){var $=l(G),J=$.anyFill,X=$.anyLine,oe=$.showLine,ie=$.showMarker,j=G[0],ee=j.trace,re=!ie&&!X&&!J&&o.hasText(ee),ce,be;function Ae(Ee,_e,fe,Fe){var rt=A.nestedProperty(ee,Ee).get(),st=A.isArrayOrTypedArray(rt)&&_e?_e(rt):rt;if(p&&st&&Fe!==void 0&&(st=Fe),fe){if(stfe[1])return fe[1]}return st}function ze(Ee){return j._distinct&&j.index&&Ee[j.index]?Ee[j.index]:Ee[0]}if(ie||re||oe){var Re={},Xe={};if(ie){Re.mc=Ae("marker.color",ze),Re.mx=Ae("marker.symbol",ze),Re.mo=Ae("marker.opacity",A.mean,[.2,1]),Re.mlc=Ae("marker.line.color",ze),Re.mlw=Ae("marker.line.width",A.mean,[0,5],f),Xe.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var it=Ae("marker.size",A.mean,[2,16],s);Re.ms=it,Xe.marker.size=it}oe&&(Xe.line={width:Ae("line.width",ze,[0,10],c)}),re&&(Re.tx="Aa",Re.tp=Ae("textposition",ze),Re.ts=10,Re.tc=Ae("textfont.color",ze),Re.tf=Ae("textfont.family",ze),Re.tw=Ae("textfont.weight",ze),Re.ty=Ae("textfont.style",ze),Re.tv=Ae("textfont.variant",ze),Re.tC=Ae("textfont.textcase",ze),Re.tE=Ae("textfont.lineposition",ze),Re.tS=Ae("textfont.shadow",ze)),ce=[A.minExtend(j,Re)],be=A.minExtend(ee,Xe),be.selectedpoints=null,be.texttemplate=null}var ot=d.select(this).select("g.legendpoints"),tt=ot.selectAll("path.scatterpts").data(ie?ce:[]);tt.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform",h),tt.exit().remove(),tt.call(e.pointStyle,be,E),ie&&(ce[0].mrc=3);var lt=ot.selectAll("g.pointtext").data(re?ce:[]);lt.enter().append("g").classed("pointtext",!0).append("text").attr("transform",h),lt.exit().remove(),lt.selectAll("text").call(e.textPointStyle,be,E)}function F(G){var $=G[0].trace,J=$.type==="waterfall";if(G[0]._distinct&&J){var X=G[0].trace[G[0].dir].marker;return G[0].mc=X.color,G[0].mlw=X.line.width,G[0].mlc=X.line.color,I(G,this,"waterfall")}var oe=[];$.visible&&J&&(oe=G[0].hasTotals?[["increasing","M-6,-6V6H0Z"],["totals","M6,6H0L-6,-6H-0Z"],["decreasing","M6,6V-6H0Z"]]:[["increasing","M-6,-6V6H6Z"],["decreasing","M6,6V-6H-6Z"]]);var ie=d.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(oe);ie.enter().append("path").classed("legendwaterfall",!0).attr("transform",h).style("stroke-miterlimit",1),ie.exit().remove(),ie.each(function(j){var ee=d.select(this),re=$[j[0]].marker,ce=P(void 0,re.line,v,f);ee.attr("d",j[1]).style("stroke-width",ce+"px").call(t.fill,re.color),ce&&ee.call(t.stroke,re.line.color)})}function B(G){I(G,this)}function O(G){I(G,this,"funnel")}function I(G,$,J){var X=G[0].trace,oe=X.marker||{},ie=oe.line||{},j=oe.cornerradius?"M6,3a3,3,0,0,1-3,3H-3a3,3,0,0,1-3-3V-3a3,3,0,0,1,3-3H3a3,3,0,0,1,3,3Z":"M6,6H-6V-6H6Z",ee=J?X.visible&&X.type===J:x.traceIs(X,"bar"),re=d.select($).select("g.legendpoints").selectAll("path.legend"+J).data(ee?[G]:[]);re.enter().append("path").classed("legend"+J,!0).attr("d",j).attr("transform",h),re.exit().remove(),re.each(function(ce){var be=d.select(this),Ae=ce[0],ze=P(Ae.mlw,oe.line,v,f);be.style("stroke-width",ze+"px");var Re=Ae.mcc;if(!y._inHover&&"mc"in Ae){var Xe=r(oe),it=Xe.mid;it===void 0&&(it=(Xe.max+Xe.min)/2),Re=e.tryColorscale(oe,"")(it)}var ot=Re||Ae.mc||oe.color,tt=oe.pattern,lt=e.getPatternAttr,Ee=tt&&(lt(tt.shape,0,"")||lt(tt.path,0,""));if(Ee){var _e=lt(tt.bgcolor,0,null),fe=lt(tt.fgcolor,0,null),Fe=tt.fgopacity,rt=_(tt.size,8,10),st=_(tt.solidity,.5,1),Qe="legend-"+X.uid;be.call(e.pattern,"legend",E,Qe,Ee,rt,st,Re,tt.fillmode,_e,fe,Fe)}else be.call(t.fill,ot);ze&&t.stroke(be,Ae.mlc||ie.color)})}function N(G){var $=G[0].trace,J=d.select(this).select("g.legendpoints").selectAll("path.legendbox").data($.visible&&x.traceIs($,"box-violin")?[G]:[]);J.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform",h),J.exit().remove(),J.each(function(){var X=d.select(this);if(($.boxpoints==="all"||$.points==="all")&&t.opacity($.fillcolor)===0&&t.opacity(($.line||{}).color)===0){var oe=A.minExtend($,{marker:{size:p?s:A.constrain($.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});J.call(e.pointStyle,oe,E)}else{var ie=P(void 0,$.line,v,f);X.style("stroke-width",ie+"px").call(t.fill,$.fillcolor),ie&&t.stroke(X,$.line.color)}})}function U(G){var $=G[0].trace,J=d.select(this).select("g.legendpoints").selectAll("path.legendcandle").data($.visible&&$.type==="candlestick"?[G,G]:[]);J.enter().append("path").classed("legendcandle",!0).attr("d",function(X,oe){return oe?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"}).attr("transform",h).style("stroke-miterlimit",1),J.exit().remove(),J.each(function(X,oe){var ie=d.select(this),j=$[oe?"increasing":"decreasing"],ee=P(void 0,j.line,v,f);ie.style("stroke-width",ee+"px").call(t.fill,j.fillcolor),ee&&t.stroke(ie,j.line.color)})}function W(G){var $=G[0].trace,J=d.select(this).select("g.legendpoints").selectAll("path.legendohlc").data($.visible&&$.type==="ohlc"?[G,G]:[]);J.enter().append("path").classed("legendohlc",!0).attr("d",function(X,oe){return oe?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"}).attr("transform",h).style("stroke-miterlimit",1),J.exit().remove(),J.each(function(X,oe){var ie=d.select(this),j=$[oe?"increasing":"decreasing"],ee=P(void 0,j.line,v,f);ie.style("fill","none").call(e.dashLine,j.line.dash,ee),ee&&t.stroke(ie,j.line.color)})}function Q(G){le(G,this,"pie")}function ue(G){le(G,this,"funnelarea")}function le(G,$,J){var X=G[0],oe=X.trace,ie=J?oe.visible&&oe.type===J:x.traceIs(oe,J),j=d.select($).select("g.legendpoints").selectAll("path.legend"+J).data(ie?[G]:[]);if(j.enter().append("path").classed("legend"+J,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",h),j.exit().remove(),j.size()){var ee=oe.marker||{},re=P(i(ee.line.width,X.pts),ee.line,v,f),ce="pieLike",be=A.minExtend(oe,{marker:{line:{width:re}}},ce),Ae=A.minExtend(X,{trace:be},ce);a(j,Ae,be,E)}}function he(G){var $=G[0].trace,J,X=[];if($.visible)switch($.type){case"histogram2d":case"heatmap":X=[["M-15,-2V4H15V-2Z"]],J=!0;break;case"choropleth":case"choroplethmapbox":case"choroplethmap":X=[["M-6,-6V6H6V-6Z"]],J=!0;break;case"densitymapbox":case"densitymap":X=[["M-6,0 a6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0"]],J="radial";break;case"cone":X=[["M-6,2 A2,2 0 0,0 -6,6 V6L6,4Z"],["M-6,-6 A2,2 0 0,0 -6,-2 L6,-4Z"],["M-6,-2 A2,2 0 0,0 -6,2 L6,0Z"]],J=!1;break;case"streamtube":X=[["M-6,2 A2,2 0 0,0 -6,6 H6 A2,2 0 0,1 6,2 Z"],["M-6,-6 A2,2 0 0,0 -6,-2 H6 A2,2 0 0,1 6,-6 Z"],["M-6,-2 A2,2 0 0,0 -6,2 H6 A2,2 0 0,1 6,-2 Z"]],J=!1;break;case"surface":X=[["M-6,-6 A2,3 0 0,0 -6,0 H6 A2,3 0 0,1 6,-6 Z"],["M-6,1 A2,3 0 0,1 -6,6 H6 A2,3 0 0,0 6,0 Z"]],J=!0;break;case"mesh3d":X=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],J=!1;break;case"volume":X=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],J=!0;break;case"isosurface":X=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6 A12,24 0 0,0 6,-6 L0,6Z"]],J=!1;break}var oe=d.select(this).select("g.legendpoints").selectAll("path.legend3dandfriends").data(X);oe.enter().append("path").classed("legend3dandfriends",!0).attr("transform",h).style("stroke-miterlimit",1),oe.exit().remove(),oe.each(function(ie,j){var ee=d.select(this),re=r($),ce=re.colorscale,be=re.reversescale,Ae=function(it){if(it.size()){var ot="legendfill-"+$.uid;e.gradient(it,E,ot,T(be,J==="radial"),ce,"fill")}},ze;if(ce){if(!J){var Xe=ce.length;ze=j===0?ce[be?Xe-1:0][1]:j===1?ce[be?0:Xe-1][1]:ce[Math.floor((Xe-1)/2)][1]}}else{var Re=$.vertexcolor||$.facecolor||$.color;ze=A.isArrayOrTypedArray(Re)?Re[j]||Re[0]:Re}ee.attr("d",ie[0]),ze?ee.call(t.fill,ze):ee.call(Ae)})}};function T(w,S){var E=S?"radial":"horizontal";return E+(w?"":"reversed")}function l(w){var S=w[0].trace,E=S.contours,y=o.hasLines(S),b=o.hasMarkers(S),p=S.visible&&S.fill&&S.fill!=="none",u=!1,m=!1;if(E){var h=E.coloring;h==="lines"?u=!0:y=h==="none"||h==="heatmap"||E.showlines,E.type==="constraint"?p=E._operation!=="=":(h==="fill"||h==="heatmap")&&(m=!0)}return{showMarker:b,showLine:y,showFill:p,showGradientLine:u,showGradientFill:m,anyLine:y||u,anyFill:p||m}}function _(w,S,E){return w&&A.isArrayOrTypedArray(w)?S:w>E?E:w}}}),g5=Ze({"src/components/legend/draw.js"(Z,q){"use strict";var d=On(),x=ca(),A=xc(),M=oo(),e=Qy(),t=Tp(),r=as(),o=Yn(),a=fu(),i=hz(),n=v5(),s=mh(),c=s.LINE_SPACING,f=s.FROM_TL,g=s.FROM_BR,v=pz(),T=m5(),l=b2(),_=1,w=/^legend[0-9]*$/;q.exports=function(U,W){if(W)E(U,W);else{var Q=U._fullLayout,ue=Q._legends,le=Q._infolayer.selectAll('[class^="legend"]');le.each(function(){var J=d.select(this),X=J.attr("class"),oe=X.split(" ")[0];oe.match(w)&&ue.indexOf(oe)===-1&&J.remove()});for(var he=0;he1)}var ee=Q.hiddenlabels||[];if(!G&&(!Q.showlegend||!$.length))return he.selectAll("."+ue).remove(),Q._topdefs.select("#"+le).remove(),A.autoMargin(N,ue);var re=x.ensureSingle(he,"g",ue,function(tt){G||tt.attr("pointer-events","all")}),ce=x.ensureSingleById(Q._topdefs,"clipPath",le,function(tt){tt.append("rect")}),be=x.ensureSingle(re,"rect","bg",function(tt){tt.attr("shape-rendering","crispEdges")});be.call(o.stroke,W.bordercolor).call(o.fill,W.bgcolor).style("stroke-width",W.borderwidth+"px");var Ae=x.ensureSingle(re,"g","scrollbox"),ze=W.title;W._titleWidth=0,W._titleHeight=0;var Re;ze.text?(Re=x.ensureSingle(Ae,"text",ue+"titletext"),Re.attr("text-anchor","start").call(r.font,ze.font).text(ze.text),h(Re,Ae,N,W,_)):Ae.selectAll("."+ue+"titletext").remove();var Xe=x.ensureSingle(re,"rect","scrollbar",function(tt){tt.attr(n.scrollBarEnterAttrs).call(o.fill,n.scrollBarColor)}),it=Ae.selectAll("g.groups").data($);it.enter().append("g").attr("class","groups"),it.exit().remove();var ot=it.selectAll("g.traces").data(x.identity);ot.enter().append("g").attr("class","traces"),ot.exit().remove(),ot.style("opacity",function(tt){var lt=tt[0].trace;return M.traceIs(lt,"pie-like")?ee.indexOf(tt[0].label)!==-1?.5:1:lt.visible==="legendonly"?.5:1}).each(function(){d.select(this).call(p,N,W)}).call(T,N,W).each(function(){G||d.select(this).call(m,N,ue)}),x.syncOrAsync([A.previousPromises,function(){return z(N,it,ot,W)},function(){var tt=Q._size,lt=W.borderwidth,Ee=W.xref==="paper",_e=W.yref==="paper";if(ze.text&&S(Re,W,lt),!G){var fe,Fe;Ee?fe=tt.l+tt.w*W.x-f[B(W)]*W._width:fe=Q.width*W.x-f[B(W)]*W._width,_e?Fe=tt.t+tt.h*(1-W.y)-f[O(W)]*W._effHeight:Fe=Q.height*(1-W.y)-f[O(W)]*W._effHeight;var rt=F(N,ue,fe,Fe);if(rt)return;if(Q.margin.autoexpand){var st=fe,Qe=Fe;fe=Ee?x.constrain(fe,0,Q.width-W._width):st,Fe=_e?x.constrain(Fe,0,Q.height-W._effHeight):Qe,fe!==st&&x.log("Constrain "+ue+".x to make legend fit inside graph"),Fe!==Qe&&x.log("Constrain "+ue+".y to make legend fit inside graph")}r.setTranslate(re,fe,Fe)}if(Xe.on(".drag",null),re.on("wheel",null),G||W._height<=W._maxHeight||N._context.staticPlot){var Lt=W._effHeight;G&&(Lt=W._height),be.attr({width:W._width-lt,height:Lt-lt,x:lt/2,y:lt/2}),r.setTranslate(Ae,0,0),ce.select("rect").attr({width:W._width-2*lt,height:Lt-2*lt,x:lt,y:lt}),r.setClipUrl(Ae,le,N),r.setRect(Xe,0,0,0,0),delete W._scrollY}else{var kt=Math.max(n.scrollBarMinHeight,W._effHeight*W._effHeight/W._height),Vt=W._effHeight-kt-2*n.scrollBarMargin,Zt=W._height-W._effHeight,Sr=Vt/Zt,xr=Math.min(W._scrollY||0,Zt);be.attr({width:W._width-2*lt+n.scrollBarWidth+n.scrollBarMargin,height:W._effHeight-lt,x:lt/2,y:lt/2}),ce.select("rect").attr({width:W._width-2*lt+n.scrollBarWidth+n.scrollBarMargin,height:W._effHeight-2*lt,x:lt,y:lt+xr}),r.setClipUrl(Ae,le,N),Me(xr,kt,Sr),re.on("wheel",function(){xr=x.constrain(W._scrollY+d.event.deltaY/Vt*Zt,0,Zt),Me(xr,kt,Sr),xr!==0&&xr!==Zt&&d.event.preventDefault()});var jr,wr,Ir,bt=function(at,yt,Tt){var Ot=(Tt-yt)/Sr+at;return x.constrain(Ot,0,Zt)},Be=function(at,yt,Tt){var Ot=(yt-Tt)/Sr+at;return x.constrain(Ot,0,Zt)},Ke=d.behavior.drag().on("dragstart",function(){var at=d.event.sourceEvent;at.type==="touchstart"?jr=at.changedTouches[0].clientY:jr=at.clientY,Ir=xr}).on("drag",function(){var at=d.event.sourceEvent;at.buttons===2||at.ctrlKey||(at.type==="touchmove"?wr=at.changedTouches[0].clientY:wr=at.clientY,xr=bt(Ir,jr,wr),Me(xr,kt,Sr))});Xe.call(Ke);var Ue=d.behavior.drag().on("dragstart",function(){var at=d.event.sourceEvent;at.type==="touchstart"&&(jr=at.changedTouches[0].clientY,Ir=xr)}).on("drag",function(){var at=d.event.sourceEvent;at.type==="touchmove"&&(wr=at.changedTouches[0].clientY,xr=Be(Ir,jr,wr),Me(xr,kt,Sr))});Ae.call(Ue)}function Me(at,yt,Tt){W._scrollY=N._fullLayout[ue]._scrollY=at,r.setTranslate(Ae,0,-at),r.setRect(Xe,W._width,n.scrollBarMargin+at*Tt,n.scrollBarWidth,yt),ce.select("rect").attr("y",lt+at)}if(N._context.edits.legendPosition){var qe,Ce,Te,Pe;re.classed("cursor-move",!0),t.init({element:re.node(),gd:N,prepFn:function(at){if(at.target!==Xe.node()){var yt=r.getTranslate(re);Te=yt.x,Pe=yt.y}},moveFn:function(at,yt){if(Te!==void 0&&Pe!==void 0){var Tt=Te+at,Ot=Pe+yt;r.setTranslate(re,Tt,Ot),qe=t.align(Tt,W._width,tt.l,tt.l+tt.w,W.xanchor),Ce=t.align(Ot+W._height,-W._height,tt.t+tt.h,tt.t,W.yanchor)}},doneFn:function(){if(qe!==void 0&&Ce!==void 0){var at={};at[ue+".x"]=qe,at[ue+".y"]=Ce,M.call("_guiRelayout",N,at)}},clickFn:function(at,yt){var Tt=he.selectAll("g.traces").filter(function(){var Ot=this.getBoundingClientRect();return yt.clientX>=Ot.left&&yt.clientX<=Ot.right&&yt.clientY>=Ot.top&&yt.clientY<=Ot.bottom});Tt.size()>0&&b(N,re,Tt,at,yt)}})}}],N)}}function y(N,U,W){var Q=N[0],ue=Q.width,le=U.entrywidthmode,he=Q.trace.legendwidth||U.entrywidth;return le==="fraction"?U._maxWidth*he:W+(he||ue)}function b(N,U,W,Q,ue){var le=W.data()[0][0].trace,he={event:ue,node:W.node(),curveNumber:le.index,expandedIndex:le.index,data:N.data,layout:N.layout,frames:N._transitionData._frames,config:N._context,fullData:N._fullData,fullLayout:N._fullLayout};le._group&&(he.group=le._group),M.traceIs(le,"pie-like")&&(he.label=W.datum()[0].label);var G=e.triggerHandler(N,"plotly_legendclick",he);if(Q===1){if(G===!1)return;U._clickTimeout=setTimeout(function(){N._fullLayout&&i(W,N,Q)},N._context.doubleClickDelay)}else if(Q===2){U._clickTimeout&&clearTimeout(U._clickTimeout),N._legendMouseDownTime=0;var $=e.triggerHandler(N,"plotly_legenddoubleclick",he);$!==!1&&G!==!1&&i(W,N,Q)}}function p(N,U,W){var Q=I(W),ue=N.data()[0][0],le=ue.trace,he=M.traceIs(le,"pie-like"),G=!W._inHover&&U._context.edits.legendText&&!he,$=W._maxNameLength,J,X;ue.groupTitle?(J=ue.groupTitle.text,X=ue.groupTitle.font):(X=W.font,W.entries?J=ue.text:(J=he?ue.label:le.name,le._meta&&(J=x.templateString(J,le._meta))));var oe=x.ensureSingle(N,"text",Q+"text");oe.attr("text-anchor","start").call(r.font,X).text(G?u(J,$):J);var ie=W.indentation+W.itemwidth+n.itemGap*2;a.positionText(oe,ie,0),G?oe.call(a.makeEditable,{gd:U,text:J}).call(h,N,U,W).on("edit",function(j){this.text(u(j,$)).call(h,N,U,W);var ee=ue.trace._fullInput||{},re={};return re.name=j,ee._isShape?M.call("_guiRelayout",U,"shapes["+le.index+"].name",re.name):M.call("_guiRestyle",U,re,le.index)}):h(oe,N,U,W)}function u(N,U){var W=Math.max(4,U);if(N&&N.trim().length>=W/2)return N;N=N||"";for(var Q=W-N.length;Q>0;Q--)N+=" ";return N}function m(N,U,W){var Q=U._context.doubleClickDelay,ue,le=1,he=x.ensureSingle(N,"rect",W+"toggle",function(G){U._context.staticPlot||G.style("cursor","pointer").attr("pointer-events","all"),G.call(o.fill,"rgba(0,0,0,0)")});U._context.staticPlot||(he.on("mousedown",function(){ue=new Date().getTime(),ue-U._legendMouseDownTimeQ&&(le=Math.max(le-1,1)),b(U,G,N,le,d.event)}}))}function h(N,U,W,Q,ue){Q._inHover&&N.attr("data-notex",!0),a.convertToTspans(N,W,function(){P(U,W,Q,ue)})}function P(N,U,W,Q){var ue=N.data()[0][0];if(!W._inHover&&ue&&!ue.trace.showlegend){N.remove();return}var le=N.select("g[class*=math-group]"),he=le.node(),G=I(W);W||(W=U._fullLayout[G]);var $=W.borderwidth,J;Q===_?J=W.title.font:ue.groupTitle?J=ue.groupTitle.font:J=W.font;var X=J.size*c,oe,ie;if(he){var j=r.bBox(he);oe=j.height,ie=j.width,Q===_?r.setTranslate(le,$,$+oe*.75):r.setTranslate(le,0,oe*.25)}else{var ee="."+G+(Q===_?"title":"")+"text",re=N.select(ee),ce=a.lineCount(re),be=re.node();if(oe=X*ce,ie=be?r.bBox(be).width:0,Q===_)W.title.side==="left"&&(ie+=n.itemGap*2),a.positionText(re,$+n.titlePad,$+X);else{var Ae=n.itemGap*2+W.indentation+W.itemwidth;ue.groupTitle&&(Ae=n.itemGap,ie-=W.indentation+W.itemwidth),a.positionText(re,Ae,-X*((ce-1)/2-.3))}}Q===_?(W._titleWidth=ie,W._titleHeight=oe):(ue.lineHeight=X,ue.height=Math.max(oe,16)+3,ue.width=ie)}function L(N){var U=0,W=0,Q=N.title.side;return Q&&(Q.indexOf("left")!==-1&&(U=N._titleWidth),Q.indexOf("top")!==-1&&(W=N._titleHeight)),[U,W]}function z(N,U,W,Q){var ue=N._fullLayout,le=I(Q);Q||(Q=ue[le]);var he=ue._size,G=l.isVertical(Q),$=l.isGrouped(Q),J=Q.entrywidthmode==="fraction",X=Q.borderwidth,oe=2*X,ie=n.itemGap,j=Q.indentation+Q.itemwidth+ie*2,ee=2*(X+ie),re=O(Q),ce=Q.y<0||Q.y===0&&re==="top",be=Q.y>1||Q.y===1&&re==="bottom",Ae=Q.tracegroupgap,ze={};let{orientation:Re,yref:Xe}=Q,{maxheight:it}=Q,ot=ce||be||Re!=="v"||Xe!=="paper";it||(it=ot?.5:1);let tt=ot?ue.height:he.h;Q._maxHeight=Math.max(it>1?it:it*tt,30);var lt=0;Q._width=0,Q._height=0;var Ee=L(Q);if(G)W.each(function(Me){var qe=Me[0].height;r.setTranslate(this,X+Ee[0],X+Ee[1]+Q._height+qe/2+ie),Q._height+=qe,Q._width=Math.max(Q._width,Me[0].width)}),lt=j+Q._width,Q._width+=ie+j+oe,Q._height+=ee,$&&(U.each(function(Me,qe){r.setTranslate(this,0,qe*Q.tracegroupgap)}),Q._height+=(Q._lgroupsLength-1)*Q.tracegroupgap);else{var _e=B(Q),fe=Q.x<0||Q.x===0&&_e==="right",Fe=Q.x>1||Q.x===1&&_e==="left",rt=be||ce,st=ue.width/2;Q._maxWidth=Math.max(fe?rt&&_e==="left"?he.l+he.w:st:Fe?rt&&_e==="right"?he.r+he.w:st:he.w,2*j);var Qe=0,Lt=0;W.each(function(Me){var qe=y(Me,Q,j);Qe=Math.max(Qe,qe),Lt+=qe}),lt=null;var kt=0;if($){var Vt=0,Zt=0,Sr=0;U.each(function(){var Me=0,qe=0;d.select(this).selectAll("g.traces").each(function(Te){var Pe=y(Te,Q,j),at=Te[0].height;r.setTranslate(this,Ee[0],Ee[1]+X+ie+at/2+qe),qe+=at,Me=Math.max(Me,Pe),ze[Te[0].trace.legendgroup]=Me});var Ce=Me+ie;Zt>0&&Ce+X+Zt>Q._maxWidth?(kt=Math.max(kt,Zt),Zt=0,Sr+=Vt+Ae,Vt=qe):Vt=Math.max(Vt,qe),r.setTranslate(this,Zt,Sr),Zt+=Ce}),Q._width=Math.max(kt,Zt)+X,Q._height=Sr+Vt+ee}else{var xr=W.size(),jr=Lt+oe+(xr-1)*ie=Q._maxWidth&&(kt=Math.max(kt,Be),Ir=0,bt+=wr,Q._height+=wr,wr=0),r.setTranslate(this,Ee[0]+X+Ir,Ee[1]+X+bt+qe/2+ie),Be=Ir+Ce+ie,Ir+=Te,wr=Math.max(wr,qe)}),jr?(Q._width=Ir+oe,Q._height=wr+ee):(Q._width=Math.max(kt,Be)+oe,Q._height+=wr+ee)}}Q._width=Math.ceil(Math.max(Q._width+Ee[0],Q._titleWidth+2*(X+n.titlePad))),Q._height=Math.ceil(Math.max(Q._height+Ee[1],Q._titleHeight+2*(X+n.itemGap))),Q._effHeight=Math.min(Q._height,Q._maxHeight);var Ke=N._context.edits,Ue=Ke.legendText||Ke.legendPosition;W.each(function(Me){var qe=d.select(this).select("."+le+"toggle"),Ce=Me[0].height,Te=Me[0].trace.legendgroup,Pe=y(Me,Q,j);$&&Te!==""&&(Pe=ze[Te]);var at=Ue?j:lt||Pe;!G&&!J&&(at+=ie/2),r.setRect(qe,0,-Ce/2,at,Ce)})}function F(N,U,W,Q){var ue=N._fullLayout,le=ue[U],he=B(le),G=O(le),$=le.xref==="paper",J=le.yref==="paper";N._fullLayout._reservedMargin[U]={};var X=le.y<.5?"b":"t",oe=le.x<.5?"l":"r",ie={r:ue.width-W,l:W+le._width,b:ue.height-Q,t:Q+le._effHeight};if($&&J)return A.autoMargin(N,U,{x:le.x,y:le.y,l:le._width*f[he],r:le._width*g[he],b:le._effHeight*g[G],t:le._effHeight*f[G]});$?N._fullLayout._reservedMargin[U][X]=ie[X]:J||le.orientation==="v"?N._fullLayout._reservedMargin[U][oe]=ie[oe]:N._fullLayout._reservedMargin[U][X]=ie[X]}function B(N){return x.isRightAnchor(N)?"right":x.isCenterAnchor(N)?"center":"left"}function O(N){return x.isBottomAnchor(N)?"bottom":x.isMiddleAnchor(N)?"middle":"top"}function I(N){return N._id||"legend"}}}),y5=Ze({"src/components/fx/hover.js"(Z){"use strict";var q=On(),d=ns(),x=Ch(),A=ca(),M=A.pushUnique,e=A.strTranslate,t=A.strRotate,r=Qy(),o=fu(),a=fz(),i=as(),n=Yn(),s=Tp(),c=Wo(),f=kh().zindexSeparator,g=oo(),v=Qp(),T=w_(),l=d5(),_=g5(),w=T.YANGLE,S=Math.PI*w/180,E=1/Math.sin(S),y=Math.cos(S),b=Math.sin(S),p=T.HOVERARROWSIZE,u=T.HOVERTEXTPAD,m={box:!0,ohlc:!0,violin:!0,candlestick:!0},h={scatter:!0,scattergl:!0,splom:!0};function P(j,ee){return j.distance-ee.distance}Z.hover=function(ee,re,ce,be){ee=A.getGraphDiv(ee);var Ae=re.target;A.throttle(ee._fullLayout._uid+T.HOVERID,T.HOVERMINTIME,function(){L(ee,re,ce,be,Ae)})},Z.loneHover=function(ee,re){var ce=!0;Array.isArray(ee)||(ce=!1,ee=[ee]);var be=re.gd,Ae=X(be),ze=oe(be),Re=ee.map(function(Fe){var rt=Fe._x0||Fe.x0||Fe.x||0,st=Fe._x1||Fe.x1||Fe.x||0,Qe=Fe._y0||Fe.y0||Fe.y||0,Lt=Fe._y1||Fe.y1||Fe.y||0,kt=Fe.eventData;if(kt){var Vt=Math.min(rt,st),Zt=Math.max(rt,st),Sr=Math.min(Qe,Lt),xr=Math.max(Qe,Lt),jr=Fe.trace;if(g.traceIs(jr,"gl3d")){var wr=be._fullLayout[jr.scene]._scene.container,Ir=wr.offsetLeft,bt=wr.offsetTop;Vt+=Ir,Zt+=Ir,Sr+=bt,xr+=bt}kt.bbox={x0:Vt+ze,x1:Zt+ze,y0:Sr+Ae,y1:xr+Ae},re.inOut_bbox&&re.inOut_bbox.push(kt.bbox)}else kt=!1;return{color:Fe.color||n.defaultLine,x0:Fe.x0||Fe.x||0,x1:Fe.x1||Fe.x||0,y0:Fe.y0||Fe.y||0,y1:Fe.y1||Fe.y||0,xLabel:Fe.xLabel,yLabel:Fe.yLabel,zLabel:Fe.zLabel,text:Fe.text,name:Fe.name,idealAlign:Fe.idealAlign,borderColor:Fe.borderColor,fontFamily:Fe.fontFamily,fontSize:Fe.fontSize,fontColor:Fe.fontColor,fontWeight:Fe.fontWeight,fontStyle:Fe.fontStyle,fontVariant:Fe.fontVariant,nameLength:Fe.nameLength,textAlign:Fe.textAlign,trace:Fe.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:Fe.hovertemplate||!1,hovertemplateLabels:Fe.hovertemplateLabels||!1,eventData:kt}}),Xe=!1,it=B(Re,{gd:be,hovermode:"closest",rotateLabels:Xe,bgColor:re.bgColor||n.background,container:q.select(re.container),outerContainer:re.outerContainer||re.container}),ot=it.hoverLabels,tt=5,lt=0,Ee=0;ot.sort(function(Fe,rt){return Fe.y0-rt.y0}).each(function(Fe,rt){var st=Fe.y0-Fe.by/2;st-ttZt[0]._length||ei<0||ei>Sr[0]._length)return s.unhoverRaw(j,ee)}if(ee.pointerX=Ra+Zt[0]._offset,ee.pointerY=ei+Sr[0]._offset,"xval"in ee?Ue=v.flat(Ae,ee.xval):Ue=v.p2c(Zt,Ra),"yval"in ee?Me=v.flat(Ae,ee.yval):Me=v.p2c(Sr,ei),!d(Ue[0])||!d(Me[0]))return A.warn("Fx.hover failed",ee,j),s.unhoverRaw(j,ee)}var Ci=1/0;function Jt(pn,Jo){for(Ce=0;CeQt&&(Be.splice(0,Qt),Ci=Be[0].distance),tt&&bt!==0&&Be.length===0){rr.distance=bt,rr.index=!1;var Vn=Pe._module.hoverPoints(rr,Ot,Gt,"closest",{hoverLayer:Re._hoverlayer});if(Vn&&(Vn=Vn.filter(function(os){return os.spikeDistance<=bt})),Vn&&Vn.length){var To,qo=Vn.filter(function(os){return os.xa.showspikes&&os.xa.spikesnap!=="hovered data"});if(qo.length){var Oo=qo[0];d(Oo.x0)&&d(Oo.y0)&&(To=Kt(Oo),(!Tr.vLinePoint||Tr.vLinePoint.spikeDistance>To.spikeDistance)&&(Tr.vLinePoint=To))}var lo=Vn.filter(function(os){return os.ya.showspikes&&os.ya.spikesnap!=="hovered data"});if(lo.length){var Co=lo[0];d(Co.x0)&&d(Co.y0)&&(To=Kt(Co),(!Tr.hLinePoint||Tr.hLinePoint.spikeDistance>To.spikeDistance)&&(Tr.hLinePoint=To))}}}}}Jt();function Nt(pn,Jo,Xo){for(var Ts=null,Po=1/0,so,Vn=0;Vn0&&Math.abs(pn.distance)Nr-1;aa--)Ur(Be[aa]);Be=Lr,ma()}var da=j._hoverdata,fa=[],It=X(j),dr=oe(j);for(qe=0;qe1||Be.length>1)||lt==="closest"&&la&&Be.length>1,zn=n.combine(Re.plot_bgcolor||n.background,Re.paper_bgcolor),Xn=B(Be,{gd:j,hovermode:lt,rotateLabels:kn,bgColor:zn,container:Re._hoverlayer,outerContainer:Re._paper.node(),commonLabelOpts:Re.hoverlabel,hoverdistance:Re.hoverdistance}),to=Xn.hoverLabels;if(v.isUnifiedHover(lt)||(I(to,kn,Re,Xn.commonLabelBoundingBox),W(to,kn,Re._invScaleX,Re._invScaleY)),be&&be.tagName){var mo=g.getComponentMethod("annotations","hasClickToShow")(j,fa);a(q.select(be),mo?"pointer":"")}!be||ce||!le(j,ee,da)||(da&&j.emit("plotly_unhover",{event:ee,points:da}),j.emit("plotly_hover",{event:ee,points:j._hoverdata,xaxes:Zt,yaxes:Sr,xvals:Ue,yvals:Me}))}function z(j){return[j.trace.index,j.index,j.x0,j.y0,j.name,j.attr,j.xa?j.xa._id:"",j.ya?j.ya._id:""].join(",")}var F=/([\s\S]*)<\/extra>/;function B(j,ee){var re=ee.gd,ce=re._fullLayout,be=ee.hovermode,Ae=ee.rotateLabels,ze=ee.bgColor,Re=ee.container,Xe=ee.outerContainer,it=ee.commonLabelOpts||{};if(j.length===0)return[[]];var ot=ee.fontFamily||T.HOVERFONT,tt=ee.fontSize||T.HOVERFONTSIZE,lt=ee.fontWeight||ce.font.weight,Ee=ee.fontStyle||ce.font.style,_e=ee.fontVariant||ce.font.variant,fe=ee.fontTextcase||ce.font.textcase,Fe=ee.fontLineposition||ce.font.lineposition,rt=ee.fontShadow||ce.font.shadow,st=j[0],Qe=st.xa,Lt=st.ya,kt=be.charAt(0),Vt=kt+"Label",Zt=st[Vt];if(Zt===void 0&&Qe.type==="multicategory")for(var Sr=0;Srce.width-dr&&(kr=ce.width-dr),Nr.attr("d","M"+(da-kr)+",0L"+(da-kr+p)+","+It+p+"H"+dr+"v"+It+(u*2+aa.height)+"H"+-dr+"V"+It+p+"H"+(da-kr-p)+"Z"),da=kr,Ce.minX=da-dr,Ce.maxX=da+dr,Qe.side==="top"?(Ce.minY=fa-(u*2+aa.height),Ce.maxY=fa-u):(Ce.minY=fa+u,Ce.maxY=fa+(u*2+aa.height))}else{var ia,Ca,Fa;Lt.side==="right"?(ia="start",Ca=1,Fa="",da=Qe._offset+Qe._length):(ia="end",Ca=-1,Fa="-",da=Qe._offset),fa=Lt._offset+(st.y0+st.y1)/2,Or.attr("text-anchor",ia),Nr.attr("d","M0,0L"+Fa+p+","+p+"V"+(u+aa.height/2)+"h"+Fa+(u*2+aa.width)+"V-"+(u+aa.height/2)+"H"+Fa+p+"V-"+p+"Z"),Ce.minY=fa-(u+aa.height/2),Ce.maxY=fa+(u+aa.height/2),Lt.side==="right"?(Ce.minX=da+p,Ce.maxX=da+p+(u*2+aa.width)):(Ce.minX=da-p-(u*2+aa.width),Ce.maxX=da-p);var Ya=aa.height/2,ha=jr-aa.top-Ya,Da="clip"+ce._uid+"commonlabel"+Lt._id,Xi;if(da=0?ai=ra:Ia+Ci=0?ai=Ia:Ha+Ci=0?mi=ta:ma+Jt=0?mi=ma:$a+Jt=0,(ct.idealAlign==="top"||!An)&&kn?(Fa-=ha/2,ct.anchor="end"):An?(Fa+=ha/2,ct.anchor="start"):ct.anchor="middle",ct.crossPos=Fa;else{if(ct.pos=Fa,An=Ca+Ya/2+fn<=wr,kn=Ca-Ya/2-fn>=0,(ct.idealAlign==="left"||!An)&&kn)Ca-=Ya/2,ct.anchor="end";else if(An)Ca+=Ya/2,ct.anchor="start";else{ct.anchor="middle";var zn=fn/2,Xn=Ca+zn-wr,to=Ca-zn;Xn>0&&(Ca-=Xn),to<0&&(Ca+=-to)}ct.crossPos=Ca}fa.attr("text-anchor",ct.anchor),dr&&It.attr("text-anchor",ct.anchor),Nr.attr("transform",e(Ca,Fa)+(Ae?t(w):""))}),{hoverLabels:xt,commonLabelBoundingBox:Ce}}function O(j,ee,re,ce,be,Ae){var ze="",Re="";j.nameOverride!==void 0&&(j.name=j.nameOverride),j.name&&(j.trace._meta&&(j.name=A.templateString(j.name,j.trace._meta)),ze=G(j.name,j.nameLength));var Xe=re.charAt(0),it=Xe==="x"?"y":"x";j.zLabel!==void 0?(j.xLabel!==void 0&&(Re+="x: "+j.xLabel+"
"),j.yLabel!==void 0&&(Re+="y: "+j.yLabel+"
"),j.trace.type!=="choropleth"&&j.trace.type!=="choroplethmapbox"&&j.trace.type!=="choroplethmap"&&(Re+=(Re?"z: ":"")+j.zLabel)):ee&&j[Xe+"Label"]===be?Re=j[it+"Label"]||"":j.xLabel===void 0?j.yLabel!==void 0&&j.trace.type!=="scattercarpet"&&(Re=j.yLabel):j.yLabel===void 0?Re=j.xLabel:Re="("+j.xLabel+", "+j.yLabel+")",(j.text||j.text===0)&&!Array.isArray(j.text)&&(Re+=(Re?"
":"")+j.text),j.extraText!==void 0&&(Re+=(Re?"
":"")+j.extraText),Ae&&Re===""&&!j.hovertemplate&&(ze===""&&Ae.remove(),Re=ze);var ot=j.hovertemplate||!1;if(ot){var tt=j.hovertemplateLabels||j;j[Xe+"Label"]!==be&&(tt[Xe+"other"]=tt[Xe+"Val"],tt[Xe+"otherLabel"]=tt[Xe+"Label"]),Re=A.hovertemplateString(ot,tt,ce._d3locale,j.eventData[0]||{},j.trace._meta),Re=Re.replace(F,function(lt,Ee){return ze=G(Ee,j.nameLength),""})}return[Re,ze]}function I(j,ee,re,ce){var be=ee?"xa":"ya",Ae=ee?"ya":"xa",ze=0,Re=1,Xe=j.size(),it=new Array(Xe),ot=0,tt=ce.minX,lt=ce.maxX,Ee=ce.minY,_e=ce.maxY,fe=function(Ue){return Ue*re._invScaleX},Fe=function(Ue){return Ue*re._invScaleY};j.each(function(Ue){var Me=Ue[be],qe=Ue[Ae],Ce=Me._id.charAt(0)==="x",Te=Me.range;ot===0&&Te&&Te[0]>Te[1]!==Ce&&(Re=-1);var Pe=0,at=Ce?re.width:re.height;if(re.hovermode==="x"||re.hovermode==="y"){var yt=N(Ue,ee),Tt=Ue.anchor,Ot=Tt==="end"?-1:1,Gt,rr;if(Tt==="middle")Gt=Ue.crossPos+(Ce?Fe(yt.y-Ue.by/2):fe(Ue.bx/2+Ue.tx2width/2)),rr=Gt+(Ce?Fe(Ue.by):fe(Ue.bx));else if(Ce)Gt=Ue.crossPos+Fe(p+yt.y)-Fe(Ue.by/2-p),rr=Gt+Fe(Ue.by);else{var Qt=fe(Ot*p+yt.x),Tr=Qt+fe(Ot*Ue.bx);Gt=Ue.crossPos+Math.min(Qt,Tr),rr=Ue.crossPos+Math.max(Qt,Tr)}Ce?Ee!==void 0&&_e!==void 0&&Math.min(rr,_e)-Math.max(Gt,Ee)>1&&(qe.side==="left"?(Pe=qe._mainLinePosition,at=re.width):at=qe._mainLinePosition):tt!==void 0&<!==void 0&&Math.min(rr,lt)-Math.max(Gt,tt)>1&&(qe.side==="top"?(Pe=qe._mainLinePosition,at=re.height):at=qe._mainLinePosition)}it[ot++]=[{datum:Ue,traceIndex:Ue.trace.index,dp:0,pos:Ue.pos,posref:Ue.posref,size:Ue.by*(Ce?E:1)/2,pmin:Pe,pmax:at}]}),it.sort(function(Ue,Me){return Ue[0].posref-Me[0].posref||Re*(Me[0].traceIndex-Ue[0].traceIndex)});var rt,st,Qe,Lt,kt,Vt,Zt;function Sr(Ue){var Me=Ue[0],qe=Ue[Ue.length-1];if(st=Me.pmin-Me.pos-Me.dp+Me.size,Qe=qe.pos+qe.dp+qe.size-Me.pmax,st>.01){for(kt=Ue.length-1;kt>=0;kt--)Ue[kt].dp+=st;rt=!1}if(!(Qe<.01)){if(st<-.01){for(kt=Ue.length-1;kt>=0;kt--)Ue[kt].dp-=Qe;rt=!1}if(rt){var Ce=0;for(Lt=0;LtMe.pmax&&Ce++;for(Lt=Ue.length-1;Lt>=0&&!(Ce<=0);Lt--)Vt=Ue[Lt],Vt.pos>Me.pmax-1&&(Vt.del=!0,Ce--);for(Lt=0;Lt=0;kt--)Ue[kt].dp-=Qe;for(Lt=Ue.length-1;Lt>=0&&!(Ce<=0);Lt--)Vt=Ue[Lt],Vt.pos+Vt.dp+Vt.size>Me.pmax&&(Vt.del=!0,Ce--)}}}for(;!rt&&ze<=Xe;){for(ze++,rt=!0,Lt=0;Lt.01){for(kt=jr.length-1;kt>=0;kt--)jr[kt].dp+=st;for(xr.push.apply(xr,jr),it.splice(Lt+1,1),Zt=0,kt=xr.length-1;kt>=0;kt--)Zt+=xr[kt].dp;for(Qe=Zt/xr.length,kt=xr.length-1;kt>=0;kt--)xr[kt].dp-=Qe;rt=!1}else Lt++}it.forEach(Sr)}for(Lt=it.length-1;Lt>=0;Lt--){var bt=it[Lt];for(kt=bt.length-1;kt>=0;kt--){var Be=bt[kt],Ke=Be.datum;Ke.offset=Be.dp,Ke.del=Be.del}}}function N(j,ee){var re=0,ce=j.offset;return ee&&(ce*=-b,re=j.offset*y),{x:re,y:ce}}function U(j){var ee={start:1,end:-1,middle:0}[j.anchor],re=ee*(p+u),ce=re+ee*(j.txwidth+u),be=j.anchor==="middle";return be&&(re-=j.tx2width/2,ce+=j.txwidth/2+u),{alignShift:ee,textShiftX:re,text2ShiftX:ce}}function W(j,ee,re,ce){var be=function(ze){return ze*re},Ae=function(ze){return ze*ce};j.each(function(ze){var Re=q.select(this);if(ze.del)return Re.remove();var Xe=Re.select("text.nums"),it=ze.anchor,ot=it==="end"?-1:1,tt=U(ze),lt=N(ze,ee),Ee=lt.x,_e=lt.y,fe=it==="middle",Fe="hoverlabel"in ze.trace?ze.trace.hoverlabel.showarrow:!0,rt;fe?rt="M-"+be(ze.bx/2+ze.tx2width/2)+","+Ae(_e-ze.by/2)+"h"+be(ze.bx)+"v"+Ae(ze.by)+"h-"+be(ze.bx)+"Z":Fe?rt="M0,0L"+be(ot*p+Ee)+","+Ae(p+_e)+"v"+Ae(ze.by/2-p)+"h"+be(ot*ze.bx)+"v-"+Ae(ze.by)+"H"+be(ot*p+Ee)+"V"+Ae(_e-p)+"Z":rt="M"+be(ot*p+Ee)+","+Ae(_e-ze.by/2)+"h"+be(ot*ze.bx)+"v"+Ae(ze.by)+"h"+be(-ot*ze.bx)+"Z",Re.select("path").attr("d",rt);var st=Ee+tt.textShiftX,Qe=_e+ze.ty0-ze.by/2+u,Lt=ze.textAlign||"auto";Lt!=="auto"&&(Lt==="left"&&it!=="start"?(Xe.attr("text-anchor","start"),st=fe?-ze.bx/2-ze.tx2width/2+u:-ze.bx-u):Lt==="right"&&it!=="end"&&(Xe.attr("text-anchor","end"),st=fe?ze.bx/2-ze.tx2width/2-u:ze.bx+u)),Xe.call(o.positionText,be(st),Ae(Qe)),ze.tx2width&&(Re.select("text.name").call(o.positionText,be(tt.text2ShiftX+tt.alignShift*u+Ee),Ae(_e+ze.ty0-ze.by/2+u)),Re.select("rect").call(i.setRect,be(tt.text2ShiftX+(tt.alignShift-1)*ze.tx2width/2+Ee),Ae(_e-ze.by/2-1),be(ze.tx2width),Ae(ze.by+2)))})}function Q(j,ee){var re=j.index,ce=j.trace||{},be=j.cd[0],Ae=j.cd[re]||{};function ze(lt){return lt||d(lt)&<===0}var Re=Array.isArray(re)?function(lt,Ee){var _e=A.castOption(be,re,lt);return ze(_e)?_e:A.extractOption({},ce,"",Ee)}:function(lt,Ee){return A.extractOption(Ae,ce,lt,Ee)};function Xe(lt,Ee,_e){var fe=Re(Ee,_e);ze(fe)&&(j[lt]=fe)}if(Xe("hoverinfo","hi","hoverinfo"),Xe("bgcolor","hbg","hoverlabel.bgcolor"),Xe("borderColor","hbc","hoverlabel.bordercolor"),Xe("fontFamily","htf","hoverlabel.font.family"),Xe("fontSize","hts","hoverlabel.font.size"),Xe("fontColor","htc","hoverlabel.font.color"),Xe("fontWeight","htw","hoverlabel.font.weight"),Xe("fontStyle","hty","hoverlabel.font.style"),Xe("fontVariant","htv","hoverlabel.font.variant"),Xe("nameLength","hnl","hoverlabel.namelength"),Xe("textAlign","hta","hoverlabel.align"),j.posref=ee==="y"||ee==="closest"&&ce.orientation==="h"?j.xa._offset+(j.x0+j.x1)/2:j.ya._offset+(j.y0+j.y1)/2,j.x0=A.constrain(j.x0,0,j.xa._length),j.x1=A.constrain(j.x1,0,j.xa._length),j.y0=A.constrain(j.y0,0,j.ya._length),j.y1=A.constrain(j.y1,0,j.ya._length),j.xLabelVal!==void 0&&(j.xLabel="xLabel"in j?j.xLabel:c.hoverLabelText(j.xa,j.xLabelVal,ce.xhoverformat),j.xVal=j.xa.c2d(j.xLabelVal)),j.yLabelVal!==void 0&&(j.yLabel="yLabel"in j?j.yLabel:c.hoverLabelText(j.ya,j.yLabelVal,ce.yhoverformat),j.yVal=j.ya.c2d(j.yLabelVal)),j.zLabelVal!==void 0&&j.zLabel===void 0&&(j.zLabel=String(j.zLabelVal)),!isNaN(j.xerr)&&!(j.xa.type==="log"&&j.xerr<=0)){var it=c.tickText(j.xa,j.xa.c2l(j.xerr),"hover").text;j.xerrneg!==void 0?j.xLabel+=" +"+it+" / -"+c.tickText(j.xa,j.xa.c2l(j.xerrneg),"hover").text:j.xLabel+=" \xB1 "+it,ee==="x"&&(j.distance+=1)}if(!isNaN(j.yerr)&&!(j.ya.type==="log"&&j.yerr<=0)){var ot=c.tickText(j.ya,j.ya.c2l(j.yerr),"hover").text;j.yerrneg!==void 0?j.yLabel+=" +"+ot+" / -"+c.tickText(j.ya,j.ya.c2l(j.yerrneg),"hover").text:j.yLabel+=" \xB1 "+ot,ee==="y"&&(j.distance+=1)}var tt=j.hoverinfo||j.trace.hoverinfo;return tt&&tt!=="all"&&(tt=Array.isArray(tt)?tt:tt.split("+"),tt.indexOf("x")===-1&&(j.xLabel=void 0),tt.indexOf("y")===-1&&(j.yLabel=void 0),tt.indexOf("z")===-1&&(j.zLabel=void 0),tt.indexOf("text")===-1&&(j.text=void 0),tt.indexOf("name")===-1&&(j.name=void 0)),j}function ue(j,ee,re){var ce=re.container,be=re.fullLayout,Ae=be._size,ze=re.event,Re=!!ee.hLinePoint,Xe=!!ee.vLinePoint,it,ot;if(ce.selectAll(".spikeline").remove(),!!(Xe||Re)){var tt=n.combine(be.plot_bgcolor,be.paper_bgcolor);if(Re){var lt=ee.hLinePoint,Ee,_e;it=lt&<.xa,ot=lt&<.ya;var fe=ot.spikesnap;fe==="cursor"?(Ee=ze.pointerX,_e=ze.pointerY):(Ee=it._offset+lt.x,_e=ot._offset+lt.y);var Fe=x.readability(lt.color,tt)<1.5?n.contrast(tt):lt.color,rt=ot.spikemode,st=ot.spikethickness,Qe=ot.spikecolor||Fe,Lt=c.getPxPosition(j,ot),kt,Vt;if(rt.indexOf("toaxis")!==-1||rt.indexOf("across")!==-1){if(rt.indexOf("toaxis")!==-1&&(kt=Lt,Vt=Ee),rt.indexOf("across")!==-1){var Zt=ot._counterDomainMin,Sr=ot._counterDomainMax;ot.anchor==="free"&&(Zt=Math.min(Zt,ot.position),Sr=Math.max(Sr,ot.position)),kt=Ae.l+Zt*Ae.w,Vt=Ae.l+Sr*Ae.w}ce.insert("line",":first-child").attr({x1:kt,x2:Vt,y1:_e,y2:_e,"stroke-width":st,stroke:Qe,"stroke-dasharray":i.dashStyle(ot.spikedash,st)}).classed("spikeline",!0).classed("crisp",!0),ce.insert("line",":first-child").attr({x1:kt,x2:Vt,y1:_e,y2:_e,"stroke-width":st+2,stroke:tt}).classed("spikeline",!0).classed("crisp",!0)}rt.indexOf("marker")!==-1&&ce.insert("circle",":first-child").attr({cx:Lt+(ot.side!=="right"?st:-st),cy:_e,r:st,fill:Qe}).classed("spikeline",!0)}if(Xe){var xr=ee.vLinePoint,jr,wr;it=xr&&xr.xa,ot=xr&&xr.ya;var Ir=it.spikesnap;Ir==="cursor"?(jr=ze.pointerX,wr=ze.pointerY):(jr=it._offset+xr.x,wr=ot._offset+xr.y);var bt=x.readability(xr.color,tt)<1.5?n.contrast(tt):xr.color,Be=it.spikemode,Ke=it.spikethickness,Ue=it.spikecolor||bt,Me=c.getPxPosition(j,it),qe,Ce;if(Be.indexOf("toaxis")!==-1||Be.indexOf("across")!==-1){if(Be.indexOf("toaxis")!==-1&&(qe=Me,Ce=wr),Be.indexOf("across")!==-1){var Te=it._counterDomainMin,Pe=it._counterDomainMax;it.anchor==="free"&&(Te=Math.min(Te,it.position),Pe=Math.max(Pe,it.position)),qe=Ae.t+(1-Pe)*Ae.h,Ce=Ae.t+(1-Te)*Ae.h}ce.insert("line",":first-child").attr({x1:jr,x2:jr,y1:qe,y2:Ce,"stroke-width":Ke,stroke:Ue,"stroke-dasharray":i.dashStyle(it.spikedash,Ke)}).classed("spikeline",!0).classed("crisp",!0),ce.insert("line",":first-child").attr({x1:jr,x2:jr,y1:qe,y2:Ce,"stroke-width":Ke+2,stroke:tt}).classed("spikeline",!0).classed("crisp",!0)}Be.indexOf("marker")!==-1&&ce.insert("circle",":first-child").attr({cx:jr,cy:Me-(it.side!=="top"?Ke:-Ke),r:Ke,fill:Ue}).classed("spikeline",!0)}}}function le(j,ee,re){if(!re||re.length!==j._hoverdata.length)return!0;for(var ce=re.length-1;ce>=0;ce--){var be=re[ce],Ae=j._hoverdata[ce];if(be.curveNumber!==Ae.curveNumber||String(be.pointNumber)!==String(Ae.pointNumber)||String(be.pointNumbers)!==String(Ae.pointNumbers)||be.binNumber!==Ae.binNumber)return!0}return!1}function he(j,ee){return!ee||ee.vLinePoint!==j._spikepoints.vLinePoint||ee.hLinePoint!==j._spikepoints.hLinePoint}function G(j,ee){return o.plainText(j||"",{len:ee,allowedTags:["br","sub","sup","b","i","em","s","u"]})}function $(j,ee){for(var re=ee.charAt(0),ce=[],be=[],Ae=[],ze=0;ze"," plotly-logomark"," "," "," "," "," "," "," "," "," "," "," "," "," ",""].join("")}}}}),T2=Ze({"src/components/shapes/draw_newshape/constants.js"(Z,q){"use strict";var d=32;q.exports={CIRCLE_SIDES:d,i000:0,i090:d/4,i180:d/2,i270:d/4*3,cos45:Math.cos(Math.PI/4),sin45:Math.sin(Math.PI/4),SQRT2:Math.sqrt(2)}}}),A2=Ze({"src/components/selections/helpers.js"(Z,q){"use strict";var d=ca().strTranslate;function x(t,r){switch(t.type){case"log":return t.p2d(r);case"date":return t.p2r(r,0,t.calendar);default:return t.p2r(r)}}function A(t,r){switch(t.type){case"log":return t.d2p(r);case"date":return t.r2p(r,0,t.calendar);default:return t.r2p(r)}}function M(t){var r=t._id.charAt(0)==="y"?1:0;return function(o){return x(t,o[r])}}function e(t){return d(t.xaxis._offset,t.yaxis._offset)}q.exports={p2r:x,r2p:A,axValue:M,getTransform:e}}}),t0=Ze({"src/components/shapes/draw_newshape/helpers.js"(Z){"use strict";var q=M_(),d=T2(),x=d.CIRCLE_SIDES,A=d.SQRT2,M=A2(),e=M.p2r,t=M.r2p,r=[0,3,4,5,6,1,2],o=[0,3,4,1,2];Z.writePaths=function(n){var s=n.length;if(!s)return"M0,0Z";for(var c="",f=0;f0&&_l&&(w="X"),w});return f>l&&(_=_.replace(/[\s,]*X.*/,""),d.log("Ignoring extra params in segment "+c)),g+_})}function M(e,t){t=t||0;var r=0;return t&&e&&(e.type==="category"||e.type==="multicategory")&&(r=(e.r2p(1)-e.r2p(0))*t),r}}}),b5=Ze({"src/components/shapes/display_labels.js"(Z,q){"use strict";var d=ca(),x=Wo(),A=fu(),M=as(),e=t0().readPaths,t=r0(),r=t.getPathString,o=d2(),a=mh().FROM_TL;q.exports=function(c,f,g,v){if(v.selectAll(".shape-label").remove(),!!(g.label.text||g.label.texttemplate)){var T;if(g.label.texttemplate){var l={};if(g.type!=="path"){var _=x.getFromId(c,g.xref),w=x.getFromId(c,g.yref);for(var S in o){var E=o[S](g,_,w);E!==void 0&&(l[S]=E)}}T=d.texttemplateStringForShapes(g.label.texttemplate,{},c._fullLayout._d3locale,l)}else T=g.label.text;var y={"data-index":f},b=g.label.font,p={"data-notex":1},u=v.append("g").attr(y).classed("shape-label",!0),m=u.append("text").attr(p).classed("shape-label-text",!0).text(T),h,P,L,z;if(g.path){var F=r(c,g),B=e(F,c);h=1/0,L=1/0,P=-1/0,z=-1/0;for(var O=0;O=s?v=c-g:v=g-c,-180/Math.PI*Math.atan2(v,T)}function n(s,c,f,g,v,T,l){var _=v.label.textposition,w=v.label.textangle,S=v.label.padding,E=v.type,y=Math.PI/180*T,b=Math.sin(y),p=Math.cos(y),u=v.label.xanchor,m=v.label.yanchor,h,P,L,z;if(E==="line"){_==="start"?(h=s,P=c):_==="end"?(h=f,P=g):(h=(s+f)/2,P=(c+g)/2),u==="auto"&&(_==="start"?w==="auto"?f>s?u="left":fs?u="right":fs?u="right":fs?u="left":f1&&!(tt.length===2&&tt[1][0]==="Z")&&(G===0&&(tt[0][0]="M"),h[he]=tt,B(),O())}}function ce(tt,lt){if(tt===2){he=+lt.srcElement.getAttribute("data-i"),G=+lt.srcElement.getAttribute("data-j");var Ee=h[he];!T(Ee)&&!l(Ee)&&re()}}function be(tt){ue=[];for(var lt=0;ltB&&Te>O&&!Me.shiftKey?s.getCursor(Pe/Ce,1-at/Te):"move";c(h,yt),kt=yt.split("-")[0]}}function xr(Me){l(m)||(I&&($=fe(P.xanchor)),N&&(J=Fe(P.yanchor)),P.type==="path"?Ae=P.path:(ue=I?P.x0:fe(P.x0),le=N?P.y0:Fe(P.y0),he=I?P.x1:fe(P.x1),G=N?P.y1:Fe(P.y1)),ueG?(X=le,ee="y0",oe=G,re="y1"):(X=G,ee="y1",oe=le,re="y0"),Sr(Me),Be(z,P),Ue(h,P,m),Lt.moveFn=kt==="move"?Ir:bt,Lt.altKey=Me.altKey)}function jr(){l(m)||(c(h),Ke(z),S(h,m,P),x.call("_guiRelayout",m,F.getUpdateObj()))}function wr(){l(m)||Ke(z)}function Ir(Me,qe){if(P.type==="path"){var Ce=function(at){return at},Te=Ce,Pe=Ce;I?Q("xanchor",P.xanchor=rt($+Me)):(Te=function(yt){return rt(fe(yt)+Me)},Re&&Re.type==="date"&&(Te=g.encodeDate(Te))),N?Q("yanchor",P.yanchor=st(J+qe)):(Pe=function(yt){return st(Fe(yt)+qe)},it&&it.type==="date"&&(Pe=g.encodeDate(Pe))),Q("path",P.path=y(Ae,Te,Pe))}else I?Q("xanchor",P.xanchor=rt($+Me)):(Q("x0",P.x0=rt(ue+Me)),Q("x1",P.x1=rt(he+Me))),N?Q("yanchor",P.yanchor=st(J+qe)):(Q("y0",P.y0=st(le+qe)),Q("y1",P.y1=st(G+qe)));h.attr("d",v(m,P)),Be(z,P),r(m,L,P,ze)}function bt(Me,qe){if(W){var Ce=function(za){return za},Te=Ce,Pe=Ce;I?Q("xanchor",P.xanchor=rt($+Me)):(Te=function(ti){return rt(fe(ti)+Me)},Re&&Re.type==="date"&&(Te=g.encodeDate(Te))),N?Q("yanchor",P.yanchor=st(J+qe)):(Pe=function(ti){return st(Fe(ti)+qe)},it&&it.type==="date"&&(Pe=g.encodeDate(Pe))),Q("path",P.path=y(Ae,Te,Pe))}else if(U){if(kt==="resize-over-start-point"){var at=ue+Me,yt=N?le-qe:le+qe;Q("x0",P.x0=I?at:rt(at)),Q("y0",P.y0=N?yt:st(yt))}else if(kt==="resize-over-end-point"){var Tt=he+Me,Ot=N?G-qe:G+qe;Q("x1",P.x1=I?Tt:rt(Tt)),Q("y1",P.y1=N?Ot:st(Ot))}}else{var Gt=function(za){return kt.indexOf(za)!==-1},rr=Gt("n"),Qt=Gt("s"),Tr=Gt("w"),la=Gt("e"),Ua=rr?X+qe:X,Ba=Qt?oe+qe:oe,Ra=Tr?ie+Me:ie,ei=la?j+Me:j;N&&(rr&&(Ua=X-qe),Qt&&(Ba=oe-qe)),(!N&&Ba-Ua>O||N&&Ua-Ba>O)&&(Q(ee,P[ee]=N?Ua:st(Ua)),Q(re,P[re]=N?Ba:st(Ba))),ei-Ra>B&&(Q(ce,P[ce]=I?Ra:rt(Ra)),Q(be,P[be]=I?ei:rt(ei)))}h.attr("d",v(m,P)),Be(z,P),r(m,L,P,ze)}function Be(Me,qe){(I||N)&&Ce();function Ce(){var Te=qe.type!=="path",Pe=Me.selectAll(".visual-cue").data([0]),at=1;Pe.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":at}).classed("visual-cue",!0);var yt=fe(I?qe.xanchor:A.midRange(Te?[qe.x0,qe.x1]:g.extractPathCoords(qe.path,f.paramIsX))),Tt=Fe(N?qe.yanchor:A.midRange(Te?[qe.y0,qe.y1]:g.extractPathCoords(qe.path,f.paramIsY)));if(yt=g.roundPositionForSharpStrokeRendering(yt,at),Tt=g.roundPositionForSharpStrokeRendering(Tt,at),I&&N){var Ot="M"+(yt-1-at)+","+(Tt-1-at)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";Pe.attr("d",Ot)}else if(I){var Gt="M"+(yt-1-at)+","+(Tt-9-at)+"v18 h2 v-18 Z";Pe.attr("d",Gt)}else{var rr="M"+(yt-9-at)+","+(Tt-1-at)+"h18 v2 h-18 Z";Pe.attr("d",rr)}}}function Ke(Me){Me.selectAll(".visual-cue").remove()}function Ue(Me,qe,Ce){var Te=qe.xref,Pe=qe.yref,at=M.getFromId(Ce,Te),yt=M.getFromId(Ce,Pe),Tt="";Te!=="paper"&&!at.autorange&&(Tt+=Te),Pe!=="paper"&&!yt.autorange&&(Tt+=Pe),i.setClipUrl(Me,Tt?"clip"+Ce._fullLayout._uid+Tt:null,Ce)}}function y(m,h,P){return m.replace(f.segmentRE,function(L){var z=0,F=L.charAt(0),B=f.paramIsX[F],O=f.paramIsY[F],I=f.numParams[F],N=L.substr(1).replace(f.paramRE,function(U){return z>=I||(B[z]?U=h(U):O[z]&&(U=P(U)),z++),U});return F+N})}function b(m,h){if(_(m)){var P=h.node(),L=+P.getAttribute("data-index");if(L>=0){if(L===m._fullLayout._activeShapeIndex){p(m);return}m._fullLayout._activeShapeIndex=L,m._fullLayout._deactivateShape=p,T(m)}}}function p(m){if(_(m)){var h=m._fullLayout._activeShapeIndex;h>=0&&(o(m),delete m._fullLayout._activeShapeIndex,T(m))}}function u(m){if(_(m)){o(m);var h=m._fullLayout._activeShapeIndex,P=(m.layout||{}).shapes||[];if(h1?(le=["toggleHover"],he=["resetViews"]):u?(ue=["zoomInGeo","zoomOutGeo"],le=["hoverClosestGeo"],he=["resetGeo"]):p?(le=["hoverClosest3d"],he=["resetCameraDefault3d","resetCameraLastSave3d"]):L?(ue=["zoomInMapbox","zoomOutMapbox"],le=["toggleHover"],he=["resetViewMapbox"]):z?(ue=["zoomInMap","zoomOutMap"],le=["toggleHover"],he=["resetViewMap"]):m?le=["hoverClosestPie"]:O?(le=["hoverClosestCartesian","hoverCompareCartesian"],he=["resetViewSankey"]):le=["toggleHover"],b&&le.push("toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"),(s(T)||N)&&(le=[]),b&&!I&&(ue=["zoomIn2d","zoomOut2d","autoScale2d"],he[0]!=="resetViews"&&(he=["resetScale2d"])),p?G=["zoom3d","pan3d","orbitRotation","tableRotation"]:b&&!I||P?G=["zoom2d","pan2d"]:L||z||u?G=["pan2d"]:F&&(G=["zoom2d"]),n(T)&&G.push("select2d","lasso2d");var $=[],J=function(j){$.indexOf(j)===-1&&le.indexOf(j)!==-1&&$.push(j)};if(Array.isArray(E)){for(var X=[],oe=0;oew?T.substr(w):l.substr(_))+S}function c(g,v){for(var T=v._size,l=T.h/T.w,_={},w=Object.keys(g),S=0;St*P&&!B)){for(w=0;wG&&rele&&(le=re);var be=(le-ue)/(2*he);u/=be,ue=y.l2r(ue),le=y.l2r(le),y.range=y._input.range=U=O[1]||W[1]<=O[0])&&Q[0]I[0])return!0}return!1}function S(O){var I=O._fullLayout,N=I._size,U=N.p,W=i.list(O,"",!0),Q,ue,le,he,G,$;if(I._paperdiv.style({width:O._context.responsive&&I.autosize&&!O._context._hasZeroWidth&&!O.layout.width?"100%":I.width+"px",height:O._context.responsive&&I.autosize&&!O._context._hasZeroHeight&&!O.layout.height?"100%":I.height+"px"}).selectAll(".main-svg").call(r.setSize,I.width,I.height),O._context.setBackground(O,I.paper_bgcolor),Z.drawMainTitle(O),a.manage(O),!I._has("cartesian"))return x.previousPromises(O);function J(Ue,Me,qe){var Ce=Ue._lw/2;if(Ue._id.charAt(0)==="x"){if(Me){if(qe==="top")return Me._offset-U-Ce}else return N.t+N.h*(1-(Ue.position||0))+Ce%1;return Me._offset+Me._length+U+Ce}if(Me){if(qe==="right")return Me._offset+Me._length+U+Ce}else return N.l+N.w*(Ue.position||0)+Ce%1;return Me._offset-U-Ce}for(Q=0;Q0){h(O,Q,G,he),le.attr({x:ue,y:Q,"text-anchor":U,dy:z(I.yanchor)}).call(M.positionText,ue,Q);var $=(I.text.match(M.BR_TAG_ALL)||[]).length;if($){var J=n.LINE_SPACING*$+n.MID_SHIFT;I.y===0&&(J=-J),le.selectAll(".line").each(function(){var ee=+this.getAttribute("dy").slice(0,-2)-J+"em";this.setAttribute("dy",ee)})}var X=q.select(O).selectAll(".gtitle-subtitle");if(X.node()){var oe=le.node().getBBox(),ie=oe.y+oe.height,j=ie+o.SUBTITLE_PADDING_EM*I.subtitle.font.size;X.attr({x:ue,y:j,"text-anchor":U,dy:z(I.yanchor)}).call(M.positionText,ue,j)}}}};function p(O,I,N,U,W){var Q=I.yref==="paper"?O._fullLayout._size.h:O._fullLayout.height,ue=A.isTopAnchor(I)?U:U-W,le=N==="b"?Q-ue:ue;return A.isTopAnchor(I)&&N==="t"||A.isBottomAnchor(I)&&N==="b"?!1:le.5?"t":"b",ue=O._fullLayout.margin[Q],le=0;return I.yref==="paper"?le=N+I.pad.t+I.pad.b:I.yref==="container"&&(le=u(Q,U,W,O._fullLayout.height,N)+I.pad.t+I.pad.b),le>ue?le:0}function h(O,I,N,U){var W="title.automargin",Q=O._fullLayout.title,ue=Q.y>.5?"t":"b",le={x:Q.x,y:Q.y,t:0,b:0},he={};Q.yref==="paper"&&p(O,Q,ue,I,U)?le[ue]=N:Q.yref==="container"&&(he[ue]=N,O._fullLayout._reservedMargin[W]=he),x.allowAutoMargin(O,W),x.autoMargin(O,W,le)}function P(O,I){var N=O.title,U=O._size,W=0;switch(I===v?W=N.pad.l:I===l&&(W=-N.pad.r),N.xref){case"paper":return U.l+U.w*N.x+W;case"container":default:return O.width*N.x+W}}function L(O,I){var N=O.title,U=O._size,W=0;if(I==="0em"||!I?W=-N.pad.b:I===n.CAP_SHIFT+"em"&&(W=N.pad.t),N.y==="auto")return U.t/2;switch(N.yref){case"paper":return U.t+U.h-U.h*N.y+W;case"container":default:return O.height-O.height*N.y+W}}function z(O){return O==="top"?n.CAP_SHIFT+.3+"em":O==="bottom"?"-0.3em":n.MID_SHIFT+"em"}function F(O){var I=O.title,N=T;return A.isRightAnchor(I)?N=l:A.isLeftAnchor(I)&&(N=v),N}function B(O){var I=O.title,N="0em";return A.isTopAnchor(I)?N=n.CAP_SHIFT+"em":A.isMiddleAnchor(I)&&(N=n.MID_SHIFT+"em"),N}Z.doTraceStyle=function(O){var I=O.calcdata,N=[],U;for(U=0;U=0;F--){var B=E.append("path").attr(b).style("opacity",F?.1:p).call(M.stroke,m).call(M.fill,u).call(e.dashLine,F?"solid":P,F?4+h:h);if(s(B,v,_),L){var O=t(v.layout,"selections",_);B.style({cursor:"move"});var I={element:B.node(),plotinfo:w,gd:v,editHelpers:O,isActiveSelection:!0},N=d(y,v);x(N,B,I)}else B.style("pointer-events",F?"all":"none");z[F]=B}var U=z[0],W=z[1];W.node().addEventListener("click",function(){return c(v,U)})}}function s(v,T,l){var _=l.xref+l.yref;e.setClipUrl(v,"clip"+T._fullLayout._uid+_,T)}function c(v,T){if(i(v)){var l=T.node(),_=+l.getAttribute("data-index");if(_>=0){if(_===v._fullLayout._activeSelectionIndex){g(v);return}v._fullLayout._activeSelectionIndex=_,v._fullLayout._deactivateSelection=g,a(v)}}}function f(v){if(i(v)){var T=v._fullLayout.selections.length-1;v._fullLayout._activeSelectionIndex=T,v._fullLayout._deactivateSelection=g,a(v)}}function g(v){if(i(v)){var T=v._fullLayout._activeSelectionIndex;T>=0&&(A(v),delete v._fullLayout._activeSelectionIndex,a(v))}}}}),Tz=Ze({"node_modules/polybooljs/lib/build-log.js"(Z,q){function d(){var x,A=0,M=!1;function e(t,r){return x.list.push({type:t,data:r?JSON.parse(JSON.stringify(r)):void 0}),x}return x={list:[],segmentId:function(){return A++},checkIntersection:function(t,r){return e("check",{seg1:t,seg2:r})},segmentChop:function(t,r){return e("div_seg",{seg:t,pt:r}),e("chop",{seg:t,pt:r})},statusRemove:function(t){return e("pop_seg",{seg:t})},segmentUpdate:function(t){return e("seg_update",{seg:t})},segmentNew:function(t,r){return e("new_seg",{seg:t,primary:r})},segmentRemove:function(t){return e("rem_seg",{seg:t})},tempStatus:function(t,r,o){return e("temp_status",{seg:t,above:r,below:o})},rewind:function(t){return e("rewind",{seg:t})},status:function(t,r,o){return e("status",{seg:t,above:r,below:o})},vert:function(t){return t===M?x:(M=t,e("vert",{x:t}))},log:function(t){return typeof t!="string"&&(t=JSON.stringify(t,!1," ")),e("log",{txt:t})},reset:function(){return e("reset")},selected:function(t){return e("selected",{segs:t})},chainStart:function(t){return e("chain_start",{seg:t})},chainRemoveHead:function(t,r){return e("chain_rem_head",{index:t,pt:r})},chainRemoveTail:function(t,r){return e("chain_rem_tail",{index:t,pt:r})},chainNew:function(t,r){return e("chain_new",{pt1:t,pt2:r})},chainMatch:function(t){return e("chain_match",{index:t})},chainClose:function(t){return e("chain_close",{index:t})},chainAddHead:function(t,r){return e("chain_add_head",{index:t,pt:r})},chainAddTail:function(t,r){return e("chain_add_tail",{index:t,pt:r})},chainConnect:function(t,r){return e("chain_con",{index1:t,index2:r})},chainReverse:function(t){return e("chain_rev",{index:t})},chainJoin:function(t,r){return e("chain_join",{index1:t,index2:r})},done:function(){return e("done")}},x}q.exports=d}}),Az=Ze({"node_modules/polybooljs/lib/epsilon.js"(Z,q){function d(x){typeof x!="number"&&(x=1e-10);var A={epsilon:function(M){return typeof M=="number"&&(x=M),x},pointAboveOrOnLine:function(M,e,t){var r=e[0],o=e[1],a=t[0],i=t[1],n=M[0],s=M[1];return(a-r)*(s-o)-(i-o)*(n-r)>=-x},pointBetween:function(M,e,t){var r=M[1]-e[1],o=t[0]-e[0],a=M[0]-e[0],i=t[1]-e[1],n=a*o+r*i;if(n-x)},pointsSameX:function(M,e){return Math.abs(M[0]-e[0])x!=a-r>x&&(o-s)*(r-c)/(a-c)+s-t>x&&(i=!i),o=s,a=c}return i}};return A}q.exports=d}}),Sz=Ze({"node_modules/polybooljs/lib/linked-list.js"(Z,q){var d={create:function(){var x={root:{root:!0,next:null},exists:function(A){return!(A===null||A===x.root)},isEmpty:function(){return x.root.next===null},getHead:function(){return x.root.next},insertBefore:function(A,M){for(var e=x.root,t=x.root.next;t!==null;){if(M(t)){A.prev=t.prev,A.next=t,t.prev.next=A,t.prev=A;return}e=t,t=t.next}e.next=A,A.prev=e,A.next=null},findTransition:function(A){for(var M=x.root,e=x.root.next;e!==null&&!A(e);)M=e,e=e.next;return{before:M===x.root?null:M,after:e,insert:function(t){return t.prev=M,t.next=e,M.next=t,e!==null&&(e.prev=t),t}}}};return x},node:function(x){return x.prev=null,x.next=null,x.remove=function(){x.prev.next=x.next,x.next&&(x.next.prev=x.prev),x.prev=null,x.next=null},x}};q.exports=d}}),Mz=Ze({"node_modules/polybooljs/lib/intersecter.js"(Z,q){var d=Sz();function x(A,M,e){function t(T,l){return{id:e?e.segmentId():-1,start:T,end:l,myFill:{above:null,below:null},otherFill:null}}function r(T,l,_){return{id:e?e.segmentId():-1,start:T,end:l,myFill:{above:_.myFill.above,below:_.myFill.below},otherFill:null}}var o=d.create();function a(T,l,_,w,S,E){var y=M.pointsCompare(l,S);return y!==0?y:M.pointsSame(_,E)?0:T!==w?T?1:-1:M.pointAboveOrOnLine(_,w?S:E,w?E:S)?1:-1}function i(T,l){o.insertBefore(T,function(_){var w=a(T.isStart,T.pt,l,_.isStart,_.pt,_.other.pt);return w<0})}function n(T,l){var _=d.node({isStart:!0,pt:T.start,seg:T,primary:l,other:null,status:null});return i(_,T.end),_}function s(T,l,_){var w=d.node({isStart:!1,pt:l.end,seg:l,primary:_,other:T,status:null});T.other=w,i(w,T.pt)}function c(T,l){var _=n(T,l);return s(_,T,l),_}function f(T,l){e&&e.segmentChop(T.seg,l),T.other.remove(),T.seg.end=l,T.other.pt=l,i(T.other,T.pt)}function g(T,l){var _=r(l,T.seg.end,T.seg);return f(T,l),c(_,T.primary)}function v(T,l){var _=d.create();function w(O,I){var N=O.seg.start,U=O.seg.end,W=I.seg.start,Q=I.seg.end;return M.pointsCollinear(N,W,Q)?M.pointsCollinear(U,W,Q)||M.pointAboveOrOnLine(U,W,Q)?1:-1:M.pointAboveOrOnLine(N,W,Q)?1:-1}function S(O){return _.findTransition(function(I){var N=w(O,I.ev);return N>0})}function E(O,I){var N=O.seg,U=I.seg,W=N.start,Q=N.end,ue=U.start,le=U.end;e&&e.checkIntersection(N,U);var he=M.linesIntersect(W,Q,ue,le);if(he===!1){if(!M.pointsCollinear(W,Q,ue)||M.pointsSame(W,le)||M.pointsSame(Q,ue))return!1;var G=M.pointsSame(W,ue),$=M.pointsSame(Q,le);if(G&&$)return I;var J=!G&&M.pointBetween(W,ue,le),X=!$&&M.pointBetween(Q,ue,le);if(G)return X?g(I,Q):g(O,le),I;J&&($||(X?g(I,Q):g(O,le)),g(I,W))}else he.alongA===0&&(he.alongB===-1?g(O,ue):he.alongB===0?g(O,he.pt):he.alongB===1&&g(O,le)),he.alongB===0&&(he.alongA===-1?g(I,W):he.alongA===0?g(I,he.pt):he.alongA===1&&g(I,Q));return!1}for(var y=[];!o.isEmpty();){var b=o.getHead();if(e&&e.vert(b.pt[0]),b.isStart){let O=function(){if(m){var I=E(b,m);if(I)return I}return h?E(b,h):!1};var p=O;e&&e.segmentNew(b.seg,b.primary);var u=S(b),m=u.before?u.before.ev:null,h=u.after?u.after.ev:null;e&&e.tempStatus(b.seg,m?m.seg:!1,h?h.seg:!1);var P=O();if(P){if(A){var L;b.seg.myFill.below===null?L=!0:L=b.seg.myFill.above!==b.seg.myFill.below,L&&(P.seg.myFill.above=!P.seg.myFill.above)}else P.seg.otherFill=b.seg.myFill;e&&e.segmentUpdate(P.seg),b.other.remove(),b.remove()}if(o.getHead()!==b){e&&e.rewind(b.seg);continue}if(A){var L;b.seg.myFill.below===null?L=!0:L=b.seg.myFill.above!==b.seg.myFill.below,h?b.seg.myFill.below=h.seg.myFill.above:b.seg.myFill.below=T,L?b.seg.myFill.above=!b.seg.myFill.below:b.seg.myFill.above=b.seg.myFill.below}else if(b.seg.otherFill===null){var z;h?b.primary===h.primary?z=h.seg.otherFill.above:z=h.seg.myFill.above:z=b.primary?l:T,b.seg.otherFill={above:z,below:z}}e&&e.status(b.seg,m?m.seg:!1,h?h.seg:!1),b.other.status=u.insert(d.node({ev:b}))}else{var F=b.status;if(F===null)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(_.exists(F.prev)&&_.exists(F.next)&&E(F.prev.ev,F.next.ev),e&&e.statusRemove(F.ev.seg),F.remove(),!b.primary){var B=b.seg.myFill;b.seg.myFill=b.seg.otherFill,b.seg.otherFill=B}y.push(b.seg)}o.getHead().remove()}return e&&e.done(),y}return A?{addRegion:function(T){for(var l,_=T[T.length-1],w=0;wr!=g>r&&t<(f-s)*(r-c)/(g-c)+s;v&&(o=!o)}return o}}}),P_=Ze({"src/lib/polygon.js"(Z,q){"use strict";var d=p2().dot,x=qs().BADNUM,A=q.exports={};A.tester=function(e){var t=e.slice(),r=t[0][0],o=r,a=t[0][1],i=a,n;for((t[t.length-1][0]!==t[0][0]||t[t.length-1][1]!==t[0][1])&&t.push(t[0]),n=1;no||S===x||Si||_&&c(l))}function g(l,_){var w=l[0],S=l[1];if(w===x||wo||S===x||Si)return!1;var E=t.length,y=t[0][0],b=t[0][1],p=0,u,m,h,P,L;for(u=1;uMath.max(m,y)||S>Math.max(h,b)))if(Sn||Math.abs(d(g,c))>o)return!0;return!1},A.filter=function(e,t){var r=[e[0]],o=0,a=0;function i(s){e.push(s);var c=r.length,f=o;r.splice(a+1);for(var g=f+1;g1){var n=e.pop();i(n)}return{addPt:i,raw:e,filtered:r}}}}),Iz=Ze({"src/components/selections/constants.js"(Z,q){"use strict";q.exports={BENDPX:1.5,MINSELECT:12,SELECTDELAY:100,SELECTID:"-select"}}}),Rz=Ze({"src/components/selections/select.js"(Z,q){"use strict";var d=Lz(),x=Pz(),A=oo(),M=as().dashStyle,e=Yn(),t=ef(),r=Qp().makeEventData,o=Jd(),a=o.freeMode,i=o.rectMode,n=o.drawMode,s=o.openMode,c=o.selectMode,f=r0(),g=k_(),v=M2(),T=Jm().clearOutline,l=t0(),_=l.handleEllipse,w=l.readPaths,S=S2().newShapes,E=x5(),y=E5().activateLastSelection,b=ca(),p=b.sorterAsc,u=P_(),m=g2(),h=$c().getFromId,P=C_(),L=L_().redrawReglTraces,z=Iz(),F=z.MINSELECT,B=u.filter,O=u.tester,I=A2(),N=I.p2r,U=I.axValue,W=I.getTransform;function Q(Be){return Be.subplot!==void 0}function ue(Be,Ke,Ue,Me,qe){var Ce=!Q(Me),Te=a(qe),Pe=i(qe),at=s(qe),yt=n(qe),Tt=c(qe),Ot=qe==="drawline",Gt=qe==="drawcircle",rr=Ot||Gt,Qt=Me.gd,Tr=Qt._fullLayout,la=Tt&&Tr.newselection.mode==="immediate"&&Ce,Ua=Tr._zoomlayer,Ba=Me.element.getBoundingClientRect(),Ra=Me.plotinfo,ei=W(Ra),za=Ke-Ba.left,ti=Ue-Ba.top;Tr._calcInverseTransform(Qt);var Ci=b.apply3DTransform(Tr._invTransform)(za,ti);za=Ci[0],ti=Ci[1];var Jt=Tr._invScaleX,Nt=Tr._invScaleY,Kt=za,Wt=ti,Pr="M"+za+","+ti,ta=Me.xaxes[0],ma=Me.yaxes[0],ra=ta._length,Ia=ma._length,Ha=Be.altKey&&!(n(qe)&&at),$a,ai,mi,xt,ct,Nr,Or;X(Be,Qt,Me),Te&&($a=B([[za,ti]],z.BENDPX));var Rr=Ua.selectAll("path.select-outline-"+Ra.id).data([1]),Lr=yt?Tr.newshape:Tr.newselection;yt&&(Me.hasText=Lr.label.text||Lr.label.texttemplate);var Gr=yt&&!at?Lr.fillcolor:"rgba(0,0,0,0)",Kr=Lr.line.color||(Ce?e.contrast(Qt._fullLayout.plot_bgcolor):"#7f7f7f");Rr.enter().append("path").attr("class","select-outline select-outline-"+Ra.id).style({opacity:yt?Lr.opacity/2:1,"stroke-dasharray":M(Lr.line.dash,Lr.line.width),"stroke-width":Lr.line.width+"px","shape-rendering":"crispEdges"}).call(e.stroke,Kr).call(e.fill,Gr).attr("fill-rule","evenodd").classed("cursor-move",!!yt).attr("transform",ei).attr("d",Pr+"Z");var Ur=Ua.append("path").attr("class","zoombox-corners").style({fill:e.background,stroke:e.defaultLine,"stroke-width":1}).attr("transform",ei).attr("d","M0,0Z");if(yt&&Me.hasText){var aa=Ua.select(".label-temp");aa.empty()&&(aa=Ua.append("g").classed("label-temp",!0).classed("select-outline",!0).style({opacity:.8}))}var da=Tr._uid+z.SELECTID,fa=[],It=re(Qt,Me.xaxes,Me.yaxes,Me.subplot);la&&!Be.shiftKey&&(Me._clearSubplotSelections=function(){if(Ce){var kr=ta._id,ia=ma._id;st(Qt,kr,ia,It);for(var Ca=(Qt.layout||{}).selections||[],Fa=[],Ya=!1,ha=0;ha=0){Qt._fullLayout._deactivateShape(Qt);return}if(!yt){var Ca=Tr.clickmode;m.done(da).then(function(){if(m.clear(da),kr===2){for(Rr.remove(),ct=0;ct-1&&le(ia,Qt,Me.xaxes,Me.yaxes,Me.subplot,Me,Rr),Ca==="event"&&Ir(Qt,void 0);t.click(Qt,ia,Ra.id)}).catch(b.error)}},Me.doneFn=function(){Ur.remove(),m.done(da).then(function(){m.clear(da),!la&&xt&&Me.selectionDefs&&(xt.subtract=Ha,Me.selectionDefs.push(xt),Me.mergedPolygons.length=0,[].push.apply(Me.mergedPolygons,mi)),(la||yt)&&j(Me,la),Me.doneFnCompleted&&Me.doneFnCompleted(fa),Tt&&Ir(Qt,Or)}).catch(b.error)}}function le(Be,Ke,Ue,Me,qe,Ce,Te){var Pe=Ke._hoverdata,at=Ke._fullLayout,yt=at.clickmode,Tt=yt.indexOf("event")>-1,Ot=[],Gt,rr,Qt,Tr,la,Ua,Ba,Ra,ei,za;if(be(Pe)){X(Be,Ke,Ce),Gt=re(Ke,Ue,Me,qe);var ti=Ae(Pe,Gt),Ci=ti.pointNumbers.length>0;if(Ci?Re(Gt,ti):Xe(Gt)&&(Ba=ze(ti))){for(Te&&Te.remove(),za=0;za=0}function ie(Be){return Be._fullLayout._activeSelectionIndex>=0}function j(Be,Ke){var Ue=Be.dragmode,Me=Be.plotinfo,qe=Be.gd;oe(qe)&&qe._fullLayout._deactivateShape(qe),ie(qe)&&qe._fullLayout._deactivateSelection(qe);var Ce=qe._fullLayout,Te=Ce._zoomlayer,Pe=n(Ue),at=c(Ue);if(Pe||at){var yt=Te.selectAll(".select-outline-"+Me.id);if(yt&&qe._fullLayout._outlining){var Tt;Pe&&(Tt=S(yt,Be)),Tt&&A.call("_guiRelayout",qe,{shapes:Tt});var Ot;at&&!Q(Be)&&(Ot=E(yt,Be)),Ot&&(qe._fullLayout._noEmitSelectedAtStart=!0,A.call("_guiRelayout",qe,{selections:Ot}).then(function(){Ke&&y(qe)})),qe._fullLayout._outlining=!1}}Me.selection={},Me.selection.selectionDefs=Be.selectionDefs=[],Me.selection.mergedPolygons=Be.mergedPolygons=[]}function ee(Be){return Be._id}function re(Be,Ke,Ue,Me){if(!Be.calcdata)return[];var qe=[],Ce=Ke.map(ee),Te=Ue.map(ee),Pe,at,yt;for(yt=0;yt0,Ce=qe?Me[0]:Ue;return Ke.selectedpoints?Ke.selectedpoints.indexOf(Ce)>-1:!1}function Re(Be,Ke){var Ue=[],Me,qe,Ce,Te;for(Te=0;Te0&&Ue.push(Me);if(Ue.length===1&&(Ce=Ue[0]===Ke.searchInfo,Ce&&(qe=Ke.searchInfo.cd[0].trace,qe.selectedpoints.length===Ke.pointNumbers.length))){for(Te=0;Te1||(Ke+=Me.selectedpoints.length,Ke>1)))return!1;return Ke===1}function it(Be,Ke,Ue){var Me;for(Me=0;Me-1&&Ke;if(!Te&&Ke){var kr=Lt(Be,!0);if(kr.length){var ia=kr[0].xref,Ca=kr[0].yref;if(ia&&Ca){var Fa=Zt(kr),Ya=xr([h(Be,ia,"x"),h(Be,Ca,"y")]);Ya(fa,Fa)}}Be._fullLayout._noEmitSelectedAtStart?Be._fullLayout._noEmitSelectedAtStart=!1:dr&&Ir(Be,fa),Gt._reselect=!1}if(!Te&&Gt._deselect){var ha=Gt._deselect;Pe=ha.xref,at=ha.yref,rt(Pe,at,Tt)||st(Be,Pe,at,Me),dr&&(fa.points.length?Ir(Be,fa):bt(Be)),Gt._deselect=!1}return{eventData:fa,selectionTesters:Ue}}function Fe(Be){var Ke=Be.calcdata;if(Ke)for(var Ue=0;Ue=0){Gr._fullLayout._deactivateShape(Gr);return}var Kr=Gr._fullLayout.clickmode;if($(Gr),Rr===2&&!Ee&&ai(),lt)Kr.indexOf("select")>-1&&p(Lr,Gr,st,Qe,be.id,Tt),Kr.indexOf("event")>-1&&n.click(Gr,Lr,be.id);else if(Rr===1&&Ee){var Ur=it?fe:_e,aa=it==="s"||ot==="w"?0:1,da=Ur._name+".range["+aa+"]",fa=I(Ur,aa),It="left",dr="middle";if(Ur.fixedrange)return;it?(dr=it==="n"?"top":"bottom",Ur.side==="right"&&(It="right")):ot==="e"&&(It="right"),Gr._context.showAxisRangeEntryBoxes&&d.select(yt).call(o.makeEditable,{gd:Gr,immediate:!0,background:Gr._fullLayout.paper_bgcolor,text:String(fa),fill:Ur.tickfont?Ur.tickfont.color:"#444",horizontalAlign:It,verticalAlign:dr}).on("edit",function(kr){var ia=Ur.d2r(kr);ia!==void 0&&t.call("_guiRelayout",Gr,da,ia)})}}f.init(Tt);var rr,Qt,Tr,la,Ua,Ba,Ra,ei,za,ti;function Ci(Rr,Lr,Gr){var Kr=yt.getBoundingClientRect();rr=Lr-Kr.left,Qt=Gr-Kr.top,ce._fullLayout._calcInverseTransform(ce);var Ur=x.apply3DTransform(ce._fullLayout._invTransform)(rr,Qt);rr=Ur[0],Qt=Ur[1],Tr={l:rr,r:rr,w:0,t:Qt,b:Qt,h:0},la=ce._hmpixcount?ce._hmlumcount/ce._hmpixcount:M(ce._fullLayout.plot_bgcolor).getLuminance(),Ua="M0,0H"+Vt+"V"+Zt+"H0V0",Ba=!1,Ra="xy",ti=!1,ei=ue(tt,la,Lt,kt,Ua),za=le(tt,Lt,kt)}function Jt(Rr,Lr){if(ce._transitioningWithDuration)return!1;var Gr=Math.max(0,Math.min(Vt,Ce*Rr+rr)),Kr=Math.max(0,Math.min(Zt,Te*Lr+Qt)),Ur=Math.abs(Gr-rr),aa=Math.abs(Kr-Qt);Tr.l=Math.min(rr,Gr),Tr.r=Math.max(rr,Gr),Tr.t=Math.min(Qt,Kr),Tr.b=Math.max(Qt,Kr);function da(){Ra="",Tr.r=Tr.l,Tr.t=Tr.b,za.attr("d","M0,0Z")}if(Sr.isSubplotConstrained)Ur>P||aa>P?(Ra="xy",Ur/Vt>aa/Zt?(aa=Ur*Zt/Vt,Qt>Kr?Tr.t=Qt-aa:Tr.b=Qt+aa):(Ur=aa*Vt/Zt,rr>Gr?Tr.l=rr-Ur:Tr.r=rr+Ur),za.attr("d",ie(Tr))):da();else if(xr.isSubplotConstrained)if(Ur>P||aa>P){Ra="xy";var fa=Math.min(Tr.l/Vt,(Zt-Tr.b)/Zt),It=Math.max(Tr.r/Vt,(Zt-Tr.t)/Zt);Tr.l=fa*Vt,Tr.r=It*Vt,Tr.b=(1-fa)*Zt,Tr.t=(1-It)*Zt,za.attr("d",ie(Tr))}else da();else!wr||aa0){var kr;if(xr.isSubplotConstrained||!jr&&wr.length===1){for(kr=0;kr1&&(da.maxallowed!==void 0&&bt===(da.range[0]1&&(fa.maxallowed!==void 0&&Be===(fa.range[0]=0?Math.min(ce,.9):1/(1/Math.max(ce,-.3)+3.222))}function Q(ce,be,Ae){return ce?ce==="nsew"?Ae?"":be==="pan"?"move":"crosshair":ce.toLowerCase()+"-resize":"pointer"}function ue(ce,be,Ae,ze,Re){return ce.append("path").attr("class","zoombox").style({fill:be>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform",r(Ae,ze)).attr("d",Re+"Z")}function le(ce,be,Ae){return ce.append("path").attr("class","zoombox-corners").style({fill:a.background,stroke:a.defaultLine,"stroke-width":1,opacity:0}).attr("transform",r(be,Ae)).attr("d","M0,0Z")}function he(ce,be,Ae,ze,Re,Xe){ce.attr("d",ze+"M"+Ae.l+","+Ae.t+"v"+Ae.h+"h"+Ae.w+"v-"+Ae.h+"h-"+Ae.w+"Z"),G(ce,be,Re,Xe)}function G(ce,be,Ae,ze){Ae||(ce.transition().style("fill",ze>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),be.transition().style("opacity",1).duration(200))}function $(ce){d.select(ce).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function J(ce){L&&ce.data&&ce._context.showTips&&(x.notifier(x._(ce,"Double-click to zoom back out"),"long"),L=!1)}function X(ce,be){return"M"+(ce.l-.5)+","+(be-P-.5)+"h-3v"+(2*P+1)+"h3ZM"+(ce.r+.5)+","+(be-P-.5)+"h3v"+(2*P+1)+"h-3Z"}function oe(ce,be){return"M"+(be-P-.5)+","+(ce.t-.5)+"v-3h"+(2*P+1)+"v3ZM"+(be-P-.5)+","+(ce.b+.5)+"v3h"+(2*P+1)+"v-3Z"}function ie(ce){var be=Math.floor(Math.min(ce.b-ce.t,ce.r-ce.l,P)/2);return"M"+(ce.l-3.5)+","+(ce.t-.5+be)+"h3v"+-be+"h"+be+"v-3h-"+(be+3)+"ZM"+(ce.r+3.5)+","+(ce.t-.5+be)+"h-3v"+-be+"h"+-be+"v-3h"+(be+3)+"ZM"+(ce.r+3.5)+","+(ce.b+.5-be)+"h-3v"+be+"h"+-be+"v3h"+(be+3)+"ZM"+(ce.l-3.5)+","+(ce.b+.5-be)+"h3v"+be+"h"+be+"v3h-"+(be+3)+"Z"}function j(ce,be,Ae,ze,Re){for(var Xe=!1,it={},ot={},tt,lt,Ee,_e,fe=(Re||{}).xaHash,Fe=(Re||{}).yaHash,rt=0;rt1&&x.warn("Full array edits are incompatible with other edits",c);var w=i[""][""];if(t(w))a.set(null);else if(Array.isArray(w))a.set(w);else return x.warn("Unrecognized full array edit value",c,w),!0;return T?!1:(f(l,_),g(o),!0)}var S=Object.keys(i).map(Number).sort(A),E=a.get(),y=E||[],b=s(_,c).get(),p=[],u=-1,m=y.length,h,P,L,z,F,B,O,I;for(h=0;hy.length-(O?0:1)){x.warn("index out of range",c,L);continue}if(B!==void 0)F.length>1&&x.warn("Insertion & removal are incompatible with edits to the same index.",c,L),t(B)?p.push(L):O?(B==="add"&&(B={}),y.splice(L,0,B),b&&b.splice(L,0,{})):x.warn("Unrecognized full object edit value",c,L,B),u===-1&&(u=L);else for(P=0;P=0;h--)y.splice(p[h],1),b&&b.splice(p[h],1);if(y.length?E||a.set(y):a.set(null),T)return!1;if(f(l,_),v!==d){var N;if(u===-1)N=S;else{for(m=Math.max(y.length,m),N=[],h=0;h=u));h++)N.push(L);for(h=u;h0&&A.log("Clearing previous rejected promises from queue."),l._promises=[]},Z.cleanLayout=function(l){var _,w;l||(l={}),l.xaxis1&&(l.xaxis||(l.xaxis=l.xaxis1),delete l.xaxis1),l.yaxis1&&(l.yaxis||(l.yaxis=l.yaxis1),delete l.yaxis1),l.scene1&&(l.scene||(l.scene=l.scene1),delete l.scene1);var S=(M.subplotsRegistry.cartesian||{}).attrRegex,E=(M.subplotsRegistry.polar||{}).attrRegex,y=(M.subplotsRegistry.ternary||{}).attrRegex,b=(M.subplotsRegistry.gl3d||{}).attrRegex,p=Object.keys(l);for(_=0;_3?(O.x=1.02,O.xanchor="left"):O.x<-2&&(O.x=-.02,O.xanchor="right"),O.y>3?(O.y=1.02,O.yanchor="bottom"):O.y<-2&&(O.y=-.02,O.yanchor="top")),l.dragmode==="rotate"&&(l.dragmode="orbit"),t.clean(l),l.template&&l.template.layout&&Z.cleanLayout(l.template.layout),l};function i(l,_){var w=l[_],S=_.charAt(0);w&&w!=="paper"&&(l[_]=r(w,S,!0))}Z.cleanData=function(l){for(var _=0;_0)return l.substr(0,_)}Z.hasParent=function(l,_){for(var w=v(_);w;){if(w in l)return!0;w=v(w)}return!1};var T=["x","y","z"];Z.clearAxisTypes=function(l,_,w){for(var S=0;S<_.length;S++)for(var E=l._fullData[S],y=0;y<3;y++){var b=o(l,E,T[y]);if(b&&b.type!=="log"){var p=b._name,u=b._id.substr(1);if(u.substr(0,5)==="scene"){if(w[u]!==void 0)continue;p=u+"."+p}var m=p+".type";w[p]===void 0&&w[m]===void 0&&A.nestedProperty(l.layout,m).set(null)}}}}}),C2=Ze({"src/plot_api/plot_api.js"(Z){"use strict";var q=On(),d=ns(),x=i5(),A=ca(),M=A.nestedProperty,e=Qy(),t=rz(),r=oo(),o=e1(),a=xc(),i=Wo(),n=h5(),s=Wh(),c=as(),f=Yn(),g=P5().initInteractions,v=vd(),T=Tf().clearOutline,l=H0().dfltConfig,_=Oz(),w=Bz(),S=L_(),E=pc(),y=kh().AX_NAME_PATTERN,b=0,p=5;function u(Me,qe,Ce,Te){var Pe;if(Me=A.getGraphDiv(Me),e.init(Me),A.isPlainObject(qe)){var at=qe;qe=at.data,Ce=at.layout,Te=at.config,Pe=at.frames}var yt=e.triggerHandler(Me,"plotly_beforeplot",[qe,Ce,Te]);if(yt===!1)return Promise.reject();!qe&&!Ce&&!A.isPlotDiv(Me)&&A.warn("Calling _doPlot as if redrawing but this container doesn't yet have a plot.",Me);function Tt(){if(Pe)return Z.addFrames(Me,Pe)}z(Me,Te),Ce||(Ce={}),q.select(Me).classed("js-plotly-plot",!0),c.makeTester(),Array.isArray(Me._promises)||(Me._promises=[]);var Ot=(Me.data||[]).length===0&&Array.isArray(qe);Array.isArray(qe)&&(w.cleanData(qe),Ot?Me.data=qe:Me.data.push.apply(Me.data,qe),Me.empty=!1),(!Me.layout||Ot)&&(Me.layout=w.cleanLayout(Ce)),a.supplyDefaults(Me);var Gt=Me._fullLayout,rr=Gt._has("cartesian");Gt._replotting=!0,(Ot||Gt._shouldCreateBgLayer)&&(Ue(Me),Gt._shouldCreateBgLayer&&delete Gt._shouldCreateBgLayer),c.initGradients(Me),c.initPatterns(Me),Ot&&i.saveShowSpikeInitial(Me);var Qt=!Me.calcdata||Me.calcdata.length!==(Me._fullData||[]).length;Qt&&a.doCalcdata(Me);for(var Tr=0;Tr=Me.data.length||Pe<-Me.data.length)throw new Error(Ce+" must be valid indices for gd.data.");if(qe.indexOf(Pe,Te+1)>-1||Pe>=0&&qe.indexOf(-Me.data.length+Pe)>-1||Pe<0&&qe.indexOf(Me.data.length+Pe)>-1)throw new Error("each index in "+Ce+" must be unique.")}}function N(Me,qe,Ce){if(!Array.isArray(Me.data))throw new Error("gd.data must be an array.");if(typeof qe>"u")throw new Error("currentIndices is a required argument.");if(Array.isArray(qe)||(qe=[qe]),I(Me,qe,"currentIndices"),typeof Ce<"u"&&!Array.isArray(Ce)&&(Ce=[Ce]),typeof Ce<"u"&&I(Me,Ce,"newIndices"),typeof Ce<"u"&&qe.length!==Ce.length)throw new Error("current and new indices must be of equal length.")}function U(Me,qe,Ce){var Te,Pe;if(!Array.isArray(Me.data))throw new Error("gd.data must be an array.");if(typeof qe>"u")throw new Error("traces must be defined.");for(Array.isArray(qe)||(qe=[qe]),Te=0;Te"u")throw new Error("indices must be an integer or array of integers");I(Me,Ce,"indices");for(var at in qe){if(!Array.isArray(qe[at])||qe[at].length!==Ce.length)throw new Error("attribute "+at+" must be an array of length equal to indices array length");if(Pe&&(!(at in Te)||!Array.isArray(Te[at])||Te[at].length!==qe[at].length))throw new Error("when maxPoints is set as a key:value object it must contain a 1:1 correspondence with the keys and number of traces in the update object")}}function Q(Me,qe,Ce,Te){var Pe=A.isPlainObject(Te),at=[],yt,Tt,Ot,Gt,rr;Array.isArray(Ce)||(Ce=[Ce]),Ce=O(Ce,Me.data.length-1);for(var Qt in qe)for(var Tr=0;Tr=0&&rr=0&&rr"u")return Gt=Z.redraw(Me),t.add(Me,Pe,yt,at,Tt),Gt;Array.isArray(Ce)||(Ce=[Ce]);try{N(Me,Te,Ce)}catch(rr){throw Me.data.splice(Me.data.length-qe.length,qe.length),rr}return t.startSequence(Me),t.add(Me,Pe,yt,at,Tt),Gt=Z.moveTraces(Me,Te,Ce),t.stopSequence(Me),Gt}function J(Me,qe){Me=A.getGraphDiv(Me);var Ce=[],Te=Z.addTraces,Pe=J,at=[Me,Ce,qe],yt=[Me,qe],Tt,Ot;if(typeof qe>"u")throw new Error("indices must be an integer or array of integers.");for(Array.isArray(qe)||(qe=[qe]),I(Me,qe,"indices"),qe=O(qe,Me.data.length-1),qe.sort(A.sorterDes),Tt=0;Tt"u")for(Ce=[],Gt=0;Gt0&&typeof Wt.parts[ma]!="string";)ma--;var ra=Wt.parts[ma],Ia=Wt.parts[ma-1]+"."+ra,Ha=Wt.parts.slice(0,ma).join("."),$a=M(Me.layout,Ha).get(),ai=M(Te,Ha).get(),mi=Wt.get();if(Pr!==void 0){ei[Kt]=Pr,za[Kt]=ra==="reverse"?Pr:ie(mi);var xt=o.getLayoutValObject(Te,Wt.parts);if(xt&&xt.impliedEdits&&Pr!==null)for(var ct in xt.impliedEdits)ti(A.relativeAttr(Kt,ct),xt.impliedEdits[ct]);if(["width","height"].indexOf(Kt)!==-1)if(Pr){ti("autosize",null);var Nr=Kt==="height"?"width":"height";ti(Nr,Te[Nr])}else Te[Kt]=Me._initialAutoSize[Kt];else if(Kt==="autosize")ti("width",Pr?null:Te.width),ti("height",Pr?null:Te.height);else if(Ia.match(Re))Nt(Ia),M(Te,Ha+"._inputRange").set(null);else if(Ia.match(Xe)){Nt(Ia),M(Te,Ha+"._inputRange").set(null);var Or=M(Te,Ha).get();Or._inputDomain&&(Or._input.domain=Or._inputDomain.slice())}else Ia.match(it)&&M(Te,Ha+"._inputDomain").set(null);if(ra==="type"){Jt=$a;var Rr=ai.type==="linear"&&Pr==="log",Lr=ai.type==="log"&&Pr==="linear";if(Rr||Lr){if(!Jt||!Jt.range)ti(Ha+".autorange",!0);else if(ai.autorange)Rr&&(Jt.range=Jt.range[1]>Jt.range[0]?[1,2]:[2,1]);else{var Gr=Jt.range[0],Kr=Jt.range[1];Rr?(Gr<=0&&Kr<=0&&ti(Ha+".autorange",!0),Gr<=0?Gr=Kr/1e6:Kr<=0&&(Kr=Gr/1e6),ti(Ha+".range[0]",Math.log(Gr)/Math.LN10),ti(Ha+".range[1]",Math.log(Kr)/Math.LN10)):(ti(Ha+".range[0]",Math.pow(10,Gr)),ti(Ha+".range[1]",Math.pow(10,Kr)))}Array.isArray(Te._subplots.polar)&&Te._subplots.polar.length&&Te[Wt.parts[0]]&&Wt.parts[1]==="radialaxis"&&delete Te[Wt.parts[0]]._subplot.viewInitial["radialaxis.range"],r.getComponentMethod("annotations","convertCoords")(Me,ai,Pr,ti),r.getComponentMethod("images","convertCoords")(Me,ai,Pr,ti)}else ti(Ha+".autorange",!0),ti(Ha+".range",null);M(Te,Ha+"._inputRange").set(null)}else if(ra.match(y)){var Ur=M(Te,Kt).get(),aa=(Pr||{}).type;(!aa||aa==="-")&&(aa="linear"),r.getComponentMethod("annotations","convertCoords")(Me,Ur,aa,ti),r.getComponentMethod("images","convertCoords")(Me,Ur,aa,ti)}var da=_.containerArrayMatch(Kt);if(da){rr=da.array,Qt=da.index;var fa=da.property,It=xt||{editType:"calc"};Qt!==""&&fa===""&&(_.isAddVal(Pr)?za[Kt]=null:_.isRemoveVal(Pr)?za[Kt]=(M(Ce,rr).get()||[])[Qt]:A.warn("unrecognized full object value",qe)),E.update(Ra,It),Gt[rr]||(Gt[rr]={});var dr=Gt[rr][Qt];dr||(dr=Gt[rr][Qt]={}),dr[fa]=Pr,delete qe[Kt]}else ra==="reverse"?($a.range?$a.range.reverse():(ti(Ha+".autorange",!0),$a.range=[1,0]),ai.autorange?Ra.calc=!0:Ra.plot=!0):(Kt==="dragmode"&&(Pr===!1&&mi!==!1||Pr!==!1&&mi===!1)||Te._has("scatter-like")&&Te._has("regl")&&Kt==="dragmode"&&(Pr==="lasso"||Pr==="select")&&!(mi==="lasso"||mi==="select")?Ra.plot=!0:xt?E.update(Ra,xt):Ra.calc=!0,Wt.set(Pr))}}for(rr in Gt){var kr=_.applyContainerArrayChanges(Me,at(Ce,rr),Gt[rr],Ra,at);kr||(Ra.plot=!0)}for(var ia in Ci){Jt=i.getFromId(Me,ia);var Ca=Jt&&Jt._constraintGroup;if(Ca){Ra.calc=!0;for(var Fa in Ca)Ci[Fa]||(i.getFromId(Me,Fa)._constraintShrinkable=!0)}}(tt(Me)||qe.height||qe.width)&&(Ra.plot=!0);var Ya=Te.shapes;for(Qt=0;Qt1;)if(Te.pop(),Ce=M(qe,Te.join(".")+".uirevision").get(),Ce!==void 0)return Ce;return qe.uirevision}function st(Me,qe){for(var Ce=0;Ce[$a,Me._ev.listeners($a)]);at=Z.newPlot(Me,qe,Ce,Te).then(()=>{for(let[$a,ai]of Ha)ai.forEach(mi=>Me.on($a,mi));return Z.react(Me,qe,Ce,Te)})}else{Me.data=qe||[],w.cleanData(Me.data),Me.layout=Ce||{},w.cleanLayout(Me.layout),kt(Me.data,Me.layout,Tt,Ot),a.supplyDefaults(Me,{skipUpdateCalc:!0});var Tr=Me._fullData,la=Me._fullLayout,Ua=la.datarevision===void 0,Ba=la.transition,Ra=Sr(Me,Ot,la,Ua,Ba),ei=Ra.newDataRevision,za=Zt(Me,Tt,Tr,Ua,Ba,ei);if(tt(Me)&&(Ra.layoutReplot=!0),za.calc||Ra.calc){Me.calcdata=void 0;for(var ti=Object.getOwnPropertyNames(la),Ci=0;Ci(rr||Me.emit("plotly_react",{config:Te,data:qe,layout:Ce}),Me))}function Zt(Me,qe,Ce,Te,Pe,at){var yt=qe.length===Ce.length;if(!Pe&&!yt)return{fullReplot:!0,calc:!0};var Tt=E.traceFlags();Tt.arrays={},Tt.nChanges=0,Tt.nChangesAnim=0;var Ot,Gt;function rr(la){var Ua=o.getTraceValObject(Gt,la);return!Gt._module.animatable&&Ua.anim&&(Ua.anim=!1),Ua}var Qt={getValObject:rr,flags:Tt,immutable:Te,transition:Pe,newDataRevision:at,gd:Me},Tr={};for(Ot=0;Ot=Pe.length?Pe[0]:Pe[Gt]:Pe}function Tt(Gt){return Array.isArray(at)?Gt>=at.length?at[0]:at[Gt]:at}function Ot(Gt,rr){var Qt=0;return function(){if(Gt&&++Qt===rr)return Gt()}}return new Promise(function(Gt,rr){function Qt(){if(Te._frameQueue.length!==0){for(;Te._frameQueue.length;){var ra=Te._frameQueue.pop();ra.onInterrupt&&ra.onInterrupt()}Me.emit("plotly_animationinterrupted",[])}}function Tr(ra){if(ra.length!==0){for(var Ia=0;IaTe._timeToNext&&Ua()};ra()}var Ra=0;function ei(ra){return Array.isArray(Pe)?Ra>=Pe.length?ra.transitionOpts=Pe[Ra]:ra.transitionOpts=Pe[0]:ra.transitionOpts=Pe,Ra++,ra}var za,ti,Ci=[],Jt=qe==null,Nt=Array.isArray(qe),Kt=!Jt&&!Nt&&A.isPlainObject(qe);if(Kt)Ci.push({type:"object",data:ei(A.extendFlat({},qe))});else if(Jt||["string","number"].indexOf(typeof qe)!==-1)for(za=0;za0&&tata)&&ma.push(ti);Ci=ma}}Ci.length>0?Tr(Ci):(Me.emit("plotly_animated"),Gt())})}function Ir(Me,qe,Ce){if(Me=A.getGraphDiv(Me),qe==null)return Promise.resolve();if(!A.isPlotDiv(Me))throw new Error("This element is not a Plotly plot: "+Me+". It's likely that you've failed to create a plot before adding frames. For more details, see https://plotly.com/javascript/animations/");var Te,Pe,at,yt,Tt=Me._transitionData._frames,Ot=Me._transitionData._frameHash;if(!Array.isArray(qe))throw new Error("addFrames failure: frameList must be an Array of frame definitions"+qe);var Gt=Tt.length+qe.length*2,rr=[],Qt={};for(Te=qe.length-1;Te>=0;Te--)if(A.isPlainObject(qe[Te])){var Tr=qe[Te].name,la=(Ot[Tr]||Qt[Tr]||{}).name,Ua=qe[Te].name,Ba=Ot[la]||Qt[la];la&&Ua&&typeof Ua=="number"&&Ba&&bWt.index?-1:Kt.index=0;Te--){if(Pe=rr[Te].frame,typeof Pe.name=="number"&&A.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!Pe.name)for(;Ot[Pe.name="frame "+Me._transitionData._counter++];);if(Ot[Pe.name]){for(at=0;at=0;Ce--)Te=qe[Ce],at.push({type:"delete",index:Te}),yt.unshift({type:"insert",index:Te,value:Pe[Te]});var Tt=a.modifyFrames,Ot=a.modifyFrames,Gt=[Me,yt],rr=[Me,at];return t&&t.add(Me,Tt,Gt,Ot,rr),a.modifyFrames(Me,at)}function Be(Me){Me=A.getGraphDiv(Me);var qe=Me._fullLayout||{},Ce=Me._fullData||[];return a.cleanPlot([],{},Ce,qe),a.purge(Me),e.purge(Me),qe._container&&qe._container.remove(),delete Me._context,Me}function Ke(Me){var qe=Me._fullLayout,Ce=Me.getBoundingClientRect();if(!A.equalDomRects(Ce,qe._lastBBox)){var Te=qe._invTransform=A.inverseTransformMatrix(A.getFullTransformMatrix(Me));qe._invScaleX=Math.sqrt(Te[0][0]*Te[0][0]+Te[0][1]*Te[0][1]+Te[0][2]*Te[0][2]),qe._invScaleY=Math.sqrt(Te[1][0]*Te[1][0]+Te[1][1]*Te[1][1]+Te[1][2]*Te[1][2]),qe._lastBBox=Ce}}function Ue(Me){var qe=q.select(Me),Ce=Me._fullLayout;if(Ce._calcInverseTransform=Ke,Ce._calcInverseTransform(Me),Ce._container=qe.selectAll(".plot-container").data([0]),Ce._container.enter().insert("div",":first-child").classed("plot-container",!0).classed("plotly",!0).style({width:"100%",height:"100%"}),Ce._paperdiv=Ce._container.selectAll(".svg-container").data([0]),Ce._paperdiv.enter().append("div").classed("user-select-none",!0).classed("svg-container",!0).style("position","relative"),Ce._glcontainer=Ce._paperdiv.selectAll(".gl-container").data([{}]),Ce._glcontainer.enter().append("div").classed("gl-container",!0),Ce._paperdiv.selectAll(".main-svg").remove(),Ce._paperdiv.select(".modebar-container").remove(),Ce._paper=Ce._paperdiv.insert("svg",":first-child").classed("main-svg",!0),Ce._toppaper=Ce._paperdiv.append("svg").classed("main-svg",!0),Ce._modebardiv=Ce._paperdiv.append("div"),delete Ce._modeBar,Ce._hoverpaper=Ce._paperdiv.append("svg").classed("main-svg",!0),!Ce._uid){var Te={};q.selectAll("defs").each(function(){this.id&&(Te[this.id.split("-")[1]]=1)}),Ce._uid=A.randstr(Te)}Ce._paperdiv.selectAll(".main-svg").attr(v.svgAttrs),Ce._defs=Ce._paper.append("defs").attr("id","defs-"+Ce._uid),Ce._clips=Ce._defs.append("g").classed("clips",!0),Ce._topdefs=Ce._toppaper.append("defs").attr("id","topdefs-"+Ce._uid),Ce._topclips=Ce._topdefs.append("g").classed("clips",!0),Ce._bgLayer=Ce._paper.append("g").classed("bglayer",!0),Ce._draggers=Ce._paper.append("g").classed("draglayer",!0);var Pe=Ce._paper.append("g").classed("layer-below",!0);Ce._imageLowerLayer=Pe.append("g").classed("imagelayer",!0),Ce._shapeLowerLayer=Pe.append("g").classed("shapelayer",!0),Ce._cartesianlayer=Ce._paper.append("g").classed("cartesianlayer",!0),Ce._polarlayer=Ce._paper.append("g").classed("polarlayer",!0),Ce._smithlayer=Ce._paper.append("g").classed("smithlayer",!0),Ce._ternarylayer=Ce._paper.append("g").classed("ternarylayer",!0),Ce._geolayer=Ce._paper.append("g").classed("geolayer",!0),Ce._funnelarealayer=Ce._paper.append("g").classed("funnelarealayer",!0),Ce._pielayer=Ce._paper.append("g").classed("pielayer",!0),Ce._iciclelayer=Ce._paper.append("g").classed("iciclelayer",!0),Ce._treemaplayer=Ce._paper.append("g").classed("treemaplayer",!0),Ce._sunburstlayer=Ce._paper.append("g").classed("sunburstlayer",!0),Ce._indicatorlayer=Ce._toppaper.append("g").classed("indicatorlayer",!0),Ce._glimages=Ce._paper.append("g").classed("glimages",!0);var at=Ce._toppaper.append("g").classed("layer-above",!0);Ce._imageUpperLayer=at.append("g").classed("imagelayer",!0),Ce._shapeUpperLayer=at.append("g").classed("shapelayer",!0),Ce._selectionLayer=Ce._toppaper.append("g").classed("selectionlayer",!0),Ce._infolayer=Ce._toppaper.append("g").classed("infolayer",!0),Ce._menulayer=Ce._toppaper.append("g").classed("menulayer",!0),Ce._zoomlayer=Ce._toppaper.append("g").classed("zoomlayer",!0),Ce._hoverlayer=Ce._hoverpaper.append("g").classed("hoverlayer",!0),Ce._modebardiv.classed("modebar-container",!0).style("position","absolute").style("top","0px").style("right","0px"),Me.emit("plotly_framework")}Z.animate=wr,Z.addFrames=Ir,Z.deleteFrames=bt,Z.addTraces=$,Z.deleteTraces=J,Z.extendTraces=he,Z.moveTraces=X,Z.prependTraces=G,Z.newPlot=B,Z._doPlot=u,Z.purge=Be,Z.react=Vt,Z.redraw=F,Z.relayout=be,Z.restyle=oe,Z.setPlotConfig=h,Z.update=lt,Z._guiRelayout=Ee(be),Z._guiRestyle=Ee(oe),Z._guiUpdate=Ee(lt),Z._storeDirectGUIEdit=re}}),Zv=Ze({"src/snapshot/helpers.js"(Z){"use strict";var q=oo();Z.getDelay=function(A){return A._has&&(A._has("gl3d")||A._has("mapbox")||A._has("map"))?500:0},Z.getRedrawFunc=function(A){return function(){q.getComponentMethod("colorbar","draw")(A)}},Z.encodeSVG=function(A){return"data:image/svg+xml,"+encodeURIComponent(A)},Z.encodeJSON=function(A){return"data:application/json,"+encodeURIComponent(A)};var d=window.URL||window.webkitURL;Z.createObjectURL=function(A){return d.createObjectURL(A)},Z.revokeObjectURL=function(A){return d.revokeObjectURL(A)},Z.createBlob=function(A,M){if(M==="svg")return new window.Blob([A],{type:"image/svg+xml;charset=utf-8"});if(M==="full-json")return new window.Blob([A],{type:"application/json;charset=utf-8"});var e=x(window.atob(A));return new window.Blob([e],{type:"image/"+M})},Z.octetStream=function(A){document.location.href="data:application/octet-stream"+A};function x(A){for(var M=A.length,e=new ArrayBuffer(M),t=new Uint8Array(e),r=0;r")!==-1?"":s.html(f).text()});return s.remove(),c}function i(n){return n.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")}q.exports=function(s,c,f){var g=s._fullLayout,v=g._paper,T=g._toppaper,l=g.width,_=g.height,w;v.insert("rect",":first-child").call(A.setRect,0,0,l,_).call(M.fill,g.paper_bgcolor);var S=g._basePlotModules||[];for(w=0;w1&&E.push(s("object","layout"))),x.supplyDefaults(y);for(var u=y._fullData,m=b.length,h=0;hP.length&&S.push(s("unused",E,m.concat(P.length)));var I=P.length,N=Array.isArray(O);N&&(I=Math.min(I,O.length));var U,W,Q,ue,le;if(L.dimensions===2)for(W=0;WP[W].length&&S.push(s("unused",E,m.concat(W,P[W].length)));var he=P[W].length;for(U=0;U<(N?Math.min(he,O[W].length):he);U++)Q=N?O[W][U]:O,ue=h[W][U],le=P[W][U],d.validate(ue,Q)?le!==ue&&le!==+ue&&S.push(s("dynamic",E,m.concat(W,U),ue,le)):S.push(s("value",E,m.concat(W,U),ue))}else S.push(s("array",E,m.concat(W),h[W]));else for(W=0;WF?S.push({code:"unused",traceType:h,templateCount:z,dataCount:F}):F>z&&S.push({code:"reused",traceType:h,templateCount:z,dataCount:F})}}function B(O,I){for(var N in O)if(N.charAt(0)!=="_"){var U=O[N],W=s(O,N,I);d(U)?(Array.isArray(O)&&U._template===!1&&U.templateitemname&&S.push({code:"missing",path:W,templateitemname:U.templateitemname}),B(U,W)):Array.isArray(U)&&c(U)&&B(U,W)}}if(B({data:y,layout:E},""),S.length)return S.map(f)};function c(g){for(var v=0;v=0;f--){var g=e[f];if(g.type==="scatter"&&g.xaxis===s.xaxis&&g.yaxis===s.yaxis){g.opacity=void 0;break}}}}}}}),Hz=Ze({"src/traces/scatter/layout_defaults.js"(Z,q){"use strict";var d=ca(),x=y2();q.exports=function(A,M){function e(r,o){return d.coerce(A,M,x,r,o)}var t=M.barmode==="group";M.scattermode==="group"&&e("scattergap",t?M.bargap:.2)}}}),tv=Ze({"src/plots/cartesian/align_period.js"(Z,q){"use strict";var d=ns(),x=ca(),A=x.dateTime2ms,M=x.incrementMonth,e=qs(),t=e.ONEAVGMONTH;q.exports=function(o,a,i,n){if(a.type!=="date")return{vals:n};var s=o[i+"periodalignment"];if(!s)return{vals:n};var c=o[i+"period"],f;if(d(c)){if(c=+c,c<=0)return{vals:n}}else if(typeof c=="string"&&c.charAt(0)==="M"){var g=+c.substring(1);if(g>0&&Math.round(g)===g)f=g;else return{vals:n}}for(var v=a.calendar,T=s==="start",l=s==="end",_=o[i+"period0"],w=A(_,v)||0,S=[],E=[],y=[],b=n.length,p=0;pu;)P=M(P,-f,v);for(;P<=u;)P=M(P,f,v);h=M(P,-f,v)}else{for(m=Math.round((u-w)/c),P=w+m*c;P>u;)P-=c;for(;P<=u;)P+=c;h=P-c}S[p]=T?h:l?P:(h+P)/2,E[p]=h,y[p]=P}return{vals:S,starts:E,ends:y}}}}),Fd=Ze({"src/traces/scatter/colorscale_calc.js"(Z,q){"use strict";var d=bp().hasColorscale,x=wp(),A=Fu();q.exports=function(e,t){A.hasLines(t)&&d(t,"line")&&x(e,t,{vals:t.line.color,containerStr:"line",cLetter:"c"}),A.hasMarkers(t)&&(d(t,"marker")&&x(e,t,{vals:t.marker.color,containerStr:"marker",cLetter:"c"}),d(t,"marker.line")&&x(e,t,{vals:t.marker.line.color,containerStr:"marker.line",cLetter:"c"}))}}}),Av=Ze({"src/traces/scatter/arrays_to_calcdata.js"(Z,q){"use strict";var d=ca();q.exports=function(A,M){for(var e=0;eB&&h[I].gap;)I--;for(U=h[I].s,O=h.length-1;O>I;O--)h[O].s=U;for(;BN+O||!d(I))}for(var W=0;Wz[v]&&v0?e:t)/(v._m*_*(v._m>0?e:t)))),Ot*=1e3}if(Gt===A){if(l&&(Gt=v.c2p(Tt.y,!0)),Gt===A)return!1;Gt*=1e3}return[Ot,Gt]}function ee(yt,Tt,Ot,Gt){var rr=Ot-yt,Qt=Gt-Tt,Tr=.5-yt,la=.5-Tt,Ua=rr*rr+Qt*Qt,Ba=rr*Tr+Qt*la;if(Ba>0&&Ba1||Math.abs(Tr.y-Ot[0][1])>1)&&(Tr=[Tr.x,Tr.y],Gt&&Ae(Tr,yt)Xe||yt[1]ot)return[a(yt[0],Re,Xe),a(yt[1],it,ot)]}function Lt(yt,Tt){if(yt[0]===Tt[0]&&(yt[0]===Re||yt[0]===Xe)||yt[1]===Tt[1]&&(yt[1]===it||yt[1]===ot))return!0}function kt(yt,Tt){var Ot=[],Gt=Qe(yt),rr=Qe(Tt);return Gt&&rr&&Lt(Gt,rr)||(Gt&&Ot.push(Gt),rr&&Ot.push(rr)),Ot}function Vt(yt,Tt,Ot){return function(Gt,rr){var Qt=Qe(Gt),Tr=Qe(rr),la=[];if(Qt&&Tr&&Lt(Qt,Tr))return la;Qt&&la.push(Qt),Tr&&la.push(Tr);var Ua=2*r.constrain((Gt[yt]+rr[yt])/2,Tt,Ot)-((Qt||Gt)[yt]+(Tr||rr)[yt]);if(Ua){var Ba;Qt&&Tr?Ba=Ua>0==Qt[yt]>Tr[yt]?Qt:Tr:Ba=Qt||Tr,Ba[yt]+=Ua}return la}}var Zt;p==="linear"||p==="spline"?Zt=st:p==="hv"||p==="vh"?Zt=kt:p==="hvh"?Zt=Vt(0,Re,Xe):p==="vhv"&&(Zt=Vt(1,it,ot));function Sr(yt,Tt){var Ot=Tt[0]-yt[0],Gt=(Tt[1]-yt[1])/Ot,rr=(yt[1]*Tt[0]-Tt[1]*yt[0])/Ot;return rr>0?[Gt>0?Re:Xe,ot]:[Gt>0?Xe:Re,it]}function xr(yt){var Tt=yt[0],Ot=yt[1],Gt=Tt===z[F-1][0],rr=Ot===z[F-1][1];if(!(Gt&&rr))if(F>1){var Qt=Tt===z[F-2][0],Tr=Ot===z[F-2][1];Gt&&(Tt===Re||Tt===Xe)&&Qt?Tr?F--:z[F-1]=yt:rr&&(Ot===it||Ot===ot)&&Tr?Qt?F--:z[F-1]=yt:z[F++]=yt}else z[F++]=yt}function jr(yt){z[F-1][0]!==yt[0]&&z[F-1][1]!==yt[1]&&xr([_e,fe]),xr(yt),Fe=null,_e=fe=0}var wr=r.isArrayOrTypedArray(E);function Ir(yt){if(yt&&S&&(yt.i=B,yt.d=s,yt.trace=f,yt.marker=wr?E[yt.i]:E,yt.backoff=S),re=yt[0]/_,ce=yt[1]/w,lt=yt[0]Xe?Xe:0,Ee=yt[1]ot?ot:0,lt||Ee){if(!F)z[F++]=[lt||yt[0],Ee||yt[1]];else if(Fe){var Tt=Zt(Fe,yt);Tt.length>1&&(jr(Tt[0]),z[F++]=Tt[1])}else rt=Zt(z[F-1],yt)[0],z[F++]=rt;var Ot=z[F-1];lt&&Ee&&(Ot[0]!==lt||Ot[1]!==Ee)?(Fe&&(_e!==lt&&fe!==Ee?xr(_e&&fe?Sr(Fe,yt):[_e||lt,fe||Ee]):_e&&fe&&xr([_e,fe])),xr([lt,Ee])):_e-lt&&fe-Ee&&xr([lt||_e,Ee||fe]),Fe=yt,_e=lt,fe=Ee}else Fe&&jr(Zt(Fe,yt)[0]),z[F++]=yt}for(B=0;Bbe(W,bt))break;I=W,J=le[0]*ue[0]+le[1]*ue[1],J>G?(G=J,N=W,Q=!1):J<$&&($=J,U=W,Q=!0)}if(Q?(Ir(N),I!==U&&Ir(U)):(U!==O&&Ir(U),I!==N&&Ir(N)),Ir(I),B>=s.length||!W)break;Ir(W),O=W}}Fe&&xr([_e||Fe[0],fe||Fe[1]]),h.push(z.slice(0,F))}var Be=p.slice(p.length-1);if(S&&Be!=="h"&&Be!=="v"){for(var Ke=!1,Ue=-1,Me=[],qe=0;qe=0?i=g:(i=g=f,f++),i0,p=a(g,v,T);if(S=l.selectAll("g.trace").data(p,function(m){return m[0].trace.uid}),S.enter().append("g").attr("class",function(m){return"trace scatter trace"+m[0].trace.uid}).style("stroke-miterlimit",2),S.order(),n(g,S,v),b){w&&(E=w());var u=d.transition().duration(_.duration).ease(_.easing).each("end",function(){E&&E()}).each("interrupt",function(){E&&E()});u.each(function(){l.selectAll("g.trace").each(function(m,h){s(g,h,v,m,p,this,_)})})}else S.each(function(m,h){s(g,h,v,m,p,this,_)});y&&S.exit().remove(),l.selectAll("path:not([d])").remove()};function n(f,g,v){g.each(function(T){var l=M(d.select(this),"g","fills");t.setClipUrl(l,v.layerClipId,f);var _=T[0].trace,w=[];_._ownfill&&w.push("_ownFill"),_._nexttrace&&w.push("_nextFill");var S=l.selectAll("g").data(w,e);S.enter().append("g"),S.exit().each(function(E){_[E]=null}).remove(),S.order().each(function(E){_[E]=M(d.select(this),"path","js-fill")})})}function s(f,g,v,T,l,_,w){var S=f._context.staticPlot,E;c(f,g,v,T,l);var y=!!w&&w.duration>0;function b(xr){return y?xr.transition():xr}var p=v.xaxis,u=v.yaxis,m=T[0].trace,h=m.line,P=d.select(_),L=M(P,"g","errorbars"),z=M(P,"g","lines"),F=M(P,"g","points"),B=M(P,"g","text");if(x.getComponentMethod("errorbars","plot")(f,L,v,w),m.visible!==!0)return;b(P).style("opacity",m.opacity);var O,I,N=m.fill.charAt(m.fill.length-1);N!=="x"&&N!=="y"&&(N="");var U,W;N==="y"?(U=1,W=u.c2p(0,!0)):N==="x"&&(U=0,W=p.c2p(0,!0)),T[0][v.isRangePlot?"nodeRangePlot3":"node3"]=P;var Q="",ue=[],le=m._prevtrace,he=null,G=null;le&&(Q=le._prevRevpath||"",I=le._nextFill,ue=le._ownPolygons,he=le._fillsegments,G=le._fillElement);var $,J,X="",oe="",ie,j,ee,re,ce,be,Ae=[];m._polygons=[];var ze=[],Re=[],Xe=A.noop;if(O=m._ownFill,r.hasLines(m)||m.fill!=="none"){I&&I.datum(T),["hv","vh","hvh","vhv"].indexOf(h.shape)!==-1?(ie=t.steps(h.shape),j=t.steps(h.shape.split("").reverse().join(""))):h.shape==="spline"?ie=j=function(xr){var jr=xr[xr.length-1];return xr.length>1&&xr[0][0]===jr[0]&&xr[0][1]===jr[1]?t.smoothclosed(xr.slice(1),h.smoothing):t.smoothopen(xr,h.smoothing)}:ie=j=function(xr){return"M"+xr.join("L")},ee=function(xr){return j(xr.reverse())},Re=o(T,{xaxis:p,yaxis:u,trace:m,connectGaps:m.connectgaps,baseTolerance:Math.max(h.width||1,3)/4,shape:h.shape,backoff:h.backoff,simplify:h.simplify,fill:m.fill}),ze=new Array(Re.length);var it=0;for(E=0;E=S[0]&&P.x<=S[1]&&P.y>=E[0]&&P.y<=E[1]}),u=Math.ceil(p.length/b),m=0;l.forEach(function(P,L){var z=P[0].trace;r.hasMarkers(z)&&z.marker.maxdisplayed>0&&L=Math.min(le,he)&&v<=Math.max(le,he)?0:1/0}var G=Math.max(3,ue.mrc||0),$=1-1/G,J=Math.abs(f.c2p(ue.x)-v);return J=Math.min(le,he)&&T<=Math.max(le,he)?0:1/0}var G=Math.max(3,ue.mrc||0),$=1-1/G,J=Math.abs(g.c2p(ue.y)-T);return Joe!=ze>=oe&&(ce=ee[j-1][0],be=ee[j][0],ze-Ae&&(re=ce+(be-ce)*(oe-Ae)/(ze-Ae),G=Math.min(G,re),$=Math.max($,re)));return G=Math.max(G,0),$=Math.min($,f._length),{x0:G,x1:$,y0:oe,y1:oe}}if(_.indexOf("fills")!==-1&&c._fillElement){var U=I(c._fillElement)&&!I(c._fillExclusionElement);if(U){var W=N(c._polygons);W===null&&(W={x0:l[0],x1:l[0],y0:l[1],y1:l[1]});var Q=e.defaultLine;return e.opacity(c.fillcolor)?Q=c.fillcolor:e.opacity((c.line||{}).color)&&(Q=c.line.color),d.extendFlat(o,{distance:o.maxHoverDistance,x0:W.x0,x1:W.x1,y0:W.y0,y1:W.y1,color:Q,hovertemplate:!1}),delete o.index,c.text&&!d.isArrayOrTypedArray(c.text)?o.text=String(c.text):o.text=c.name,[o]}}}}}),c1=Ze({"src/traces/scatter/select.js"(Z,q){"use strict";var d=Fu();q.exports=function(A,M){var e=A.cd,t=A.xaxis,r=A.yaxis,o=[],a=e[0].trace,i,n,s,c,f=!d.hasMarkers(a)&&!d.hasText(a);if(f)return[];if(M===!1)for(i=0;i0&&(n["_"+a+"axes"]||{})[o])return n;if((n[a+"axis"]||a)===o){if(t(n,a))return n;if((n[a]||[]).length||n[a+"0"])return n}}}function e(r){return{v:"x",h:"y"}[r.orientation||"v"]}function t(r,o){var a=e(r),i=d(r,"box-violin"),n=d(r._fullInput||{},"candlestick");return i&&!n&&o===a&&r[a]===void 0&&r[a+"0"]===void 0}}}),I2=Ze({"src/plots/cartesian/category_order_defaults.js"(Z,q){"use strict";var d=xp().isTypedArraySpec;function x(A,M){var e=M.dataAttr||A._id.charAt(0),t={},r,o,a;if(M.axData)r=M.axData;else for(r=[],o=0;o0||d(o),i;a&&(i="array");var n=t("categoryorder",i),s;n==="array"&&(s=t("categoryarray")),!a&&n==="array"&&(n=e.categoryorder="trace"),n==="trace"?e._initialCategories=[]:n==="array"?e._initialCategories=s.slice():(s=x(e,r).sort(),n==="category ascending"?e._initialCategories=s:n==="category descending"&&(e._initialCategories=s.reverse()))}}}}),D_=Ze({"src/plots/cartesian/line_grid_defaults.js"(Z,q){"use strict";var d=Ch().mix,x=oh(),A=ca();q.exports=function(e,t,r,o){o=o||{};var a=o.dfltColor;function i(h,P){return A.coerce2(e,t,o.attributes,h,P)}var n=i("linecolor",a),s=i("linewidth"),c=r("showline",o.showLine||!!n||!!s);c||(delete t.linecolor,delete t.linewidth);var f=d(a,o.bgColor,o.blend||x.lightFraction).toRgbString(),g=i("gridcolor",f),v=i("gridwidth"),T=i("griddash"),l=r("showgrid",o.showGrid||!!g||!!v||!!T);if(l||(delete t.gridcolor,delete t.gridwidth,delete t.griddash),o.hasMinor){var _=d(t.gridcolor,o.bgColor,67).toRgbString(),w=i("minor.gridcolor",_),S=i("minor.gridwidth",t.gridwidth||1),E=i("minor.griddash",t.griddash||"solid"),y=r("minor.showgrid",!!w||!!S||!!E);y||(delete t.minor.gridcolor,delete t.minor.gridwidth,delete t.minor.griddash)}if(!o.noZeroLine){var b=i("zerolinelayer"),p=i("zerolinecolor",a),u=i("zerolinewidth"),m=r("zeroline",o.showGrid||!!p||!!u);m||(delete t.zerolinelayer,delete t.zerolinecolor,delete t.zerolinewidth)}}}}),z_=Ze({"src/plots/cartesian/axis_defaults.js"(Z,q){"use strict";var d=ns(),x=oo(),A=ca(),M=Dl(),e=fp(),t=Wh(),r=X0(),o=t1(),a=$m(),i=Qm(),n=I2(),s=D_(),c=h5(),f=wv(),g=kh().WEEKDAY_PATTERN,v=kh().HOUR_PATTERN;q.exports=function(S,E,y,b,p){var u=b.letter,m=b.font||{},h=b.splomStash||{},P=y("visible",!b.visibleDflt),L=E._template||{},z=E.type||L.type||"-",F;if(z==="date"){var B=x.getComponentMethod("calendars","handleDefaults");B(S,E,"calendar",b.calendar),b.noTicklabelmode||(F=y("ticklabelmode"))}!b.noTicklabelindex&&(z==="date"||z==="linear")&&y("ticklabelindex");var O="";(!b.noTicklabelposition||z==="multicategory")&&(O=A.coerce(S,E,{ticklabelposition:{valType:"enumerated",dflt:"outside",values:F==="period"?["outside","inside"]:u==="x"?["outside","inside","outside left","inside left","outside right","inside right"]:["outside","inside","outside top","inside top","outside bottom","inside bottom"]}},"ticklabelposition")),b.noTicklabeloverflow||y("ticklabeloverflow",O.indexOf("inside")!==-1?"hide past domain":z==="category"||z==="multicategory"?"allow":"hide past div"),f(E,p),c(S,E,y,b),n(S,E,y,b),b.noHover||(z!=="category"&&y("hoverformat"),b.noUnifiedhovertitle||y("unifiedhovertitle.text"));var I=y("color"),N=I!==t.color.dflt?I:m.color,U=h.label||p._dfltTitle[u];if(i(S,E,y,z,b),!P)return E;y("title.text",U),A.coerceFont(y,"title.font",m,{overrideDflt:{size:A.bigFont(m.size),color:N}}),r(S,E,y,z);var W=b.hasMinor;if(W&&(M.newContainer(E,"minor"),r(S,E,y,z,{isMinor:!0})),a(S,E,y,z,b),o(S,E,y,b),W){var Q=b.isMinor;b.isMinor=!0,o(S,E,y,b),b.isMinor=Q}s(S,E,y,{dfltColor:I,bgColor:b.bgColor,showGrid:b.showGrid,hasMinor:W,attributes:t}),W&&!E.minor.ticks&&!E.minor.showgrid&&delete E.minor,(E.showline||E.ticks)&&y("mirror");var ue=z==="multicategory";if(!b.noTickson&&(z==="category"||ue)&&(E.ticks||E.showgrid)&&(ue?(y("tickson","boundaries"),delete E.ticklabelposition):y("tickson")),ue){var le=y("showdividers");le&&(y("dividercolor"),y("dividerwidth"))}if(z==="date")if(e(S,E,{name:"rangebreaks",inclusionAttr:"enabled",handleItemDefaults:T}),!E.rangebreaks.length)delete E.rangebreaks;else{for(var he=0;he=2){var u="",m,h;if(p.length===2){for(m=0;m<2;m++)if(h=_(p[m]),h){u=g;break}}var P=y("pattern",u);if(P===g)for(m=0;m<2;m++)h=_(p[m]),h&&(S.bounds[m]=p[m]=h-1);if(P)for(m=0;m<2;m++)switch(h=p[m],P){case g:if(!d(h)){S.enabled=!1;return}if(h=+h,h!==Math.floor(h)||h<0||h>=7){S.enabled=!1;return}S.bounds[m]=p[m]=h;break;case v:if(!d(h)){S.enabled=!1;return}if(h=+h,h<0||h>24){S.enabled=!1;return}S.bounds[m]=p[m]=h;break}if(E.autorange===!1){var L=E.range;if(L[0]L[1]){S.enabled=!1;return}}else if(p[0]>L[0]&&p[1]y[1]-1/4096&&(e.domain=f),x.noneOrAll(M.domain,e.domain,f),e.tickmode==="sync"&&(e.tickmode="auto")}return t("layer"),e}}}),Yz=Ze({"src/plots/cartesian/layout_defaults.js"(Z,q){"use strict";var d=ca(),x=Yn(),A=Qp().isUnifiedHover,M=_5(),e=Dl(),t=$y(),r=Wh(),o=O5(),a=z_(),i=Y0(),n=R2(),s=$c(),c=s.id2name,f=s.name2id,g=kh().AX_ID_PATTERN,v=oo(),T=v.traceIs,l=v.getComponentMethod;function _(w,S,E){Array.isArray(w[S])?w[S].push(E):w[S]=[E]}q.exports=function(S,E,y){var b=E.autotypenumbers,p={},u={},m={},h={},P={},L={},z={},F={},B={},O={},I,N;for(I=0;I rect").call(M.setTranslate,0,0).call(M.setScale,1,1),E.plot.call(M.setTranslate,y._offset,b._offset).call(M.setScale,1,1);var p=E.plot.selectAll(".scatterlayer .trace");p.selectAll(".point").call(M.setPointGroupScale,1,1),p.selectAll(".textpoint").call(M.setTextPointsScale,1,1),p.call(M.hideOutsideRangePoints,E)}function c(E,y){var b=E.plotinfo,p=b.xaxis,u=b.yaxis,m=p._length,h=u._length,P=!!E.xr1,L=!!E.yr1,z=[];if(P){var F=A.simpleMap(E.xr0,p.r2l),B=A.simpleMap(E.xr1,p.r2l),O=F[1]-F[0],I=B[1]-B[0];z[0]=(F[0]*(1-y)+y*B[0]-F[0])/(F[1]-F[0])*m,z[2]=m*(1-y+y*I/O),p.range[0]=p.l2r(F[0]*(1-y)+y*B[0]),p.range[1]=p.l2r(F[1]*(1-y)+y*B[1])}else z[0]=0,z[2]=m;if(L){var N=A.simpleMap(E.yr0,u.r2l),U=A.simpleMap(E.yr1,u.r2l),W=N[1]-N[0],Q=U[1]-U[0];z[1]=(N[1]*(1-y)+y*U[1]-N[1])/(N[0]-N[1])*h,z[3]=h*(1-y+y*Q/W),u.range[0]=p.l2r(N[0]*(1-y)+y*U[0]),u.range[1]=u.l2r(N[1]*(1-y)+y*U[1])}else z[1]=0,z[3]=h;e.drawOne(r,p,{skipTitle:!0}),e.drawOne(r,u,{skipTitle:!0}),e.redrawComponents(r,[p._id,u._id]);var ue=P?m/z[2]:1,le=L?h/z[3]:1,he=P?z[0]:0,G=L?z[1]:0,$=P?z[0]/z[2]*m:0,J=L?z[1]/z[3]*h:0,X=p._offset-$,oe=u._offset-J;b.clipRect.call(M.setTranslate,he,G).call(M.setScale,1/ue,1/le),b.plot.call(M.setTranslate,X,oe).call(M.setScale,ue,le),M.setPointGroupScale(b.zoomScalePts,1/ue,1/le),M.setTextPointsScale(b.zoomScaleTxt,1/ue,1/le)}var f;i&&(f=i());function g(){for(var E={},y=0;ya.duration?(g(),_=window.cancelAnimationFrame(S)):_=window.requestAnimationFrame(S)}return T=Date.now(),_=window.requestAnimationFrame(S),Promise.resolve()}}}),Zf=Ze({"src/plots/cartesian/index.js"(Z){"use strict";var q=On(),d=oo(),x=ca(),A=xc(),M=as(),e=Hh().getModuleCalcData,t=$c(),r=kh(),o=vd(),a=x.ensureSingle;function i(T,l,_){return x.ensureSingle(T,l,_,function(w){w.datum(_)})}var n=r.zindexSeparator;Z.name="cartesian",Z.attr=["xaxis","yaxis"],Z.idRoot=["x","y"],Z.idRegex=r.idRegex,Z.attrRegex=r.attrRegex,Z.attributes=Zz(),Z.layoutAttributes=Wh(),Z.supplyLayoutDefaults=Yz(),Z.transitionAxes=Kz(),Z.finalizeSubplots=function(T,l){var _=l._subplots,w=_.xaxis,S=_.yaxis,E=_.cartesian,y=E,b={},p={},u,m,h;for(u=0;u0){var L=P.id;if(L.indexOf(n)!==-1)continue;L+=n+(u+1),P=x.extendFlat({},P,{id:L,plot:S._cartesianlayer.selectAll(".subplot").select("."+L)})}for(var z=[],F,B=0;B1&&(W+=n+U),N.push(b+W),y=0;y1,h=l.mainplotinfo;if(!l.mainplot||m)if(u)l.xlines=a(w,"path","xlines-above"),l.ylines=a(w,"path","ylines-above"),l.xaxislayer=a(w,"g","xaxislayer-above"),l.yaxislayer=a(w,"g","yaxislayer-above");else{if(!y){var P=a(w,"g","layer-subplot");l.shapelayer=a(P,"g","shapelayer"),l.imagelayer=a(P,"g","imagelayer"),h&&m?(l.minorGridlayer=h.minorGridlayer,l.gridlayer=h.gridlayer,l.zerolinelayer=h.zerolinelayer):(l.minorGridlayer=a(w,"g","minor-gridlayer"),l.gridlayer=a(w,"g","gridlayer"),l.zerolinelayer=a(w,"g","zerolinelayer"));var L=a(w,"g","layer-between");l.shapelayerBetween=a(L,"g","shapelayer"),l.imagelayerBetween=a(L,"g","imagelayer"),a(w,"path","xlines-below"),a(w,"path","ylines-below"),l.overlinesBelow=a(w,"g","overlines-below"),a(w,"g","xaxislayer-below"),a(w,"g","yaxislayer-below"),l.overaxesBelow=a(w,"g","overaxes-below")}l.overplot=a(w,"g","overplot"),l.plot=a(l.overplot,"g",S),h&&m?l.zerolinelayerAbove=h.zerolinelayerAbove:l.zerolinelayerAbove=a(w,"g","zerolinelayer-above"),y||(l.xlines=a(w,"path","xlines-above"),l.ylines=a(w,"path","ylines-above"),l.overlinesAbove=a(w,"g","overlines-above"),a(w,"g","xaxislayer-above"),a(w,"g","yaxislayer-above"),l.overaxesAbove=a(w,"g","overaxes-above"),l.xlines=w.select(".xlines-"+b),l.ylines=w.select(".ylines-"+p),l.xaxislayer=w.select(".xaxislayer-"+b),l.yaxislayer=w.select(".yaxislayer-"+p))}else{var z=h.plotgroup,F=S+"-x",B=S+"-y";l.minorGridlayer=h.minorGridlayer,l.gridlayer=h.gridlayer,l.zerolinelayer=h.zerolinelayer,l.zerolinelayerAbove=h.zerolinelayerAbove,a(h.overlinesBelow,"path",F),a(h.overlinesBelow,"path",B),a(h.overaxesBelow,"g",F),a(h.overaxesBelow,"g",B),l.plot=a(h.overplot,"g",S),a(h.overlinesAbove,"path",F),a(h.overlinesAbove,"path",B),a(h.overaxesAbove,"g",F),a(h.overaxesAbove,"g",B),l.xlines=z.select(".overlines-"+b).select("."+F),l.ylines=z.select(".overlines-"+p).select("."+B),l.xaxislayer=z.select(".overaxes-"+b).select("."+F),l.yaxislayer=z.select(".overaxes-"+p).select("."+B)}y||(u||(i(l.minorGridlayer,"g",l.xaxis._id),i(l.minorGridlayer,"g",l.yaxis._id),l.minorGridlayer.selectAll("g").map(function(O){return O[0]}).sort(t.idSort),i(l.gridlayer,"g",l.xaxis._id),i(l.gridlayer,"g",l.yaxis._id),l.gridlayer.selectAll("g").map(function(O){return O[0]}).sort(t.idSort)),l.xlines.style("fill","none").classed("crisp",!0),l.ylines.style("fill","none").classed("crisp",!0))}function g(T,l){if(T){var _={};T.each(function(p){var u=p[0],m=q.select(this);m.remove(),v(u,l),_[u]=!0});for(var w in l._plots)for(var S=l._plots[w],E=S.overlays||[],y=0;y=0,l=i.indexOf("end")>=0,_=c.backoff*g+n.standoff,w=f.backoff*v+n.startstandoff,S,E,y,b;if(s.nodeName==="line"){S={x:+a.attr("x1"),y:+a.attr("y1")},E={x:+a.attr("x2"),y:+a.attr("y2")};var p=S.x-E.x,u=S.y-E.y;if(y=Math.atan2(u,p),b=y+Math.PI,_&&w&&_+w>Math.sqrt(p*p+u*u)){W();return}if(_){if(_*_>p*p+u*u){W();return}var m=_*Math.cos(y),h=_*Math.sin(y);E.x+=m,E.y+=h,a.attr({x2:E.x,y2:E.y})}if(w){if(w*w>p*p+u*u){W();return}var P=w*Math.cos(y),L=w*Math.sin(y);S.x-=P,S.y-=L,a.attr({x1:S.x,y1:S.y})}}else if(s.nodeName==="path"){var z=s.getTotalLength(),F="";if(z<_+w){W();return}var B=s.getPointAtLength(0),O=s.getPointAtLength(.1);y=Math.atan2(B.y-O.y,B.x-O.x),S=s.getPointAtLength(Math.min(w,z)),F="0px,"+w+"px,";var I=s.getPointAtLength(z),N=s.getPointAtLength(z-.1);b=Math.atan2(I.y-N.y,I.x-N.x),E=s.getPointAtLength(Math.max(0,z-_));var U=F?w+_:_;F+=z-U+"px,"+z+"px",a.style("stroke-dasharray",F)}function W(){a.style("stroke-dasharray","0px,100px")}function Q(ue,le,he,G){ue.path&&(ue.noRotate&&(he=0),d.select(s.parentNode).append("path").attr({class:a.attr("class"),d:ue.path,transform:r(le.x,le.y)+t(he*180/Math.PI)+e(G)}).style({fill:x.rgb(n.arrowcolor),"stroke-width":0}))}T&&Q(f,S,y,v),l&&Q(c,E,b,g)}}}),D2=Ze({"src/components/annotations/draw.js"(Z,q){"use strict";var d=On(),x=oo(),A=xc(),M=ca(),e=M.strTranslate,t=Wo(),r=Yn(),o=as(),a=ef(),i=fu(),n=Kd(),s=Tp(),c=Dl().arrayEditor,f=$z();q.exports={draw:g,drawOne:v,drawRaw:l};function g(_){var w=_._fullLayout;w._infolayer.selectAll(".annotation").remove();for(var S=0;S2/3?za="right":za="center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[za]}for(var rt=!1,st=["x","y"],Qe=0;Qe1)&&(Vt===kt?(Pe=Zt.r2fraction(w["a"+Lt]),(Pe<0||Pe>1)&&(rt=!0)):rt=!0),Ke=Zt._offset+Zt.r2p(w[Lt]),qe=.5}else{var at=Te==="domain";Lt==="x"?(Me=w[Lt],Ke=at?Zt._offset+Zt._length*Me:Ke=u.l+u.w*Me):(Me=1-w[Lt],Ke=at?Zt._offset+Zt._length*Me:Ke=u.t+u.h*Me),qe=w.showarrow?.5:Me}if(w.showarrow){Be.head=Ke;var yt=w["a"+Lt];if(Ce=xr*Fe(.5,w.xanchor)-jr*Fe(.5,w.yanchor),Vt===kt){var Tt=t.getRefType(Vt);Tt==="domain"?(Lt==="y"&&(yt=1-yt),Be.tail=Zt._offset+Zt._length*yt):Tt==="paper"?Lt==="y"?(yt=1-yt,Be.tail=u.t+u.h*yt):Be.tail=u.l+u.w*yt:Be.tail=Zt._offset+Zt.r2p(yt),Ue=Ce}else Be.tail=Ke+yt,Ue=Ce+yt;Be.text=Be.tail+Ce;var Ot=p[Lt==="x"?"width":"height"];if(kt==="paper"&&(Be.head=M.constrain(Be.head,1,Ot-1)),Vt==="pixel"){var Gt=-Math.max(Be.tail-3,Be.text),rr=Math.min(Be.tail+3,Be.text)-Ot;Gt>0?(Be.tail+=Gt,Be.text+=Gt):rr>0&&(Be.tail-=rr,Be.text-=rr)}Be.tail+=bt,Be.head+=bt}else Ce=wr*Fe(qe,Ir),Ue=Ce,Be.text=Ke+Ce;Be.text+=bt,Ce+=bt,Ue+=bt,w["_"+Lt+"padplus"]=wr/2+Ue,w["_"+Lt+"padminus"]=wr/2-Ue,w["_"+Lt+"size"]=wr,w["_"+Lt+"shift"]=Ce}if(rt){he.remove();return}var Qt=0,Tr=0;if(w.align!=="left"&&(Qt=(lt-ot)*(w.align==="center"?.5:1)),w.valign!=="top"&&(Tr=(Ee-tt)*(w.valign==="middle"?.5:1)),Xe)Re.select("svg").attr({x:J+Qt-1,y:J+Tr}).call(o.setClipUrl,oe?O:null,_);else{var la=J+Tr-it.top,Ua=J+Qt-it.left;re.call(i.positionText,Ua,la).call(o.setClipUrl,oe?O:null,_)}ie.select("rect").call(o.setRect,J,J,lt,Ee),X.call(o.setRect,G/2,G/2,_e-G,fe-G),he.call(o.setTranslate,Math.round(I.x.text-_e/2),Math.round(I.y.text-fe/2)),W.attr({transform:"rotate("+N+","+I.x.text+","+I.y.text+")"});var Ba=function(ei,za){U.selectAll(".annotation-arrow-g").remove();var ti=I.x.head,Ci=I.y.head,Jt=I.x.tail+ei,Nt=I.y.tail+za,Kt=I.x.text+ei,Wt=I.y.text+za,Pr=M.rotationXYMatrix(N,Kt,Wt),ta=M.apply2DTransform(Pr),ma=M.apply2DTransform2(Pr),ra=+X.attr("width"),Ia=+X.attr("height"),Ha=Kt-.5*ra,$a=Ha+ra,ai=Wt-.5*Ia,mi=ai+Ia,xt=[[Ha,ai,Ha,mi],[Ha,mi,$a,mi],[$a,mi,$a,ai],[$a,ai,Ha,ai]].map(ma);if(!xt.reduce(function(It,dr){return It^!!M.segmentsIntersect(ti,Ci,ti+1e6,Ci+1e6,dr[0],dr[1],dr[2],dr[3])},!1)){xt.forEach(function(It){var dr=M.segmentsIntersect(Jt,Nt,ti,Ci,It[0],It[1],It[2],It[3]);dr&&(Jt=dr.x,Nt=dr.y)});var ct=w.arrowwidth,Nr=w.arrowcolor,Or=w.arrowside,Rr=U.append("g").style({opacity:r.opacity(Nr)}).classed("annotation-arrow-g",!0),Lr=Rr.append("path").attr("d","M"+Jt+","+Nt+"L"+ti+","+Ci).style("stroke-width",ct+"px").call(r.stroke,r.rgb(Nr));if(f(Lr,Or,w),m.annotationPosition&&Lr.node().parentNode&&!E){var Gr=ti,Kr=Ci;if(w.standoff){var Ur=Math.sqrt(Math.pow(ti-Jt,2)+Math.pow(Ci-Nt,2));Gr+=w.standoff*(Jt-ti)/Ur,Kr+=w.standoff*(Nt-Ci)/Ur}var aa=Rr.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(Jt-Gr)+","+(Nt-Kr),transform:e(Gr,Kr)}).style("stroke-width",ct+6+"px").call(r.stroke,"rgba(0,0,0,0)").call(r.fill,"rgba(0,0,0,0)"),da,fa;s.init({element:aa.node(),gd:_,prepFn:function(){var It=o.getTranslate(he);da=It.x,fa=It.y,y&&y.autorange&&z(y._name+".autorange",!0),b&&b.autorange&&z(b._name+".autorange",!0)},moveFn:function(It,dr){var kr=ta(da,fa),ia=kr[0]+It,Ca=kr[1]+dr;he.call(o.setTranslate,ia,Ca),F("x",T(y,It,"x",u,w)),F("y",T(b,dr,"y",u,w)),w.axref===w.xref&&F("ax",T(y,It,"ax",u,w)),w.ayref===w.yref&&F("ay",T(b,dr,"ay",u,w)),Rr.attr("transform",e(It,dr)),W.attr({transform:"rotate("+N+","+ia+","+Ca+")"})},doneFn:function(){x.call("_guiRelayout",_,B());var It=document.querySelector(".js-notes-box-panel");It&&It.redraw(It.selectedObj)}})}}};if(w.showarrow&&Ba(0,0),Q){var Ra;s.init({element:he.node(),gd:_,prepFn:function(){Ra=W.attr("transform")},moveFn:function(ei,za){var ti="pointer";if(w.showarrow)w.axref===w.xref?F("ax",T(y,ei,"ax",u,w)):F("ax",w.ax+ei),w.ayref===w.yref?F("ay",T(b,za,"ay",u.w,w)):F("ay",w.ay+za),Ba(ei,za);else{if(E)return;var Ci,Jt;if(y)Ci=T(y,ei,"x",u,w);else{var Nt=w._xsize/u.w,Kt=w.x+(w._xshift-w.xshift)/u.w-Nt/2;Ci=s.align(Kt+ei/u.w,Nt,0,1,w.xanchor)}if(b)Jt=T(b,za,"y",u,w);else{var Wt=w._ysize/u.h,Pr=w.y-(w._yshift+w.yshift)/u.h-Wt/2;Jt=s.align(Pr-za/u.h,Wt,0,1,w.yanchor)}F("x",Ci),F("y",Jt),(!y||!b)&&(ti=s.getCursor(y?.5:Ci,b?.5:Jt,w.xanchor,w.yanchor))}W.attr({transform:e(ei,za)+Ra}),n(he,ti)},clickFn:function(ei,za){w.captureevents&&_.emit("plotly_clickannotation",le(za))},doneFn:function(){n(he),x.call("_guiRelayout",_,B());var ei=document.querySelector(".js-notes-box-panel");ei&&ei.redraw(ei.selectedObj)}})}}m.annotationText?re.call(i.makeEditable,{delegate:he,gd:_}).call(ce).on("edit",function(Ae){w.text=Ae,this.call(ce),F("text",Ae),y&&y.autorange&&z(y._name+".autorange",!0),b&&b.autorange&&z(b._name+".autorange",!0),x.call("_guiRelayout",_,B())}):re.call(ce)}}}),Qz=Ze({"src/components/annotations/click.js"(Z,q){"use strict";var d=ca(),x=oo(),A=Dl().arrayEditor;q.exports={hasClickToShow:M,onClick:e};function M(o,a){var i=t(o,a);return i.on.length>0||i.explicitOff.length>0}function e(o,a){var i=t(o,a),n=i.on,s=i.off.concat(i.explicitOff),c={},f=o._fullLayout.annotations,g,v;if(n.length||s.length){for(g=0;g1){n=!0;break}}n?e.fullLayout._infolayer.select(".annotation-"+e.id+'[data-index="'+a+'"]').remove():(i._pdata=x(e.glplot.cameraParams,[t.xaxis.r2l(i.x)*r[0],t.yaxis.r2l(i.y)*r[1],t.zaxis.r2l(i.z)*r[2]]),d(e.graphDiv,i,a,e.id,i._xa,i._ya))}}}}),s9=Ze({"src/components/annotations3d/index.js"(Z,q){"use strict";var d=oo(),x=ca();q.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:z2()}}},layoutAttributes:z2(),handleDefaults:i9(),includeBasePlot:A,convert:n9(),draw:o9()};function A(M,e){var t=d.subplotsRegistry.gl3d;if(t)for(var r=t.attrRegex,o=Object.keys(M),a=0;a0?l+g:g;return{ppad:g,ppadplus:v?w:S,ppadminus:v?S:w}}else return{ppad:g}}function o(a,i,n){var s=a._id.charAt(0)==="x"?"x":"y",c=a.type==="category"||a.type==="multicategory",f,g,v=0,T=0,l=c?a.r2c:a.d2c,_=i[s+"sizemode"]==="scaled";if(_?(f=i[s+"0"],g=i[s+"1"],c&&(v=i[s+"0shift"],T=i[s+"1shift"])):(f=i[s+"anchor"],g=i[s+"anchor"]),f!==void 0)return[l(f)+v,l(g)+T];if(i.path){var w=1/0,S=-1/0,E=i.path.match(A.segmentRE),y,b,p,u,m;for(a.type==="date"&&(l=M.decodeDate(l)),y=0;yS&&(S=m)));if(S>=w)return[w,S]}}}}),f9=Ze({"src/components/shapes/index.js"(Z,q){"use strict";var d=E2();q.exports={moduleType:"component",name:"shapes",layoutAttributes:U5(),supplyLayoutDefaults:l9(),supplyDrawNewShapeDefaults:u9(),includeBasePlot:R_()("shapes"),calcAutorange:c9(),draw:d.draw,drawOne:d.drawOne}}}),j5=Ze({"src/components/images/attributes.js"(Z,q){"use strict";var d=kh(),x=Dl().templatedArray,A=I_();q.exports=x("image",{visible:{valType:"boolean",dflt:!0,editType:"arraydraw"},source:{valType:"string",editType:"arraydraw"},layer:{valType:"enumerated",values:["below","above"],dflt:"above",editType:"arraydraw"},sizex:{valType:"number",dflt:0,editType:"arraydraw"},sizey:{valType:"number",dflt:0,editType:"arraydraw"},sizing:{valType:"enumerated",values:["fill","contain","stretch"],dflt:"contain",editType:"arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},x:{valType:"any",dflt:0,editType:"arraydraw"},y:{valType:"any",dflt:0,editType:"arraydraw"},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left",editType:"arraydraw"},yanchor:{valType:"enumerated",values:["top","middle","bottom"],dflt:"top",editType:"arraydraw"},xref:{valType:"enumerated",values:["paper",d.idRegex.x.toString()],dflt:"paper",editType:"arraydraw"},yref:{valType:"enumerated",values:["paper",d.idRegex.y.toString()],dflt:"paper",editType:"arraydraw"},editType:"arraydraw"})}}),h9=Ze({"src/components/images/defaults.js"(Z,q){"use strict";var d=ca(),x=Wo(),A=fp(),M=j5(),e="images";q.exports=function(o,a){var i={name:e,handleItemDefaults:t};A(o,a,i)};function t(r,o,a){function i(_,w){return d.coerce(r,o,M,_,w)}var n=i("source"),s=i("visible",!!n);if(!s)return o;i("layer"),i("xanchor"),i("yanchor"),i("sizex"),i("sizey"),i("sizing"),i("opacity");for(var c={_fullLayout:a},f=["x","y"],g=0;g<2;g++){var v=f[g],T=x.coerceRef(r,o,c,v,"paper",void 0);if(T!=="paper"){var l=x.getFromId(c,T);l._imgIndices.push(o._index)}x.coercePosition(o,c,i,T,v,0)}return o}}}),p9=Ze({"src/components/images/draw.js"(Z,q){"use strict";var d=On(),x=as(),A=Wo(),M=$c(),e=vd();q.exports=function(r){var o=r._fullLayout,a=[],i={},n=[],s,c;for(c=0;c0);f&&(s("active"),s("direction"),s("type"),s("showactive"),s("x"),s("y"),d.noneOrAll(a,i,["x","y"]),s("xanchor"),s("yanchor"),s("pad.t"),s("pad.r"),s("pad.b"),s("pad.l"),d.coerceFont(s,"font",n.font),s("bgcolor",n.paper_bgcolor),s("bordercolor"),s("borderwidth"))}function o(a,i){function n(c,f){return d.coerce(a,i,t,c,f)}var s=n("visible",a.method==="skip"||Array.isArray(a.args));s&&(n("method"),n("args"),n("args2"),n("label"),n("execute"))}}}),g9=Ze({"src/components/updatemenus/scrollbox.js"(Z,q){"use strict";q.exports=e;var d=On(),x=Yn(),A=as(),M=ca();function e(t,r,o){this.gd=t,this.container=r,this.id=o,this.position=null,this.translateX=null,this.translateY=null,this.hbar=null,this.vbar=null,this.bg=this.container.selectAll("rect.scrollbox-bg").data([0]),this.bg.exit().on(".drag",null).on("wheel",null).remove(),this.bg.enter().append("rect").classed("scrollbox-bg",!0).style("pointer-events","all").attr({opacity:0,x:0,y:0,width:0,height:0})}e.barWidth=2,e.barLength=20,e.barRadius=2,e.barPad=1,e.barColor="#808BA4",e.prototype.enable=function(r,o,a){var i=this.gd._fullLayout,n=i.width,s=i.height;this.position=r;var c=this.position.l,f=this.position.w,g=this.position.t,v=this.position.h,T=this.position.direction,l=T==="down",_=T==="left",w=T==="right",S=T==="up",E=f,y=v,b,p,u,m;!l&&!_&&!w&&!S&&(this.position.direction="down",l=!0);var h=l||S;h?(b=c,p=b+E,l?(u=g,m=Math.min(u+y,s),y=m-u):(m=g+y,u=Math.max(m-y,0),y=m-u)):(u=g,m=u+y,_?(p=c+E,b=Math.max(p-E,0),E=p-b):(b=c,p=Math.min(b+E,n),E=p-b)),this._box={l:b,t:u,w:E,h:y};var P=f>E,L=e.barLength+2*e.barPad,z=e.barWidth+2*e.barPad,F=c,B=g+v;B+z>s&&(B=s-z);var O=this.container.selectAll("rect.scrollbar-horizontal").data(P?[0]:[]);O.exit().on(".drag",null).remove(),O.enter().append("rect").classed("scrollbar-horizontal",!0).call(x.fill,e.barColor),P?(this.hbar=O.attr({rx:e.barRadius,ry:e.barRadius,x:F,y:B,width:L,height:z}),this._hbarXMin=F+L/2,this._hbarTranslateMax=E-L):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var I=v>y,N=e.barWidth+2*e.barPad,U=e.barLength+2*e.barPad,W=c+f,Q=g;W+N>n&&(W=n-N);var ue=this.container.selectAll("rect.scrollbar-vertical").data(I?[0]:[]);ue.exit().on(".drag",null).remove(),ue.enter().append("rect").classed("scrollbar-vertical",!0).call(x.fill,e.barColor),I?(this.vbar=ue.attr({rx:e.barRadius,ry:e.barRadius,x:W,y:Q,width:N,height:U}),this._vbarYMin=Q+U/2,this._vbarTranslateMax=y-U):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var le=this.id,he=b-.5,G=I?p+N+.5:p+.5,$=u-.5,J=P?m+z+.5:m+.5,X=i._topdefs.selectAll("#"+le).data(P||I?[0]:[]);if(X.exit().remove(),X.enter().append("clipPath").attr("id",le).append("rect"),P||I?(this._clipRect=X.select("rect").attr({x:Math.floor(he),y:Math.floor($),width:Math.ceil(G)-Math.floor(he),height:Math.ceil(J)-Math.floor($)}),this.container.call(A.setClipUrl,le,this.gd),this.bg.attr({x:c,y:g,width:f,height:v})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(A.setClipUrl,null),delete this._clipRect),P||I){var oe=d.behavior.drag().on("dragstart",function(){d.event.sourceEvent.preventDefault()}).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(oe);var ie=d.behavior.drag().on("dragstart",function(){d.event.sourceEvent.preventDefault(),d.event.sourceEvent.stopPropagation()}).on("drag",this._onBarDrag.bind(this));P&&this.hbar.on(".drag",null).call(ie),I&&this.vbar.on(".drag",null).call(ie)}this.setTranslate(o,a)},e.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(A.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},e.prototype._onBoxDrag=function(){var r=this.translateX,o=this.translateY;this.hbar&&(r-=d.event.dx),this.vbar&&(o-=d.event.dy),this.setTranslate(r,o)},e.prototype._onBoxWheel=function(){var r=this.translateX,o=this.translateY;this.hbar&&(r+=d.event.deltaY),this.vbar&&(o+=d.event.deltaY),this.setTranslate(r,o)},e.prototype._onBarDrag=function(){var r=this.translateX,o=this.translateY;if(this.hbar){var a=r+this._hbarXMin,i=a+this._hbarTranslateMax,n=M.constrain(d.event.x,a,i),s=(n-a)/(i-a),c=this.position.w-this._box.w;r=s*c}if(this.vbar){var f=o+this._vbarYMin,g=f+this._vbarTranslateMax,v=M.constrain(d.event.y,f,g),T=(v-f)/(g-f),l=this.position.h-this._box.h;o=T*l}this.setTranslate(r,o)},e.prototype.setTranslate=function(r,o){var a=this.position.w-this._box.w,i=this.position.h-this._box.h;if(r=M.constrain(r||0,0,a),o=M.constrain(o||0,0,i),this.translateX=r,this.translateY=o,this.container.call(A.setTranslate,this._box.l-this.position.l-r,this._box.t-this.position.t-o),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+r-.5),y:Math.floor(this.position.t+o-.5)}),this.hbar){var n=r/a;this.hbar.call(A.setTranslate,r+n*this._hbarTranslateMax,o)}if(this.vbar){var s=o/i;this.vbar.call(A.setTranslate,r,o+s*this._vbarTranslateMax)}}}}),y9=Ze({"src/components/updatemenus/draw.js"(Z,q){"use strict";var d=On(),x=xc(),A=Yn(),M=as(),e=ca(),t=fu(),r=Dl().arrayEditor,o=mh().LINE_SPACING,a=F2(),i=g9();q.exports=function(L){var z=L._fullLayout,F=e.filterVisible(z[a.name]);function B(le){x.autoMargin(L,u(le))}var O=z._menulayer.selectAll("g."+a.containerClassName).data(F.length>0?[0]:[]);if(O.enter().append("g").classed(a.containerClassName,!0).style("cursor","pointer"),O.exit().each(function(){d.select(this).selectAll("g."+a.headerGroupClassName).each(B)}).remove(),F.length!==0){var I=O.selectAll("g."+a.headerGroupClassName).data(F,n);I.enter().append("g").classed(a.headerGroupClassName,!0);for(var N=e.ensureSingle(O,"g",a.dropdownButtonGroupClassName,function(le){le.style("pointer-events","all")}),U=0;U0?[0]:[]);W.enter().append("g").classed(a.containerClassName,!0).style("cursor",I?null:"ew-resize");function Q(G){G._commandObserver&&(G._commandObserver.remove(),delete G._commandObserver),x.autoMargin(O,f(G))}if(W.exit().each(function(){d.select(this).selectAll("g."+a.groupClassName).each(Q)}).remove(),U.length!==0){var ue=W.selectAll("g."+a.groupClassName).data(U,v);ue.enter().append("g").classed(a.groupClassName,!0),ue.exit().each(Q).remove();for(var le=0;le0&&(ue=ue.transition().duration(O.transition.duration).ease(O.transition.easing)),ue.attr("transform",t(Q-a.gripWidth*.5,O._dims.currentValueTotalHeight))}}function P(B,O){var I=B._dims;return I.inputAreaStart+a.stepInset+(I.inputAreaLength-2*a.stepInset)*Math.min(1,Math.max(0,O))}function L(B,O){var I=B._dims;return Math.min(1,Math.max(0,(O-a.stepInset-I.inputAreaStart)/(I.inputAreaLength-2*a.stepInset-2*I.inputAreaStart)))}function z(B,O,I){var N=I._dims,U=e.ensureSingle(B,"rect",a.railTouchRectClass,function(W){W.call(p,O,B,I).style("pointer-events","all")});U.attr({width:N.inputAreaLength,height:Math.max(N.inputAreaWidth,a.tickOffset+I.ticklen+N.labelHeight)}).call(A.fill,I.bgcolor).attr("opacity",0),M.setTranslate(U,0,N.currentValueTotalHeight)}function F(B,O){var I=O._dims,N=I.inputAreaLength-a.railInset*2,U=e.ensureSingle(B,"rect",a.railRectClass);U.attr({width:N,height:a.railWidth,rx:a.railRadius,ry:a.railRadius,"shape-rendering":"crispEdges"}).call(A.stroke,O.bordercolor).call(A.fill,O.bgcolor).style("stroke-width",O.borderwidth+"px"),M.setTranslate(U,a.railInset,(I.inputAreaWidth-a.railWidth)*.5+I.currentValueTotalHeight)}}}),w9=Ze({"src/components/sliders/index.js"(Z,q){"use strict";var d=F_();q.exports={moduleType:"component",name:d.name,layoutAttributes:V5(),supplyLayoutDefaults:x9(),draw:b9()}}}),O2=Ze({"src/components/rangeslider/attributes.js"(Z,q){"use strict";var d=oh();q.exports={bgcolor:{valType:"color",dflt:d.background,editType:"plot"},bordercolor:{valType:"color",dflt:d.defaultLine,editType:"plot"},borderwidth:{valType:"integer",dflt:0,min:0,editType:"plot"},autorange:{valType:"boolean",dflt:!0,editType:"calc",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},range:{valType:"info_array",items:[{valType:"any",editType:"calc",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"calc",impliedEdits:{"^autorange":!1}}],editType:"calc",impliedEdits:{autorange:!1}},thickness:{valType:"number",dflt:.15,min:0,max:1,editType:"plot"},visible:{valType:"boolean",dflt:!0,editType:"calc"},editType:"calc"}}}),G5=Ze({"src/components/rangeslider/oppaxis_attributes.js"(Z,q){"use strict";q.exports={_isSubplotObj:!0,rangemode:{valType:"enumerated",values:["auto","fixed","match"],dflt:"match",editType:"calc"},range:{valType:"info_array",items:[{valType:"any",editType:"plot"},{valType:"any",editType:"plot"}],editType:"plot"},editType:"calc"}}}),B2=Ze({"src/components/rangeslider/constants.js"(Z,q){"use strict";q.exports={name:"rangeslider",containerClassName:"rangeslider-container",bgClassName:"rangeslider-bg",rangePlotClassName:"rangeslider-rangeplot",maskMinClassName:"rangeslider-mask-min",maskMaxClassName:"rangeslider-mask-max",slideBoxClassName:"rangeslider-slidebox",grabberMinClassName:"rangeslider-grabber-min",grabAreaMinClassName:"rangeslider-grabarea-min",handleMinClassName:"rangeslider-handle-min",grabberMaxClassName:"rangeslider-grabber-max",grabAreaMaxClassName:"rangeslider-grabarea-max",handleMaxClassName:"rangeslider-handle-max",maskMinOppAxisClassName:"rangeslider-mask-min-opp-axis",maskMaxOppAxisClassName:"rangeslider-mask-max-opp-axis",maskColor:"rgba(0,0,0,0.4)",maskOppAxisColor:"rgba(0,0,0,0.2)",slideBoxFill:"transparent",slideBoxCursor:"ew-resize",grabAreaFill:"transparent",grabAreaCursor:"col-resize",grabAreaWidth:10,handleWidth:4,handleRadius:1,handleStrokeWidth:1,extraPad:15}}}),T9=Ze({"src/components/rangeslider/helpers.js"(Z){"use strict";var q=$c(),d=fu(),x=B2(),A=mh().LINE_SPACING,M=x.name;function e(t){var r=t&&t[M];return r&&r.visible}Z.isVisible=e,Z.makeData=function(t){for(var r=q.list({_fullLayout:t},"x",!0),o=t.margin,a=[],i=0;i=ot.max)Xe=ce[it+1];else if(Re=ot.pmax)Xe=ce[it+1];else if(Re0?p.touches[0].clientX:0}function g(p,u,m,h){if(u._context.staticPlot)return;var P=p.select("rect."+c.slideBoxClassName).node(),L=p.select("rect."+c.grabAreaMinClassName).node(),z=p.select("rect."+c.grabAreaMaxClassName).node();function F(){var B=d.event,O=B.target,I=f(B),N=I-p.node().getBoundingClientRect().left,U=h.d2p(m._rl[0]),W=h.d2p(m._rl[1]),Q=n.coverSlip();this.addEventListener("touchmove",ue),this.addEventListener("touchend",le),Q.addEventListener("mousemove",ue),Q.addEventListener("mouseup",le);function ue(he){var G=f(he),$=+G-I,J,X,oe;switch(O){case P:if(oe="ew-resize",U+$>m._length||W+$<0)return;J=U+$,X=W+$;break;case L:if(oe="col-resize",U+$>m._length)return;J=U+$,X=W;break;case z:if(oe="col-resize",W+$<0)return;J=U,X=W+$;break;default:oe="ew-resize",J=N,X=N+$;break}if(X0);if(_){var w=o(n,s,c);T("x",w[0]),T("y",w[1]),d.noneOrAll(i,n,["x","y"]),T("xanchor"),T("yanchor"),d.coerceFont(T,"font",s.font);var S=T("bgcolor");T("activecolor",x.contrast(S,t.lightAmount,t.darkAmount)),T("bordercolor"),T("borderwidth")}};function r(a,i,n,s){var c=s.calendar;function f(T,l){return d.coerce(a,i,e.buttons,T,l)}var g=f("visible");if(g){var v=f("step");v!=="all"&&(c&&c!=="gregorian"&&(v==="month"||v==="year")?i.stepmode="backward":f("stepmode"),f("count")),f("label")}}function o(a,i,n){for(var s=n.filter(function(v){return i[v].anchor===a._id}),c=0,f=0;f1)){delete c.grid;return}if(!T&&!l&&!_){var m=b("pattern")==="independent";m&&(T=!0)}y._hasSubplotGrid=T;var h=b("roworder"),P=h==="top to bottom",L=T?.2:.1,z=T?.3:.1,F,B;w&&c._splomGridDflt&&(F=c._splomGridDflt.xside,B=c._splomGridDflt.yside),y._domains={x:a("x",b,L,F,u),y:a("y",b,z,B,p,P)}}function a(s,c,f,g,v,T){var l=c(s+"gap",f),_=c("domain."+s);c(s+"side",g);for(var w=new Array(v),S=_[0],E=(_[1]-S)/(v-l),y=E*(1-l),b=0;b0,g=r._context.staticPlot;o.each(function(v){var T=v[0].trace,l=T.error_x||{},_=T.error_y||{},w;T.ids&&(w=function(b){return b.id});var S=M.hasMarkers(T)&&T.marker.maxdisplayed>0;!_.visible&&!l.visible&&(v=[]);var E=d.select(this).selectAll("g.errorbar").data(v,w);if(E.exit().remove(),!!v.length){l.visible||E.selectAll("path.xerror").remove(),_.visible||E.selectAll("path.yerror").remove(),E.style("opacity",1);var y=E.enter().append("g").classed("errorbar",!0);f&&y.style("opacity",0).transition().duration(i.duration).style("opacity",1),A.setClipUrl(E,a.layerClipId,r),E.each(function(b){var p=d.select(this),u=e(b,s,c);if(!(S&&!b.vis)){var m,h=p.select("path.yerror");if(_.visible&&x(u.x)&&x(u.yh)&&x(u.ys)){var P=_.width;m="M"+(u.x-P)+","+u.yh+"h"+2*P+"m-"+P+",0V"+u.ys,u.noYS||(m+="m-"+P+",0h"+2*P),n=!h.size(),n?h=p.append("path").style("vector-effect",g?"none":"non-scaling-stroke").classed("yerror",!0):f&&(h=h.transition().duration(i.duration).ease(i.easing)),h.attr("d",m)}else h.remove();var L=p.select("path.xerror");if(l.visible&&x(u.y)&&x(u.xh)&&x(u.xs)){var z=(l.copy_ystyle?_:l).width;m="M"+u.xh+","+(u.y-z)+"v"+2*z+"m0,-"+z+"H"+u.xs,u.noXS||(m+="m0,-"+z+"v"+2*z),n=!L.size(),n?L=p.append("path").style("vector-effect",g?"none":"non-scaling-stroke").classed("xerror",!0):f&&(L=L.transition().duration(i.duration).ease(i.easing)),L.attr("d",m)}else L.remove()}})}})};function e(t,r,o){var a={x:r.c2p(t.x),y:o.c2p(t.y)};return t.yh!==void 0&&(a.yh=o.c2p(t.yh),a.ys=o.c2p(t.ys),x(a.ys)||(a.noYS=!0,a.ys=o.c2p(t.ys,!0))),t.xh!==void 0&&(a.xh=r.c2p(t.xh),a.xs=r.c2p(t.xs),x(a.xs)||(a.noXS=!0,a.xs=r.c2p(t.xs,!0))),a}}}),z9=Ze({"src/components/errorbars/style.js"(Z,q){"use strict";var d=On(),x=Yn();q.exports=function(M){M.each(function(e){var t=e[0].trace,r=t.error_y||{},o=t.error_x||{},a=d.select(this);a.selectAll("path.yerror").style("stroke-width",r.thickness+"px").call(x.stroke,r.color),o.copy_ystyle&&(o=r),a.selectAll("path.xerror").style("stroke-width",o.thickness+"px").call(x.stroke,o.color)})}}}),F9=Ze({"src/components/errorbars/index.js"(Z,q){"use strict";var d=ca(),x=pc().overrideAll,A=X5(),M={error_x:d.extendFlat({},A),error_y:d.extendFlat({},A)};delete M.error_x.copy_zstyle,delete M.error_y.copy_zstyle,delete M.error_y.copy_ystyle;var e={error_x:d.extendFlat({},A),error_y:d.extendFlat({},A),error_z:d.extendFlat({},A)};delete e.error_x.copy_ystyle,delete e.error_y.copy_ystyle,delete e.error_z.copy_ystyle,delete e.error_z.copy_zstyle,q.exports={moduleType:"component",name:"errorbars",schema:{traces:{scatter:M,bar:M,histogram:M,scatter3d:x(e,"calc","nested"),scattergl:x(M,"calc","nested")}},supplyDefaults:I9(),calc:R9(),makeComputeError:Z5(),plot:D9(),style:z9(),hoverInfo:t};function t(r,o,a){(o.error_y||{}).visible&&(a.yerr=r.yh-r.y,o.error_y.symmetric||(a.yerrneg=r.y-r.ys)),(o.error_x||{}).visible&&(a.xerr=r.xh-r.x,o.error_x.symmetric||(a.xerrneg=r.x-r.xs))}}}),O9=Ze({"src/components/colorbar/constants.js"(Z,q){"use strict";q.exports={cn:{colorbar:"colorbar",cbbg:"cbbg",cbfill:"cbfill",cbfills:"cbfills",cbline:"cbline",cblines:"cblines",cbaxis:"cbaxis",cbtitleunshift:"cbtitleunshift",cbtitle:"cbtitle",cboutline:"cboutline",crisp:"crisp",jsPlaceholder:"js-placeholder"}}}}),B9=Ze({"src/components/colorbar/draw.js"(Z,q){"use strict";var d=On(),x=Ch(),A=xc(),M=oo(),e=Wo(),t=Tp(),r=ca(),o=r.strTranslate,a=rs().extendFlat,i=Kd(),n=as(),s=Yn(),c=Z0(),f=fu(),g=bp().flipScale,v=z_(),T=R2(),l=Wh(),_=mh(),w=_.LINE_SPACING,S=_.FROM_TL,E=_.FROM_BR,y=O9().cn;function b(L){var z=L._fullLayout,F=z._infolayer.selectAll("g."+y.colorbar).data(p(L),function(B){return B._id});F.enter().append("g").attr("class",function(B){return B._id}).classed(y.colorbar,!0),F.each(function(B){var O=d.select(this);r.ensureSingle(O,"rect",y.cbbg),r.ensureSingle(O,"g",y.cbfills),r.ensureSingle(O,"g",y.cblines),r.ensureSingle(O,"g",y.cbaxis,function(N){N.classed(y.crisp,!0)}),r.ensureSingle(O,"g",y.cbtitleunshift,function(N){N.append("g").classed(y.cbtitle,!0)}),r.ensureSingle(O,"rect",y.cboutline);var I=u(O,B,L);I&&I.then&&(L._promises||[]).push(I),L._context.edits.colorbarPosition&&m(O,B,L)}),F.exit().each(function(B){A.autoMargin(L,B._id)}).remove(),F.order()}function p(L){var z=L._fullLayout,F=L.calcdata,B=[],O,I,N,U;function W(j){return a(j,{_fillcolor:null,_line:{color:null,width:null,dash:null},_levels:{start:null,end:null,size:null},_filllevels:null,_fillgradient:null,_zrange:null})}function Q(){typeof U.calc=="function"?U.calc(L,N,O):(O._fillgradient=I.reversescale?g(I.colorscale):I.colorscale,O._zrange=[I[U.min],I[U.max]])}for(var ue=0;ue1){var Be=Math.pow(10,Math.floor(Math.log(bt)/Math.LN10));wr*=Be*r.roundUp(bt/Be,[2,5,10]),(Math.abs(it.start)/it.size+1e-6)%1<2e-6&&(xr.tick0=0)}xr.dtick=wr}xr.domain=B?[Zt+$/ee.h,Zt+Fe-$/ee.h]:[Zt+G/ee.w,Zt+Fe-G/ee.w],xr.setScale(),L.attr("transform",o(Math.round(ee.l),Math.round(ee.t)));var Ke=L.select("."+y.cbtitleunshift).attr("transform",o(-Math.round(ee.l),-Math.round(ee.t))),Ue=xr.ticklabelposition,Me=xr.title.font.size,qe=L.select("."+y.cbaxis),Ce,Te=0,Pe=0;function at(rr,Qt){var Tr={propContainer:xr,propName:z._propPrefix+"title",traceIndex:z._traceIndex,_meta:z._meta,placeholder:j._dfltTitle.colorbar,containerGroup:L.select("."+y.cbtitle)},la=rr.charAt(0)==="h"?rr.substr(1):"h"+rr;L.selectAll("."+la+",."+la+"-math-group").remove(),c.draw(F,rr,a(Tr,Qt||{}))}function yt(){if(B&&jr||!B&&!jr){var rr,Qt;Ae==="top"&&(rr=G+ee.l+rt*J,Qt=$+ee.t+st*(1-Zt-Fe)+3+Me*.75),Ae==="bottom"&&(rr=G+ee.l+rt*J,Qt=$+ee.t+st*(1-Zt)-3-Me*.25),Ae==="right"&&(Qt=$+ee.t+st*X+3+Me*.75,rr=G+ee.l+rt*Zt),at(xr._id+"title",{attributes:{x:rr,y:Qt,"text-anchor":B?"start":"middle"}})}}function Tt(){if(B&&!jr||!B&&jr){var rr=xr.position||0,Qt=xr._offset+xr._length/2,Tr,la;if(Ae==="right")la=Qt,Tr=ee.l+rt*rr+10+Me*(xr.showticklabels?1:.5);else if(Tr=Qt,Ae==="bottom"&&(la=ee.t+st*rr+10+(Ue.indexOf("inside")===-1?xr.tickfont.size:0)+(xr.ticks!=="inside"&&z.ticklen||0)),Ae==="top"){var Ua=be.text.split("
").length;la=ee.t+st*rr+10-Ee-w*Me*Ua}at((B?"h":"v")+xr._id+"title",{avoid:{selection:d.select(F).selectAll("g."+xr._id+"tick"),side:Ae,offsetTop:B?0:ee.t,offsetLeft:B?ee.l:0,maxShift:B?j.width:j.height},attributes:{x:Tr,y:la,"text-anchor":"middle"},transform:{rotate:B?-90:0,offset:0}})}}function Ot(){if(!B&&!jr||B&&jr){var rr=L.select("."+y.cbtitle),Qt=rr.select("text"),Tr=[-W/2,W/2],la=rr.select(".h"+xr._id+"title-math-group").node(),Ua=15.6;Qt.node()&&(Ua=parseInt(Qt.node().style.fontSize,10)*w);var Ba;if(la?(Ba=n.bBox(la),Pe=Ba.width,Te=Ba.height,Te>Ua&&(Tr[1]-=(Te-Ua)/2)):Qt.node()&&!Qt.classed(y.jsPlaceholder)&&(Ba=n.bBox(Qt.node()),Pe=Ba.width,Te=Ba.height),B){if(Te){if(Te+=5,Ae==="top")xr.domain[1]-=Te/ee.h,Tr[1]*=-1;else{xr.domain[0]+=Te/ee.h;var Ra=f.lineCount(Qt);Tr[1]+=(1-Ra)*Ua}rr.attr("transform",o(Tr[0],Tr[1])),xr.setScale()}}else Pe&&(Ae==="right"&&(xr.domain[0]+=(Pe+Me/2)/ee.w),rr.attr("transform",o(Tr[0],Tr[1])),xr.setScale())}L.selectAll("."+y.cbfills+",."+y.cblines).attr("transform",B?o(0,Math.round(ee.h*(1-xr.domain[1]))):o(Math.round(ee.w*xr.domain[0]),0)),qe.attr("transform",B?o(0,Math.round(-ee.t)):o(Math.round(-ee.l),0));var ei=L.select("."+y.cbfills).selectAll("rect."+y.cbfill).attr("style","").data(tt);ei.enter().append("rect").classed(y.cbfill,!0).attr("style",""),ei.exit().remove();var za=ze.map(xr.c2p).map(Math.round).sort(function(Kt,Wt){return Kt-Wt});ei.each(function(Kt,Wt){var Pr=[Wt===0?ze[0]:(tt[Wt]+tt[Wt-1])/2,Wt===tt.length-1?ze[1]:(tt[Wt]+tt[Wt+1])/2].map(xr.c2p).map(Math.round);B&&(Pr[1]=r.constrain(Pr[1]+(Pr[1]>Pr[0])?1:-1,za[0],za[1]));var ta=d.select(this).attr(B?"x":"y",Qe).attr(B?"y":"x",d.min(Pr)).attr(B?"width":"height",Math.max(Ee,2)).attr(B?"height":"width",Math.max(d.max(Pr)-d.min(Pr),2));if(z._fillgradient)n.gradient(ta,F,z._id,B?"vertical":"horizontalreversed",z._fillgradient,"fill");else{var ma=Xe(Kt).replace("e-","");ta.attr("fill",x(ma).toHexString())}});var ti=L.select("."+y.cblines).selectAll("path."+y.cbline).data(ce.color&&ce.width?lt:[]);ti.enter().append("path").classed(y.cbline,!0),ti.exit().remove(),ti.each(function(Kt){var Wt=Qe,Pr=Math.round(xr.c2p(Kt))+ce.width/2%1;d.select(this).attr("d","M"+(B?Wt+","+Pr:Pr+","+Wt)+(B?"h":"v")+Ee).call(n.lineGroupStyle,ce.width,Re(Kt),ce.dash)}),qe.selectAll("g."+xr._id+"tick,path").remove();var Ci=Qe+Ee+(W||0)/2-(z.ticks==="outside"?1:0),Jt=e.calcTicks(xr),Nt=e.getTickSigns(xr)[2];return e.drawTicks(F,xr,{vals:xr.ticks==="inside"?e.clipEnds(xr,Jt):Jt,layer:qe,path:e.makeTickPath(xr,Ci,Nt),transFn:e.makeTransTickFn(xr)}),e.drawLabels(F,xr,{vals:Jt,layer:qe,transFn:e.makeTransTickLabelFn(xr),labelFns:e.makeLabelFns(xr,Ci)})}function Gt(){var rr,Qt=Ee+W/2;Ue.indexOf("inside")===-1&&(rr=n.bBox(qe.node()),Qt+=B?rr.width:rr.height),Ce=Ke.select("text");var Tr=0,la=B&&Ae==="top",Ua=!B&&Ae==="right",Ba=0;if(Ce.node()&&!Ce.classed(y.jsPlaceholder)){var Ra,ei=Ke.select(".h"+xr._id+"title-math-group").node();ei&&(B&&jr||!B&&!jr)?(rr=n.bBox(ei),Tr=rr.width,Ra=rr.height):(rr=n.bBox(Ke.node()),Tr=rr.right-ee.l-(B?Qe:Sr),Ra=rr.bottom-ee.t-(B?Sr:Qe),!B&&Ae==="top"&&(Qt+=rr.height,Ba=rr.height)),Ua&&(Ce.attr("transform",o(Tr/2+Me/2,0)),Tr*=2),Qt=Math.max(Qt,B?Tr:Ra)}var za=(B?G:$)*2+Qt+Q+W/2,ti=0;!B&&be.text&&he==="bottom"&&X<=0&&(ti=za/2,za+=ti,Ba+=ti),j._hColorbarMoveTitle=ti,j._hColorbarMoveCBTitle=Ba;var Ci=Q+W,Jt=(B?Qe:Sr)-Ci/2-(B?G:0),Nt=(B?Sr:Qe)-(B?fe:$+Ba-ti);L.select("."+y.cbbg).attr("x",Jt).attr("y",Nt).attr(B?"width":"height",Math.max(za-ti,2)).attr(B?"height":"width",Math.max(fe+Ci,2)).call(s.fill,ue).call(s.stroke,z.bordercolor).style("stroke-width",Q);var Kt=Ua?Math.max(Tr-10,0):0;L.selectAll("."+y.cboutline).attr("x",(B?Qe:Sr+G)+Kt).attr("y",(B?Sr+$-fe:Qe)+(la?Te:0)).attr(B?"width":"height",Math.max(Ee,2)).attr(B?"height":"width",Math.max(fe-(B?2*$+Te:2*G+Kt),2)).call(s.stroke,z.outlinecolor).style({fill:"none","stroke-width":W});var Wt=B?Lt*za:0,Pr=B?0:(1-kt)*za-Ba;if(Wt=ie?ee.l-Wt:-Wt,Pr=oe?ee.t-Pr:-Pr,L.attr("transform",o(Wt,Pr)),!B&&(Q||x(ue).getAlpha()&&!x.equals(j.paper_bgcolor,ue))){var ta=qe.selectAll("text"),ma=ta[0].length,ra=L.select("."+y.cbbg).node(),Ia=n.bBox(ra),Ha=n.getTranslate(L),$a=2;ta.each(function(Kr,Ur){var aa=0,da=ma-1;if(Ur===aa||Ur===da){var fa=n.bBox(this),It=n.getTranslate(this),dr;if(Ur===da){var kr=fa.right+It.x,ia=Ia.right+Ha.x+Sr-Q-$a+J;dr=ia-kr,dr>0&&(dr=0)}else if(Ur===aa){var Ca=fa.left+It.x,Fa=Ia.left+Ha.x+Sr+Q+$a;dr=Fa-Ca,dr<0&&(dr=0)}dr&&(ma<3?this.setAttribute("transform","translate("+dr+",0) "+this.getAttribute("transform")):this.setAttribute("visibility","hidden"))}})}var ai={},mi=S[le],xt=E[le],ct=S[he],Nr=E[he],Or=za-Ee;B?(I==="pixels"?(ai.y=X,ai.t=fe*ct,ai.b=fe*Nr):(ai.t=ai.b=0,ai.yt=X+O*ct,ai.yb=X-O*Nr),U==="pixels"?(ai.x=J,ai.l=za*mi,ai.r=za*xt):(ai.l=Or*mi,ai.r=Or*xt,ai.xl=J-N*mi,ai.xr=J+N*xt)):(I==="pixels"?(ai.x=J,ai.l=fe*mi,ai.r=fe*xt):(ai.l=ai.r=0,ai.xl=J+O*mi,ai.xr=J-O*xt),U==="pixels"?(ai.y=1-X,ai.t=za*ct,ai.b=za*Nr):(ai.t=Or*ct,ai.b=Or*Nr,ai.yt=X-N*ct,ai.yb=X+N*Nr));var Rr=z.y<.5?"b":"t",Lr=z.x<.5?"l":"r";F._fullLayout._reservedMargin[z._id]={};var Gr={r:j.width-Jt-Wt,l:Jt+ai.r,b:j.height-Nt-Pr,t:Nt+ai.b};ie&&oe?A.autoMargin(F,z._id,ai):ie?F._fullLayout._reservedMargin[z._id][Rr]=Gr[Rr]:oe||B?F._fullLayout._reservedMargin[z._id][Lr]=Gr[Lr]:F._fullLayout._reservedMargin[z._id][Rr]=Gr[Rr]}return r.syncOrAsync([A.previousPromises,yt,Ot,Tt,A.previousPromises,Gt],F)}function m(L,z,F){var B=z.orientation==="v",O=F._fullLayout,I=O._size,N,U,W;t.init({element:L.node(),gd:F,prepFn:function(){N=L.attr("transform"),i(L)},moveFn:function(Q,ue){L.attr("transform",N+o(Q,ue)),U=t.align((B?z._uFrac:z._vFrac)+Q/I.w,B?z._thickFrac:z._lenFrac,0,1,z.xanchor),W=t.align((B?z._vFrac:1-z._uFrac)-ue/I.h,B?z._lenFrac:z._thickFrac,0,1,z.yanchor);var le=t.getCursor(U,W,z.xanchor,z.yanchor);i(L,le)},doneFn:function(){if(i(L),U!==void 0&&W!==void 0){var Q={};Q[z._propPrefix+"x"]=U,Q[z._propPrefix+"y"]=W,z._traceIndex!==void 0?M.call("_guiRestyle",F,Q,z._traceIndex):M.call("_guiRelayout",F,Q)}}})}function h(L,z,F){var B=z._levels,O=[],I=[],N,U,W=B.end+B.size/100,Q=B.size,ue=1.001*F[0]-.001*F[1],le=1.001*F[1]-.001*F[0];for(U=0;U<1e5&&(N=B.start+U*Q,!(Q>0?N>=W:N<=W));U++)N>ue&&N0?N>=W:N<=W));U++)N>F[0]&&N-1}q.exports=function(o,a){var i,n=o.data,s=o.layout,c=M([],n),f=M({},s,e(a.tileClass)),g=o._context||{};if(a.width&&(f.width=a.width),a.height&&(f.height=a.height),a.tileClass==="thumbnail"||a.tileClass==="themes__thumb"){f.annotations=[];var v=Object.keys(f);for(i=0;i=0)return g}else if(typeof g=="string"&&(g=g.trim(),g.slice(-1)==="%"&&d(g.slice(0,-1))&&(g=+g.slice(0,-1),g>=0)))return g+"%"}function f(g,v,T,l,_,w){w=w||{};var S=w.moduleHasSelected!==!1,E=w.moduleHasUnselected!==!1,y=w.moduleHasConstrain!==!1,b=w.moduleHasCliponaxis!==!1,p=w.moduleHasTextangle!==!1,u=w.moduleHasInsideanchor!==!1,m=!!w.hasPathbar,h=Array.isArray(_)||_==="auto",P=h||_==="inside",L=h||_==="outside";if(P||L){var z=i(l,"textfont",T.font),F=x.extendFlat({},z),B=g.textfont&&g.textfont.color,O=!B;if(O&&delete F.color,i(l,"insidetextfont",F),m){var I=x.extendFlat({},z);O&&delete I.color,i(l,"pathbar.textfont",I)}L&&i(l,"outsidetextfont",z),S&&l("selected.textfont.color"),E&&l("unselected.textfont.color"),y&&l("constraintext"),b&&l("cliponaxis"),p&&l("textangle"),l("texttemplate")}P&&u&&l("insidetextanchor")}q.exports={supplyDefaults:n,crossTraceDefaults:s,handleText:f,validateCornerradius:c}}}),K5=Ze({"src/traces/bar/layout_defaults.js"(Z,q){"use strict";var d=oo(),x=Wo(),A=ca(),M=U2(),e=gd().validateCornerradius;q.exports=function(t,r,o){function a(S,E){return A.coerce(t,r,M,S,E)}for(var i=!1,n=!1,s=!1,c={},f=a("barmode"),g=f==="group",v=0;v0&&!c[l]&&(s=!0),c[l]=!0),T.visible&&T.type==="histogram"){var _=x.getFromId({_fullLayout:r},T[T.orientation==="v"?"xaxis":"yaxis"]);_.type!=="category"&&(n=!0)}}if(!i){delete r.barmode;return}f!=="overlay"&&a("barnorm"),a("bargap",n&&!s?0:.2),a("bargroupgap");var w=a("barcornerradius");r.barcornerradius=e(w)}}}),O_=Ze({"src/traces/bar/arrays_to_calcdata.js"(Z,q){"use strict";var d=ca();q.exports=function(A,M){for(var e=0;er;if(!o)return M}return e!==void 0?e:A.dflt},Z.coerceColor=function(A,M,e){return d(M).isValid()?M:e!==void 0?e:A.dflt},Z.coerceEnumerated=function(A,M,e){return A.coerceNumber&&(M=+M),A.values.indexOf(M)!==-1?M:e!==void 0?e:A.dflt},Z.getValue=function(A,M){var e;return x(A)?M1||m.bargap===0&&m.bargroupgap===0&&!h[0].trace.marker.line.width)&&d.select(this).attr("shape-rendering","crispEdges")}),p.selectAll("g.points").each(function(h){var P=d.select(this),L=h[0].trace;c(P,L,b)}),e.getComponentMethod("errorbars","style")(p)}function c(b,p,u){A.pointStyle(b.selectAll("path"),p,u),f(b,p,u)}function f(b,p,u){b.selectAll("text").each(function(m){var h=d.select(this),P=M.ensureUniformFontSize(u,l(h,m,p,u));A.font(h,P)})}function g(b,p,u){var m=p[0].trace;m.selectedpoints?v(u,m,b):(c(u,m,b),e.getComponentMethod("errorbars","style")(u))}function v(b,p,u){A.selectedPointStyle(b.selectAll("path"),p),T(b.selectAll("text"),p,u)}function T(b,p,u){b.each(function(m){var h=d.select(this),P;if(m.selected){P=M.ensureUniformFontSize(u,l(h,m,p,u));var L=p.selected.textfont&&p.selected.textfont.color;L&&(P.color=L),A.font(h,P)}else A.selectedTextStyle(h,p)})}function l(b,p,u,m){var h=m._fullLayout.font,P=u.textfont;if(b.classed("bartext-inside")){var L=y(p,u);P=w(u,p.i,h,L)}else b.classed("bartext-outside")&&(P=S(u,p.i,h));return P}function _(b,p,u){return E(o,b.textfont,p,u)}function w(b,p,u,m){var h=_(b,p,u),P=b._input.textfont===void 0||b._input.textfont.color===void 0||Array.isArray(b.textfont.color)&&b.textfont.color[p]===void 0;return P&&(h={color:x.contrast(m),family:h.family,size:h.size,weight:h.weight,style:h.style,variant:h.variant,textcase:h.textcase,lineposition:h.lineposition,shadow:h.shadow}),E(a,b.insidetextfont,p,h)}function S(b,p,u){var m=_(b,p,u);return E(i,b.outsidetextfont,p,m)}function E(b,p,u,m){p=p||{};var h=n.getValue(p.family,u),P=n.getValue(p.size,u),L=n.getValue(p.color,u),z=n.getValue(p.weight,u),F=n.getValue(p.style,u),B=n.getValue(p.variant,u),O=n.getValue(p.textcase,u),I=n.getValue(p.lineposition,u),N=n.getValue(p.shadow,u);return{family:n.coerceString(b.family,h,m.family),size:n.coerceNumber(b.size,P,m.size),color:n.coerceColor(b.color,L,m.color),weight:n.coerceString(b.weight,z,m.weight),style:n.coerceString(b.style,F,m.style),variant:n.coerceString(b.variant,B,m.variant),textcase:n.coerceString(b.variant,O,m.textcase),lineposition:n.coerceString(b.variant,I,m.lineposition),shadow:n.coerceString(b.variant,N,m.shadow)}}function y(b,p){return p.type==="waterfall"?p[b.dir].marker.color:b.mcc||b.mc||p.marker.color}q.exports={style:s,styleTextPoints:f,styleOnSelect:g,getInsideTextFont:w,getOutsideTextFont:S,getBarColor:y,resizeText:t}}}),eg=Ze({"src/traces/bar/plot.js"(Z,q){"use strict";var d=On(),x=ns(),A=ca(),M=fu(),e=Yn(),t=as(),r=oo(),o=Wo().tickText,a=Ap(),i=a.recordMinTextSize,n=a.clearMinTextSize,s=Nd(),c=q2(),f=Q0(),g=Sv(),v=g.text,T=g.textposition,l=Qp().appendArrayPointValue,_=f.TEXTPAD;function w(Q){return Q.id}function S(Q){if(Q.ids)return w}function E(Q){return(Q>0)-(Q<0)}function y(Q,ue){return Q0}function m(Q,ue,le,he,G,$){var J=ue.xaxis,X=ue.yaxis,oe=Q._fullLayout,ie=Q._context.staticPlot;G||(G={mode:oe.barmode,norm:oe.barmode,gap:oe.bargap,groupgap:oe.bargroupgap},n("bar",oe));var j=A.makeTraceGroups(he,le,"trace bars").each(function(ee){var re=d.select(this),ce=ee[0].trace,be=ee[0].t,Ae=ce.type==="waterfall",ze=ce.type==="funnel",Re=ce.type==="histogram",Xe=ce.type==="bar",it=Xe||ze,ot=0;Ae&&ce.connector.visible&&ce.connector.mode==="between"&&(ot=ce.connector.line.width/2);var tt=ce.orientation==="h",lt=u(G),Ee=A.ensureSingle(re,"g","points"),_e=S(ce),fe=Ee.selectAll("g.point").data(A.identity,_e);fe.enter().append("g").classed("point",!0),fe.exit().remove(),fe.each(function(rt,st){var Qe=d.select(this),Lt=b(rt,J,X,tt),kt=Lt[0][0],Vt=Lt[0][1],Zt=Lt[1][0],Sr=Lt[1][1],xr=(tt?Vt-kt:Sr-Zt)===0;xr&&it&&c.getLineWidth(ce,rt)&&(xr=!1),xr||(xr=!x(kt)||!x(Vt)||!x(Zt)||!x(Sr)),rt.isBlank=xr,xr&&(tt?Vt=kt:Sr=Zt),ot&&!xr&&(tt?(kt-=y(kt,Vt)*ot,Vt+=y(kt,Vt)*ot):(Zt-=y(Zt,Sr)*ot,Sr+=y(Zt,Sr)*ot));var jr,wr;if(ce.type==="waterfall"){if(!xr){var Ir=ce[rt.dir].marker;jr=Ir.line.width,wr=Ir.color}}else jr=c.getLineWidth(ce,rt),wr=rt.mc||ce.marker.color;function bt(Ci){var Jt=d.round(jr/2%1,2);return G.gap===0&&G.groupgap===0?d.round(Math.round(Ci)-Jt,2):Ci}function Be(Ci,Jt,Nt){return Nt&&Ci===Jt?Ci:Math.abs(Ci-Jt)>=2?bt(Ci):Ci>Jt?Math.ceil(Ci):Math.floor(Ci)}var Ke=e.opacity(wr),Ue=Ke<1||jr>.01?bt:Be;Q._context.staticPlot||(kt=Ue(kt,Vt,tt),Vt=Ue(Vt,kt,tt),Zt=Ue(Zt,Sr,!tt),Sr=Ue(Sr,Zt,!tt));var Me=tt?J.c2p:X.c2p,qe;rt.s0>0?qe=rt._sMax:rt.s0<0?qe=rt._sMin:qe=rt.s1>0?rt._sMax:rt._sMin;function Ce(Ci,Jt){if(!Ci)return 0;var Nt=Math.abs(tt?Sr-Zt:Vt-kt),Kt=Math.abs(tt?Vt-kt:Sr-Zt),Wt=Ue(Math.abs(Me(qe,!0)-Me(0,!0))),Pr=rt.hasB?Math.min(Nt/2,Kt/2):Math.min(Nt/2,Wt),ta;if(Jt==="%"){var ma=Math.min(50,Ci);ta=Nt*(ma/100)}else ta=Ci;return Ue(Math.max(Math.min(ta,Pr),0))}var Te=Xe||Re?Ce(be.cornerradiusvalue,be.cornerradiusform):0,Pe,at,yt="M"+kt+","+Zt+"V"+Sr+"H"+Vt+"V"+Zt+"Z",Tt=0;if(Te&&rt.s){var Ot=E(rt.s0)===0||E(rt.s)===E(rt.s0)?rt.s1:rt.s0;if(Tt=Ue(rt.hasB?0:Math.abs(Me(qe,!0)-Me(Ot,!0))),Tt0?Math.sqrt(Tt*(2*Te-Tt)):0,Ua=Gt>0?Math.max:Math.min;Pe="M"+kt+","+Zt+"V"+(Sr-Tr*rr)+"H"+Ua(Vt-(Te-Tt)*Gt,kt)+"A "+Te+","+Te+" 0 0 "+Qt+" "+Vt+","+(Sr-Te*rr-la)+"V"+(Zt+Te*rr+la)+"A "+Te+","+Te+" 0 0 "+Qt+" "+Ua(Vt-(Te-Tt)*Gt,kt)+","+(Zt+Tr*rr)+"Z"}else if(rt.hasB)Pe="M"+(kt+Te*Gt)+","+Zt+"A "+Te+","+Te+" 0 0 "+Qt+" "+kt+","+(Zt+Te*rr)+"V"+(Sr-Te*rr)+"A "+Te+","+Te+" 0 0 "+Qt+" "+(kt+Te*Gt)+","+Sr+"H"+(Vt-Te*Gt)+"A "+Te+","+Te+" 0 0 "+Qt+" "+Vt+","+(Sr-Te*rr)+"V"+(Zt+Te*rr)+"A "+Te+","+Te+" 0 0 "+Qt+" "+(Vt-Te*Gt)+","+Zt+"Z";else{at=Math.abs(Sr-Zt)+Tt;var Ba=at0?Math.sqrt(Tt*(2*Te-Tt)):0,ei=rr>0?Math.max:Math.min;Pe="M"+(kt+Ba*Gt)+","+Zt+"V"+ei(Sr-(Te-Tt)*rr,Zt)+"A "+Te+","+Te+" 0 0 "+Qt+" "+(kt+Te*Gt-Ra)+","+Sr+"H"+(Vt-Te*Gt+Ra)+"A "+Te+","+Te+" 0 0 "+Qt+" "+(Vt-Ba*Gt)+","+ei(Sr-(Te-Tt)*rr,Zt)+"V"+Zt+"Z"}}else Pe=yt}else Pe=yt;var za=p(A.ensureSingle(Qe,"path"),oe,G,$);if(za.style("vector-effect",ie?"none":"non-scaling-stroke").attr("d",isNaN((Vt-kt)*(Sr-Zt))||xr&&Q._context.staticPlot?"M0,0Z":Pe).call(t.setClipUrl,ue.layerClipId,Q),!oe.uniformtext.mode&<){var ti=t.makePointStyleFns(ce);t.singlePointStyle(rt,za,ce,ti,Q)}h(Q,ue,Qe,ee,st,kt,Vt,Zt,Sr,Te,Tt,G,$),ue.layerClipId&&t.hideOutsideRangePoint(rt,Qe.select("text"),J,X,ce.xcalendar,ce.ycalendar)});var Fe=ce.cliponaxis===!1;t.setClipUrl(re,Fe?null:ue.layerClipId,Q)});r.getComponentMethod("errorbars","plot")(Q,j,ue,G)}function h(Q,ue,le,he,G,$,J,X,oe,ie,j,ee,re){var ce=ue.xaxis,be=ue.yaxis,Ae=Q._fullLayout,ze;function Re(at,yt,Tt){var Ot=A.ensureSingle(at,"text").text(yt).attr({class:"bartext bartext-"+ze,"text-anchor":"middle","data-notex":1}).call(t.font,Tt).call(M.convertToTspans,Q);return Ot}var Xe=he[0].trace,it=Xe.orientation==="h",ot=I(Ae,he,G,ce,be);ze=N(Xe,G);var tt=ee.mode==="stack"||ee.mode==="relative",lt=he[G],Ee=!tt||lt._outmost,_e=lt.hasB,fe=ie&&ie-j>_;if(!ot||ze==="none"||(lt.isBlank||$===J||X===oe)&&(ze==="auto"||ze==="inside")){le.select("text").remove();return}var Fe=Ae.font,rt=s.getBarColor(he[G],Xe),st=s.getInsideTextFont(Xe,G,Fe,rt),Qe=s.getOutsideTextFont(Xe,G,Fe),Lt=Xe.insidetextanchor||"end",kt=le.datum();it?ce.type==="log"&&kt.s0<=0&&(ce.range[0]0&&bt>0,Ue;fe?_e?Ue=P(Sr-2*ie,xr,Ir,bt,it)||P(Sr,xr-2*ie,Ir,bt,it):it?Ue=P(Sr-(ie-j),xr,Ir,bt,it)||P(Sr,xr-2*(ie-j),Ir,bt,it):Ue=P(Sr,xr-(ie-j),Ir,bt,it)||P(Sr-2*(ie-j),xr,Ir,bt,it):Ue=P(Sr,xr,Ir,bt,it),Ke&&Ue?ze="inside":(ze="outside",jr.remove(),jr=null)}else ze="inside";if(!jr){Be=A.ensureUniformFontSize(Q,ze==="outside"?Qe:st),jr=Re(le,ot,Be);var Me=jr.attr("transform");if(jr.attr("transform",""),wr=t.bBox(jr.node()),Ir=wr.width,bt=wr.height,jr.attr("transform",Me),Ir<=0||bt<=0){jr.remove();return}}var qe=Xe.textangle,Ce,Te;ze==="outside"?(Te=Xe.constraintext==="both"||Xe.constraintext==="outside",Ce=O($,J,X,oe,wr,{isHorizontal:it,constrained:Te,angle:qe})):(Te=Xe.constraintext==="both"||Xe.constraintext==="inside",Ce=F($,J,X,oe,wr,{isHorizontal:it,constrained:Te,angle:qe,anchor:Lt,hasB:_e,r:ie,overhead:j})),Ce.fontSize=Be.size,i(Xe.type==="histogram"?"bar":Xe.type,Ce,Ae),lt.transform=Ce;var Pe=p(jr,Ae,ee,re);A.setTransormAndDisplay(Pe,Ce)}function P(Q,ue,le,he,G){if(Q<0||ue<0)return!1;var $=le<=Q&&he<=ue,J=le<=ue&&he<=Q,X=G?Q>=le*(ue/he):ue>=he*(Q/le);return $||J||X}function L(Q){return Q==="auto"?0:Q}function z(Q,ue){var le=Math.PI/180*ue,he=Math.abs(Math.sin(le)),G=Math.abs(Math.cos(le));return{x:Q.width*G+Q.height*he,y:Q.width*he+Q.height*G}}function F(Q,ue,le,he,G,$){var J=!!$.isHorizontal,X=!!$.constrained,oe=$.angle||0,ie=$.anchor,j=ie==="end",ee=ie==="start",re=$.leftToRight||0,ce=(re+1)/2,be=1-ce,Ae=$.hasB,ze=$.r,Re=$.overhead,Xe=G.width,it=G.height,ot=Math.abs(ue-Q),tt=Math.abs(he-le),lt=ot>2*_&&tt>2*_?_:0;ot-=2*lt,tt-=2*lt;var Ee=L(oe);oe==="auto"&&!(Xe<=ot&&it<=tt)&&(Xe>ot||it>tt)&&(!(Xe>tt||it>ot)||Xe_){var rt=B(Q,ue,le,he,_e,ze,Re,J,Ae);fe=rt.scale,Fe=rt.pad}else fe=1,X&&(fe=Math.min(1,ot/_e.x,tt/_e.y)),Fe=0;var st=G.left*be+G.right*ce,Qe=(G.top+G.bottom)/2,Lt=(Q+_)*be+(ue-_)*ce,kt=(le+he)/2,Vt=0,Zt=0;if(ee||j){var Sr=(J?_e.x:_e.y)/2;ze&&(j||Ae)&&(lt+=Fe);var xr=J?y(Q,ue):y(le,he);J?ee?(Lt=Q+xr*lt,Vt=-xr*Sr):(Lt=ue-xr*lt,Vt=xr*Sr):ee?(kt=le+xr*lt,Zt=-xr*Sr):(kt=he-xr*lt,Zt=xr*Sr)}return{textX:st,textY:Qe,targetX:Lt,targetY:kt,anchorX:Vt,anchorY:Zt,scale:fe,rotate:Ee}}function B(Q,ue,le,he,G,$,J,X,oe){var ie=Math.max(0,Math.abs(ue-Q)-2*_),j=Math.max(0,Math.abs(he-le)-2*_),ee=$-_,re=J?ee-Math.sqrt(ee*ee-(ee-J)*(ee-J)):ee,ce=oe?ee*2:X?ee-J:2*re,be=oe?ee*2:X?2*re:ee-J,Ae,ze,Re,Xe,it;return G.y/G.x>=j/(ie-ce)?Xe=j/G.y:G.y/G.x<=(j-be)/ie?Xe=ie/G.x:!oe&&X?(Ae=G.x*G.x+G.y*G.y/4,ze=-2*G.x*(ie-ee)-G.y*(j/2-ee),Re=(ie-ee)*(ie-ee)+(j/2-ee)*(j/2-ee)-ee*ee,Xe=(-ze+Math.sqrt(ze*ze-4*Ae*Re))/(2*Ae)):oe?(Ae=(G.x*G.x+G.y*G.y)/4,ze=-G.x*(ie/2-ee)-G.y*(j/2-ee),Re=(ie/2-ee)*(ie/2-ee)+(j/2-ee)*(j/2-ee)-ee*ee,Xe=(-ze+Math.sqrt(ze*ze-4*Ae*Re))/(2*Ae)):(Ae=G.x*G.x/4+G.y*G.y,ze=-G.x*(ie/2-ee)-2*G.y*(j-ee),Re=(ie/2-ee)*(ie/2-ee)+(j-ee)*(j-ee)-ee*ee,Xe=(-ze+Math.sqrt(ze*ze-4*Ae*Re))/(2*Ae)),Xe=Math.min(1,Xe),X?it=Math.max(0,ee-Math.sqrt(Math.max(0,ee*ee-(ee-(j-G.y*Xe)/2)*(ee-(j-G.y*Xe)/2)))-J):it=Math.max(0,ee-Math.sqrt(Math.max(0,ee*ee-(ee-(ie-G.x*Xe)/2)*(ee-(ie-G.x*Xe)/2)))-J),{scale:Xe,pad:it}}function O(Q,ue,le,he,G,$){var J=!!$.isHorizontal,X=!!$.constrained,oe=$.angle||0,ie=G.width,j=G.height,ee=Math.abs(ue-Q),re=Math.abs(he-le),ce;J?ce=re>2*_?_:0:ce=ee>2*_?_:0;var be=1;X&&(be=J?Math.min(1,re/j):Math.min(1,ee/ie));var Ae=L(oe),ze=z(G,Ae),Re=(J?ze.x:ze.y)/2,Xe=(G.left+G.right)/2,it=(G.top+G.bottom)/2,ot=(Q+ue)/2,tt=(le+he)/2,lt=0,Ee=0,_e=J?y(ue,Q):y(le,he);return J?(ot=ue-_e*ce,lt=_e*Re):(tt=he+_e*ce,Ee=-_e*Re),{textX:Xe,textY:it,targetX:ot,targetY:tt,anchorX:lt,anchorY:Ee,scale:be,rotate:Ae}}function I(Q,ue,le,he,G){var $=ue[0].trace,J=$.texttemplate,X;return J?X=U(Q,ue,le,he,G):$.textinfo?X=W(ue,le,he,G):X=c.getValue($.text,le),c.coerceString(v,X)}function N(Q,ue){var le=c.getValue(Q.textposition,ue);return c.coerceEnumerated(T,le)}function U(Q,ue,le,he,G){var $=ue[0].trace,J=A.castOption($,le,"texttemplate");if(!J)return"";var X=$.type==="histogram",oe=$.type==="waterfall",ie=$.type==="funnel",j=$.orientation==="h",ee,re,ce,be;j?(ee="y",re=G,ce="x",be=he):(ee="x",re=he,ce="y",be=G);function Ae(lt){return o(re,re.c2l(lt),!0).text}function ze(lt){return o(be,be.c2l(lt),!0).text}var Re=ue[le],Xe={};Xe.label=Re.p,Xe.labelLabel=Xe[ee+"Label"]=Ae(Re.p);var it=A.castOption($,Re.i,"text");(it===0||it)&&(Xe.text=it),Xe.value=Re.s,Xe.valueLabel=Xe[ce+"Label"]=ze(Re.s);var ot={};l(ot,$,Re.i),(X||ot.x===void 0)&&(ot.x=j?Xe.value:Xe.label),(X||ot.y===void 0)&&(ot.y=j?Xe.label:Xe.value),(X||ot.xLabel===void 0)&&(ot.xLabel=j?Xe.valueLabel:Xe.labelLabel),(X||ot.yLabel===void 0)&&(ot.yLabel=j?Xe.labelLabel:Xe.valueLabel),oe&&(Xe.delta=+Re.rawS||Re.s,Xe.deltaLabel=ze(Xe.delta),Xe.final=Re.v,Xe.finalLabel=ze(Xe.final),Xe.initial=Xe.final-Xe.delta,Xe.initialLabel=ze(Xe.initial)),ie&&(Xe.value=Re.s,Xe.valueLabel=ze(Xe.value),Xe.percentInitial=Re.begR,Xe.percentInitialLabel=A.formatPercent(Re.begR),Xe.percentPrevious=Re.difR,Xe.percentPreviousLabel=A.formatPercent(Re.difR),Xe.percentTotal=Re.sumR,Xe.percenTotalLabel=A.formatPercent(Re.sumR));var tt=A.castOption($,Re.i,"customdata");return tt&&(Xe.customdata=tt),A.texttemplateString(J,Xe,Q._d3locale,ot,Xe,$._meta||{})}function W(Q,ue,le,he){var G=Q[0].trace,$=G.orientation==="h",J=G.type==="waterfall",X=G.type==="funnel";function oe(tt){var lt=$?he:le;return o(lt,tt,!0).text}function ie(tt){var lt=$?le:he;return o(lt,+tt,!0).text}var j=G.textinfo,ee=Q[ue],re=j.split("+"),ce=[],be,Ae=function(tt){return re.indexOf(tt)!==-1};if(Ae("label")&&ce.push(oe(Q[ue].p)),Ae("text")&&(be=A.castOption(G,ee.i,"text"),(be===0||be)&&ce.push(be)),J){var ze=+ee.rawS||ee.s,Re=ee.v,Xe=Re-ze;Ae("initial")&&ce.push(ie(Xe)),Ae("delta")&&ce.push(ie(ze)),Ae("final")&&ce.push(ie(Re))}if(X){Ae("value")&&ce.push(ie(ee.s));var it=0;Ae("percent initial")&&it++,Ae("percent previous")&&it++,Ae("percent total")&&it++;var ot=it>1;Ae("percent initial")&&(be=A.formatPercent(ee.begR),ot&&(be+=" of initial"),ce.push(be)),Ae("percent previous")&&(be=A.formatPercent(ee.difR),ot&&(be+=" of previous"),ce.push(be)),Ae("percent total")&&(be=A.formatPercent(ee.sumR),ot&&(be+=" of total"),ce.push(be))}return ce.join("
")}q.exports={plot:m,toMoveInsideBar:F}}}),f1=Ze({"src/traces/bar/hover.js"(Z,q){"use strict";var d=ef(),x=oo(),A=Yn(),M=ca().fillText,e=q2().getLineWidth,t=Wo().hoverLabelText,r=qs().BADNUM;function o(n,s,c,f,g){var v=a(n,s,c,f,g);if(v){var T=v.cd,l=T[0].trace,_=T[v.index];return v.color=i(l,_),x.getComponentMethod("errorbars","hoverInfo")(_,l,v),[v]}}function a(n,s,c,f,g){var v=n.cd,T=v[0].trace,l=v[0].t,_=f==="closest",w=T.type==="waterfall",S=n.maxHoverDistance,E=n.maxSpikeDistance,y,b,p,u,m,h,P;T.orientation==="h"?(y=c,b=s,p="y",u="x",m=he,h=Q):(y=s,b=c,p="x",u="y",h=he,m=Q);var L=T[p+"period"],z=_||L;function F(be){return O(be,-1)}function B(be){return O(be,1)}function O(be,Ae){var ze=be.w;return be[p]+Ae*ze/2}function I(be){return be[p+"End"]-be[p+"Start"]}var N=_?F:L?function(be){return be.p-I(be)/2}:function(be){return Math.min(F(be),be.p-l.bardelta/2)},U=_?B:L?function(be){return be.p+I(be)/2}:function(be){return Math.max(B(be),be.p+l.bardelta/2)};function W(be,Ae,ze){return g.finiteRange&&(ze=0),d.inbox(be-y,Ae-y,ze+Math.min(1,Math.abs(Ae-be)/P)-1)}function Q(be){return W(N(be),U(be),S)}function ue(be){return W(F(be),B(be),E)}function le(be){var Ae=be[u];if(w){var ze=Math.abs(be.rawS)||0;b>0?Ae+=ze:b<0&&(Ae-=ze)}return Ae}function he(be){var Ae=b,ze=be.b,Re=le(be);return d.inbox(ze-Ae,Re-Ae,S+(Re-Ae)/(Re-ze)-1)}function G(be){var Ae=b,ze=be.b,Re=le(be);return d.inbox(ze-Ae,Re-Ae,E+(Re-Ae)/(Re-ze)-1)}var $=n[p+"a"],J=n[u+"a"];P=Math.abs($.r2c($.range[1])-$.r2c($.range[0]));function X(be){return(m(be)+h(be))/2}var oe=d.getDistanceFunction(f,m,h,X);if(d.getClosest(v,oe,n),n.index!==!1&&v[n.index].p!==r){z||(N=function(be){return Math.min(F(be),be.p-l.bargroupwidth/2)},U=function(be){return Math.max(B(be),be.p+l.bargroupwidth/2)});var ie=n.index,j=v[ie],ee=T.base?j.b+j.s:j.s;n[u+"0"]=n[u+"1"]=J.c2p(j[u],!0),n[u+"LabelVal"]=ee;var re=l.extents[l.extents.round(j.p)];n[p+"0"]=$.c2p(_?N(j):re[0],!0),n[p+"1"]=$.c2p(_?U(j):re[1],!0);var ce=j.orig_p!==void 0;return n[p+"LabelVal"]=ce?j.orig_p:j.p,n.labelLabel=t($,n[p+"LabelVal"],T[p+"hoverformat"]),n.valueLabel=t(J,n[u+"LabelVal"],T[u+"hoverformat"]),n.baseLabel=t(J,j.b,T[u+"hoverformat"]),n.spikeDistance=(G(j)+ue(j))/2,n[p+"Spike"]=$.c2p(j.p,!0),M(j,T,n),n.hovertemplate=T.hovertemplate,n}}function i(n,s){var c=s.mcc||n.marker.color,f=s.mlcc||n.marker.line.color,g=e(n,s);if(A.opacity(c))return c;if(A.opacity(f)&&g)return f}q.exports={hoverPoints:o,hoverOnBars:a,getTraceColor:i}}}),Z9=Ze({"src/traces/bar/event_data.js"(Z,q){"use strict";q.exports=function(x,A,M){return x.x="xVal"in A?A.xVal:A.x,x.y="yVal"in A?A.yVal:A.y,A.xa&&(x.xaxis=A.xa),A.ya&&(x.yaxis=A.ya),M.orientation==="h"?(x.label=x.y,x.value=x.x):(x.label=x.x,x.value=x.y),x}}}),h1=Ze({"src/traces/bar/select.js"(Z,q){"use strict";q.exports=function(A,M){var e=A.cd,t=A.xaxis,r=A.yaxis,o=e[0].trace,a=o.type==="funnel",i=o.orientation==="h",n=[],s;if(M===!1)for(s=0;s0?(L="v",p>0?z=Math.min(m,u):z=Math.min(u)):p>0?(L="h",z=Math.min(m)):z=0;if(!z){c.visible=!1;return}c._length=z;var N=f("orientation",L);c._hasPreCompStats?N==="v"&&p===0?(f("x0",0),f("dx",1)):N==="h"&&b===0&&(f("y0",0),f("dy",1)):N==="v"&&p===0?f("x0"):N==="h"&&b===0&&f("y0");var U=x.getComponentMethod("calendars","handleTraceDefaults");U(s,c,["x","y"],g)}function i(s,c,f,g){var v=g.prefix,T=d.coerce2(s,c,r,"marker.outliercolor"),l=f("marker.line.outliercolor"),_="outliers";c._hasPreCompStats?_="all":(T||l)&&(_="suspectedoutliers");var w=f(v+"points",_);w?(f("jitter",w==="all"?.3:0),f("pointpos",w==="all"?-1.5:0),f("marker.symbol"),f("marker.opacity"),f("marker.size"),f("marker.angle"),f("marker.color",c.line.color),f("marker.line.color"),f("marker.line.width"),w==="suspectedoutliers"&&(f("marker.line.outliercolor",c.marker.color),f("marker.line.outlierwidth")),f("selected.marker.color"),f("unselected.marker.color"),f("selected.marker.size"),f("unselected.marker.size"),f("text"),f("hovertext")):delete c.marker;var S=f("hoveron");(S==="all"||S.indexOf("points")!==-1)&&f("hovertemplate"),d.coerceSelectionMarkerOpacity(c,f)}function n(s,c){var f,g;function v(w){return d.coerce(g._input,g,r,w)}for(var T=0;Tle.uf};if(E._hasPreCompStats){var ie=E[z],j=function(xr){return L.d2c((E[xr]||[])[h])},ee=1/0,re=-1/0;for(h=0;h=le.q1&&le.q3>=le.med){var be=j("lowerfence");le.lf=be!==e&&be<=le.q1?be:g(le,G,$);var Ae=j("upperfence");le.uf=Ae!==e&&Ae>=le.q3?Ae:v(le,G,$);var ze=j("mean");le.mean=ze!==e?ze:$?M.mean(G,$):(le.q1+le.q3)/2;var Re=j("sd");le.sd=ze!==e&&Re>=0?Re:$?M.stdev(G,$,le.mean):le.q3-le.q1,le.lo=T(le),le.uo=l(le);var Xe=j("notchspan");Xe=Xe!==e&&Xe>0?Xe:_(le,$),le.ln=le.med-Xe,le.un=le.med+Xe;var it=le.lf,ot=le.uf;E.boxpoints&&G.length&&(it=Math.min(it,G[0]),ot=Math.max(ot,G[$-1])),E.notched&&(it=Math.min(it,le.ln),ot=Math.max(ot,le.un)),le.min=it,le.max=ot}else{M.warn(["Invalid input - make sure that q1 <= median <= q3","q1 = "+le.q1,"median = "+le.med,"q3 = "+le.q3].join(` `));var tt;le.med!==e?tt=le.med:le.q1!==e?le.q3!==e?tt=(le.q1+le.q3)/2:tt=le.q1:le.q3!==e?tt=le.q3:tt=0,le.med=tt,le.q1=le.q3=tt,le.lf=le.uf=tt,le.mean=le.sd=tt,le.ln=le.un=tt,le.min=le.max=tt}ee=Math.min(ee,le.min),re=Math.max(re,le.max),le.pts2=he.filter(oe),u.push(le)}}E._extremes[L._id]=x.findExtremes(L,[ee,re],{padded:!0})}else{var lt=L.makeCalcdata(E,z),Ee=o(Q,ue),_e=Q.length,fe=a(_e);for(h=0;h=0&&Fe<_e&&(J={v:X,i:h},n(J,E,h),fe[Fe].push(J))}var rt=1/0,st=-1/0,Qe=E.quartilemethod,Lt=Qe==="exclusive",kt=Qe==="inclusive";for(h=0;h<_e;h++)if(fe[h].length>0){if(le={},le.pos=le[B]=Q[h],he=le.pts=fe[h].sort(c),G=le[z]=he.map(f),$=G.length,le.min=G[0],le.max=G[$-1],le.mean=M.mean(G,$),le.sd=M.stdev(G,$,le.mean)*E.sdmultiple,le.med=M.interp(G,.5),$%2&&(Lt||kt)){var Vt,Zt;Lt?(Vt=G.slice(0,$/2),Zt=G.slice($/2+1)):kt&&(Vt=G.slice(0,$/2+1),Zt=G.slice($/2)),le.q1=M.interp(Vt,.5),le.q3=M.interp(Zt,.5)}else le.q1=M.interp(G,.25),le.q3=M.interp(G,.75);le.lf=g(le,G,$),le.uf=v(le,G,$),le.lo=T(le),le.uo=l(le);var Sr=_(le,$);le.ln=le.med-Sr,le.un=le.med+Sr,rt=Math.min(rt,le.ln),st=Math.max(st,le.un),le.pts2=he.filter(oe),u.push(le)}E.notched&&M.isTypedArray(lt)&&(lt=Array.from(lt)),E._extremes[L._id]=x.findExtremes(L,E.notched?lt.concat([rt,st]):lt,{padded:!0})}return s(u,E),u.length>0?(u[0].t={num:y[m],dPos:ue,posLetter:B,valLetter:z,labels:{med:t(S,"median:"),min:t(S,"min:"),q1:t(S,"q1:"),q3:t(S,"q3:"),max:t(S,"max:"),mean:E.boxmean==="sd"||E.sizemode==="sd"?t(S,"mean \xB1 \u03C3:").replace("\u03C3",E.sdmultiple===1?"\u03C3":E.sdmultiple+"\u03C3"):t(S,"mean:"),lf:t(S,"lower fence:"),uf:t(S,"upper fence:")}},y[m]++,u):[{t:{empty:!0}}]};function r(w,S,E,y){var b=S in w,p=S+"0"in w,u="d"+S in w;if(b||p&&u){var m=E.makeCalcdata(w,S),h=A(w,E,S,m).vals;return[h,m]}var P;p?P=w[S+"0"]:"name"in w&&(E.type==="category"||d(w.name)&&["linear","log"].indexOf(E.type)!==-1||M.isDateTime(w.name)&&E.type==="date")?P=w.name:P=y;for(var L=E.type==="multicategory"?E.r2c_just_indices(P):E.d2c(P,0,w[S+"calendar"]),z=w._length,F=new Array(z),B=0;B1,p=1-s[r+"gap"],u=1-s[r+"groupgap"];for(g=0;g0;if(L==="positive"?(le=z*(P?1:.5),$=G,he=$=B):L==="negative"?(le=$=B,he=z*(P?1:.5),J=G):(le=he=z,$=J=G),re){var ce=m.pointpos,be=m.jitter,Ae=m.marker.size/2,ze=0;ce+be>=0&&(ze=G*(ce+be),ze>le?(ee=!0,ie=Ae,X=ze):ze>$&&(ie=Ae,X=le)),ze<=le&&(X=le);var Re=0;ce-be<=0&&(Re=-G*(ce-be),Re>he?(ee=!0,j=Ae,oe=Re):Re>J&&(j=Ae,oe=he)),Re<=he&&(oe=he)}else X=le,oe=he;var Xe=new Array(T.length);for(v=0;vE.lo&&(N.so=!0)}return b});S.enter().append("path").classed("point",!0),S.exit().remove(),S.call(A.translatePoints,f,g)}function a(i,n,s,c){var f=n.val,g=n.pos,v=!!g.rangebreaks,T=c.bPos,l=c.bPosPxOffset||0,_=s.boxmean||(s.meanline||{}).visible,w,S;Array.isArray(c.bdPos)?(w=c.bdPos[0],S=c.bdPos[1]):(w=c.bdPos,S=c.bdPos);var E=i.selectAll("path.mean").data(s.type==="box"&&s.boxmean||s.type==="violin"&&s.box.visible&&s.meanline.visible?x.identity:[]);E.enter().append("path").attr("class","mean").style({fill:"none","vector-effect":"non-scaling-stroke"}),E.exit().remove(),E.each(function(y){var b=g.c2l(y.pos+T,!0),p=g.l2p(b-w)+l,u=g.l2p(b+S)+l,m=v?(p+u)/2:g.l2p(b)+l,h=f.c2p(y.mean,!0),P=f.c2p(y.mean-y.sd,!0),L=f.c2p(y.mean+y.sd,!0);s.orientation==="h"?d.select(this).attr("d","M"+h+","+p+"V"+u+(_==="sd"?"m0,0L"+P+","+m+"L"+h+","+p+"L"+L+","+m+"Z":"")):d.select(this).attr("d","M"+p+","+h+"H"+u+(_==="sd"?"m0,0L"+m+","+P+"L"+p+","+h+"L"+m+","+L+"Z":""))})}q.exports={plot:t,plotBoxAndWhiskers:r,plotPoints:o,plotBoxMean:a}}}),W2=Ze({"src/traces/box/style.js"(Z,q){"use strict";var d=On(),x=Yn(),A=as();function M(t,r,o){var a=o||d.select(t).selectAll("g.trace.boxes");a.style("opacity",function(i){return i[0].trace.opacity}),a.each(function(i){var n=d.select(this),s=i[0].trace,c=s.line.width;function f(T,l,_,w){T.style("stroke-width",l+"px").call(x.stroke,_).call(x.fill,w)}var g=n.selectAll("path.box");if(s.type==="candlestick")g.each(function(T){if(!T.empty){var l=d.select(this),_=s[T.dir];f(l,_.line.width,_.line.color,_.fillcolor),l.style("opacity",s.selectedpoints&&!T.selected?.3:1)}});else{f(g,c,s.line.color,s.fillcolor),n.selectAll("path.mean").style({"stroke-width":c,"stroke-dasharray":2*c+"px,"+c+"px"}).call(x.stroke,s.line.color);var v=n.selectAll("path.point");A.pointStyle(v,s,t)}})}function e(t,r,o){var a=r[0].trace,i=o.selectAll("path.point");a.selectedpoints?A.selectedPointStyle(i,a):A.pointStyle(i,a,t)}q.exports={style:M,styleOnSelect:e}}}),$5=Ze({"src/traces/box/hover.js"(Z,q){"use strict";var d=Wo(),x=ca(),A=ef(),M=Yn(),e=x.fillText;function t(a,i,n,s){var c=a.cd,f=c[0].trace,g=f.hoveron,v=[],T;return g.indexOf("boxes")!==-1&&(v=v.concat(r(a,i,n,s))),g.indexOf("points")!==-1&&(T=o(a,i,n)),s==="closest"?T?[T]:v:(T&&v.push(T),v)}function r(a,i,n,s){var c=a.cd,f=a.xa,g=a.ya,v=c[0].trace,T=c[0].t,l=v.type==="violin",_,w,S,E,y,b,p,u,m,h,P,L=T.bdPos,z,F,B=T.wHover,O=function(Re){return S.c2l(Re.pos)+T.bPos-S.c2l(b)};l&&v.side!=="both"?(v.side==="positive"&&(m=function(Re){var Xe=O(Re);return A.inbox(Xe,Xe+B,h)},z=L,F=0),v.side==="negative"&&(m=function(Re){var Xe=O(Re);return A.inbox(Xe-B,Xe,h)},z=0,F=L)):(m=function(Re){var Xe=O(Re);return A.inbox(Xe-B,Xe+B,h)},z=F=L);var I;l?I=function(Re){return A.inbox(Re.span[0]-y,Re.span[1]-y,h)}:I=function(Re){return A.inbox(Re.min-y,Re.max-y,h)},v.orientation==="h"?(y=i,b=n,p=I,u=m,_="y",S=g,w="x",E=f):(y=n,b=i,p=m,u=I,_="x",S=f,w="y",E=g);var N=Math.min(1,L/Math.abs(S.r2c(S.range[1])-S.r2c(S.range[0])));h=a.maxHoverDistance-N,P=a.maxSpikeDistance-N;function U(Re){return(p(Re)+u(Re))/2}var W=A.getDistanceFunction(s,p,u,U);if(A.getClosest(c,W,a),a.index===!1)return[];var Q=c[a.index],ue=v.line.color,le=(v.marker||{}).color;M.opacity(ue)&&v.line.width?a.color=ue:M.opacity(le)&&v.boxpoints?a.color=le:a.color=v.fillcolor,a[_+"0"]=S.c2p(Q.pos+T.bPos-F,!0),a[_+"1"]=S.c2p(Q.pos+T.bPos+z,!0),a[_+"LabelVal"]=Q.orig_p!==void 0?Q.orig_p:Q.pos;var he=_+"Spike";a.spikeDistance=U(Q)*P/h,a[he]=S.c2p(Q.pos,!0);var G=v.boxmean||v.sizemode==="sd"||(v.meanline||{}).visible,$=v.boxpoints||v.points,J=$&&G?["max","uf","q3","med","mean","q1","lf","min"]:$&&!G?["max","uf","q3","med","q1","lf","min"]:!$&&G?["max","q3","med","mean","q1","min"]:["max","q3","med","q1","min"],X=E.range[1]0&&(o=!0);for(var s=0;st){var r=t-M[x];return M[x]=t,r}}else return M[x]=t,t;return 0},max:function(x,A,M,e){var t=e[A];if(d(t))if(t=Number(t),d(M[x])){if(M[x]p&&pM){var h=u===x?1:6,P=u===x?"M12":"M1";return function(L,z){var F=T.c2d(L,x,l),B=F.indexOf("-",h);B>0&&(F=F.substr(0,B));var O=T.d2c(F,0,l);if(Or?c>M?c>x*1.1?x:c>A*1.1?A:M:c>e?e:c>t?t:r:Math.pow(10,Math.floor(Math.log(c)/Math.LN10))}function n(c,f,g,v,T,l){if(v&&c>M){var _=s(f,T,l),w=s(g,T,l),S=c===x?0:1;return _[S]!==w[S]}return Math.floor(g/c)-Math.floor(f/c)>.1}function s(c,f,g){var v=f.c2d(c,x,g).split("-");return v[0]===""&&(v.unshift(),v[0]="-"+v[0]),v}}}),nS=Ze({"src/traces/histogram/calc.js"(Z,q){"use strict";var d=ns(),x=ca(),A=oo(),M=Wo(),{hasColorscale:e}=bp(),t=wp(),r=O_(),o=tS(),a=rS(),i=aS(),n=iS();function s(T,l){var _=[],w=[],S=l.orientation==="h",E=M.getFromId(T,S?l.yaxis:l.xaxis),y=S?"y":"x",b={x:"y",y:"x"}[y],p=l[y+"calendar"],u=l.cumulative,m,h=c(T,l,E,y),P=h[0],L=h[1],z=typeof P.size=="string",F=[],B=z?F:P,O=[],I=[],N=[],U=0,W=l.histnorm,Q=l.histfunc,ue=W.indexOf("density")!==-1,le,he,G;u.enabled&&ue&&(W=W.replace(/ ?density$/,""),ue=!1);var $=Q==="max"||Q==="min",J=$?null:0,X=o.count,oe=a[W],ie=!1,j=function(Fe){return E.r2c(Fe,0,p)},ee;for(x.isArrayOrTypedArray(l[b])&&Q!=="count"&&(ee=l[b],ie=Q==="avg",X=o[Q]),m=j(P.start),he=j(P.end)+(m-M.tickIncrement(m,P.size,!1,p))/1e6;m=0&&G=Ee;m--)if(w[m]){_e=m;break}for(m=Ee;m<=_e;m++)if(d(_[m])&&d(w[m])){var fe={p:_[m],s:w[m],b:0};u.enabled||(fe.pts=N[m],Ae?fe.ph0=fe.ph1=N[m].length?L[N[m][0]]:_[m]:(l._computePh=!0,fe.ph0=ot(F[m]),fe.ph1=ot(F[m+1],!0))),lt.push(fe)}return lt.length===1&&(lt[0].width1=M.tickIncrement(lt[0].p,P.size,!1,p)-lt[0].p),e(l,"marker")&&t(T,l,{vals:l.marker.color,containerStr:"marker",cLetter:"c"}),e(l,"marker.line")&&t(T,l,{vals:l.marker.line.color,containerStr:"marker.line",cLetter:"c"}),r(lt,l),x.isArrayOrTypedArray(l.selectedpoints)&&x.tagSelected(lt,l,Xe),lt}function c(T,l,_,w,S){var E=w+"bins",y=T._fullLayout,b=l["_"+w+"bingroup"],p=y._histogramBinOpts[b],u=y.barmode==="overlay",m,h,P,L,z,F,B,O=function(it){return _.r2c(it,0,L)},I=function(it){return _.c2r(it,0,L)},N=_.type==="date"?function(it){return it||it===0?x.cleanDate(it,null,L):null}:function(it){return d(it)?Number(it):null};function U(it,ot,tt){ot[it+"Found"]?(ot[it]=N(ot[it]),ot[it]===null&&(ot[it]=tt[it])):(F[it]=ot[it]=tt[it],x.nestedProperty(h[0],E+"."+it).set(tt[it]))}if(l["_"+w+"autoBinFinished"])delete l["_"+w+"autoBinFinished"];else{h=p.traces;var W=[],Q=!0,ue=!1,le=!1;for(m=0;m"u"){if(S)return[G,z,!0];G=f(T,l,_,w,E)}B=P.cumulative||{},B.enabled&&B.currentbin!=="include"&&(B.direction==="decreasing"?G.start=I(M.tickIncrement(O(G.start),G.size,!0,L)):G.end=I(M.tickIncrement(O(G.end),G.size,!1,L))),p.size=G.size,p.sizeFound||(F.size=G.size,x.nestedProperty(h[0],E+".size").set(G.size)),U("start",p,G),U("end",p,G)}z=l["_"+w+"pos0"],delete l["_"+w+"pos0"];var J=l._input[E]||{},X=x.extendFlat({},p),oe=p.start,ie=_.r2l(J.start),j=ie!==void 0;if((p.startFound||j)&&ie!==_.r2l(oe)){var ee=j?ie:x.aggNums(Math.min,null,z),re={type:_.type==="category"||_.type==="multicategory"?"linear":_.type,r2l:_.r2l,dtick:p.size,tick0:oe,calendar:L,range:[ee,M.tickIncrement(ee,p.size,!1,L)].map(_.l2r)},ce=M.tickFirst(re);ce>_.r2l(ee)&&(ce=M.tickIncrement(ce,p.size,!0,L)),X.start=_.l2r(ce),j||x.nestedProperty(l,E+".start").set(X.start)}var be=p.end,Ae=_.r2l(J.end),ze=Ae!==void 0;if((p.endFound||ze)&&Ae!==_.r2l(be)){var Re=ze?Ae:x.aggNums(Math.max,null,z);X.end=_.l2r(Re),ze||x.nestedProperty(l,E+".start").set(X.end)}var Xe="autobin"+w;return l._input[Xe]===!1&&(l._input[E]=x.extendFlat({},l[E]||{}),delete l._input[Xe],delete l[Xe]),[X,z]}function f(T,l,_,w,S){var E=T._fullLayout,y=g(T,l),b=!1,p=1/0,u=[l],m,h,P;for(m=0;m=0;w--)b(w);else if(l==="increasing"){for(w=1;w=0;w--)T[w]+=T[w+1];_==="exclude"&&(T.push(0),T.shift())}}q.exports={calc:s,calcAllAutoBins:c}}}),tF=Ze({"src/traces/histogram2d/calc.js"(Z,q){"use strict";var d=ca(),x=Wo(),A=tS(),M=rS(),e=aS(),t=iS(),r=nS().calcAllAutoBins;q.exports=function(s,c){var f=x.getFromId(s,c.xaxis),g=x.getFromId(s,c.yaxis),v=c.xcalendar,T=c.ycalendar,l=function(Be){return f.r2c(Be,0,v)},_=function(Be){return g.r2c(Be,0,T)},w=function(Be){return f.c2r(Be,0,v)},S=function(Be){return g.c2r(Be,0,T)},E,y,b,p,u=r(s,c,f,"x"),m=u[0],h=u[1],P=r(s,c,g,"y"),L=P[0],z=P[1],F=c._length;h.length>F&&h.splice(F,h.length-F),z.length>F&&z.splice(F,z.length-F);var B=[],O=[],I=[],N=typeof m.size=="string",U=typeof L.size=="string",W=[],Q=[],ue=N?W:m,le=U?Q:L,he=0,G=[],$=[],J=c.histnorm,X=c.histfunc,oe=J.indexOf("density")!==-1,ie=X==="max"||X==="min",j=ie?null:0,ee=A.count,re=M[J],ce=!1,be=[],Ae=[],ze="z"in c?c.z:"marker"in c&&Array.isArray(c.marker.color)?c.marker.color:"";ze&&X!=="count"&&(ce=X==="avg",ee=A[X]);var Re=m.size,Xe=l(m.start),it=l(m.end)+(Xe-x.tickIncrement(Xe,Re,!1,v))/1e6;for(E=Xe;E=0&&b=0&&px;i++)a=e(r,o,M(a));return a>x&&d.log("interp2d didn't converge quickly",a),r};function e(t,r,o){var a=0,i,n,s,c,f,g,v,T,l,_,w,S,E;for(c=0;cS&&(a=Math.max(a,Math.abs(t[n][s]-w)/(E-S))))}return a}}}),J2=Ze({"src/traces/heatmap/find_empties.js"(Z,q){"use strict";var d=ca().maxRowLength;q.exports=function(A){var M=[],e={},t=[],r=A[0],o=[],a=[0,0,0],i=d(A),n,s,c,f,g,v,T,l;for(s=0;s=0;g--)f=t[g],s=f[0],c=f[1],v=((e[[s-1,c]]||a)[2]+(e[[s+1,c]]||a)[2]+(e[[s,c-1]]||a)[2]+(e[[s,c+1]]||a)[2])/20,v&&(T[f]=[s,c,v],t.splice(g,1),l=!0);if(!l)throw"findEmpties iterated with no new neighbors";for(f in T)e[f]=T[f],M.push(T[f])}return M.sort(function(_,w){return w[2]-_[2]})}}}),oS=Ze({"src/traces/heatmap/make_bound_array.js"(Z,q){"use strict";var d=oo(),x=ca().isArrayOrTypedArray;q.exports=function(M,e,t,r,o,a){var i=[],n=d.traceIs(M,"contour"),s=d.traceIs(M,"histogram"),c,f,g,v=x(e)&&e.length>1;if(v&&!s&&a.type!=="category"){var T=e.length;if(T<=o){if(n)i=Array.from(e).slice(0,o);else if(o===1)a.type==="log"?i=[.5*e[0],2*e[0]]:i=[e[0]-.5,e[0]+.5];else if(a.type==="log"){for(i=[Math.pow(e[0],1.5)/Math.pow(e[1],.5)],g=1;g1){var J=($[$.length-1]-$[0])/($.length-1),X=Math.abs(J/100);for(F=0;F<$.length-1;F++)if(Math.abs($[F+1]-$[F]-J)>X)return!1}return!0}T._islinear=!1,l.type==="log"||_.type==="log"?E==="fast"&&I("log axis found"):N(y)?N(m)?T._islinear=!0:E==="fast"&&I("y scale is not linear"):E==="fast"&&I("x scale is not linear");var U=x.maxRowLength(z),W=T.xtype==="scaled"?"":y,Q=n(T,W,b,p,U,l),ue=T.ytype==="scaled"?"":m,le=n(T,ue,h,P,z.length,_);T._extremes[l._id]=A.findExtremes(l,Q),T._extremes[_._id]=A.findExtremes(_,le);var he={x:Q,y:le,z,text:T._text||T.text,hovertext:T._hovertext||T.hovertext};if(T.xperiodalignment&&u&&(he.orig_x=u),T.yperiodalignment&&L&&(he.orig_y=L),W&&W.length===Q.length-1&&(he.xCenter=W),ue&&ue.length===le.length-1&&(he.yCenter=ue),S&&(he.xRanges=B.xRanges,he.yRanges=B.yRanges,he.pts=B.pts),w||t(v,T,{vals:z,cLetter:"z"}),w&&T.contours&&T.contours.coloring==="heatmap"){var G={type:T.type==="contour"?"heatmap":"histogram2d",xcalendar:T.xcalendar,ycalendar:T.ycalendar};he.xfill=n(G,W,b,p,U,l),he.yfill=n(G,ue,h,P,z.length,_)}return[he]};function c(g){for(var v=[],T=g.length,l=0;l0;)oe=m.c2p(N[re]),re--;for(oe0;)ee=h.c2p(U[re]),re--;ee=m._length||oe<=0||j>=h._length||ee<=0;if(it){var ot=L.selectAll("image").data([]);ot.exit().remove(),_(L);return}var tt,lt;Ae==="fast"?(tt=G,lt=he):(tt=Re,lt=Xe);var Ee=document.createElement("canvas");Ee.width=tt,Ee.height=lt;var _e=Ee.getContext("2d",{willReadFrequently:!0}),fe=n(F,{noNumericCheck:!0,returnArray:!0}),Fe,rt;Ae==="fast"?(Fe=$?function(Da){return G-1-Da}:t.identity,rt=J?function(Da){return he-1-Da}:t.identity):(Fe=function(Da){return t.constrain(Math.round(m.c2p(N[Da])-X),0,Re)},rt=function(Da){return t.constrain(Math.round(h.c2p(U[Da])-j),0,Xe)});var st=rt(0),Qe=[st,st],Lt=$?0:1,kt=J?0:1,Vt=0,Zt=0,Sr=0,xr=0,jr,wr,Ir,bt,Be;function Ke(Da,Xi){if(Da!==void 0){var Li=fe(Da);return Li[0]=Math.round(Li[0]),Li[1]=Math.round(Li[1]),Li[2]=Math.round(Li[2]),Vt+=Xi,Zt+=Li[0]*Xi,Sr+=Li[1]*Xi,xr+=Li[2]*Xi,Li}return[0,0,0,0]}function Ue(Da,Xi,Li,fn){var An=Da[Li.bin0];if(An===void 0)return Ke(void 0,1);var kn=Da[Li.bin1],zn=Xi[Li.bin0],Xn=Xi[Li.bin1],to=kn-An||0,mo=zn-An||0,pn;return kn===void 0?Xn===void 0?pn=0:zn===void 0?pn=2*(Xn-An):pn=(2*Xn-zn-An)*2/3:Xn===void 0?zn===void 0?pn=0:pn=(2*An-kn-zn)*2/3:zn===void 0?pn=(2*Xn-kn-An)*2/3:pn=Xn+An-kn-zn,Ke(An+Li.frac*to+fn.frac*(mo+Li.frac*pn))}if(Ae!=="default"){var Me=0,qe;try{qe=new Uint8Array(tt*lt*4)}catch{qe=new Array(tt*lt*4)}if(Ae==="smooth"){var Ce=W||N,Te=Q||U,Pe=new Array(Ce.length),at=new Array(Te.length),yt=new Array(Re),Tt=W?S:w,Ot=Q?S:w,Gt,rr,Qt;for(re=0;reHa||Ha>h._length))for(ce=ta;ceai||ai>m._length)){var mi=o({x:$a,y:Ia},F,y._fullLayout);mi.x=$a,mi.y=Ia;var xt=z.z[re][ce];xt===void 0?(mi.z="",mi.zLabel=""):(mi.z=xt,mi.zLabel=e.tickText(Jt,xt,"hover").text);var ct=z.text&&z.text[re]&&z.text[re][ce];(ct===void 0||ct===!1)&&(ct=""),mi.text=ct;var Nr=t.texttemplateString(ti,mi,y._fullLayout._d3locale,mi,F._meta||{});if(Nr){var Or=Nr.split("
"),Rr=Or.length,Lr=0;for(be=0;be=_[0].length||P<0||P>_.length)return}else{if(d.inbox(o-T[0],o-T[T.length-1],0)>0||d.inbox(a-l[0],a-l[l.length-1],0)>0)return;if(s){var L;for(b=[2*T[0]-T[1]],L=1;L=",">","<="],COMPARISON_OPS2:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"],CONSTRAINT_REDUCTION:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}}}),q_=Ze({"src/traces/contour/attributes.js"(Z,q){"use strict";var d=p1(),x=tf(),A=Qc(),M=A.axisHoverFormat,e=A.descriptionOnlyNumbers,t=Mu(),r=Gh().dash,o=tc(),a=rs().extendFlat,i=o3(),n=i.COMPARISON_OPS2,s=i.INTERVAL_OPS,c=x.line;q.exports=a({z:d.z,x:d.x,x0:d.x0,dx:d.dx,y:d.y,y0:d.y0,dy:d.dy,xperiod:d.xperiod,yperiod:d.yperiod,xperiod0:x.xperiod0,yperiod0:x.yperiod0,xperiodalignment:d.xperiodalignment,yperiodalignment:d.yperiodalignment,text:d.text,hovertext:d.hovertext,transpose:d.transpose,xtype:d.xtype,ytype:d.ytype,xhoverformat:M("x"),yhoverformat:M("y"),zhoverformat:M("z",1),hovertemplate:d.hovertemplate,texttemplate:a({},d.texttemplate,{}),textfont:a({},d.textfont,{}),hoverongaps:d.hoverongaps,connectgaps:a({},d.connectgaps,{}),fillcolor:{valType:"color",editType:"calc"},autocontour:{valType:"boolean",dflt:!0,editType:"calc",impliedEdits:{"contours.start":void 0,"contours.end":void 0,"contours.size":void 0}},ncontours:{valType:"integer",dflt:15,min:1,editType:"calc"},contours:{type:{valType:"enumerated",values:["levels","constraint"],dflt:"levels",editType:"calc"},start:{valType:"number",dflt:null,editType:"plot",impliedEdits:{"^autocontour":!1}},end:{valType:"number",dflt:null,editType:"plot",impliedEdits:{"^autocontour":!1}},size:{valType:"number",dflt:null,min:0,editType:"plot",impliedEdits:{"^autocontour":!1}},coloring:{valType:"enumerated",values:["fill","heatmap","lines","none"],dflt:"fill",editType:"calc"},showlines:{valType:"boolean",dflt:!0,editType:"plot"},showlabels:{valType:"boolean",dflt:!1,editType:"plot"},labelfont:o({editType:"plot",colorEditType:"style"}),labelformat:{valType:"string",dflt:"",editType:"plot",description:e("contour label")},operation:{valType:"enumerated",values:[].concat(n).concat(s),dflt:"=",editType:"calc"},value:{valType:"any",dflt:0,editType:"calc"},editType:"calc",impliedEdits:{autocontour:!1}},line:{color:a({},c.color,{editType:"style+colorbars"}),width:{valType:"number",min:0,editType:"style+colorbars"},dash:r,smoothing:a({},c.smoothing,{}),editType:"plot"},zorder:x.zorder},t("",{cLetter:"z",autoColorDflt:!1,editTypeOverride:"calc"}))}}),fS=Ze({"src/traces/histogram2dcontour/attributes.js"(Z,q){"use strict";var d=n3(),x=q_(),A=Mu(),M=Qc().axisHoverFormat,e=rs().extendFlat;q.exports=e({x:d.x,y:d.y,z:d.z,marker:d.marker,histnorm:d.histnorm,histfunc:d.histfunc,nbinsx:d.nbinsx,xbins:d.xbins,nbinsy:d.nbinsy,ybins:d.ybins,autobinx:d.autobinx,autobiny:d.autobiny,bingroup:d.bingroup,xbingroup:d.xbingroup,ybingroup:d.ybingroup,autocontour:x.autocontour,ncontours:x.ncontours,contours:x.contours,line:{color:x.line.color,width:e({},x.line.width,{dflt:.5}),dash:x.line.dash,smoothing:x.line.smoothing,editType:"plot"},xhoverformat:M("x"),yhoverformat:M("y"),zhoverformat:M("z",1),hovertemplate:d.hovertemplate,texttemplate:x.texttemplate,textfont:x.textfont},A("",{cLetter:"z",editTypeOverride:"calc"}))}}),s3=Ze({"src/traces/contour/contours_defaults.js"(Z,q){"use strict";q.exports=function(x,A,M,e){var t=e("contours.start"),r=e("contours.end"),o=t===!1||r===!1,a=M("contours.size"),i;o?i=A.autocontour=!0:i=M("autocontour",!1),(i||!a)&&M("ncontours")}}}),hS=Ze({"src/traces/contour/label_defaults.js"(Z,q){"use strict";var d=ca();q.exports=function(A,M,e,t){t||(t={});var r=A("contours.showlabels");if(r){var o=M.font;d.coerceFont(A,"contours.labelfont",o,{overrideDflt:{color:e}}),A("contours.labelformat")}t.hasHover!==!1&&A("zhoverformat")}}}),l3=Ze({"src/traces/contour/style_defaults.js"(Z,q){"use strict";var d=gh(),x=hS();q.exports=function(M,e,t,r,o){var a=t("contours.coloring"),i,n="";a==="fill"&&(i=t("contours.showlines")),i!==!1&&(a!=="lines"&&(n=t("line.color","#000")),t("line.width",.5),t("line.dash")),a!=="none"&&(M.showlegend!==!0&&(e.showlegend=!1),e._dfltShowLegend=!1,d(M,e,r,t,{prefix:"",cLetter:"z"})),t("line.smoothing"),x(t,r,n,o)}}}),pF=Ze({"src/traces/histogram2dcontour/defaults.js"(Z,q){"use strict";var d=ca(),x=cS(),A=s3(),M=l3(),e=j_(),t=fS();q.exports=function(o,a,i,n){function s(f,g){return d.coerce(o,a,t,f,g)}function c(f){return d.coerce2(o,a,t,f)}x(o,a,s,n),a.visible!==!1&&(A(o,a,s,c),M(o,a,s,n),s("xhoverformat"),s("yhoverformat"),s("hovertemplate"),a.contours&&a.contours.coloring==="heatmap"&&e(s,n))}}}),pS=Ze({"src/traces/contour/set_contours.js"(Z,q){"use strict";var d=Wo(),x=ca();q.exports=function(e,t){var r=e.contours;if(e.autocontour){var o=e.zmin,a=e.zmax;(e.zauto||o===void 0)&&(o=x.aggNums(Math.min,null,t)),(e.zauto||a===void 0)&&(a=x.aggNums(Math.max,null,t));var i=A(o,a,e.ncontours);r.size=i.dtick,r.start=d.tickFirst(i),i.range.reverse(),r.end=d.tickFirst(i),r.start===o&&(r.start+=r.size),r.end===a&&(r.end-=r.size),r.start>r.end&&(r.start=r.end=(r.start+r.end)/2),e._input.contours||(e._input.contours={}),x.extendFlat(e._input.contours,{start:r.start,end:r.end,size:r.size}),e._input.autocontour=!0}else if(r.type!=="constraint"){var n=r.start,s=r.end,c=e._input.contours;if(n>s&&(r.start=c.start=s,s=r.end=c.end=n,n=r.start),!(r.size>0)){var f;n===s?f=1:f=A(n,s,e.ncontours).dtick,c.size=r.size=f}}};function A(M,e,t){var r={type:"linear",range:[M,e]};return d.autoTicks(r,(e-M)/(t||15)),r}}}),V_=Ze({"src/traces/contour/end_plus.js"(Z,q){"use strict";q.exports=function(x){return x.end+x.size/1e6}}}),dS=Ze({"src/traces/contour/calc.js"(Z,q){"use strict";var d=rc(),x=$2(),A=pS(),M=V_();q.exports=function(t,r){var o=x(t,r),a=o[0].z;A(r,a);var i=r.contours,n=d.extractOpts(r),s;if(i.coloring==="heatmap"&&n.auto&&r.autocontour===!1){var c=i.start,f=M(i),g=i.size||1,v=Math.floor((f-c)/g)+1;isFinite(g)||(g=1,v=1);var T=c-g/2,l=T+v*g;s=[T,l]}else s=a;return d.calc(t,r,{vals:s,cLetter:"z"}),o}}}),G_=Ze({"src/traces/contour/constants.js"(Z,q){"use strict";q.exports={BOTTOMSTART:[1,9,13,104,713],TOPSTART:[4,6,7,104,713],LEFTSTART:[8,12,14,208,1114],RIGHTSTART:[2,3,11,208,1114],NEWDELTA:[null,[-1,0],[0,-1],[-1,0],[1,0],null,[0,-1],[-1,0],[0,1],[0,1],null,[0,1],[1,0],[1,0],[0,-1]],CHOOSESADDLE:{104:[4,1],208:[2,8],713:[7,13],1114:[11,14]},SADDLEREMAINDER:{1:4,2:8,4:1,7:13,8:2,11:14,13:7,14:11},LABELDISTANCE:2,LABELINCREASE:10,LABELMIN:3,LABELMAX:10,LABELOPTIMIZER:{EDGECOST:1,ANGLECOST:1,NEIGHBORCOST:5,SAMELEVELFACTOR:10,SAMELEVELDISTANCE:5,MAXCOST:100,INITIALSEARCHPOINTS:10,ITERATIONS:5}}}}),vS=Ze({"src/traces/contour/make_crossings.js"(Z,q){"use strict";var d=G_();q.exports=function(M){var e=M[0].z,t=e.length,r=e[0].length,o=t===2||r===2,a,i,n,s,c,f,g,v,T;for(i=0;iA?0:1)+(M[0][1]>A?0:2)+(M[1][1]>A?0:4)+(M[1][0]>A?0:8);if(e===5||e===10){var t=(M[0][0]+M[0][1]+M[1][0]+M[1][1])/4;return A>t?e===5?713:1114:e===5?104:208}return e===15?0:e}}}),mS=Ze({"src/traces/contour/find_all_paths.js"(Z,q){"use strict";var d=ca(),x=G_();q.exports=function(a,i,n){var s,c,f,g,v;for(i=i||.01,n=n||.01,f=0;f20?(f=x.CHOOSESADDLE[f][(g[0]||g[1])<0?0:1],o.crossings[c]=x.SADDLEREMAINDER[f]):delete o.crossings[c],g=x.NEWDELTA[f],!g){d.log("Found bad marching index:",f,a,o.level);break}v.push(r(o,a,g)),a[0]+=g[0],a[1]+=g[1],c=a.join(","),A(v[v.length-1],v[v.length-2],n,s)&&v.pop();var E=g[0]&&(a[0]<0||a[0]>l-2)||g[1]&&(a[1]<0||a[1]>T-2),y=a[0]===_[0]&&a[1]===_[1]&&g[0]===w[0]&&g[1]===w[1];if(y||i&&E)break;f=o.crossings[c]}S===1e4&&d.log("Infinite loop in contour?");var b=A(v[0],v[v.length-1],n,s),p=0,u=.2*o.smoothing,m=[],h=0,P,L,z,F,B,O,I,N,U,W,Q;for(S=1;S=h;S--)if(P=m[S],P=h&&P+m[L]N&&U--,o.edgepaths[U]=Q.concat(v,W));break}G||(o.edgepaths[N]=v.concat(W))}for(N=0;N20&&a?o===208||o===1114?n=i[0]===0?1:-1:s=i[1]===0?1:-1:x.BOTTOMSTART.indexOf(o)!==-1?s=1:x.LEFTSTART.indexOf(o)!==-1?n=1:x.TOPSTART.indexOf(o)!==-1?s=-1:n=-1,[n,s]}function r(o,a,i){var n=a[0]+Math.max(i[0],0),s=a[1]+Math.max(i[1],0),c=o.z[s][n],f=o.xaxis,g=o.yaxis;if(i[1]){var v=(o.level-c)/(o.z[s][n+1]-c),T=(v!==1?(1-v)*f.c2l(o.x[n]):0)+(v!==0?v*f.c2l(o.x[n+1]):0);return[f.c2p(f.l2c(T),!0),g.c2p(o.y[s],!0),n+v,s]}else{var l=(o.level-c)/(o.z[s+1][n]-c),_=(l!==1?(1-l)*g.c2l(o.y[s]):0)+(l!==0?l*g.c2l(o.y[s+1]):0);return[f.c2p(o.x[n],!0),g.c2p(g.l2c(_),!0),n,s+l]}}}}),dF=Ze({"src/traces/contour/constraint_mapping.js"(Z,q){"use strict";var d=o3(),x=ns();q.exports={"[]":M("[]"),"][":M("]["),">":e(">"),"<":e("<"),"=":e("=")};function A(t,r){var o=Array.isArray(r),a;function i(n){return x(n)?+n:null}return d.COMPARISON_OPS2.indexOf(t)!==-1?a=i(o?r[0]:r):d.INTERVAL_OPS.indexOf(t)!==-1?a=o?[i(r[0]),i(r[1])]:[i(r),i(r)]:d.SET_OPS.indexOf(t)!==-1&&(a=o?r.map(i):[i(r)]),a}function M(t){return function(r){r=A(t,r);var o=Math.min(r[0],r[1]),a=Math.max(r[0],r[1]);return{start:o,end:a,size:a-o}}}function e(t){return function(r){return r=A(t,r),{start:r,end:1/0,size:1/0}}}}}),gS=Ze({"src/traces/contour/empty_pathinfo.js"(Z,q){"use strict";var d=ca(),x=dF(),A=V_();q.exports=function(e,t,r){for(var o=e.type==="constraint"?x[e._operation](e.value):e,a=o.size,i=[],n=A(o),s=r.trace._carpetTrace,c=s?{xaxis:s.aaxis,yaxis:s.baxis,x:r.a,y:r.b}:{xaxis:t.xaxis,yaxis:t.yaxis,x:r.x,y:r.y},f=o.start;f1e3){d.warn("Too many contours, clipping at 1000",e);break}return i}}}),yS=Ze({"src/traces/contour/convert_to_constraints.js"(Z,q){"use strict";var d=ca();q.exports=function(A,M){var e,t,r,o=function(n){return n.reverse()},a=function(n){return n};switch(M){case"=":case"<":return A;case">":for(A.length!==1&&d.warn("Contour data invalid for the specified inequality operation."),t=A[0],e=0;er.level||r.starts.length&&t===r.level)}break;case"constraint":if(A.prefixBoundary=!1,A.edgepaths.length)return;var o=A.x.length,a=A.y.length,i=-1/0,n=1/0;for(e=0;e":s>i&&(A.prefixBoundary=!0);break;case"<":(si||A.starts.length&&f===n)&&(A.prefixBoundary=!0);break;case"][":c=Math.min(s[0],s[1]),f=Math.max(s[0],s[1]),ci&&(A.prefixBoundary=!0);break}break}}}}),u3=Ze({"src/traces/contour/plot.js"(Z){"use strict";var q=On(),d=ca(),x=as(),A=rc(),M=fu(),e=Wo(),t=wv(),r=e3(),o=vS(),a=mS(),i=gS(),n=yS(),s=_S(),c=G_(),f=c.LABELOPTIMIZER;Z.plot=function(y,b,p,u){var m=b.xaxis,h=b.yaxis;d.makeTraceGroups(u,p,"contour").each(function(P){var L=q.select(this),z=P[0],F=z.trace,B=z.x,O=z.y,I=F.contours,N=i(I,b,z),U=d.ensureSingle(L,"g","heatmapcoloring"),W=[];I.coloring==="heatmap"&&(W=[P]),r(y,b,W,U),o(N),a(N);var Q=m.c2p(B[0],!0),ue=m.c2p(B[B.length-1],!0),le=h.c2p(O[0],!0),he=h.c2p(O[O.length-1],!0),G=[[Q,he],[ue,he],[ue,le],[Q,le]],$=N;I.type==="constraint"&&($=n(N,I._operation)),g(L,G,I),v(L,$,G,I),l(L,N,y,z,I),w(L,b,y,z,G)})};function g(E,y,b){var p=d.ensureSingle(E,"g","contourbg"),u=p.selectAll("path").data(b.coloring==="fill"?[0]:[]);u.enter().append("path"),u.exit().remove(),u.attr("d","M"+y.join("L")+"Z").style("stroke","none")}function v(E,y,b,p){var u=p.coloring==="fill"||p.type==="constraint"&&p._operation!=="=",m="M"+b.join("L")+"Z";u&&s(y,p);var h=d.ensureSingle(E,"g","contourfill"),P=h.selectAll("path").data(u?y:[]);P.enter().append("path"),P.exit().remove(),P.each(function(L){var z=(L.prefixBoundary?m:"")+T(L,b);z?q.select(this).attr("d",z).style("stroke","none"):q.select(this).remove()})}function T(E,y){var b="",p=0,u=E.edgepaths.map(function(Q,ue){return ue}),m=!0,h,P,L,z,F,B;function O(Q){return Math.abs(Q[1]-y[0][1])<.01}function I(Q){return Math.abs(Q[1]-y[2][1])<.01}function N(Q){return Math.abs(Q[0]-y[0][0])<.01}function U(Q){return Math.abs(Q[0]-y[2][0])<.01}for(;u.length;){for(B=x.smoothopen(E.edgepaths[p],E.smoothing),b+=m?B:B.replace(/^M/,"L"),u.splice(u.indexOf(p),1),h=E.edgepaths[p][E.edgepaths[p].length-1],z=-1,L=0;L<4;L++){if(!h){d.log("Missing end?",p,E);break}for(O(h)&&!U(h)?P=y[1]:N(h)?P=y[0]:I(h)?P=y[3]:U(h)&&(P=y[2]),F=0;F=0&&(P=W,z=F):Math.abs(h[1]-P[1])<.01?Math.abs(h[1]-W[1])<.01&&(W[0]-h[0])*(P[0]-W[0])>=0&&(P=W,z=F):d.log("endpt to newendpt is not vert. or horz.",h,P,W)}if(h=P,z>=0)break;b+="L"+P}if(z===E.edgepaths.length){d.log("unclosed perimeter path");break}p=z,m=u.indexOf(p)===-1,m&&(p=u[0],b+="Z")}for(p=0;pf.MAXCOST*2)break;O&&(P/=2),h=z-P/2,L=h+P*1.5}if(B<=f.MAXCOST)return F};function _(E,y,b,p){var u=y.width/2,m=y.height/2,h=E.x,P=E.y,L=E.theta,z=Math.cos(L)*u,F=Math.sin(L)*u,B=(h>p.center?p.right-h:h-p.left)/(z+Math.abs(Math.sin(L)*m)),O=(P>p.middle?p.bottom-P:P-p.top)/(Math.abs(F)+Math.cos(L)*m);if(B<1||O<1)return 1/0;var I=f.EDGECOST*(1/(B-1)+1/(O-1));I+=f.ANGLECOST*L*L;for(var N=h-z,U=P-F,W=h+z,Q=P+F,ue=0;ue=w)&&(r<=_&&(r=_),o>=w&&(o=w),i=Math.floor((o-r)/a)+1,n=0),l=0;l_&&(g.unshift(_),v.unshift(v[0])),g[g.length-1]2?s.value=s.value.slice(2):s.length===0?s.value=[0,1]:s.length<2?(c=parseFloat(s.value[0]),s.value=[c,c+1]):s.value=[parseFloat(s.value[0]),parseFloat(s.value[1])]:d(s.value)&&(c=parseFloat(s.value),s.value=[c,c+1])):(n("contours.value",0),d(s.value)||(r(s.value)?s.value=parseFloat(s.value[0]):s.value=0))}}}),gF=Ze({"src/traces/contour/defaults.js"(Z,q){"use strict";var d=ca(),x=X2(),A=Qd(),M=wS(),e=s3(),t=l3(),r=j_(),o=q_();q.exports=function(i,n,s,c){function f(l,_){return d.coerce(i,n,o,l,_)}function g(l){return d.coerce2(i,n,o,l)}var v=x(i,n,f,c);if(!v){n.visible=!1;return}A(i,n,c,f),f("xhoverformat"),f("yhoverformat"),f("text"),f("hovertext"),f("hoverongaps"),f("hovertemplate");var T=f("contours.type")==="constraint";f("connectgaps",d.isArray1D(n.z)),T?M(i,n,f,c,s):(e(i,n,f,g),t(i,n,f,c)),n.contours&&n.contours.coloring==="heatmap"&&r(f,c),f("zorder")}}}),yF=Ze({"src/traces/contour/index.js"(Z,q){"use strict";q.exports={attributes:q_(),supplyDefaults:gF(),calc:dS(),plot:u3().plot,style:c3(),colorbar:f3(),hoverPoints:bS(),moduleType:"trace",name:"contour",basePlotModule:Zf(),categories:["cartesian","svg","2dMap","contour","showLegend"],meta:{}}}}),_F=Ze({"lib/contour.js"(Z,q){"use strict";q.exports=yF()}}),TS=Ze({"src/traces/scatterternary/attributes.js"(Z,q){"use strict";var d=Cs().hovertemplateAttrs,x=Cs().texttemplateAttrs,A=$d(),M=tf(),e=eu(),t=Mu(),r=Gh().dash,o=rs().extendFlat,a=M.marker,i=M.line,n=a.line;q.exports={a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},c:{valType:"data_array",editType:"calc"},sum:{valType:"number",dflt:0,min:0,editType:"calc"},mode:o({},M.mode,{dflt:"markers"}),text:o({},M.text,{}),texttemplate:x({editType:"plot"},{keys:["a","b","c","text"]}),hovertext:o({},M.hovertext,{}),line:{color:i.color,width:i.width,dash:r,backoff:i.backoff,shape:o({},i.shape,{values:["linear","spline"]}),smoothing:i.smoothing,editType:"calc"},connectgaps:M.connectgaps,cliponaxis:M.cliponaxis,fill:o({},M.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:A(),marker:o({symbol:a.symbol,opacity:a.opacity,angle:a.angle,angleref:a.angleref,standoff:a.standoff,maxdisplayed:a.maxdisplayed,size:a.size,sizeref:a.sizeref,sizemin:a.sizemin,sizemode:a.sizemode,line:o({width:n.width,editType:"calc"},t("marker.line")),gradient:a.gradient,editType:"calc"},t("marker")),textfont:M.textfont,textposition:M.textposition,selected:M.selected,unselected:M.unselected,hoverinfo:o({},e.hoverinfo,{flags:["a","b","c","text","name"]}),hoveron:M.hoveron,hovertemplate:d()}}}),xF=Ze({"src/traces/scatterternary/defaults.js"(Z,q){"use strict";var d=ca(),x=Tv(),A=Fu(),M=md(),e=Dd(),t=o1(),r=zd(),o=ev(),a=TS();q.exports=function(n,s,c,f){function g(E,y){return d.coerce(n,s,a,E,y)}var v=g("a"),T=g("b"),l=g("c"),_;if(v?(_=v.length,T?(_=Math.min(_,T.length),l&&(_=Math.min(_,l.length))):l?_=Math.min(_,l.length):_=0):T&&l&&(_=Math.min(T.length,l.length)),!_){s.visible=!1;return}s._length=_,g("sum"),g("text"),g("hovertext"),s.hoveron!=="fills"&&g("hovertemplate");var w=_"),o.hovertemplate=f.hovertemplate,r}}}),SF=Ze({"src/traces/scatterternary/event_data.js"(Z,q){"use strict";q.exports=function(x,A,M,e,t){if(A.xa&&(x.xaxis=A.xa),A.ya&&(x.yaxis=A.ya),e[t]){var r=e[t];x.a=r.a,x.b=r.b,x.c=r.c}else x.a=A.a,x.b=A.b,x.c=A.c;return x}}}),MF=Ze({"src/plots/ternary/ternary.js"(Z,q){"use strict";var d=On(),x=Ch(),A=oo(),M=ca(),e=M.strTranslate,t=M._,r=Yn(),o=as(),a=wv(),i=rs().extendFlat,n=xc(),s=Wo(),c=Tp(),f=ef(),g=Jd(),v=g.freeMode,T=g.rectMode,l=Z0(),_=Tf().prepSelect,w=Tf().selectOnClick,S=Tf().clearOutline,E=Tf().clearSelectionsCache,y=kh();function b(I,N){this.id=I.id,this.graphDiv=I.graphDiv,this.init(N),this.makeFramework(N),this.updateFx(N),this.aTickLayout=null,this.bTickLayout=null,this.cTickLayout=null}q.exports=b;var p=b.prototype;p.init=function(I){this.container=I._ternarylayer,this.defs=I._defs,this.layoutId=I._uid,this.traceHash={},this.layers={}},p.plot=function(I,N){var U=this,W=N[U.id],Q=N._size;U._hasClipOnAxisFalse=!1;for(var ue=0;ueu*$?(ce=$,re=ce*u):(re=G,ce=re/u),be=le*re/G,Ae=he*ce/$,j=N.l+N.w*Q-re/2,ee=N.t+N.h*(1-ue)-ce/2,U.x0=j,U.y0=ee,U.w=re,U.h=ce,U.sum=J,U.xaxis={type:"linear",range:[X+2*ie-J,J-X-2*oe],domain:[Q-be/2,Q+be/2],_id:"x"},a(U.xaxis,U.graphDiv._fullLayout),U.xaxis.setScale(),U.xaxis.isPtWithinRange=function(Fe){return Fe.a>=U.aaxis.range[0]&&Fe.a<=U.aaxis.range[1]&&Fe.b>=U.baxis.range[1]&&Fe.b<=U.baxis.range[0]&&Fe.c>=U.caxis.range[1]&&Fe.c<=U.caxis.range[0]},U.yaxis={type:"linear",range:[X,J-oe-ie],domain:[ue-Ae/2,ue+Ae/2],_id:"y"},a(U.yaxis,U.graphDiv._fullLayout),U.yaxis.setScale(),U.yaxis.isPtWithinRange=function(){return!0};var ze=U.yaxis.domain[0],Re=U.aaxis=i({},I.aaxis,{range:[X,J-oe-ie],side:"left",tickangle:(+I.aaxis.tickangle||0)-30,domain:[ze,ze+Ae*u],anchor:"free",position:0,_id:"y",_length:re});a(Re,U.graphDiv._fullLayout),Re.setScale();var Xe=U.baxis=i({},I.baxis,{range:[J-X-ie,oe],side:"bottom",domain:U.xaxis.domain,anchor:"free",position:0,_id:"x",_length:re});a(Xe,U.graphDiv._fullLayout),Xe.setScale();var it=U.caxis=i({},I.caxis,{range:[J-X-oe,ie],side:"right",tickangle:(+I.caxis.tickangle||0)+30,domain:[ze,ze+Ae*u],anchor:"free",position:0,_id:"y",_length:re});a(it,U.graphDiv._fullLayout),it.setScale();var ot="M"+j+","+(ee+ce)+"h"+re+"l-"+re/2+",-"+ce+"Z";U.clipDef.select("path").attr("d",ot),U.layers.plotbg.select("path").attr("d",ot);var tt="M0,"+ce+"h"+re+"l-"+re/2+",-"+ce+"Z";U.clipDefRelative.select("path").attr("d",tt);var lt=e(j,ee);U.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",lt),U.clipDefRelative.select("path").attr("transform",null);var Ee=e(j-Xe._offset,ee+ce);U.layers.baxis.attr("transform",Ee),U.layers.bgrid.attr("transform",Ee);var _e=e(j+re/2,ee)+"rotate(30)"+e(0,-Re._offset);U.layers.aaxis.attr("transform",_e),U.layers.agrid.attr("transform",_e);var fe=e(j+re/2,ee)+"rotate(-30)"+e(0,-it._offset);U.layers.caxis.attr("transform",fe),U.layers.cgrid.attr("transform",fe),U.drawAxes(!0),U.layers.aline.select("path").attr("d",Re.showline?"M"+j+","+(ee+ce)+"l"+re/2+",-"+ce:"M0,0").call(r.stroke,Re.linecolor||"#000").style("stroke-width",(Re.linewidth||0)+"px"),U.layers.bline.select("path").attr("d",Xe.showline?"M"+j+","+(ee+ce)+"h"+re:"M0,0").call(r.stroke,Xe.linecolor||"#000").style("stroke-width",(Xe.linewidth||0)+"px"),U.layers.cline.select("path").attr("d",it.showline?"M"+(j+re/2)+","+ee+"l"+re/2+","+ce:"M0,0").call(r.stroke,it.linecolor||"#000").style("stroke-width",(it.linewidth||0)+"px"),U.graphDiv._context.staticPlot||U.initInteractions(),o.setClipUrl(U.layers.frontplot,U._hasClipOnAxisFalse?null:U.clipId,U.graphDiv)},p.drawAxes=function(I){var N=this,U=N.graphDiv,W=N.id.substr(7)+"title",Q=N.layers,ue=N.aaxis,le=N.baxis,he=N.caxis;if(N.drawAx(ue),N.drawAx(le),N.drawAx(he),I){var G=Math.max(ue.showticklabels?ue.tickfont.size/2:0,(he.showticklabels?he.tickfont.size*.75:0)+(he.ticks==="outside"?he.ticklen*.87:0)),$=(le.showticklabels?le.tickfont.size:0)+(le.ticks==="outside"?le.ticklen:0)+3;Q["a-title"]=l.draw(U,"a"+W,{propContainer:ue,propName:N.id+".aaxis.title",placeholder:t(U,"Click to enter Component A title"),attributes:{x:N.x0+N.w/2,y:N.y0-ue.title.font.size/3-G,"text-anchor":"middle"}}),Q["b-title"]=l.draw(U,"b"+W,{propContainer:le,propName:N.id+".baxis.title",placeholder:t(U,"Click to enter Component B title"),attributes:{x:N.x0-$,y:N.y0+N.h+le.title.font.size*.83+$,"text-anchor":"middle"}}),Q["c-title"]=l.draw(U,"c"+W,{propContainer:he,propName:N.id+".caxis.title",placeholder:t(U,"Click to enter Component C title"),attributes:{x:N.x0+N.w+$,y:N.y0+N.h+he.title.font.size*.83+$,"text-anchor":"middle"}})}},p.drawAx=function(I){var N=this,U=N.graphDiv,W=I._name,Q=W.charAt(0),ue=I._id,le=N.layers[W],he=30,G=Q+"tickLayout",$=m(I);N[G]!==$&&(le.selectAll("."+ue+"tick").remove(),N[G]=$),I.setScale();var J=s.calcTicks(I),X=s.clipEnds(I,J),oe=s.makeTransTickFn(I),ie=s.getTickSigns(I)[2],j=M.deg2rad(he),ee=ie*(I.linewidth||1)/2,re=ie*I.ticklen,ce=N.w,be=N.h,Ae=Q==="b"?"M0,"+ee+"l"+Math.sin(j)*re+","+Math.cos(j)*re:"M"+ee+",0l"+Math.cos(j)*re+","+-Math.sin(j)*re,ze={a:"M0,0l"+be+",-"+ce/2,b:"M0,0l-"+ce/2+",-"+be,c:"M0,0l-"+be+","+ce/2}[Q];s.drawTicks(U,I,{vals:I.ticks==="inside"?X:J,layer:le,path:Ae,transFn:oe,crisp:!1}),s.drawGrid(U,I,{vals:X,layer:N.layers[Q+"grid"],path:ze,transFn:oe,crisp:!1}),s.drawLabels(U,I,{vals:J,layer:le,transFn:oe,labelFns:s.makeLabelFns(I,0,he)})};function m(I){return I.ticks+String(I.ticklen)+String(I.showticklabels)}var h=y.MINZOOM/2+.87,P="m-0.87,.5h"+h+"v3h-"+(h+5.2)+"l"+(h/2+2.6)+",-"+(h*.87+4.5)+"l2.6,1.5l-"+h/2+","+h*.87+"Z",L="m0.87,.5h-"+h+"v3h"+(h+5.2)+"l-"+(h/2+2.6)+",-"+(h*.87+4.5)+"l-2.6,1.5l"+h/2+","+h*.87+"Z",z="m0,1l"+h/2+","+h*.87+"l2.6,-1.5l-"+(h/2+2.6)+",-"+(h*.87+4.5)+"l-"+(h/2+2.6)+","+(h*.87+4.5)+"l2.6,1.5l"+h/2+",-"+h*.87+"Z",F="m0.5,0.5h5v-2h-5v-5h-2v5h-5v2h5v5h2Z",B=!0;p.clearOutline=function(){E(this.dragOptions),S(this.dragOptions.gd)},p.initInteractions=function(){var I=this,N=I.layers.plotbg.select("path").node(),U=I.graphDiv,W=U._fullLayout._zoomlayer,Q,ue;this.dragOptions={element:N,gd:U,plotinfo:{id:I.id,domain:U._fullLayout[I.id].domain,xaxis:I.xaxis,yaxis:I.yaxis},subplot:I.id,prepFn:function(Ee,_e,fe){I.dragOptions.xaxes=[I.xaxis],I.dragOptions.yaxes=[I.yaxis],Q=U._fullLayout._invScaleX,ue=U._fullLayout._invScaleY;var Fe=I.dragOptions.dragmode=U._fullLayout.dragmode;v(Fe)?I.dragOptions.minDrag=1:I.dragOptions.minDrag=void 0,Fe==="zoom"?(I.dragOptions.moveFn=Xe,I.dragOptions.clickFn=ce,I.dragOptions.doneFn=it,be(Ee,_e,fe)):Fe==="pan"?(I.dragOptions.moveFn=tt,I.dragOptions.clickFn=ce,I.dragOptions.doneFn=lt,ot(),I.clearOutline(U)):(T(Fe)||v(Fe))&&_(Ee,_e,fe,I.dragOptions,Fe)}};var le,he,G,$,J,X,oe,ie,j,ee;function re(Ee){var _e={};return _e[I.id+".aaxis.min"]=Ee.a,_e[I.id+".baxis.min"]=Ee.b,_e[I.id+".caxis.min"]=Ee.c,_e}function ce(Ee,_e){var fe=U._fullLayout.clickmode;O(U),Ee===2&&(U.emit("plotly_doubleclick",null),A.call("_guiRelayout",U,re({a:0,b:0,c:0}))),fe.indexOf("select")>-1&&Ee===1&&w(_e,U,[I.xaxis],[I.yaxis],I.id,I.dragOptions),fe.indexOf("event")>-1&&f.click(U,_e,I.id)}function be(Ee,_e,fe){var Fe=N.getBoundingClientRect();le=_e-Fe.left,he=fe-Fe.top,U._fullLayout._calcInverseTransform(U);var rt=U._fullLayout._invTransform,st=M.apply3DTransform(rt)(le,he);le=st[0],he=st[1],G={a:I.aaxis.range[0],b:I.baxis.range[1],c:I.caxis.range[1]},J=G,$=I.aaxis.range[1]-G.a,X=x(I.graphDiv._fullLayout[I.id].bgcolor).getLuminance(),oe="M0,"+I.h+"L"+I.w/2+", 0L"+I.w+","+I.h+"Z",ie=!1,j=W.append("path").attr("class","zoombox").attr("transform",e(I.x0,I.y0)).style({fill:X>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("d",oe),ee=W.append("path").attr("class","zoombox-corners").attr("transform",e(I.x0,I.y0)).style({fill:r.background,stroke:r.defaultLine,"stroke-width":1,opacity:0}).attr("d","M0,0Z"),I.clearOutline(U)}function Ae(Ee,_e){return 1-_e/I.h}function ze(Ee,_e){return 1-(Ee+(I.h-_e)/Math.sqrt(3))/I.w}function Re(Ee,_e){return(Ee-(I.h-_e)/Math.sqrt(3))/I.w}function Xe(Ee,_e){var fe=le+Ee*Q,Fe=he+_e*ue,rt=Math.max(0,Math.min(1,Ae(le,he),Ae(fe,Fe))),st=Math.max(0,Math.min(1,ze(le,he),ze(fe,Fe))),Qe=Math.max(0,Math.min(1,Re(le,he),Re(fe,Fe))),Lt=(rt/2+Qe)*I.w,kt=(1-rt/2-st)*I.w,Vt=(Lt+kt)/2,Zt=kt-Lt,Sr=(1-rt)*I.h,xr=Sr-Zt/u;Zt.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),ee.transition().style("opacity",1).duration(200),ie=!0),U.emit("plotly_relayouting",re(J))}function it(){O(U),J!==G&&(A.call("_guiRelayout",U,re(J)),B&&U.data&&U._context.showTips&&(M.notifier(t(U,"Double-click to zoom back out"),"long"),B=!1))}function ot(){G={a:I.aaxis.range[0],b:I.baxis.range[1],c:I.caxis.range[1]},J=G}function tt(Ee,_e){var fe=Ee/I.xaxis._m,Fe=_e/I.yaxis._m;J={a:G.a-Fe,b:G.b+(fe+Fe)/2,c:G.c-(fe-Fe)/2};var rt=[J.a,J.b,J.c].sort(M.sorterAsc),st={a:rt.indexOf(J.a),b:rt.indexOf(J.b),c:rt.indexOf(J.c)};rt[0]<0&&(rt[1]+rt[0]/2<0?(rt[2]+=rt[0]+rt[1],rt[0]=rt[1]=0):(rt[2]+=rt[0]/2,rt[1]+=rt[0]/2,rt[0]=0),J={a:rt[st.a],b:rt[st.b],c:rt[st.c]},_e=(G.a-J.a)*I.yaxis._m,Ee=(G.c-J.c-G.b+J.b)*I.xaxis._m);var Qe=e(I.x0+Ee,I.y0+_e);I.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",Qe);var Lt=e(-Ee,-_e);I.clipDefRelative.select("path").attr("transform",Lt),I.aaxis.range=[J.a,I.sum-J.b-J.c],I.baxis.range=[I.sum-J.a-J.c,J.b],I.caxis.range=[I.sum-J.a-J.b,J.c],I.drawAxes(!1),I._hasClipOnAxisFalse&&I.plotContainer.select(".scatterlayer").selectAll(".trace").call(o.hideOutsideRangePoints,I),U.emit("plotly_relayouting",re(J))}function lt(){A.call("_guiRelayout",U,re(J))}N.onmousemove=function(Ee){f.hover(U,Ee,I.id),U._fullLayout._lasthover=N,U._fullLayout._hoversubplot=I.id},N.onmouseout=function(Ee){U._dragging||c.unhover(U,Ee)},c.init(this.dragOptions)};function O(I){d.select(I).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}}}),AS=Ze({"src/plots/ternary/layout_attributes.js"(Z,q){"use strict";var d=oh(),x=bc().attributes,A=Wh(),M=pc().overrideAll,e=rs().extendFlat,t={title:{text:A.title.text,font:A.title.font},color:A.color,tickmode:A.minor.tickmode,nticks:e({},A.nticks,{dflt:6,min:1}),tick0:A.tick0,dtick:A.dtick,tickvals:A.tickvals,ticktext:A.ticktext,ticks:A.ticks,ticklen:A.ticklen,tickwidth:A.tickwidth,tickcolor:A.tickcolor,ticklabelstep:A.ticklabelstep,showticklabels:A.showticklabels,labelalias:A.labelalias,showtickprefix:A.showtickprefix,tickprefix:A.tickprefix,showticksuffix:A.showticksuffix,ticksuffix:A.ticksuffix,showexponent:A.showexponent,exponentformat:A.exponentformat,minexponent:A.minexponent,separatethousands:A.separatethousands,tickfont:A.tickfont,tickangle:A.tickangle,tickformat:A.tickformat,tickformatstops:A.tickformatstops,hoverformat:A.hoverformat,showline:e({},A.showline,{dflt:!0}),linecolor:A.linecolor,linewidth:A.linewidth,showgrid:e({},A.showgrid,{dflt:!0}),gridcolor:A.gridcolor,gridwidth:A.gridwidth,griddash:A.griddash,layer:A.layer,min:{valType:"number",dflt:0,min:0}},r=q.exports=M({domain:x({name:"ternary"}),bgcolor:{valType:"color",dflt:d.background},sum:{valType:"number",dflt:1,min:0},aaxis:t,baxis:t,caxis:t},"plot","from-root");r.uirevision={valType:"any",editType:"none"},r.aaxis.uirevision=r.baxis.uirevision=r.caxis.uirevision={valType:"any",editType:"none"}}}),i0=Ze({"src/plots/subplot_defaults.js"(Z,q){"use strict";var d=ca(),x=Dl(),A=bc().defaults;q.exports=function(e,t,r,o){var a=o.type,i=o.attributes,n=o.handleDefaults,s=o.partition||"x",c=t._subplots[a],f=c.length,g=f&&c[0].replace(/\d+$/,""),v,T;function l(E,y){return d.coerce(v,T,i,E,y)}for(var _=0;_=_&&(b.min=0,p.min=0,u.min=0,f.aaxis&&delete f.aaxis.min,f.baxis&&delete f.baxis.min,f.caxis&&delete f.caxis.min)}function c(f,g,v,T){var l=i[g._name];function _(m,h){return A.coerce(f,g,l,m,h)}_("uirevision",T.uirevision),g.type="linear";var w=_("color"),S=w!==l.color.dflt?w:v.font.color,E=g._name,y=E.charAt(0).toUpperCase(),b="Component "+y,p=_("title.text",b);g._hovertitle=p===b?p:y,A.coerceFont(_,"title.font",v.font,{overrideDflt:{size:A.bigFont(v.font.size),color:S}}),_("min"),o(f,g,_,"linear"),t(f,g,_,"linear"),e(f,g,_,"linear",{noAutotickangles:!0,noTicklabelshift:!0,noTicklabelstandoff:!0}),r(f,g,_,{outerTicks:!0});var u=_("showticklabels");u&&(A.coerceFont(_,"tickfont",v.font,{overrideDflt:{color:S}}),_("tickangle"),_("tickformat")),a(f,g,_,{dfltColor:w,bgColor:v.bgColor,blend:60,showLine:!0,showGrid:!0,noZeroLine:!0,attributes:l}),_("hoverformat"),_("layer")}}}),CF=Ze({"src/plots/ternary/index.js"(Z){"use strict";var q=MF(),d=Hh().getSubplotCalcData,x=ca().counterRegex,A="ternary";Z.name=A;var M=Z.attr="subplot";Z.idRoot=A,Z.idRegex=Z.attrRegex=x(A);var e=Z.attributes={};e[M]={valType:"subplotid",dflt:"ternary",editType:"calc"},Z.layoutAttributes=AS(),Z.supplyLayoutDefaults=EF(),Z.plot=function(r){for(var o=r._fullLayout,a=r.calcdata,i=o._subplots[A],n=0;n0){var E=r.xa,y=r.ya,b,p,u,m,h;f.orientation==="h"?(h=o,b="y",u=y,p="x",m=E):(h=a,b="x",u=E,p="y",m=y);var P=c[r.index];if(h>=P.span[0]&&h<=P.span[1]){var L=x.extendFlat({},r),z=m.c2p(h,!0),F=e.getKdeValue(P,f,h),B=e.getPositionOnKdePath(P,f,z),O=u._offset,I=u._length;L[b+"0"]=B[0],L[b+"1"]=B[1],L[p+"0"]=L[p+"1"]=z,L[p+"Label"]=p+": "+A.hoverLabelText(m,h,f[p+"hoverformat"])+", "+c[0].t.labels.kde+" "+F.toFixed(3);for(var N=0,U=0;U path").each(function(v){if(!v.isBlank){var T=g.marker;d.select(this).call(A.fill,v.mc||T.color).call(A.stroke,v.mlc||T.line.color).call(x.dashLine,T.line.dash,v.mlw||T.line.width).style("opacity",g.selectedpoints&&!v.selected?M:1)}}),r(f,g,a),f.selectAll(".regions").each(function(){d.select(this).selectAll("path").style("stroke-width",0).call(A.fill,g.connector.fillcolor)}),f.selectAll(".lines").each(function(){var v=g.connector.line;x.lineGroupStyle(d.select(this).selectAll("path"),v.width,v.color,v.dash)})})}q.exports={style:o}}}),XF=Ze({"src/traces/funnel/hover.js"(Z,q){"use strict";var d=Yn().opacity,x=f1().hoverOnBars,A=ca().formatPercent;q.exports=function(t,r,o,a,i){var n=x(t,r,o,a,i);if(n){var s=n.cd,c=s[0].trace,f=c.orientation==="h",g=n.index,v=s[g],T=f?"x":"y";n[T+"LabelVal"]=v.s,n.percentInitial=v.begR,n.percentInitialLabel=A(v.begR,1),n.percentPrevious=v.difR,n.percentPreviousLabel=A(v.difR,1),n.percentTotal=v.sumR,n.percentTotalLabel=A(v.sumR,1);var l=v.hi||c.hoverinfo,_=[];if(l&&l!=="none"&&l!=="skip"){var w=l==="all",S=l.split("+"),E=function(y){return w||S.indexOf(y)!==-1};E("percent initial")&&_.push(n.percentInitialLabel+" of initial"),E("percent previous")&&_.push(n.percentPreviousLabel+" of previous"),E("percent total")&&_.push(n.percentTotalLabel+" of total")}return n.extraText=_.join("
"),n.color=M(c,v),[n]}};function M(e,t){var r=e.marker,o=t.mc||r.color,a=t.mlc||r.line.color,i=t.mlw||r.line.width;if(d(o))return o;if(d(a)&&i)return a}}}),ZF=Ze({"src/traces/funnel/event_data.js"(Z,q){"use strict";q.exports=function(x,A){return x.x="xVal"in A?A.xVal:A.x,x.y="yVal"in A?A.yVal:A.y,"percentInitial"in A&&(x.percentInitial=A.percentInitial),"percentPrevious"in A&&(x.percentPrevious=A.percentPrevious),"percentTotal"in A&&(x.percentTotal=A.percentTotal),A.xa&&(x.xaxis=A.xa),A.ya&&(x.yaxis=A.ya),x}}}),YF=Ze({"src/traces/funnel/index.js"(Z,q){"use strict";q.exports={attributes:ES(),layoutAttributes:CS(),supplyDefaults:kS().supplyDefaults,crossTraceDefaults:kS().crossTraceDefaults,supplyLayoutDefaults:jF(),calc:VF(),crossTraceCalc:GF(),plot:HF(),style:WF().style,hoverPoints:XF(),eventData:ZF(),selectPoints:h1(),moduleType:"trace",name:"funnel",basePlotModule:Zf(),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}}}),KF=Ze({"lib/funnel.js"(Z,q){"use strict";q.exports=YF()}}),JF=Ze({"src/traces/waterfall/constants.js"(Z,q){"use strict";q.exports={eventDataKeys:["initial","delta","final"]}}}),LS=Ze({"src/traces/waterfall/attributes.js"(Z,q){"use strict";var d=Sv(),x=tf().line,A=eu(),M=Qc().axisHoverFormat,e=Cs().hovertemplateAttrs,t=Cs().texttemplateAttrs,r=JF(),o=rs().extendFlat,a=Yn();function i(n){return{marker:{color:o({},d.marker.color,{arrayOk:!1,editType:"style"}),line:{color:o({},d.marker.line.color,{arrayOk:!1,editType:"style"}),width:o({},d.marker.line.width,{arrayOk:!1,editType:"style"}),editType:"style"},editType:"style"},editType:"style"}}q.exports={measure:{valType:"data_array",dflt:[],editType:"calc"},base:{valType:"number",dflt:null,arrayOk:!1,editType:"calc"},x:d.x,x0:d.x0,dx:d.dx,y:d.y,y0:d.y0,dy:d.dy,xperiod:d.xperiod,yperiod:d.yperiod,xperiod0:d.xperiod0,yperiod0:d.yperiod0,xperiodalignment:d.xperiodalignment,yperiodalignment:d.yperiodalignment,xhoverformat:M("x"),yhoverformat:M("y"),hovertext:d.hovertext,hovertemplate:e({},{keys:r.eventDataKeys}),hoverinfo:o({},A.hoverinfo,{flags:["name","x","y","text","initial","delta","final"]}),textinfo:{valType:"flaglist",flags:["label","text","initial","delta","final"],extras:["none"],editType:"plot",arrayOk:!1},texttemplate:t({editType:"plot"},{keys:r.eventDataKeys.concat(["label"])}),text:d.text,textposition:d.textposition,insidetextanchor:d.insidetextanchor,textangle:d.textangle,textfont:d.textfont,insidetextfont:d.insidetextfont,outsidetextfont:d.outsidetextfont,constraintext:d.constraintext,cliponaxis:d.cliponaxis,orientation:d.orientation,offset:d.offset,width:d.width,increasing:i("increasing"),decreasing:i("decreasing"),totals:i("intermediate sums and total"),connector:{line:{color:o({},x.color,{dflt:a.defaultLine}),width:o({},x.width,{editType:"plot"}),dash:x.dash,editType:"plot"},mode:{valType:"enumerated",values:["spanning","between"],dflt:"between",editType:"plot"},visible:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},offsetgroup:d.offsetgroup,alignmentgroup:d.alignmentgroup,zorder:d.zorder}}}),PS=Ze({"src/traces/waterfall/layout_attributes.js"(Z,q){"use strict";q.exports={waterfallmode:{valType:"enumerated",values:["group","overlay"],dflt:"group",editType:"calc"},waterfallgap:{valType:"number",min:0,max:1,editType:"calc"},waterfallgroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}}}),d1=Ze({"src/constants/delta.js"(Z,q){"use strict";q.exports={INCREASING:{COLOR:"#3D9970",SYMBOL:"\u25B2"},DECREASING:{COLOR:"#FF4136",SYMBOL:"\u25BC"}}}}),IS=Ze({"src/traces/waterfall/defaults.js"(Z,q){"use strict";var d=ca(),x=J0(),A=gd().handleText,M=n1(),e=Qd(),t=LS(),r=Yn(),o=d1(),a=o.INCREASING.COLOR,i=o.DECREASING.COLOR,n="#4499FF";function s(g,v,T){g(v+".marker.color",T),g(v+".marker.line.color",r.defaultLine),g(v+".marker.line.width")}function c(g,v,T,l){function _(b,p){return d.coerce(g,v,t,b,p)}var w=M(g,v,l,_);if(!w){v.visible=!1;return}e(g,v,l,_),_("xhoverformat"),_("yhoverformat"),_("measure"),_("orientation",v.x&&!v.y?"h":"v"),_("base"),_("offset"),_("width"),_("text"),_("hovertext"),_("hovertemplate");var S=_("textposition");A(g,v,l,_,S,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),v.textposition!=="none"&&(_("texttemplate"),v.texttemplate||_("textinfo")),s(_,"increasing",a),s(_,"decreasing",i),s(_,"totals",n);var E=_("connector.visible");if(E){_("connector.mode");var y=_("connector.line.width");y&&(_("connector.line.color"),_("connector.line.dash"))}_("zorder")}function f(g,v){var T,l;function _(S){return d.coerce(l._input,l,t,S)}if(v.waterfallmode==="group")for(var w=0;w0&&(_?h+="M"+u[0]+","+m[1]+"V"+m[0]:h+="M"+u[1]+","+m[0]+"H"+u[0]),w!=="between"&&(y.isSum||b path").each(function(v){if(!v.isBlank){var T=g[v.dir].marker;d.select(this).call(A.fill,T.color).call(A.stroke,T.line.color).call(x.dashLine,T.line.dash,T.line.width).style("opacity",g.selectedpoints&&!v.selected?M:1)}}),r(f,g,a),f.selectAll(".lines").each(function(){var v=g.connector.line;x.lineGroupStyle(d.select(this).selectAll("path"),v.width,v.color,v.dash)})})}q.exports={style:o}}}),aO=Ze({"src/traces/waterfall/hover.js"(Z,q){"use strict";var d=Wo().hoverLabelText,x=Yn().opacity,A=f1().hoverOnBars,M=d1(),e={increasing:M.INCREASING.SYMBOL,decreasing:M.DECREASING.SYMBOL};q.exports=function(o,a,i,n,s){var c=A(o,a,i,n,s);if(!c)return;var f=c.cd,g=f[0].trace,v=g.orientation==="h",T=v?"x":"y",l=v?o.xa:o.ya;function _(P){return d(l,P,g[T+"hoverformat"])}var w=c.index,S=f[w],E=S.isSum?S.b+S.s:S.rawS;c.initial=S.b+S.s-E,c.delta=E,c.final=c.initial+c.delta;var y=_(Math.abs(c.delta));c.deltaLabel=E<0?"("+y+")":y,c.finalLabel=_(c.final),c.initialLabel=_(c.initial);var b=S.hi||g.hoverinfo,p=[];if(b&&b!=="none"&&b!=="skip"){var u=b==="all",m=b.split("+"),h=function(P){return u||m.indexOf(P)!==-1};S.isSum||(h("final")&&(v?!h("x"):!h("y"))&&p.push(c.finalLabel),h("delta")&&(E<0?p.push(c.deltaLabel+" "+e.decreasing):p.push(c.deltaLabel+" "+e.increasing)),h("initial")&&p.push("Initial: "+c.initialLabel))}return p.length&&(c.extraText=p.join("
")),c.color=t(g,S),[c]};function t(r,o){var a=r[o.dir].marker,i=a.color,n=a.line.color,s=a.line.width;if(x(i))return i;if(x(n)&&s)return n}}}),iO=Ze({"src/traces/waterfall/event_data.js"(Z,q){"use strict";q.exports=function(x,A){return x.x="xVal"in A?A.xVal:A.x,x.y="yVal"in A?A.yVal:A.y,"initial"in A&&(x.initial=A.initial),"delta"in A&&(x.delta=A.delta),"final"in A&&(x.final=A.final),A.xa&&(x.xaxis=A.xa),A.ya&&(x.yaxis=A.ya),x}}}),nO=Ze({"src/traces/waterfall/index.js"(Z,q){"use strict";q.exports={attributes:LS(),layoutAttributes:PS(),supplyDefaults:IS().supplyDefaults,crossTraceDefaults:IS().crossTraceDefaults,supplyLayoutDefaults:$F(),calc:QF(),crossTraceCalc:eO(),plot:tO(),style:rO().style,hoverPoints:aO(),eventData:iO(),selectPoints:h1(),moduleType:"trace",name:"waterfall",basePlotModule:Zf(),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}}}),oO=Ze({"lib/waterfall.js"(Z,q){"use strict";q.exports=nO()}}),v1=Ze({"src/traces/image/constants.js"(Z,q){"use strict";q.exports={colormodel:{rgb:{min:[0,0,0],max:[255,255,255],fmt:function(d){return d.slice(0,3)},suffix:["","",""]},rgba:{min:[0,0,0,0],max:[255,255,255,1],fmt:function(d){return d.slice(0,4)},suffix:["","","",""]},rgba256:{colormodel:"rgba",zminDflt:[0,0,0,0],zmaxDflt:[255,255,255,255],min:[0,0,0,0],max:[255,255,255,1],fmt:function(d){return d.slice(0,4)},suffix:["","","",""]},hsl:{min:[0,0,0],max:[360,100,100],fmt:function(d){var x=d.slice(0,3);return x[1]=x[1]+"%",x[2]=x[2]+"%",x},suffix:["\xB0","%","%"]},hsla:{min:[0,0,0,0],max:[360,100,100,1],fmt:function(d){var x=d.slice(0,4);return x[1]=x[1]+"%",x[2]=x[2]+"%",x},suffix:["\xB0","%","%",""]}}}}}),RS=Ze({"src/traces/image/attributes.js"(Z,q){"use strict";var d=eu(),x=tf().zorder,A=Cs().hovertemplateAttrs,M=rs().extendFlat,e=v1().colormodel,t=["rgb","rgba","rgba256","hsl","hsla"],r=[],o=[];for(i=0;i0)throw new Error("Invalid string. Length must be a multiple of 4");var g=c.indexOf("=");g===-1&&(g=f);var v=g===f?0:4-g%4;return[g,v]}function r(c){var f=t(c),g=f[0],v=f[1];return(g+v)*3/4-v}function o(c,f,g){return(f+g)*3/4-g}function a(c){var f,g=t(c),v=g[0],T=g[1],l=new x(o(c,v,T)),_=0,w=T>0?v-4:v,S;for(S=0;S>16&255,l[_++]=f>>8&255,l[_++]=f&255;return T===2&&(f=d[c.charCodeAt(S)]<<2|d[c.charCodeAt(S+1)]>>4,l[_++]=f&255),T===1&&(f=d[c.charCodeAt(S)]<<10|d[c.charCodeAt(S+1)]<<4|d[c.charCodeAt(S+2)]>>2,l[_++]=f>>8&255,l[_++]=f&255),l}function i(c){return q[c>>18&63]+q[c>>12&63]+q[c>>6&63]+q[c&63]}function n(c,f,g){for(var v,T=[],l=f;lw?w:_+l));return v===1?(f=c[g-1],T.push(q[f>>2]+q[f<<4&63]+"==")):v===2&&(f=(c[g-2]<<8)+c[g-1],T.push(q[f>>10]+q[f>>4&63]+q[f<<2&63]+"=")),T.join("")}}}),uO=Ze({"node_modules/ieee754/index.js"(Z){Z.read=function(q,d,x,A,M){var e,t,r=M*8-A-1,o=(1<>1,i=-7,n=x?M-1:0,s=x?-1:1,c=q[d+n];for(n+=s,e=c&(1<<-i)-1,c>>=-i,i+=r;i>0;e=e*256+q[d+n],n+=s,i-=8);for(t=e&(1<<-i)-1,e>>=-i,i+=A;i>0;t=t*256+q[d+n],n+=s,i-=8);if(e===0)e=1-a;else{if(e===o)return t?NaN:(c?-1:1)*(1/0);t=t+Math.pow(2,A),e=e-a}return(c?-1:1)*t*Math.pow(2,e-A)},Z.write=function(q,d,x,A,M,e){var t,r,o,a=e*8-M-1,i=(1<>1,s=M===23?Math.pow(2,-24)-Math.pow(2,-77):0,c=A?0:e-1,f=A?1:-1,g=d<0||d===0&&1/d<0?1:0;for(d=Math.abs(d),isNaN(d)||d===1/0?(r=isNaN(d)?1:0,t=i):(t=Math.floor(Math.log(d)/Math.LN2),d*(o=Math.pow(2,-t))<1&&(t--,o*=2),t+n>=1?d+=s/o:d+=s*Math.pow(2,1-n),d*o>=2&&(t++,o/=2),t+n>=i?(r=0,t=i):t+n>=1?(r=(d*o-1)*Math.pow(2,M),t=t+n):(r=d*Math.pow(2,n-1)*Math.pow(2,M),t=0));M>=8;q[x+c]=r&255,c+=f,r/=256,M-=8);for(t=t<0;q[x+c]=t&255,c+=f,t/=256,a-=8);q[x+c-f]|=g*128}}}),tg=Ze({"node_modules/buffer/index.js"(Z){"use strict";var q=lO(),d=uO(),x=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Z.Buffer=t,Z.SlowBuffer=T,Z.INSPECT_MAX_BYTES=50;var A=2147483647;Z.kMaxLength=A,t.TYPED_ARRAY_SUPPORT=M(),!t.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function M(){try{let Ee=new Uint8Array(1),_e={foo:function(){return 42}};return Object.setPrototypeOf(_e,Uint8Array.prototype),Object.setPrototypeOf(Ee,_e),Ee.foo()===42}catch{return!1}}Object.defineProperty(t.prototype,"parent",{enumerable:!0,get:function(){if(t.isBuffer(this))return this.buffer}}),Object.defineProperty(t.prototype,"offset",{enumerable:!0,get:function(){if(t.isBuffer(this))return this.byteOffset}});function e(Ee){if(Ee>A)throw new RangeError('The value "'+Ee+'" is invalid for option "size"');let _e=new Uint8Array(Ee);return Object.setPrototypeOf(_e,t.prototype),_e}function t(Ee,_e,fe){if(typeof Ee=="number"){if(typeof _e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return i(Ee)}return r(Ee,_e,fe)}t.poolSize=8192;function r(Ee,_e,fe){if(typeof Ee=="string")return n(Ee,_e);if(ArrayBuffer.isView(Ee))return c(Ee);if(Ee==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Ee);if(Xe(Ee,ArrayBuffer)||Ee&&Xe(Ee.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Xe(Ee,SharedArrayBuffer)||Ee&&Xe(Ee.buffer,SharedArrayBuffer)))return f(Ee,_e,fe);if(typeof Ee=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let Fe=Ee.valueOf&&Ee.valueOf();if(Fe!=null&&Fe!==Ee)return t.from(Fe,_e,fe);let rt=g(Ee);if(rt)return rt;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof Ee[Symbol.toPrimitive]=="function")return t.from(Ee[Symbol.toPrimitive]("string"),_e,fe);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Ee)}t.from=function(Ee,_e,fe){return r(Ee,_e,fe)},Object.setPrototypeOf(t.prototype,Uint8Array.prototype),Object.setPrototypeOf(t,Uint8Array);function o(Ee){if(typeof Ee!="number")throw new TypeError('"size" argument must be of type number');if(Ee<0)throw new RangeError('The value "'+Ee+'" is invalid for option "size"')}function a(Ee,_e,fe){return o(Ee),Ee<=0?e(Ee):_e!==void 0?typeof fe=="string"?e(Ee).fill(_e,fe):e(Ee).fill(_e):e(Ee)}t.alloc=function(Ee,_e,fe){return a(Ee,_e,fe)};function i(Ee){return o(Ee),e(Ee<0?0:v(Ee)|0)}t.allocUnsafe=function(Ee){return i(Ee)},t.allocUnsafeSlow=function(Ee){return i(Ee)};function n(Ee,_e){if((typeof _e!="string"||_e==="")&&(_e="utf8"),!t.isEncoding(_e))throw new TypeError("Unknown encoding: "+_e);let fe=l(Ee,_e)|0,Fe=e(fe),rt=Fe.write(Ee,_e);return rt!==fe&&(Fe=Fe.slice(0,rt)),Fe}function s(Ee){let _e=Ee.length<0?0:v(Ee.length)|0,fe=e(_e);for(let Fe=0;Fe<_e;Fe+=1)fe[Fe]=Ee[Fe]&255;return fe}function c(Ee){if(Xe(Ee,Uint8Array)){let _e=new Uint8Array(Ee);return f(_e.buffer,_e.byteOffset,_e.byteLength)}return s(Ee)}function f(Ee,_e,fe){if(_e<0||Ee.byteLength<_e)throw new RangeError('"offset" is outside of buffer bounds');if(Ee.byteLength<_e+(fe||0))throw new RangeError('"length" is outside of buffer bounds');let Fe;return _e===void 0&&fe===void 0?Fe=new Uint8Array(Ee):fe===void 0?Fe=new Uint8Array(Ee,_e):Fe=new Uint8Array(Ee,_e,fe),Object.setPrototypeOf(Fe,t.prototype),Fe}function g(Ee){if(t.isBuffer(Ee)){let _e=v(Ee.length)|0,fe=e(_e);return fe.length===0||Ee.copy(fe,0,0,_e),fe}if(Ee.length!==void 0)return typeof Ee.length!="number"||it(Ee.length)?e(0):s(Ee);if(Ee.type==="Buffer"&&Array.isArray(Ee.data))return s(Ee.data)}function v(Ee){if(Ee>=A)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+A.toString(16)+" bytes");return Ee|0}function T(Ee){return+Ee!=Ee&&(Ee=0),t.alloc(+Ee)}t.isBuffer=function(_e){return _e!=null&&_e._isBuffer===!0&&_e!==t.prototype},t.compare=function(_e,fe){if(Xe(_e,Uint8Array)&&(_e=t.from(_e,_e.offset,_e.byteLength)),Xe(fe,Uint8Array)&&(fe=t.from(fe,fe.offset,fe.byteLength)),!t.isBuffer(_e)||!t.isBuffer(fe))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(_e===fe)return 0;let Fe=_e.length,rt=fe.length;for(let st=0,Qe=Math.min(Fe,rt);strt.length?(t.isBuffer(Qe)||(Qe=t.from(Qe)),Qe.copy(rt,st)):Uint8Array.prototype.set.call(rt,Qe,st);else if(t.isBuffer(Qe))Qe.copy(rt,st);else throw new TypeError('"list" argument must be an Array of Buffers');st+=Qe.length}return rt};function l(Ee,_e){if(t.isBuffer(Ee))return Ee.length;if(ArrayBuffer.isView(Ee)||Xe(Ee,ArrayBuffer))return Ee.byteLength;if(typeof Ee!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof Ee);let fe=Ee.length,Fe=arguments.length>2&&arguments[2]===!0;if(!Fe&&fe===0)return 0;let rt=!1;for(;;)switch(_e){case"ascii":case"latin1":case"binary":return fe;case"utf8":case"utf-8":return ce(Ee).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return fe*2;case"hex":return fe>>>1;case"base64":return ze(Ee).length;default:if(rt)return Fe?-1:ce(Ee).length;_e=(""+_e).toLowerCase(),rt=!0}}t.byteLength=l;function _(Ee,_e,fe){let Fe=!1;if((_e===void 0||_e<0)&&(_e=0),_e>this.length||((fe===void 0||fe>this.length)&&(fe=this.length),fe<=0)||(fe>>>=0,_e>>>=0,fe<=_e))return"";for(Ee||(Ee="utf8");;)switch(Ee){case"hex":return O(this,_e,fe);case"utf8":case"utf-8":return P(this,_e,fe);case"ascii":return F(this,_e,fe);case"latin1":case"binary":return B(this,_e,fe);case"base64":return h(this,_e,fe);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,_e,fe);default:if(Fe)throw new TypeError("Unknown encoding: "+Ee);Ee=(Ee+"").toLowerCase(),Fe=!0}}t.prototype._isBuffer=!0;function w(Ee,_e,fe){let Fe=Ee[_e];Ee[_e]=Ee[fe],Ee[fe]=Fe}t.prototype.swap16=function(){let _e=this.length;if(_e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let fe=0;fe<_e;fe+=2)w(this,fe,fe+1);return this},t.prototype.swap32=function(){let _e=this.length;if(_e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let fe=0;fe<_e;fe+=4)w(this,fe,fe+3),w(this,fe+1,fe+2);return this},t.prototype.swap64=function(){let _e=this.length;if(_e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let fe=0;fe<_e;fe+=8)w(this,fe,fe+7),w(this,fe+1,fe+6),w(this,fe+2,fe+5),w(this,fe+3,fe+4);return this},t.prototype.toString=function(){let _e=this.length;return _e===0?"":arguments.length===0?P(this,0,_e):_.apply(this,arguments)},t.prototype.toLocaleString=t.prototype.toString,t.prototype.equals=function(_e){if(!t.isBuffer(_e))throw new TypeError("Argument must be a Buffer");return this===_e?!0:t.compare(this,_e)===0},t.prototype.inspect=function(){let _e="",fe=Z.INSPECT_MAX_BYTES;return _e=this.toString("hex",0,fe).replace(/(.{2})/g,"$1 ").trim(),this.length>fe&&(_e+=" ... "),""},x&&(t.prototype[x]=t.prototype.inspect),t.prototype.compare=function(_e,fe,Fe,rt,st){if(Xe(_e,Uint8Array)&&(_e=t.from(_e,_e.offset,_e.byteLength)),!t.isBuffer(_e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof _e);if(fe===void 0&&(fe=0),Fe===void 0&&(Fe=_e?_e.length:0),rt===void 0&&(rt=0),st===void 0&&(st=this.length),fe<0||Fe>_e.length||rt<0||st>this.length)throw new RangeError("out of range index");if(rt>=st&&fe>=Fe)return 0;if(rt>=st)return-1;if(fe>=Fe)return 1;if(fe>>>=0,Fe>>>=0,rt>>>=0,st>>>=0,this===_e)return 0;let Qe=st-rt,Lt=Fe-fe,kt=Math.min(Qe,Lt),Vt=this.slice(rt,st),Zt=_e.slice(fe,Fe);for(let Sr=0;Sr2147483647?fe=2147483647:fe<-2147483648&&(fe=-2147483648),fe=+fe,it(fe)&&(fe=rt?0:Ee.length-1),fe<0&&(fe=Ee.length+fe),fe>=Ee.length){if(rt)return-1;fe=Ee.length-1}else if(fe<0)if(rt)fe=0;else return-1;if(typeof _e=="string"&&(_e=t.from(_e,Fe)),t.isBuffer(_e))return _e.length===0?-1:E(Ee,_e,fe,Fe,rt);if(typeof _e=="number")return _e=_e&255,typeof Uint8Array.prototype.indexOf=="function"?rt?Uint8Array.prototype.indexOf.call(Ee,_e,fe):Uint8Array.prototype.lastIndexOf.call(Ee,_e,fe):E(Ee,[_e],fe,Fe,rt);throw new TypeError("val must be string, number or Buffer")}function E(Ee,_e,fe,Fe,rt){let st=1,Qe=Ee.length,Lt=_e.length;if(Fe!==void 0&&(Fe=String(Fe).toLowerCase(),Fe==="ucs2"||Fe==="ucs-2"||Fe==="utf16le"||Fe==="utf-16le")){if(Ee.length<2||_e.length<2)return-1;st=2,Qe/=2,Lt/=2,fe/=2}function kt(Zt,Sr){return st===1?Zt[Sr]:Zt.readUInt16BE(Sr*st)}let Vt;if(rt){let Zt=-1;for(Vt=fe;VtQe&&(fe=Qe-Lt),Vt=fe;Vt>=0;Vt--){let Zt=!0;for(let Sr=0;Srrt&&(Fe=rt)):Fe=rt;let st=_e.length;Fe>st/2&&(Fe=st/2);let Qe;for(Qe=0;Qe>>0,isFinite(Fe)?(Fe=Fe>>>0,rt===void 0&&(rt="utf8")):(rt=Fe,Fe=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let st=this.length-fe;if((Fe===void 0||Fe>st)&&(Fe=st),_e.length>0&&(Fe<0||fe<0)||fe>this.length)throw new RangeError("Attempt to write outside buffer bounds");rt||(rt="utf8");let Qe=!1;for(;;)switch(rt){case"hex":return y(this,_e,fe,Fe);case"utf8":case"utf-8":return b(this,_e,fe,Fe);case"ascii":case"latin1":case"binary":return p(this,_e,fe,Fe);case"base64":return u(this,_e,fe,Fe);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return m(this,_e,fe,Fe);default:if(Qe)throw new TypeError("Unknown encoding: "+rt);rt=(""+rt).toLowerCase(),Qe=!0}},t.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function h(Ee,_e,fe){return _e===0&&fe===Ee.length?q.fromByteArray(Ee):q.fromByteArray(Ee.slice(_e,fe))}function P(Ee,_e,fe){fe=Math.min(Ee.length,fe);let Fe=[],rt=_e;for(;rt239?4:st>223?3:st>191?2:1;if(rt+Lt<=fe){let kt,Vt,Zt,Sr;switch(Lt){case 1:st<128&&(Qe=st);break;case 2:kt=Ee[rt+1],(kt&192)===128&&(Sr=(st&31)<<6|kt&63,Sr>127&&(Qe=Sr));break;case 3:kt=Ee[rt+1],Vt=Ee[rt+2],(kt&192)===128&&(Vt&192)===128&&(Sr=(st&15)<<12|(kt&63)<<6|Vt&63,Sr>2047&&(Sr<55296||Sr>57343)&&(Qe=Sr));break;case 4:kt=Ee[rt+1],Vt=Ee[rt+2],Zt=Ee[rt+3],(kt&192)===128&&(Vt&192)===128&&(Zt&192)===128&&(Sr=(st&15)<<18|(kt&63)<<12|(Vt&63)<<6|Zt&63,Sr>65535&&Sr<1114112&&(Qe=Sr))}}Qe===null?(Qe=65533,Lt=1):Qe>65535&&(Qe-=65536,Fe.push(Qe>>>10&1023|55296),Qe=56320|Qe&1023),Fe.push(Qe),rt+=Lt}return z(Fe)}var L=4096;function z(Ee){let _e=Ee.length;if(_e<=L)return String.fromCharCode.apply(String,Ee);let fe="",Fe=0;for(;Fe<_e;)fe+=String.fromCharCode.apply(String,Ee.slice(Fe,Fe+=L));return fe}function F(Ee,_e,fe){let Fe="";fe=Math.min(Ee.length,fe);for(let rt=_e;rtFe)&&(fe=Fe);let rt="";for(let st=_e;stFe&&(_e=Fe),fe<0?(fe+=Fe,fe<0&&(fe=0)):fe>Fe&&(fe=Fe),fe<_e&&(fe=_e);let rt=this.subarray(_e,fe);return Object.setPrototypeOf(rt,t.prototype),rt};function N(Ee,_e,fe){if(Ee%1!==0||Ee<0)throw new RangeError("offset is not uint");if(Ee+_e>fe)throw new RangeError("Trying to access beyond buffer length")}t.prototype.readUintLE=t.prototype.readUIntLE=function(_e,fe,Fe){_e=_e>>>0,fe=fe>>>0,Fe||N(_e,fe,this.length);let rt=this[_e],st=1,Qe=0;for(;++Qe>>0,fe=fe>>>0,Fe||N(_e,fe,this.length);let rt=this[_e+--fe],st=1;for(;fe>0&&(st*=256);)rt+=this[_e+--fe]*st;return rt},t.prototype.readUint8=t.prototype.readUInt8=function(_e,fe){return _e=_e>>>0,fe||N(_e,1,this.length),this[_e]},t.prototype.readUint16LE=t.prototype.readUInt16LE=function(_e,fe){return _e=_e>>>0,fe||N(_e,2,this.length),this[_e]|this[_e+1]<<8},t.prototype.readUint16BE=t.prototype.readUInt16BE=function(_e,fe){return _e=_e>>>0,fe||N(_e,2,this.length),this[_e]<<8|this[_e+1]},t.prototype.readUint32LE=t.prototype.readUInt32LE=function(_e,fe){return _e=_e>>>0,fe||N(_e,4,this.length),(this[_e]|this[_e+1]<<8|this[_e+2]<<16)+this[_e+3]*16777216},t.prototype.readUint32BE=t.prototype.readUInt32BE=function(_e,fe){return _e=_e>>>0,fe||N(_e,4,this.length),this[_e]*16777216+(this[_e+1]<<16|this[_e+2]<<8|this[_e+3])},t.prototype.readBigUInt64LE=tt(function(_e){_e=_e>>>0,ie(_e,"offset");let fe=this[_e],Fe=this[_e+7];(fe===void 0||Fe===void 0)&&j(_e,this.length-8);let rt=fe+this[++_e]*2**8+this[++_e]*2**16+this[++_e]*2**24,st=this[++_e]+this[++_e]*2**8+this[++_e]*2**16+Fe*2**24;return BigInt(rt)+(BigInt(st)<>>0,ie(_e,"offset");let fe=this[_e],Fe=this[_e+7];(fe===void 0||Fe===void 0)&&j(_e,this.length-8);let rt=fe*2**24+this[++_e]*2**16+this[++_e]*2**8+this[++_e],st=this[++_e]*2**24+this[++_e]*2**16+this[++_e]*2**8+Fe;return(BigInt(rt)<>>0,fe=fe>>>0,Fe||N(_e,fe,this.length);let rt=this[_e],st=1,Qe=0;for(;++Qe=st&&(rt-=Math.pow(2,8*fe)),rt},t.prototype.readIntBE=function(_e,fe,Fe){_e=_e>>>0,fe=fe>>>0,Fe||N(_e,fe,this.length);let rt=fe,st=1,Qe=this[_e+--rt];for(;rt>0&&(st*=256);)Qe+=this[_e+--rt]*st;return st*=128,Qe>=st&&(Qe-=Math.pow(2,8*fe)),Qe},t.prototype.readInt8=function(_e,fe){return _e=_e>>>0,fe||N(_e,1,this.length),this[_e]&128?(255-this[_e]+1)*-1:this[_e]},t.prototype.readInt16LE=function(_e,fe){_e=_e>>>0,fe||N(_e,2,this.length);let Fe=this[_e]|this[_e+1]<<8;return Fe&32768?Fe|4294901760:Fe},t.prototype.readInt16BE=function(_e,fe){_e=_e>>>0,fe||N(_e,2,this.length);let Fe=this[_e+1]|this[_e]<<8;return Fe&32768?Fe|4294901760:Fe},t.prototype.readInt32LE=function(_e,fe){return _e=_e>>>0,fe||N(_e,4,this.length),this[_e]|this[_e+1]<<8|this[_e+2]<<16|this[_e+3]<<24},t.prototype.readInt32BE=function(_e,fe){return _e=_e>>>0,fe||N(_e,4,this.length),this[_e]<<24|this[_e+1]<<16|this[_e+2]<<8|this[_e+3]},t.prototype.readBigInt64LE=tt(function(_e){_e=_e>>>0,ie(_e,"offset");let fe=this[_e],Fe=this[_e+7];(fe===void 0||Fe===void 0)&&j(_e,this.length-8);let rt=this[_e+4]+this[_e+5]*2**8+this[_e+6]*2**16+(Fe<<24);return(BigInt(rt)<>>0,ie(_e,"offset");let fe=this[_e],Fe=this[_e+7];(fe===void 0||Fe===void 0)&&j(_e,this.length-8);let rt=(fe<<24)+this[++_e]*2**16+this[++_e]*2**8+this[++_e];return(BigInt(rt)<>>0,fe||N(_e,4,this.length),d.read(this,_e,!0,23,4)},t.prototype.readFloatBE=function(_e,fe){return _e=_e>>>0,fe||N(_e,4,this.length),d.read(this,_e,!1,23,4)},t.prototype.readDoubleLE=function(_e,fe){return _e=_e>>>0,fe||N(_e,8,this.length),d.read(this,_e,!0,52,8)},t.prototype.readDoubleBE=function(_e,fe){return _e=_e>>>0,fe||N(_e,8,this.length),d.read(this,_e,!1,52,8)};function U(Ee,_e,fe,Fe,rt,st){if(!t.isBuffer(Ee))throw new TypeError('"buffer" argument must be a Buffer instance');if(_e>rt||_eEe.length)throw new RangeError("Index out of range")}t.prototype.writeUintLE=t.prototype.writeUIntLE=function(_e,fe,Fe,rt){if(_e=+_e,fe=fe>>>0,Fe=Fe>>>0,!rt){let Lt=Math.pow(2,8*Fe)-1;U(this,_e,fe,Fe,Lt,0)}let st=1,Qe=0;for(this[fe]=_e&255;++Qe>>0,Fe=Fe>>>0,!rt){let Lt=Math.pow(2,8*Fe)-1;U(this,_e,fe,Fe,Lt,0)}let st=Fe-1,Qe=1;for(this[fe+st]=_e&255;--st>=0&&(Qe*=256);)this[fe+st]=_e/Qe&255;return fe+Fe},t.prototype.writeUint8=t.prototype.writeUInt8=function(_e,fe,Fe){return _e=+_e,fe=fe>>>0,Fe||U(this,_e,fe,1,255,0),this[fe]=_e&255,fe+1},t.prototype.writeUint16LE=t.prototype.writeUInt16LE=function(_e,fe,Fe){return _e=+_e,fe=fe>>>0,Fe||U(this,_e,fe,2,65535,0),this[fe]=_e&255,this[fe+1]=_e>>>8,fe+2},t.prototype.writeUint16BE=t.prototype.writeUInt16BE=function(_e,fe,Fe){return _e=+_e,fe=fe>>>0,Fe||U(this,_e,fe,2,65535,0),this[fe]=_e>>>8,this[fe+1]=_e&255,fe+2},t.prototype.writeUint32LE=t.prototype.writeUInt32LE=function(_e,fe,Fe){return _e=+_e,fe=fe>>>0,Fe||U(this,_e,fe,4,4294967295,0),this[fe+3]=_e>>>24,this[fe+2]=_e>>>16,this[fe+1]=_e>>>8,this[fe]=_e&255,fe+4},t.prototype.writeUint32BE=t.prototype.writeUInt32BE=function(_e,fe,Fe){return _e=+_e,fe=fe>>>0,Fe||U(this,_e,fe,4,4294967295,0),this[fe]=_e>>>24,this[fe+1]=_e>>>16,this[fe+2]=_e>>>8,this[fe+3]=_e&255,fe+4};function W(Ee,_e,fe,Fe,rt){oe(_e,Fe,rt,Ee,fe,7);let st=Number(_e&BigInt(4294967295));Ee[fe++]=st,st=st>>8,Ee[fe++]=st,st=st>>8,Ee[fe++]=st,st=st>>8,Ee[fe++]=st;let Qe=Number(_e>>BigInt(32)&BigInt(4294967295));return Ee[fe++]=Qe,Qe=Qe>>8,Ee[fe++]=Qe,Qe=Qe>>8,Ee[fe++]=Qe,Qe=Qe>>8,Ee[fe++]=Qe,fe}function Q(Ee,_e,fe,Fe,rt){oe(_e,Fe,rt,Ee,fe,7);let st=Number(_e&BigInt(4294967295));Ee[fe+7]=st,st=st>>8,Ee[fe+6]=st,st=st>>8,Ee[fe+5]=st,st=st>>8,Ee[fe+4]=st;let Qe=Number(_e>>BigInt(32)&BigInt(4294967295));return Ee[fe+3]=Qe,Qe=Qe>>8,Ee[fe+2]=Qe,Qe=Qe>>8,Ee[fe+1]=Qe,Qe=Qe>>8,Ee[fe]=Qe,fe+8}t.prototype.writeBigUInt64LE=tt(function(_e,fe=0){return W(this,_e,fe,BigInt(0),BigInt("0xffffffffffffffff"))}),t.prototype.writeBigUInt64BE=tt(function(_e,fe=0){return Q(this,_e,fe,BigInt(0),BigInt("0xffffffffffffffff"))}),t.prototype.writeIntLE=function(_e,fe,Fe,rt){if(_e=+_e,fe=fe>>>0,!rt){let kt=Math.pow(2,8*Fe-1);U(this,_e,fe,Fe,kt-1,-kt)}let st=0,Qe=1,Lt=0;for(this[fe]=_e&255;++st>0)-Lt&255;return fe+Fe},t.prototype.writeIntBE=function(_e,fe,Fe,rt){if(_e=+_e,fe=fe>>>0,!rt){let kt=Math.pow(2,8*Fe-1);U(this,_e,fe,Fe,kt-1,-kt)}let st=Fe-1,Qe=1,Lt=0;for(this[fe+st]=_e&255;--st>=0&&(Qe*=256);)_e<0&&Lt===0&&this[fe+st+1]!==0&&(Lt=1),this[fe+st]=(_e/Qe>>0)-Lt&255;return fe+Fe},t.prototype.writeInt8=function(_e,fe,Fe){return _e=+_e,fe=fe>>>0,Fe||U(this,_e,fe,1,127,-128),_e<0&&(_e=255+_e+1),this[fe]=_e&255,fe+1},t.prototype.writeInt16LE=function(_e,fe,Fe){return _e=+_e,fe=fe>>>0,Fe||U(this,_e,fe,2,32767,-32768),this[fe]=_e&255,this[fe+1]=_e>>>8,fe+2},t.prototype.writeInt16BE=function(_e,fe,Fe){return _e=+_e,fe=fe>>>0,Fe||U(this,_e,fe,2,32767,-32768),this[fe]=_e>>>8,this[fe+1]=_e&255,fe+2},t.prototype.writeInt32LE=function(_e,fe,Fe){return _e=+_e,fe=fe>>>0,Fe||U(this,_e,fe,4,2147483647,-2147483648),this[fe]=_e&255,this[fe+1]=_e>>>8,this[fe+2]=_e>>>16,this[fe+3]=_e>>>24,fe+4},t.prototype.writeInt32BE=function(_e,fe,Fe){return _e=+_e,fe=fe>>>0,Fe||U(this,_e,fe,4,2147483647,-2147483648),_e<0&&(_e=4294967295+_e+1),this[fe]=_e>>>24,this[fe+1]=_e>>>16,this[fe+2]=_e>>>8,this[fe+3]=_e&255,fe+4},t.prototype.writeBigInt64LE=tt(function(_e,fe=0){return W(this,_e,fe,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),t.prototype.writeBigInt64BE=tt(function(_e,fe=0){return Q(this,_e,fe,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function ue(Ee,_e,fe,Fe,rt,st){if(fe+Fe>Ee.length)throw new RangeError("Index out of range");if(fe<0)throw new RangeError("Index out of range")}function le(Ee,_e,fe,Fe,rt){return _e=+_e,fe=fe>>>0,rt||ue(Ee,_e,fe,4,34028234663852886e22,-34028234663852886e22),d.write(Ee,_e,fe,Fe,23,4),fe+4}t.prototype.writeFloatLE=function(_e,fe,Fe){return le(this,_e,fe,!0,Fe)},t.prototype.writeFloatBE=function(_e,fe,Fe){return le(this,_e,fe,!1,Fe)};function he(Ee,_e,fe,Fe,rt){return _e=+_e,fe=fe>>>0,rt||ue(Ee,_e,fe,8,17976931348623157e292,-17976931348623157e292),d.write(Ee,_e,fe,Fe,52,8),fe+8}t.prototype.writeDoubleLE=function(_e,fe,Fe){return he(this,_e,fe,!0,Fe)},t.prototype.writeDoubleBE=function(_e,fe,Fe){return he(this,_e,fe,!1,Fe)},t.prototype.copy=function(_e,fe,Fe,rt){if(!t.isBuffer(_e))throw new TypeError("argument should be a Buffer");if(Fe||(Fe=0),!rt&&rt!==0&&(rt=this.length),fe>=_e.length&&(fe=_e.length),fe||(fe=0),rt>0&&rt=this.length)throw new RangeError("Index out of range");if(rt<0)throw new RangeError("sourceEnd out of bounds");rt>this.length&&(rt=this.length),_e.length-fe>>0,Fe=Fe===void 0?this.length:Fe>>>0,_e||(_e=0);let st;if(typeof _e=="number")for(st=fe;st2**32?rt=J(String(fe)):typeof fe=="bigint"&&(rt=String(fe),(fe>BigInt(2)**BigInt(32)||fe<-(BigInt(2)**BigInt(32)))&&(rt=J(rt)),rt+="n"),Fe+=` It must be ${_e}. Received ${rt}`,Fe},RangeError);function J(Ee){let _e="",fe=Ee.length,Fe=Ee[0]==="-"?1:0;for(;fe>=Fe+4;fe-=3)_e=`_${Ee.slice(fe-3,fe)}${_e}`;return`${Ee.slice(0,fe)}${_e}`}function X(Ee,_e,fe){ie(_e,"offset"),(Ee[_e]===void 0||Ee[_e+fe]===void 0)&&j(_e,Ee.length-(fe+1))}function oe(Ee,_e,fe,Fe,rt,st){if(Ee>fe||Ee<_e){let Qe=typeof _e=="bigint"?"n":"",Lt;throw st>3?_e===0||_e===BigInt(0)?Lt=`>= 0${Qe} and < 2${Qe} ** ${(st+1)*8}${Qe}`:Lt=`>= -(2${Qe} ** ${(st+1)*8-1}${Qe}) and < 2 ** ${(st+1)*8-1}${Qe}`:Lt=`>= ${_e}${Qe} and <= ${fe}${Qe}`,new G.ERR_OUT_OF_RANGE("value",Lt,Ee)}X(Fe,rt,st)}function ie(Ee,_e){if(typeof Ee!="number")throw new G.ERR_INVALID_ARG_TYPE(_e,"number",Ee)}function j(Ee,_e,fe){throw Math.floor(Ee)!==Ee?(ie(Ee,fe),new G.ERR_OUT_OF_RANGE(fe||"offset","an integer",Ee)):_e<0?new G.ERR_BUFFER_OUT_OF_BOUNDS:new G.ERR_OUT_OF_RANGE(fe||"offset",`>= ${fe?1:0} and <= ${_e}`,Ee)}var ee=/[^+/0-9A-Za-z-_]/g;function re(Ee){if(Ee=Ee.split("=")[0],Ee=Ee.trim().replace(ee,""),Ee.length<2)return"";for(;Ee.length%4!==0;)Ee=Ee+"=";return Ee}function ce(Ee,_e){_e=_e||1/0;let fe,Fe=Ee.length,rt=null,st=[];for(let Qe=0;Qe55295&&fe<57344){if(!rt){if(fe>56319){(_e-=3)>-1&&st.push(239,191,189);continue}else if(Qe+1===Fe){(_e-=3)>-1&&st.push(239,191,189);continue}rt=fe;continue}if(fe<56320){(_e-=3)>-1&&st.push(239,191,189),rt=fe;continue}fe=(rt-55296<<10|fe-56320)+65536}else rt&&(_e-=3)>-1&&st.push(239,191,189);if(rt=null,fe<128){if((_e-=1)<0)break;st.push(fe)}else if(fe<2048){if((_e-=2)<0)break;st.push(fe>>6|192,fe&63|128)}else if(fe<65536){if((_e-=3)<0)break;st.push(fe>>12|224,fe>>6&63|128,fe&63|128)}else if(fe<1114112){if((_e-=4)<0)break;st.push(fe>>18|240,fe>>12&63|128,fe>>6&63|128,fe&63|128)}else throw new Error("Invalid code point")}return st}function be(Ee){let _e=[];for(let fe=0;fe>8,rt=fe%256,st.push(rt),st.push(Fe);return st}function ze(Ee){return q.toByteArray(re(Ee))}function Re(Ee,_e,fe,Fe){let rt;for(rt=0;rt=_e.length||rt>=Ee.length);++rt)_e[rt+fe]=Ee[rt];return rt}function Xe(Ee,_e){return Ee instanceof _e||Ee!=null&&Ee.constructor!=null&&Ee.constructor.name!=null&&Ee.constructor.name===_e.name}function it(Ee){return Ee!==Ee}var ot=function(){let Ee="0123456789abcdef",_e=new Array(256);for(let fe=0;fe<16;++fe){let Fe=fe*16;for(let rt=0;rt<16;++rt)_e[Fe+rt]=Ee[fe]+Ee[rt]}return _e}();function tt(Ee){return typeof BigInt>"u"?lt:Ee}function lt(){throw new Error("BigInt not supported")}}}),p3=Ze({"node_modules/has-symbols/shams.js"(Z,q){"use strict";q.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var x={},A=Symbol("test"),M=Object(A);if(typeof A=="string"||Object.prototype.toString.call(A)!=="[object Symbol]"||Object.prototype.toString.call(M)!=="[object Symbol]")return!1;var e=42;x[A]=e;for(var t in x)return!1;if(typeof Object.keys=="function"&&Object.keys(x).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(x).length!==0)return!1;var r=Object.getOwnPropertySymbols(x);if(r.length!==1||r[0]!==A||!Object.prototype.propertyIsEnumerable.call(x,A))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var o=Object.getOwnPropertyDescriptor(x,A);if(o.value!==e||o.enumerable!==!0)return!1}return!0}}}),H_=Ze({"node_modules/has-tostringtag/shams.js"(Z,q){"use strict";var d=p3();q.exports=function(){return d()&&!!Symbol.toStringTag}}}),zS=Ze({"node_modules/es-object-atoms/index.js"(Z,q){"use strict";q.exports=Object}}),cO=Ze({"node_modules/es-errors/index.js"(Z,q){"use strict";q.exports=Error}}),fO=Ze({"node_modules/es-errors/eval.js"(Z,q){"use strict";q.exports=EvalError}}),hO=Ze({"node_modules/es-errors/range.js"(Z,q){"use strict";q.exports=RangeError}}),pO=Ze({"node_modules/es-errors/ref.js"(Z,q){"use strict";q.exports=ReferenceError}}),FS=Ze({"node_modules/es-errors/syntax.js"(Z,q){"use strict";q.exports=SyntaxError}}),m1=Ze({"node_modules/es-errors/type.js"(Z,q){"use strict";q.exports=TypeError}}),dO=Ze({"node_modules/es-errors/uri.js"(Z,q){"use strict";q.exports=URIError}}),vO=Ze({"node_modules/math-intrinsics/abs.js"(Z,q){"use strict";q.exports=Math.abs}}),mO=Ze({"node_modules/math-intrinsics/floor.js"(Z,q){"use strict";q.exports=Math.floor}}),gO=Ze({"node_modules/math-intrinsics/max.js"(Z,q){"use strict";q.exports=Math.max}}),yO=Ze({"node_modules/math-intrinsics/min.js"(Z,q){"use strict";q.exports=Math.min}}),_O=Ze({"node_modules/math-intrinsics/pow.js"(Z,q){"use strict";q.exports=Math.pow}}),xO=Ze({"node_modules/math-intrinsics/round.js"(Z,q){"use strict";q.exports=Math.round}}),bO=Ze({"node_modules/math-intrinsics/isNaN.js"(Z,q){"use strict";q.exports=Number.isNaN||function(x){return x!==x}}}),wO=Ze({"node_modules/math-intrinsics/sign.js"(Z,q){"use strict";var d=bO();q.exports=function(A){return d(A)||A===0?A:A<0?-1:1}}}),TO=Ze({"node_modules/gopd/gOPD.js"(Z,q){"use strict";q.exports=Object.getOwnPropertyDescriptor}}),rg=Ze({"node_modules/gopd/index.js"(Z,q){"use strict";var d=TO();if(d)try{d([],"length")}catch{d=null}q.exports=d}}),W_=Ze({"node_modules/es-define-property/index.js"(Z,q){"use strict";var d=Object.defineProperty||!1;if(d)try{d({},"a",{value:1})}catch{d=!1}q.exports=d}}),AO=Ze({"node_modules/has-symbols/index.js"(Z,q){"use strict";var d=typeof Symbol<"u"&&Symbol,x=p3();q.exports=function(){return typeof d!="function"||typeof Symbol!="function"||typeof d("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:x()}}}),OS=Ze({"node_modules/get-proto/Reflect.getPrototypeOf.js"(Z,q){"use strict";q.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null}}),BS=Ze({"node_modules/get-proto/Object.getPrototypeOf.js"(Z,q){"use strict";var d=zS();q.exports=d.getPrototypeOf||null}}),SO=Ze({"node_modules/function-bind/implementation.js"(Z,q){"use strict";var d="Function.prototype.bind called on incompatible ",x=Object.prototype.toString,A=Math.max,M="[object Function]",e=function(a,i){for(var n=[],s=0;s"u"||!b?d:b(Uint8Array),z={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?d:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?d:ArrayBuffer,"%ArrayIteratorPrototype%":y&&b?b([][Symbol.iterator]()):d,"%AsyncFromSyncIteratorPrototype%":d,"%AsyncFunction%":P,"%AsyncGenerator%":P,"%AsyncGeneratorFunction%":P,"%AsyncIteratorPrototype%":P,"%Atomics%":typeof Atomics>"u"?d:Atomics,"%BigInt%":typeof BigInt>"u"?d:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?d:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?d:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?d:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":A,"%eval%":eval,"%EvalError%":M,"%Float16Array%":typeof Float16Array>"u"?d:Float16Array,"%Float32Array%":typeof Float32Array>"u"?d:Float32Array,"%Float64Array%":typeof Float64Array>"u"?d:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?d:FinalizationRegistry,"%Function%":T,"%GeneratorFunction%":P,"%Int8Array%":typeof Int8Array>"u"?d:Int8Array,"%Int16Array%":typeof Int16Array>"u"?d:Int16Array,"%Int32Array%":typeof Int32Array>"u"?d:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":y&&b?b(b([][Symbol.iterator]())):d,"%JSON%":typeof JSON=="object"?JSON:d,"%Map%":typeof Map>"u"?d:Map,"%MapIteratorPrototype%":typeof Map>"u"||!y||!b?d:b(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":x,"%Object.getOwnPropertyDescriptor%":_,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?d:Promise,"%Proxy%":typeof Proxy>"u"?d:Proxy,"%RangeError%":e,"%ReferenceError%":t,"%Reflect%":typeof Reflect>"u"?d:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?d:Set,"%SetIteratorPrototype%":typeof Set>"u"||!y||!b?d:b(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?d:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":y&&b?b(""[Symbol.iterator]()):d,"%Symbol%":y?Symbol:d,"%SyntaxError%":r,"%ThrowTypeError%":E,"%TypedArray%":L,"%TypeError%":o,"%Uint8Array%":typeof Uint8Array>"u"?d:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?d:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?d:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?d:Uint32Array,"%URIError%":a,"%WeakMap%":typeof WeakMap>"u"?d:WeakMap,"%WeakRef%":typeof WeakRef>"u"?d:WeakRef,"%WeakSet%":typeof WeakSet>"u"?d:WeakSet,"%Function.prototype.call%":h,"%Function.prototype.apply%":m,"%Object.defineProperty%":w,"%Object.getPrototypeOf%":p,"%Math.abs%":i,"%Math.floor%":n,"%Math.max%":s,"%Math.min%":c,"%Math.pow%":f,"%Math.round%":g,"%Math.sign%":v,"%Reflect.getPrototypeOf%":u};if(b)try{null.error}catch(X){F=b(b(X)),z["%Error.prototype%"]=F}var F,B=function X(oe){var ie;if(oe==="%AsyncFunction%")ie=l("async function () {}");else if(oe==="%GeneratorFunction%")ie=l("function* () {}");else if(oe==="%AsyncGeneratorFunction%")ie=l("async function* () {}");else if(oe==="%AsyncGenerator%"){var j=X("%AsyncGeneratorFunction%");j&&(ie=j.prototype)}else if(oe==="%AsyncIteratorPrototype%"){var ee=X("%AsyncGenerator%");ee&&b&&(ie=b(ee.prototype))}return z[oe]=ie,ie},O={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},I=g1(),N=PO(),U=I.call(h,Array.prototype.concat),W=I.call(m,Array.prototype.splice),Q=I.call(h,String.prototype.replace),ue=I.call(h,String.prototype.slice),le=I.call(h,RegExp.prototype.exec),he=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,G=/\\(\\)?/g,$=function(oe){var ie=ue(oe,0,1),j=ue(oe,-1);if(ie==="%"&&j!=="%")throw new r("invalid intrinsic syntax, expected closing `%`");if(j==="%"&&ie!=="%")throw new r("invalid intrinsic syntax, expected opening `%`");var ee=[];return Q(oe,he,function(re,ce,be,Ae){ee[ee.length]=be?Q(Ae,G,"$1"):ce||re}),ee},J=function(oe,ie){var j=oe,ee;if(N(O,j)&&(ee=O[j],j="%"+ee[0]+"%"),N(z,j)){var re=z[j];if(re===P&&(re=B(j)),typeof re>"u"&&!ie)throw new o("intrinsic "+oe+" exists, but is not available. Please file an issue!");return{alias:ee,name:j,value:re}}throw new r("intrinsic "+oe+" does not exist!")};q.exports=function(oe,ie){if(typeof oe!="string"||oe.length===0)throw new o("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof ie!="boolean")throw new o('"allowMissing" argument must be a boolean');if(le(/^%?[^%]*%?$/,oe)===null)throw new r("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var j=$(oe),ee=j.length>0?j[0]:"",re=J("%"+ee+"%",ie),ce=re.name,be=re.value,Ae=!1,ze=re.alias;ze&&(ee=ze[0],W(j,U([0,1],ze)));for(var Re=1,Xe=!0;Re=j.length){var lt=_(be,it);Xe=!!lt,Xe&&"get"in lt&&!("originalValue"in lt.get)?be=lt.get:be=be[it]}else Xe=N(be,it),be=be[it];Xe&&!Ae&&(z[ce]=be)}}return be}}}),IO=Ze({"node_modules/define-data-property/index.js"(Z,q){"use strict";var d=W_(),x=FS(),A=m1(),M=rg();q.exports=function(t,r,o){if(!t||typeof t!="object"&&typeof t!="function")throw new A("`obj` must be an object or a function`");if(typeof r!="string"&&typeof r!="symbol")throw new A("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new A("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new A("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new A("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new A("`loose`, if provided, must be a boolean");var a=arguments.length>3?arguments[3]:null,i=arguments.length>4?arguments[4]:null,n=arguments.length>5?arguments[5]:null,s=arguments.length>6?arguments[6]:!1,c=!!M&&M(t,r);if(d)d(t,r,{configurable:n===null&&c?c.configurable:!n,enumerable:a===null&&c?c.enumerable:!a,value:o,writable:i===null&&c?c.writable:!i});else if(s||!a&&!i&&!n)t[r]=o;else throw new x("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}}}),US=Ze({"node_modules/has-property-descriptors/index.js"(Z,q){"use strict";var d=W_(),x=function(){return!!d};x.hasArrayLengthDefineBug=function(){if(!d)return null;try{return d([],"length",{value:1}).length!==1}catch{return!0}},q.exports=x}}),RO=Ze({"node_modules/set-function-length/index.js"(Z,q){"use strict";var d=v3(),x=IO(),A=US()(),M=rg(),e=m1(),t=d("%Math.floor%");q.exports=function(o,a){if(typeof o!="function")throw new e("`fn` is not a function");if(typeof a!="number"||a<0||a>4294967295||t(a)!==a)throw new e("`length` must be a positive 32-bit integer");var i=arguments.length>2&&!!arguments[2],n=!0,s=!0;if("length"in o&&M){var c=M(o,"length");c&&!c.configurable&&(n=!1),c&&!c.writable&&(s=!1)}return(n||s||!i)&&(A?x(o,"length",a,!0,!0):x(o,"length",a)),o}}}),X_=Ze({"node_modules/call-bind/index.js"(Z,q){"use strict";var d=g1(),x=v3(),A=RO(),M=m1(),e=x("%Function.prototype.apply%"),t=x("%Function.prototype.call%"),r=x("%Reflect.apply%",!0)||d.call(t,e),o=W_(),a=x("%Math.max%");q.exports=function(s){if(typeof s!="function")throw new M("a function is required");var c=r(d,t,arguments);return A(c,1+a(0,s.length-(arguments.length-1)),!0)};var i=function(){return r(d,e,arguments)};o?o(q.exports,"apply",{value:i}):q.exports.apply=i}}),y1=Ze({"node_modules/call-bind/callBound.js"(Z,q){"use strict";var d=v3(),x=X_(),A=x(d("String.prototype.indexOf"));q.exports=function(e,t){var r=d(e,!!t);return typeof r=="function"&&A(e,".prototype.")>-1?x(r):r}}}),DO=Ze({"node_modules/is-arguments/index.js"(Z,q){"use strict";var d=H_()(),x=y1(),A=x("Object.prototype.toString"),M=function(o){return d&&o&&typeof o=="object"&&Symbol.toStringTag in o?!1:A(o)==="[object Arguments]"},e=function(o){return M(o)?!0:o!==null&&typeof o=="object"&&typeof o.length=="number"&&o.length>=0&&A(o)!=="[object Array]"&&A(o.callee)==="[object Function]"},t=function(){return M(arguments)}();M.isLegacyArguments=e,q.exports=t?M:e}}),zO=Ze({"node_modules/is-generator-function/index.js"(Z,q){"use strict";var d=Object.prototype.toString,x=Function.prototype.toString,A=/^\s*(?:function)?\*/,M=H_()(),e=Object.getPrototypeOf,t=function(){if(!M)return!1;try{return Function("return function*() {}")()}catch{}},r;q.exports=function(a){if(typeof a!="function")return!1;if(A.test(x.call(a)))return!0;if(!M){var i=d.call(a);return i==="[object GeneratorFunction]"}if(!e)return!1;if(typeof r>"u"){var n=t();r=n?e(n):!1}return e(a)===r}}}),FO=Ze({"node_modules/is-callable/index.js"(Z,q){"use strict";var d=Function.prototype.toString,x=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,A,M;if(typeof x=="function"&&typeof Object.defineProperty=="function")try{A=Object.defineProperty({},"length",{get:function(){throw M}}),M={},x(function(){throw 42},null,A)}catch(_){_!==M&&(x=null)}else x=null;var e=/^\s*class\b/,t=function(w){try{var S=d.call(w);return e.test(S)}catch{return!1}},r=function(w){try{return t(w)?!1:(d.call(w),!0)}catch{return!1}},o=Object.prototype.toString,a="[object Object]",i="[object Function]",n="[object GeneratorFunction]",s="[object HTMLAllCollection]",c="[object HTML document.all class]",f="[object HTMLCollection]",g=typeof Symbol=="function"&&!!Symbol.toStringTag,v=!(0 in[,]),T=function(){return!1};typeof document=="object"&&(l=document.all,o.call(l)===o.call(document.all)&&(T=function(w){if((v||!w)&&(typeof w>"u"||typeof w=="object"))try{var S=o.call(w);return(S===s||S===c||S===f||S===a)&&w("")==null}catch{}return!1}));var l;q.exports=x?function(w){if(T(w))return!0;if(!w||typeof w!="function"&&typeof w!="object")return!1;try{x(w,null,A)}catch(S){if(S!==M)return!1}return!t(w)&&r(w)}:function(w){if(T(w))return!0;if(!w||typeof w!="function"&&typeof w!="object")return!1;if(g)return r(w);if(t(w))return!1;var S=o.call(w);return S!==i&&S!==n&&!/^\[object HTML/.test(S)?!1:r(w)}}}),jS=Ze({"node_modules/for-each/index.js"(Z,q){"use strict";var d=FO(),x=Object.prototype.toString,A=Object.prototype.hasOwnProperty,M=function(a,i,n){for(var s=0,c=a.length;s=3&&(s=n),x.call(a)==="[object Array]"?M(a,i,s):typeof a=="string"?e(a,i,s):t(a,i,s)};q.exports=r}}),qS=Ze({"node_modules/available-typed-arrays/index.js"(Z,q){"use strict";var d=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],x=typeof globalThis>"u"?window:globalThis;q.exports=function(){for(var M=[],e=0;e"u"?window:globalThis,a=x(),i=M("String.prototype.slice"),n=Object.getPrototypeOf,s=M("Array.prototype.indexOf",!0)||function(T,l){for(var _=0;_-1?l:l!=="Object"?!1:g(T)}return e?f(T):null}}}),BO=Ze({"node_modules/is-typed-array/index.js"(Z,q){"use strict";var d=jS(),x=qS(),A=y1(),M=A("Object.prototype.toString"),e=H_()(),t=rg(),r=typeof globalThis>"u"?window:globalThis,o=x(),a=A("Array.prototype.indexOf",!0)||function(g,v){for(var T=0;T-1}return t?c(g):!1}}}),VS=Ze({"node_modules/util/support/types.js"(Z){"use strict";var q=DO(),d=zO(),x=OO(),A=BO();function M(Ae){return Ae.call.bind(Ae)}var e=typeof BigInt<"u",t=typeof Symbol<"u",r=M(Object.prototype.toString),o=M(Number.prototype.valueOf),a=M(String.prototype.valueOf),i=M(Boolean.prototype.valueOf);e&&(n=M(BigInt.prototype.valueOf));var n;t&&(s=M(Symbol.prototype.valueOf));var s;function c(Ae,ze){if(typeof Ae!="object")return!1;try{return ze(Ae),!0}catch{return!1}}Z.isArgumentsObject=q,Z.isGeneratorFunction=d,Z.isTypedArray=A;function f(Ae){return typeof Promise<"u"&&Ae instanceof Promise||Ae!==null&&typeof Ae=="object"&&typeof Ae.then=="function"&&typeof Ae.catch=="function"}Z.isPromise=f;function g(Ae){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(Ae):A(Ae)||W(Ae)}Z.isArrayBufferView=g;function v(Ae){return x(Ae)==="Uint8Array"}Z.isUint8Array=v;function T(Ae){return x(Ae)==="Uint8ClampedArray"}Z.isUint8ClampedArray=T;function l(Ae){return x(Ae)==="Uint16Array"}Z.isUint16Array=l;function _(Ae){return x(Ae)==="Uint32Array"}Z.isUint32Array=_;function w(Ae){return x(Ae)==="Int8Array"}Z.isInt8Array=w;function S(Ae){return x(Ae)==="Int16Array"}Z.isInt16Array=S;function E(Ae){return x(Ae)==="Int32Array"}Z.isInt32Array=E;function y(Ae){return x(Ae)==="Float32Array"}Z.isFloat32Array=y;function b(Ae){return x(Ae)==="Float64Array"}Z.isFloat64Array=b;function p(Ae){return x(Ae)==="BigInt64Array"}Z.isBigInt64Array=p;function u(Ae){return x(Ae)==="BigUint64Array"}Z.isBigUint64Array=u;function m(Ae){return r(Ae)==="[object Map]"}m.working=typeof Map<"u"&&m(new Map);function h(Ae){return typeof Map>"u"?!1:m.working?m(Ae):Ae instanceof Map}Z.isMap=h;function P(Ae){return r(Ae)==="[object Set]"}P.working=typeof Set<"u"&&P(new Set);function L(Ae){return typeof Set>"u"?!1:P.working?P(Ae):Ae instanceof Set}Z.isSet=L;function z(Ae){return r(Ae)==="[object WeakMap]"}z.working=typeof WeakMap<"u"&&z(new WeakMap);function F(Ae){return typeof WeakMap>"u"?!1:z.working?z(Ae):Ae instanceof WeakMap}Z.isWeakMap=F;function B(Ae){return r(Ae)==="[object WeakSet]"}B.working=typeof WeakSet<"u"&&B(new WeakSet);function O(Ae){return B(Ae)}Z.isWeakSet=O;function I(Ae){return r(Ae)==="[object ArrayBuffer]"}I.working=typeof ArrayBuffer<"u"&&I(new ArrayBuffer);function N(Ae){return typeof ArrayBuffer>"u"?!1:I.working?I(Ae):Ae instanceof ArrayBuffer}Z.isArrayBuffer=N;function U(Ae){return r(Ae)==="[object DataView]"}U.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&U(new DataView(new ArrayBuffer(1),0,1));function W(Ae){return typeof DataView>"u"?!1:U.working?U(Ae):Ae instanceof DataView}Z.isDataView=W;var Q=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function ue(Ae){return r(Ae)==="[object SharedArrayBuffer]"}function le(Ae){return typeof Q>"u"?!1:(typeof ue.working>"u"&&(ue.working=ue(new Q)),ue.working?ue(Ae):Ae instanceof Q)}Z.isSharedArrayBuffer=le;function he(Ae){return r(Ae)==="[object AsyncFunction]"}Z.isAsyncFunction=he;function G(Ae){return r(Ae)==="[object Map Iterator]"}Z.isMapIterator=G;function $(Ae){return r(Ae)==="[object Set Iterator]"}Z.isSetIterator=$;function J(Ae){return r(Ae)==="[object Generator]"}Z.isGeneratorObject=J;function X(Ae){return r(Ae)==="[object WebAssembly.Module]"}Z.isWebAssemblyCompiledModule=X;function oe(Ae){return c(Ae,o)}Z.isNumberObject=oe;function ie(Ae){return c(Ae,a)}Z.isStringObject=ie;function j(Ae){return c(Ae,i)}Z.isBooleanObject=j;function ee(Ae){return e&&c(Ae,n)}Z.isBigIntObject=ee;function re(Ae){return t&&c(Ae,s)}Z.isSymbolObject=re;function ce(Ae){return oe(Ae)||ie(Ae)||j(Ae)||ee(Ae)||re(Ae)}Z.isBoxedPrimitive=ce;function be(Ae){return typeof Uint8Array<"u"&&(N(Ae)||le(Ae))}Z.isAnyArrayBuffer=be,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(Ae){Object.defineProperty(Z,Ae,{enumerable:!1,value:function(){throw new Error(Ae+" is not supported in userland")}})})}}),GS=Ze({"node_modules/util/support/isBufferBrowser.js"(Z,q){q.exports=function(x){return x&&typeof x=="object"&&typeof x.copy=="function"&&typeof x.fill=="function"&&typeof x.readUInt8=="function"}}}),HS=Ze({"(disabled):node_modules/util/util.js"(Z){var q=Object.getOwnPropertyDescriptors||function(W){for(var Q=Object.keys(W),ue={},le=0;le=le)return $;switch($){case"%s":return String(ue[Q++]);case"%d":return Number(ue[Q++]);case"%j":try{return JSON.stringify(ue[Q++])}catch{return"[Circular]"}default:return $}}),G=ue[Q];Q"u")return function(){return Z.deprecate(U,W).apply(this,arguments)};var Q=!1;function ue(){if(!Q){if(process.throwDeprecation)throw new Error(W);process.traceDeprecation?console.trace(W):console.error(W),Q=!0}return U.apply(this,arguments)}return ue};var x={},A=/^$/;M="false",M=M.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),A=new RegExp("^"+M+"$","i");var M;Z.debuglog=function(U){if(U=U.toUpperCase(),!x[U])if(A.test(U)){var W=process.pid;x[U]=function(){var Q=Z.format.apply(Z,arguments);console.error("%s %d: %s",U,W,Q)}}else x[U]=function(){};return x[U]};function e(U,W){var Q={seen:[],stylize:r};return arguments.length>=3&&(Q.depth=arguments[2]),arguments.length>=4&&(Q.colors=arguments[3]),v(W)?Q.showHidden=W:W&&Z._extend(Q,W),E(Q.showHidden)&&(Q.showHidden=!1),E(Q.depth)&&(Q.depth=2),E(Q.colors)&&(Q.colors=!1),E(Q.customInspect)&&(Q.customInspect=!0),Q.colors&&(Q.stylize=t),a(Q,U,Q.depth)}Z.inspect=e,e.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},e.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function t(U,W){var Q=e.styles[W];return Q?"\x1B["+e.colors[Q][0]+"m"+U+"\x1B["+e.colors[Q][1]+"m":U}function r(U,W){return U}function o(U){var W={};return U.forEach(function(Q,ue){W[Q]=!0}),W}function a(U,W,Q){if(U.customInspect&&W&&m(W.inspect)&&W.inspect!==Z.inspect&&!(W.constructor&&W.constructor.prototype===W)){var ue=W.inspect(Q,U);return w(ue)||(ue=a(U,ue,Q)),ue}var le=i(U,W);if(le)return le;var he=Object.keys(W),G=o(he);if(U.showHidden&&(he=Object.getOwnPropertyNames(W)),u(W)&&(he.indexOf("message")>=0||he.indexOf("description")>=0))return n(W);if(he.length===0){if(m(W)){var $=W.name?": "+W.name:"";return U.stylize("[Function"+$+"]","special")}if(y(W))return U.stylize(RegExp.prototype.toString.call(W),"regexp");if(p(W))return U.stylize(Date.prototype.toString.call(W),"date");if(u(W))return n(W)}var J="",X=!1,oe=["{","}"];if(g(W)&&(X=!0,oe=["[","]"]),m(W)){var ie=W.name?": "+W.name:"";J=" [Function"+ie+"]"}if(y(W)&&(J=" "+RegExp.prototype.toString.call(W)),p(W)&&(J=" "+Date.prototype.toUTCString.call(W)),u(W)&&(J=" "+n(W)),he.length===0&&(!X||W.length==0))return oe[0]+J+oe[1];if(Q<0)return y(W)?U.stylize(RegExp.prototype.toString.call(W),"regexp"):U.stylize("[Object]","special");U.seen.push(W);var j;return X?j=s(U,W,Q,G,he):j=he.map(function(ee){return c(U,W,Q,G,ee,X)}),U.seen.pop(),f(j,J,oe)}function i(U,W){if(E(W))return U.stylize("undefined","undefined");if(w(W)){var Q="'"+JSON.stringify(W).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return U.stylize(Q,"string")}if(_(W))return U.stylize(""+W,"number");if(v(W))return U.stylize(""+W,"boolean");if(T(W))return U.stylize("null","null")}function n(U){return"["+Error.prototype.toString.call(U)+"]"}function s(U,W,Q,ue,le){for(var he=[],G=0,$=W.length;G<$;++G)B(W,String(G))?he.push(c(U,W,Q,ue,String(G),!0)):he.push("");return le.forEach(function(J){J.match(/^\d+$/)||he.push(c(U,W,Q,ue,J,!0))}),he}function c(U,W,Q,ue,le,he){var G,$,J;if(J=Object.getOwnPropertyDescriptor(W,le)||{value:W[le]},J.get?J.set?$=U.stylize("[Getter/Setter]","special"):$=U.stylize("[Getter]","special"):J.set&&($=U.stylize("[Setter]","special")),B(ue,le)||(G="["+le+"]"),$||(U.seen.indexOf(J.value)<0?(T(Q)?$=a(U,J.value,null):$=a(U,J.value,Q-1),$.indexOf(` `)>-1&&(he?$=$.split(` `).map(function(X){return" "+X}).join(` `).slice(2):$=` `+$.split(` `).map(function(X){return" "+X}).join(` `))):$=U.stylize("[Circular]","special")),E(G)){if(he&&le.match(/^\d+$/))return $;G=JSON.stringify(""+le),G.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(G=G.slice(1,-1),G=U.stylize(G,"name")):(G=G.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),G=U.stylize(G,"string"))}return G+": "+$}function f(U,W,Q){var ue=0,le=U.reduce(function(he,G){return ue++,G.indexOf(` `)>=0&&ue++,he+G.replace(/\u001b\[\d\d?m/g,"").length+1},0);return le>60?Q[0]+(W===""?"":W+` `)+" "+U.join(`, `)+" "+Q[1]:Q[0]+W+" "+U.join(", ")+" "+Q[1]}Z.types=VS();function g(U){return Array.isArray(U)}Z.isArray=g;function v(U){return typeof U=="boolean"}Z.isBoolean=v;function T(U){return U===null}Z.isNull=T;function l(U){return U==null}Z.isNullOrUndefined=l;function _(U){return typeof U=="number"}Z.isNumber=_;function w(U){return typeof U=="string"}Z.isString=w;function S(U){return typeof U=="symbol"}Z.isSymbol=S;function E(U){return U===void 0}Z.isUndefined=E;function y(U){return b(U)&&P(U)==="[object RegExp]"}Z.isRegExp=y,Z.types.isRegExp=y;function b(U){return typeof U=="object"&&U!==null}Z.isObject=b;function p(U){return b(U)&&P(U)==="[object Date]"}Z.isDate=p,Z.types.isDate=p;function u(U){return b(U)&&(P(U)==="[object Error]"||U instanceof Error)}Z.isError=u,Z.types.isNativeError=u;function m(U){return typeof U=="function"}Z.isFunction=m;function h(U){return U===null||typeof U=="boolean"||typeof U=="number"||typeof U=="string"||typeof U=="symbol"||typeof U>"u"}Z.isPrimitive=h,Z.isBuffer=GS();function P(U){return Object.prototype.toString.call(U)}function L(U){return U<10?"0"+U.toString(10):U.toString(10)}var z=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function F(){var U=new Date,W=[L(U.getHours()),L(U.getMinutes()),L(U.getSeconds())].join(":");return[U.getDate(),z[U.getMonth()],W].join(" ")}Z.log=function(){console.log("%s - %s",F(),Z.format.apply(Z,arguments))},Z.inherits=Yv(),Z._extend=function(U,W){if(!W||!b(W))return U;for(var Q=Object.keys(W),ue=Q.length;ue--;)U[Q[ue]]=W[Q[ue]];return U};function B(U,W){return Object.prototype.hasOwnProperty.call(U,W)}var O=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;Z.promisify=function(W){if(typeof W!="function")throw new TypeError('The "original" argument must be of type Function');if(O&&W[O]){var Q=W[O];if(typeof Q!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(Q,O,{value:Q,enumerable:!1,writable:!1,configurable:!0}),Q}function Q(){for(var ue,le,he=new Promise(function(J,X){ue=J,le=X}),G=[],$=0;$0?this.tail.next=v:this.head=v,this.tail=v,++this.length}},{key:"unshift",value:function(g){var v={data:g,next:this.head};this.length===0&&(this.tail=v),this.head=v,++this.length}},{key:"shift",value:function(){if(this.length!==0){var g=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,g}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(g){if(this.length===0)return"";for(var v=this.head,T=""+v.data;v=v.next;)T+=g+v.data;return T}},{key:"concat",value:function(g){if(this.length===0)return o.alloc(0);for(var v=o.allocUnsafe(g>>>0),T=this.head,l=0;T;)s(T.data,v,l),l+=T.data.length,T=T.next;return v}},{key:"consume",value:function(g,v){var T;return g_.length?_.length:g;if(w===_.length?l+=_:l+=_.slice(0,g),g-=w,g===0){w===_.length?(++T,v.next?this.head=v.next:this.head=this.tail=null):(this.head=v,v.data=_.slice(w));break}++T}return this.length-=T,l}},{key:"_getBuffer",value:function(g){var v=o.allocUnsafe(g),T=this.head,l=1;for(T.data.copy(v),g-=T.data.length;T=T.next;){var _=T.data,w=g>_.length?_.length:g;if(_.copy(v,v.length-g,0,w),g-=w,g===0){w===_.length?(++l,T.next?this.head=T.next:this.head=this.tail=null):(this.head=T,T.data=_.slice(w));break}++l}return this.length-=l,v}},{key:n,value:function(g,v){return i(this,x({},v,{depth:0,customInspect:!1}))}}]),c}()}}),WS=Ze({"node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/destroy.js"(Z,q){"use strict";function d(r,o){var a=this,i=this._readableState&&this._readableState.destroyed,n=this._writableState&&this._writableState.destroyed;return i||n?(o?o(r):r&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(e,this,r)):process.nextTick(e,this,r)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(r||null,function(s){!o&&s?a._writableState?a._writableState.errorEmitted?process.nextTick(A,a):(a._writableState.errorEmitted=!0,process.nextTick(x,a,s)):process.nextTick(x,a,s):o?(process.nextTick(A,a),o(s)):process.nextTick(A,a)}),this)}function x(r,o){e(r,o),A(r)}function A(r){r._writableState&&!r._writableState.emitClose||r._readableState&&!r._readableState.emitClose||r.emit("close")}function M(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function e(r,o){r.emit("error",o)}function t(r,o){var a=r._readableState,i=r._writableState;a&&a.autoDestroy||i&&i.autoDestroy?r.destroy(o):r.emit("error",o)}q.exports={destroy:d,undestroy:M,errorOrDestroy:t}}}),ag=Ze({"node_modules/stream-browserify/node_modules/readable-stream/errors-browser.js"(Z,q){"use strict";function d(o,a){o.prototype=Object.create(a.prototype),o.prototype.constructor=o,o.__proto__=a}var x={};function A(o,a,i){i||(i=Error);function n(c,f,g){return typeof a=="string"?a:a(c,f,g)}var s=function(c){d(f,c);function f(g,v,T){return c.call(this,n(g,v,T))||this}return f}(i);s.prototype.name=i.name,s.prototype.code=o,x[o]=s}function M(o,a){if(Array.isArray(o)){var i=o.length;return o=o.map(function(n){return String(n)}),i>2?"one of ".concat(a," ").concat(o.slice(0,i-1).join(", "),", or ")+o[i-1]:i===2?"one of ".concat(a," ").concat(o[0]," or ").concat(o[1]):"of ".concat(a," ").concat(o[0])}else return"of ".concat(a," ").concat(String(o))}function e(o,a,i){return o.substr(!i||i<0?0:+i,a.length)===a}function t(o,a,i){return(i===void 0||i>o.length)&&(i=o.length),o.substring(i-a.length,i)===a}function r(o,a,i){return typeof i!="number"&&(i=0),i+a.length>o.length?!1:o.indexOf(a,i)!==-1}A("ERR_INVALID_OPT_VALUE",function(o,a){return'The value "'+a+'" is invalid for option "'+o+'"'},TypeError),A("ERR_INVALID_ARG_TYPE",function(o,a,i){var n;typeof a=="string"&&e(a,"not ")?(n="must not be",a=a.replace(/^not /,"")):n="must be";var s;if(t(o," argument"))s="The ".concat(o," ").concat(n," ").concat(M(a,"type"));else{var c=r(o,".")?"property":"argument";s='The "'.concat(o,'" ').concat(c," ").concat(n," ").concat(M(a,"type"))}return s+=". Received type ".concat(typeof i),s},TypeError),A("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),A("ERR_METHOD_NOT_IMPLEMENTED",function(o){return"The "+o+" method is not implemented"}),A("ERR_STREAM_PREMATURE_CLOSE","Premature close"),A("ERR_STREAM_DESTROYED",function(o){return"Cannot call "+o+" after a stream was destroyed"}),A("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),A("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),A("ERR_STREAM_WRITE_AFTER_END","write after end"),A("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),A("ERR_UNKNOWN_ENCODING",function(o){return"Unknown encoding: "+o},TypeError),A("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),q.exports.codes=x}}),XS=Ze({"node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/state.js"(Z,q){"use strict";var d=ag().codes.ERR_INVALID_OPT_VALUE;function x(M,e,t){return M.highWaterMark!=null?M.highWaterMark:e?M[t]:null}function A(M,e,t,r){var o=x(e,r,t);if(o!=null){if(!(isFinite(o)&&Math.floor(o)===o)||o<0){var a=r?t:"highWaterMark";throw new d(a,o)}return Math.floor(o)}return M.objectMode?16:16*1024}q.exports={getHighWaterMark:A}}}),UO=Ze({"node_modules/util-deprecate/browser.js"(Z,q){q.exports=d;function d(A,M){if(x("noDeprecation"))return A;var e=!1;function t(){if(!e){if(x("throwDeprecation"))throw new Error(M);x("traceDeprecation")?console.trace(M):console.warn(M),e=!0}return A.apply(this,arguments)}return t}function x(A){try{if(!window.localStorage)return!1}catch{return!1}var M=window.localStorage[A];return M==null?!1:String(M).toLowerCase()==="true"}}}),ZS=Ze({"node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_writable.js"(Z,q){"use strict";q.exports=p;function d(G){var $=this;this.next=null,this.entry=null,this.finish=function(){he($,G)}}var x;p.WritableState=y;var A={deprecate:UO()},M=DS(),e=tg().Buffer,t=window.Uint8Array||function(){};function r(G){return e.from(G)}function o(G){return e.isBuffer(G)||G instanceof t}var a=WS(),i=XS(),n=i.getHighWaterMark,s=ag().codes,c=s.ERR_INVALID_ARG_TYPE,f=s.ERR_METHOD_NOT_IMPLEMENTED,g=s.ERR_MULTIPLE_CALLBACK,v=s.ERR_STREAM_CANNOT_PIPE,T=s.ERR_STREAM_DESTROYED,l=s.ERR_STREAM_NULL_VALUES,_=s.ERR_STREAM_WRITE_AFTER_END,w=s.ERR_UNKNOWN_ENCODING,S=a.errorOrDestroy;Yv()(p,M);function E(){}function y(G,$,J){x=x||ig(),G=G||{},typeof J!="boolean"&&(J=$ instanceof x),this.objectMode=!!G.objectMode,J&&(this.objectMode=this.objectMode||!!G.writableObjectMode),this.highWaterMark=n(this,G,"writableHighWaterMark",J),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var X=G.decodeStrings===!1;this.decodeStrings=!X,this.defaultEncoding=G.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(oe){B($,oe)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=G.emitClose!==!1,this.autoDestroy=!!G.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new d(this)}y.prototype.getBuffer=function(){for(var $=this.bufferedRequest,J=[];$;)J.push($),$=$.next;return J},function(){try{Object.defineProperty(y.prototype,"buffer",{get:A.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var b;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(b=Function.prototype[Symbol.hasInstance],Object.defineProperty(p,Symbol.hasInstance,{value:function($){return b.call(this,$)?!0:this!==p?!1:$&&$._writableState instanceof y}})):b=function($){return $ instanceof this};function p(G){x=x||ig();var $=this instanceof x;if(!$&&!b.call(p,this))return new p(G);this._writableState=new y(G,this,$),this.writable=!0,G&&(typeof G.write=="function"&&(this._write=G.write),typeof G.writev=="function"&&(this._writev=G.writev),typeof G.destroy=="function"&&(this._destroy=G.destroy),typeof G.final=="function"&&(this._final=G.final)),M.call(this)}p.prototype.pipe=function(){S(this,new v)};function u(G,$){var J=new _;S(G,J),process.nextTick($,J)}function m(G,$,J,X){var oe;return J===null?oe=new l:typeof J!="string"&&!$.objectMode&&(oe=new c("chunk",["string","Buffer"],J)),oe?(S(G,oe),process.nextTick(X,oe),!1):!0}p.prototype.write=function(G,$,J){var X=this._writableState,oe=!1,ie=!X.objectMode&&o(G);return ie&&!e.isBuffer(G)&&(G=r(G)),typeof $=="function"&&(J=$,$=null),ie?$="buffer":$||($=X.defaultEncoding),typeof J!="function"&&(J=E),X.ending?u(this,J):(ie||m(this,X,G,J))&&(X.pendingcb++,oe=P(this,X,ie,G,$,J)),oe},p.prototype.cork=function(){this._writableState.corked++},p.prototype.uncork=function(){var G=this._writableState;G.corked&&(G.corked--,!G.writing&&!G.corked&&!G.bufferProcessing&&G.bufferedRequest&&N(this,G))},p.prototype.setDefaultEncoding=function($){if(typeof $=="string"&&($=$.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf(($+"").toLowerCase())>-1))throw new w($);return this._writableState.defaultEncoding=$,this},Object.defineProperty(p.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function h(G,$,J){return!G.objectMode&&G.decodeStrings!==!1&&typeof $=="string"&&($=e.from($,J)),$}Object.defineProperty(p.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function P(G,$,J,X,oe,ie){if(!J){var j=h($,X,oe);X!==j&&(J=!0,oe="buffer",X=j)}var ee=$.objectMode?1:X.length;$.length+=ee;var re=$.length<$.highWaterMark;if(re||($.needDrain=!0),$.writing||$.corked){var ce=$.lastBufferedRequest;$.lastBufferedRequest={chunk:X,encoding:oe,isBuf:J,callback:ie,next:null},ce?ce.next=$.lastBufferedRequest:$.bufferedRequest=$.lastBufferedRequest,$.bufferedRequestCount+=1}else L(G,$,!1,ee,X,oe,ie);return re}function L(G,$,J,X,oe,ie,j){$.writelen=X,$.writecb=j,$.writing=!0,$.sync=!0,$.destroyed?$.onwrite(new T("write")):J?G._writev(oe,$.onwrite):G._write(oe,ie,$.onwrite),$.sync=!1}function z(G,$,J,X,oe){--$.pendingcb,J?(process.nextTick(oe,X),process.nextTick(ue,G,$),G._writableState.errorEmitted=!0,S(G,X)):(oe(X),G._writableState.errorEmitted=!0,S(G,X),ue(G,$))}function F(G){G.writing=!1,G.writecb=null,G.length-=G.writelen,G.writelen=0}function B(G,$){var J=G._writableState,X=J.sync,oe=J.writecb;if(typeof oe!="function")throw new g;if(F(J),$)z(G,J,X,$,oe);else{var ie=U(J)||G.destroyed;!ie&&!J.corked&&!J.bufferProcessing&&J.bufferedRequest&&N(G,J),X?process.nextTick(O,G,J,ie,oe):O(G,J,ie,oe)}}function O(G,$,J,X){J||I(G,$),$.pendingcb--,X(),ue(G,$)}function I(G,$){$.length===0&&$.needDrain&&($.needDrain=!1,G.emit("drain"))}function N(G,$){$.bufferProcessing=!0;var J=$.bufferedRequest;if(G._writev&&J&&J.next){var X=$.bufferedRequestCount,oe=new Array(X),ie=$.corkedRequestsFree;ie.entry=J;for(var j=0,ee=!0;J;)oe[j]=J,J.isBuf||(ee=!1),J=J.next,j+=1;oe.allBuffers=ee,L(G,$,!0,$.length,oe,"",ie.finish),$.pendingcb++,$.lastBufferedRequest=null,ie.next?($.corkedRequestsFree=ie.next,ie.next=null):$.corkedRequestsFree=new d($),$.bufferedRequestCount=0}else{for(;J;){var re=J.chunk,ce=J.encoding,be=J.callback,Ae=$.objectMode?1:re.length;if(L(G,$,!1,Ae,re,ce,be),J=J.next,$.bufferedRequestCount--,$.writing)break}J===null&&($.lastBufferedRequest=null)}$.bufferedRequest=J,$.bufferProcessing=!1}p.prototype._write=function(G,$,J){J(new f("_write()"))},p.prototype._writev=null,p.prototype.end=function(G,$,J){var X=this._writableState;return typeof G=="function"?(J=G,G=null,$=null):typeof $=="function"&&(J=$,$=null),G!=null&&this.write(G,$),X.corked&&(X.corked=1,this.uncork()),X.ending||le(this,X,J),this},Object.defineProperty(p.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function U(G){return G.ending&&G.length===0&&G.bufferedRequest===null&&!G.finished&&!G.writing}function W(G,$){G._final(function(J){$.pendingcb--,J&&S(G,J),$.prefinished=!0,G.emit("prefinish"),ue(G,$)})}function Q(G,$){!$.prefinished&&!$.finalCalled&&(typeof G._final=="function"&&!$.destroyed?($.pendingcb++,$.finalCalled=!0,process.nextTick(W,G,$)):($.prefinished=!0,G.emit("prefinish")))}function ue(G,$){var J=U($);if(J&&(Q(G,$),$.pendingcb===0&&($.finished=!0,G.emit("finish"),$.autoDestroy))){var X=G._readableState;(!X||X.autoDestroy&&X.endEmitted)&&G.destroy()}return J}function le(G,$,J){$.ending=!0,ue(G,$),J&&($.finished?process.nextTick(J):G.once("finish",J)),$.ended=!0,G.writable=!1}function he(G,$,J){var X=G.entry;for(G.entry=null;X;){var oe=X.callback;$.pendingcb--,oe(J),X=X.next}$.corkedRequestsFree.next=G}Object.defineProperty(p.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function($){this._writableState&&(this._writableState.destroyed=$)}}),p.prototype.destroy=a.destroy,p.prototype._undestroy=a.undestroy,p.prototype._destroy=function(G,$){$(G)}}}),ig=Ze({"node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_duplex.js"(Z,q){"use strict";var d=Object.keys||function(i){var n=[];for(var s in i)n.push(s);return n};q.exports=r;var x=KS(),A=ZS();for(Yv()(r,x),M=d(A.prototype),t=0;t>5===6?2:T>>4===14?3:T>>3===30?4:T>>6===2?-1:-2}function t(T,l,_){var w=l.length-1;if(w<_)return 0;var S=e(l[w]);return S>=0?(S>0&&(T.lastNeed=S-1),S):--w<_||S===-2?0:(S=e(l[w]),S>=0?(S>0&&(T.lastNeed=S-2),S):--w<_||S===-2?0:(S=e(l[w]),S>=0?(S>0&&(S===2?S=0:T.lastNeed=S-3),S):0))}function r(T,l,_){if((l[0]&192)!==128)return T.lastNeed=0,"\uFFFD";if(T.lastNeed>1&&l.length>1){if((l[1]&192)!==128)return T.lastNeed=1,"\uFFFD";if(T.lastNeed>2&&l.length>2&&(l[2]&192)!==128)return T.lastNeed=2,"\uFFFD"}}function o(T){var l=this.lastTotal-this.lastNeed,_=r(this,T,l);if(_!==void 0)return _;if(this.lastNeed<=T.length)return T.copy(this.lastChar,l,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);T.copy(this.lastChar,l,0,T.length),this.lastNeed-=T.length}function a(T,l){var _=t(this,T,l);if(!this.lastNeed)return T.toString("utf8",l);this.lastTotal=_;var w=T.length-(_-this.lastNeed);return T.copy(this.lastChar,0,w),T.toString("utf8",l,w)}function i(T){var l=T&&T.length?this.write(T):"";return this.lastNeed?l+"\uFFFD":l}function n(T,l){if((T.length-l)%2===0){var _=T.toString("utf16le",l);if(_){var w=_.charCodeAt(_.length-1);if(w>=55296&&w<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=T[T.length-2],this.lastChar[1]=T[T.length-1],_.slice(0,-1)}return _}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=T[T.length-1],T.toString("utf16le",l,T.length-1)}function s(T){var l=T&&T.length?this.write(T):"";if(this.lastNeed){var _=this.lastTotal-this.lastNeed;return l+this.lastChar.toString("utf16le",0,_)}return l}function c(T,l){var _=(T.length-l)%3;return _===0?T.toString("base64",l):(this.lastNeed=3-_,this.lastTotal=3,_===1?this.lastChar[0]=T[T.length-1]:(this.lastChar[0]=T[T.length-2],this.lastChar[1]=T[T.length-1]),T.toString("base64",l,T.length-_))}function f(T){var l=T&&T.length?this.write(T):"";return this.lastNeed?l+this.lastChar.toString("base64",0,3-this.lastNeed):l}function g(T){return T.toString(this.encoding)}function v(T){return T&&T.length?this.write(T):""}}}),m3=Ze({"node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/end-of-stream.js"(Z,q){"use strict";var d=ag().codes.ERR_STREAM_PREMATURE_CLOSE;function x(t){var r=!1;return function(){if(!r){r=!0;for(var o=arguments.length,a=new Array(o),i=0;i0)if(typeof ee!="string"&&!Ae.objectMode&&Object.getPrototypeOf(ee)!==e.prototype&&(ee=r(ee)),ce)Ae.endEmitted?y(j,new _):P(j,Ae,ee,!0);else if(Ae.ended)y(j,new T);else{if(Ae.destroyed)return!1;Ae.reading=!1,Ae.decoder&&!re?(ee=Ae.decoder.write(ee),Ae.objectMode||ee.length!==0?P(j,Ae,ee,!1):U(j,Ae)):P(j,Ae,ee,!1)}else ce||(Ae.reading=!1,U(j,Ae))}return!Ae.ended&&(Ae.length=z?j=z:(j--,j|=j>>>1,j|=j>>>2,j|=j>>>4,j|=j>>>8,j|=j>>>16,j++),j}function B(j,ee){return j<=0||ee.length===0&&ee.ended?0:ee.objectMode?1:j!==j?ee.flowing&&ee.length?ee.buffer.head.data.length:ee.length:(j>ee.highWaterMark&&(ee.highWaterMark=F(j)),j<=ee.length?j:ee.ended?ee.length:(ee.needReadable=!0,0))}m.prototype.read=function(j){i("read",j),j=parseInt(j,10);var ee=this._readableState,re=j;if(j!==0&&(ee.emittedReadable=!1),j===0&&ee.needReadable&&((ee.highWaterMark!==0?ee.length>=ee.highWaterMark:ee.length>0)||ee.ended))return i("read: emitReadable",ee.length,ee.ended),ee.length===0&&ee.ended?X(this):I(this),null;if(j=B(j,ee),j===0&&ee.ended)return ee.length===0&&X(this),null;var ce=ee.needReadable;i("need readable",ce),(ee.length===0||ee.length-j0?be=J(j,ee):be=null,be===null?(ee.needReadable=ee.length<=ee.highWaterMark,j=0):(ee.length-=j,ee.awaitDrain=0),ee.length===0&&(ee.ended||(ee.needReadable=!0),re!==j&&ee.ended&&X(this)),be!==null&&this.emit("data",be),be};function O(j,ee){if(i("onEofChunk"),!ee.ended){if(ee.decoder){var re=ee.decoder.end();re&&re.length&&(ee.buffer.push(re),ee.length+=ee.objectMode?1:re.length)}ee.ended=!0,ee.sync?I(j):(ee.needReadable=!1,ee.emittedReadable||(ee.emittedReadable=!0,N(j)))}}function I(j){var ee=j._readableState;i("emitReadable",ee.needReadable,ee.emittedReadable),ee.needReadable=!1,ee.emittedReadable||(i("emitReadable",ee.flowing),ee.emittedReadable=!0,process.nextTick(N,j))}function N(j){var ee=j._readableState;i("emitReadable_",ee.destroyed,ee.length,ee.ended),!ee.destroyed&&(ee.length||ee.ended)&&(j.emit("readable"),ee.emittedReadable=!1),ee.needReadable=!ee.flowing&&!ee.ended&&ee.length<=ee.highWaterMark,$(j)}function U(j,ee){ee.readingMore||(ee.readingMore=!0,process.nextTick(W,j,ee))}function W(j,ee){for(;!ee.reading&&!ee.ended&&(ee.length1&&ie(ce.pipes,j)!==-1)&&!it&&(i("false write response, pause",ce.awaitDrain),ce.awaitDrain++),re.pause())}function lt(Fe){i("onerror",Fe),fe(),j.removeListener("error",lt),A(j,"error")===0&&y(j,Fe)}p(j,"error",lt);function Ee(){j.removeListener("finish",_e),fe()}j.once("close",Ee);function _e(){i("onfinish"),j.removeListener("close",Ee),fe()}j.once("finish",_e);function fe(){i("unpipe"),re.unpipe(j)}return j.emit("pipe",re),ce.flowing||(i("pipe resume"),re.resume()),j};function Q(j){return function(){var re=j._readableState;i("pipeOnDrain",re.awaitDrain),re.awaitDrain&&re.awaitDrain--,re.awaitDrain===0&&A(j,"data")&&(re.flowing=!0,$(j))}}m.prototype.unpipe=function(j){var ee=this._readableState,re={hasUnpiped:!1};if(ee.pipesCount===0)return this;if(ee.pipesCount===1)return j&&j!==ee.pipes?this:(j||(j=ee.pipes),ee.pipes=null,ee.pipesCount=0,ee.flowing=!1,j&&j.emit("unpipe",this,re),this);if(!j){var ce=ee.pipes,be=ee.pipesCount;ee.pipes=null,ee.pipesCount=0,ee.flowing=!1;for(var Ae=0;Ae0,ce.flowing!==!1&&this.resume()):j==="readable"&&!ce.endEmitted&&!ce.readableListening&&(ce.readableListening=ce.needReadable=!0,ce.flowing=!1,ce.emittedReadable=!1,i("on readable",ce.length,ce.reading),ce.length?I(this):ce.reading||process.nextTick(le,this)),re},m.prototype.addListener=m.prototype.on,m.prototype.removeListener=function(j,ee){var re=M.prototype.removeListener.call(this,j,ee);return j==="readable"&&process.nextTick(ue,this),re},m.prototype.removeAllListeners=function(j){var ee=M.prototype.removeAllListeners.apply(this,arguments);return(j==="readable"||j===void 0)&&process.nextTick(ue,this),ee};function ue(j){var ee=j._readableState;ee.readableListening=j.listenerCount("readable")>0,ee.resumeScheduled&&!ee.paused?ee.flowing=!0:j.listenerCount("data")>0&&j.resume()}function le(j){i("readable nexttick read 0"),j.read(0)}m.prototype.resume=function(){var j=this._readableState;return j.flowing||(i("resume"),j.flowing=!j.readableListening,he(this,j)),j.paused=!1,this};function he(j,ee){ee.resumeScheduled||(ee.resumeScheduled=!0,process.nextTick(G,j,ee))}function G(j,ee){i("resume",ee.reading),ee.reading||j.read(0),ee.resumeScheduled=!1,j.emit("resume"),$(j),ee.flowing&&!ee.reading&&j.read(0)}m.prototype.pause=function(){return i("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(i("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function $(j){var ee=j._readableState;for(i("flow",ee.flowing);ee.flowing&&j.read()!==null;);}m.prototype.wrap=function(j){var ee=this,re=this._readableState,ce=!1;j.on("end",function(){if(i("wrapped end"),re.decoder&&!re.ended){var ze=re.decoder.end();ze&&ze.length&&ee.push(ze)}ee.push(null)}),j.on("data",function(ze){if(i("wrapped data"),re.decoder&&(ze=re.decoder.write(ze)),!(re.objectMode&&ze==null)&&!(!re.objectMode&&(!ze||!ze.length))){var Re=ee.push(ze);Re||(ce=!0,j.pause())}});for(var be in j)this[be]===void 0&&typeof j[be]=="function"&&(this[be]=function(Re){return function(){return j[Re].apply(j,arguments)}}(be));for(var Ae=0;Ae=ee.length?(ee.decoder?re=ee.buffer.join(""):ee.buffer.length===1?re=ee.buffer.first():re=ee.buffer.concat(ee.length),ee.buffer.clear()):re=ee.buffer.consume(j,ee.decoder),re}function X(j){var ee=j._readableState;i("endReadable",ee.endEmitted),ee.endEmitted||(ee.ended=!0,process.nextTick(oe,ee,j))}function oe(j,ee){if(i("endReadableNT",j.endEmitted,j.length),!j.endEmitted&&j.length===0&&(j.endEmitted=!0,ee.readable=!1,ee.emit("end"),j.autoDestroy)){var re=ee._writableState;(!re||re.autoDestroy&&re.finished)&&ee.destroy()}}typeof Symbol=="function"&&(m.from=function(j,ee){return E===void 0&&(E=VO()),E(m,j,ee)});function ie(j,ee){for(var re=0,ce=j.length;re0;return o(_,S,E,function(y){T||(T=y),y&&l.forEach(a),!S&&(l.forEach(a),v(T))})});return f.reduce(i)}q.exports=s}}),WO=Ze({"node_modules/stream-browserify/index.js"(Z,q){q.exports=A;var d=W0().EventEmitter,x=Yv();x(A,d),A.Readable=KS(),A.Writable=ZS(),A.Duplex=ig(),A.Transform=JS(),A.PassThrough=GO(),A.finished=m3(),A.pipeline=HO(),A.Stream=A;function A(){d.call(this)}A.prototype.pipe=function(M,e){var t=this;function r(f){M.writable&&M.write(f)===!1&&t.pause&&t.pause()}t.on("data",r);function o(){t.readable&&t.resume&&t.resume()}M.on("drain",o),!M._isStdio&&(!e||e.end!==!1)&&(t.on("end",i),t.on("close",n));var a=!1;function i(){a||(a=!0,M.end())}function n(){a||(a=!0,typeof M.destroy=="function"&&M.destroy())}function s(f){if(c(),d.listenerCount(this,"error")===0)throw f}t.on("error",s),M.on("error",s);function c(){t.removeListener("data",r),M.removeListener("drain",o),t.removeListener("end",i),t.removeListener("close",n),t.removeListener("error",s),M.removeListener("error",s),t.removeListener("end",c),t.removeListener("close",c),M.removeListener("close",c)}return t.on("end",c),t.on("close",c),M.on("close",c),M.emit("pipe",t),M}}}),_1=Ze({"node_modules/util/util.js"(Z){var q=Object.getOwnPropertyDescriptors||function(W){for(var Q=Object.keys(W),ue={},le=0;le=le)return $;switch($){case"%s":return String(ue[Q++]);case"%d":return Number(ue[Q++]);case"%j":try{return JSON.stringify(ue[Q++])}catch{return"[Circular]"}default:return $}}),G=ue[Q];Q"u")return function(){return Z.deprecate(U,W).apply(this,arguments)};var Q=!1;function ue(){if(!Q){if(process.throwDeprecation)throw new Error(W);process.traceDeprecation?console.trace(W):console.error(W),Q=!0}return U.apply(this,arguments)}return ue};var x={},A=/^$/;M="false",M=M.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),A=new RegExp("^"+M+"$","i");var M;Z.debuglog=function(U){if(U=U.toUpperCase(),!x[U])if(A.test(U)){var W=process.pid;x[U]=function(){var Q=Z.format.apply(Z,arguments);console.error("%s %d: %s",U,W,Q)}}else x[U]=function(){};return x[U]};function e(U,W){var Q={seen:[],stylize:r};return arguments.length>=3&&(Q.depth=arguments[2]),arguments.length>=4&&(Q.colors=arguments[3]),v(W)?Q.showHidden=W:W&&Z._extend(Q,W),E(Q.showHidden)&&(Q.showHidden=!1),E(Q.depth)&&(Q.depth=2),E(Q.colors)&&(Q.colors=!1),E(Q.customInspect)&&(Q.customInspect=!0),Q.colors&&(Q.stylize=t),a(Q,U,Q.depth)}Z.inspect=e,e.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},e.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function t(U,W){var Q=e.styles[W];return Q?"\x1B["+e.colors[Q][0]+"m"+U+"\x1B["+e.colors[Q][1]+"m":U}function r(U,W){return U}function o(U){var W={};return U.forEach(function(Q,ue){W[Q]=!0}),W}function a(U,W,Q){if(U.customInspect&&W&&m(W.inspect)&&W.inspect!==Z.inspect&&!(W.constructor&&W.constructor.prototype===W)){var ue=W.inspect(Q,U);return w(ue)||(ue=a(U,ue,Q)),ue}var le=i(U,W);if(le)return le;var he=Object.keys(W),G=o(he);if(U.showHidden&&(he=Object.getOwnPropertyNames(W)),u(W)&&(he.indexOf("message")>=0||he.indexOf("description")>=0))return n(W);if(he.length===0){if(m(W)){var $=W.name?": "+W.name:"";return U.stylize("[Function"+$+"]","special")}if(y(W))return U.stylize(RegExp.prototype.toString.call(W),"regexp");if(p(W))return U.stylize(Date.prototype.toString.call(W),"date");if(u(W))return n(W)}var J="",X=!1,oe=["{","}"];if(g(W)&&(X=!0,oe=["[","]"]),m(W)){var ie=W.name?": "+W.name:"";J=" [Function"+ie+"]"}if(y(W)&&(J=" "+RegExp.prototype.toString.call(W)),p(W)&&(J=" "+Date.prototype.toUTCString.call(W)),u(W)&&(J=" "+n(W)),he.length===0&&(!X||W.length==0))return oe[0]+J+oe[1];if(Q<0)return y(W)?U.stylize(RegExp.prototype.toString.call(W),"regexp"):U.stylize("[Object]","special");U.seen.push(W);var j;return X?j=s(U,W,Q,G,he):j=he.map(function(ee){return c(U,W,Q,G,ee,X)}),U.seen.pop(),f(j,J,oe)}function i(U,W){if(E(W))return U.stylize("undefined","undefined");if(w(W)){var Q="'"+JSON.stringify(W).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return U.stylize(Q,"string")}if(_(W))return U.stylize(""+W,"number");if(v(W))return U.stylize(""+W,"boolean");if(T(W))return U.stylize("null","null")}function n(U){return"["+Error.prototype.toString.call(U)+"]"}function s(U,W,Q,ue,le){for(var he=[],G=0,$=W.length;G<$;++G)B(W,String(G))?he.push(c(U,W,Q,ue,String(G),!0)):he.push("");return le.forEach(function(J){J.match(/^\d+$/)||he.push(c(U,W,Q,ue,J,!0))}),he}function c(U,W,Q,ue,le,he){var G,$,J;if(J=Object.getOwnPropertyDescriptor(W,le)||{value:W[le]},J.get?J.set?$=U.stylize("[Getter/Setter]","special"):$=U.stylize("[Getter]","special"):J.set&&($=U.stylize("[Setter]","special")),B(ue,le)||(G="["+le+"]"),$||(U.seen.indexOf(J.value)<0?(T(Q)?$=a(U,J.value,null):$=a(U,J.value,Q-1),$.indexOf(` `)>-1&&(he?$=$.split(` `).map(function(X){return" "+X}).join(` `).slice(2):$=` `+$.split(` `).map(function(X){return" "+X}).join(` `))):$=U.stylize("[Circular]","special")),E(G)){if(he&&le.match(/^\d+$/))return $;G=JSON.stringify(""+le),G.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(G=G.slice(1,-1),G=U.stylize(G,"name")):(G=G.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),G=U.stylize(G,"string"))}return G+": "+$}function f(U,W,Q){var ue=0,le=U.reduce(function(he,G){return ue++,G.indexOf(` `)>=0&&ue++,he+G.replace(/\u001b\[\d\d?m/g,"").length+1},0);return le>60?Q[0]+(W===""?"":W+` `)+" "+U.join(`, `)+" "+Q[1]:Q[0]+W+" "+U.join(", ")+" "+Q[1]}Z.types=VS();function g(U){return Array.isArray(U)}Z.isArray=g;function v(U){return typeof U=="boolean"}Z.isBoolean=v;function T(U){return U===null}Z.isNull=T;function l(U){return U==null}Z.isNullOrUndefined=l;function _(U){return typeof U=="number"}Z.isNumber=_;function w(U){return typeof U=="string"}Z.isString=w;function S(U){return typeof U=="symbol"}Z.isSymbol=S;function E(U){return U===void 0}Z.isUndefined=E;function y(U){return b(U)&&P(U)==="[object RegExp]"}Z.isRegExp=y,Z.types.isRegExp=y;function b(U){return typeof U=="object"&&U!==null}Z.isObject=b;function p(U){return b(U)&&P(U)==="[object Date]"}Z.isDate=p,Z.types.isDate=p;function u(U){return b(U)&&(P(U)==="[object Error]"||U instanceof Error)}Z.isError=u,Z.types.isNativeError=u;function m(U){return typeof U=="function"}Z.isFunction=m;function h(U){return U===null||typeof U=="boolean"||typeof U=="number"||typeof U=="string"||typeof U=="symbol"||typeof U>"u"}Z.isPrimitive=h,Z.isBuffer=GS();function P(U){return Object.prototype.toString.call(U)}function L(U){return U<10?"0"+U.toString(10):U.toString(10)}var z=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function F(){var U=new Date,W=[L(U.getHours()),L(U.getMinutes()),L(U.getSeconds())].join(":");return[U.getDate(),z[U.getMonth()],W].join(" ")}Z.log=function(){console.log("%s - %s",F(),Z.format.apply(Z,arguments))},Z.inherits=Yv(),Z._extend=function(U,W){if(!W||!b(W))return U;for(var Q=Object.keys(W),ue=Q.length;ue--;)U[Q[ue]]=W[Q[ue]];return U};function B(U,W){return Object.prototype.hasOwnProperty.call(U,W)}var O=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;Z.promisify=function(W){if(typeof W!="function")throw new TypeError('The "original" argument must be of type Function');if(O&&W[O]){var Q=W[O];if(typeof Q!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(Q,O,{value:Q,enumerable:!1,writable:!1,configurable:!0}),Q}function Q(){for(var ue,le,he=new Promise(function(J,X){ue=J,le=X}),G=[],$=0;$"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function c(E){return c=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(b){return b.__proto__||Object.getPrototypeOf(b)},c(E)}var f={},g,v;function T(E,y,b){b||(b=Error);function p(m,h,P){return typeof y=="string"?y:y(m,h,P)}var u=function(m){r(P,m);var h=a(P);function P(L,z,F){var B;return t(this,P),B=h.call(this,p(L,z,F)),B.code=E,B}return A(P)}(b);f[E]=u}function l(E,y){if(Array.isArray(E)){var b=E.length;return E=E.map(function(p){return String(p)}),b>2?"one of ".concat(y," ").concat(E.slice(0,b-1).join(", "),", or ")+E[b-1]:b===2?"one of ".concat(y," ").concat(E[0]," or ").concat(E[1]):"of ".concat(y," ").concat(E[0])}else return"of ".concat(y," ").concat(String(E))}function _(E,y,b){return E.substr(!b||b<0?0:+b,y.length)===y}function w(E,y,b){return(b===void 0||b>E.length)&&(b=E.length),E.substring(b-y.length,b)===y}function S(E,y,b){return typeof b!="number"&&(b=0),b+y.length>E.length?!1:E.indexOf(y,b)!==-1}T("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),T("ERR_INVALID_ARG_TYPE",function(E,y,b){g===void 0&&(g=Y_()),g(typeof E=="string","'name' must be a string");var p;typeof y=="string"&&_(y,"not ")?(p="must not be",y=y.replace(/^not /,"")):p="must be";var u;if(w(E," argument"))u="The ".concat(E," ").concat(p," ").concat(l(y,"type"));else{var m=S(E,".")?"property":"argument";u='The "'.concat(E,'" ').concat(m," ").concat(p," ").concat(l(y,"type"))}return u+=". Received type ".concat(d(b)),u},TypeError),T("ERR_INVALID_ARG_VALUE",function(E,y){var b=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";v===void 0&&(v=_1());var p=v.inspect(y);return p.length>128&&(p="".concat(p.slice(0,128),"...")),"The argument '".concat(E,"' ").concat(b,". Received ").concat(p)},TypeError,RangeError),T("ERR_INVALID_RETURN_VALUE",function(E,y,b){var p;return b&&b.constructor&&b.constructor.name?p="instance of ".concat(b.constructor.name):p="type ".concat(d(b)),"Expected ".concat(E,' to be returned from the "').concat(y,'"')+" function but got ".concat(p,".")},TypeError),T("ERR_MISSING_ARGS",function(){for(var E=arguments.length,y=new Array(E),b=0;b0,"At least one arg needs to be specified");var p="The ",u=y.length;switch(y=y.map(function(m){return'"'.concat(m,'"')}),u){case 1:p+="".concat(y[0]," argument");break;case 2:p+="".concat(y[0]," and ").concat(y[1]," arguments");break;default:p+=y.slice(0,u-1).join(", "),p+=", and ".concat(y[u-1]," arguments");break}return"".concat(p," must be specified")},TypeError),q.exports.codes=f}}),XO=Ze({"node_modules/assert/build/internal/assert/assertion_error.js"(Z,q){"use strict";function d(N,U){var W=Object.keys(N);if(Object.getOwnPropertySymbols){var Q=Object.getOwnPropertySymbols(N);U&&(Q=Q.filter(function(ue){return Object.getOwnPropertyDescriptor(N,ue).enumerable})),W.push.apply(W,Q)}return W}function x(N){for(var U=1;U"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function v(N){return Function.toString.call(N).indexOf("[native code]")!==-1}function T(N,U){return T=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(Q,ue){return Q.__proto__=ue,Q},T(N,U)}function l(N){return l=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(W){return W.__proto__||Object.getPrototypeOf(W)},l(N)}function _(N){"@babel/helpers - typeof";return _=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(U){return typeof U}:function(U){return U&&typeof Symbol=="function"&&U.constructor===Symbol&&U!==Symbol.prototype?"symbol":typeof U},_(N)}var w=_1(),S=w.inspect,E=$S(),y=E.codes.ERR_INVALID_ARG_TYPE;function b(N,U,W){return(W===void 0||W>N.length)&&(W=N.length),N.substring(W-U.length,W)===U}function p(N,U){if(U=Math.floor(U),N.length==0||U==0)return"";var W=N.length*U;for(U=Math.floor(Math.log(U)/Math.log(2));U;)N+=N,U--;return N+=N.substring(0,W-N.length),N}var u="",m="",h="",P="",L={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"},z=10;function F(N){var U=Object.keys(N),W=Object.create(Object.getPrototypeOf(N));return U.forEach(function(Q){W[Q]=N[Q]}),Object.defineProperty(W,"message",{value:N.message}),W}function B(N){return S(N,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function O(N,U,W){var Q="",ue="",le=0,he="",G=!1,$=B(N),J=$.split(` `),X=B(U).split(` `),oe=0,ie="";if(W==="strictEqual"&&_(N)==="object"&&_(U)==="object"&&N!==null&&U!==null&&(W="strictEqualObject"),J.length===1&&X.length===1&&J[0]!==X[0]){var j=J[0].length+X[0].length;if(j<=z){if((_(N)!=="object"||N===null)&&(_(U)!=="object"||U===null)&&(N!==0||U!==0))return"".concat(L[W],` `)+"".concat(J[0]," !== ").concat(X[0],` `)}else if(W!=="strictEqualObject"){var ee=process.stderr&&process.stderr.isTTY?process.stderr.columns:80;if(j2&&(ie=` `.concat(p(" ",oe),"^"),oe=0)}}}for(var re=J[J.length-1],ce=X[X.length-1];re===ce&&(oe++<2?he=` `.concat(re).concat(he):Q=re,J.pop(),X.pop(),!(J.length===0||X.length===0));)re=J[J.length-1],ce=X[X.length-1];var be=Math.max(J.length,X.length);if(be===0){var Ae=$.split(` `);if(Ae.length>30)for(Ae[26]="".concat(u,"...").concat(P);Ae.length>27;)Ae.pop();return"".concat(L.notIdentical,` `).concat(Ae.join(` `),` `)}oe>3&&(he=` `.concat(u,"...").concat(P).concat(he),G=!0),Q!==""&&(he=` `.concat(Q).concat(he),Q="");var ze=0,Re=L[W]+` `.concat(m,"+ actual").concat(P," ").concat(h,"- expected").concat(P),Xe=" ".concat(u,"...").concat(P," Lines skipped");for(oe=0;oe1&&oe>2&&(it>4?(ue+=` `.concat(u,"...").concat(P),G=!0):it>3&&(ue+=` `.concat(X[oe-2]),ze++),ue+=` `.concat(X[oe-1]),ze++),le=oe,Q+=` `.concat(h,"-").concat(P," ").concat(X[oe]),ze++;else if(X.length1&&oe>2&&(it>4?(ue+=` `.concat(u,"...").concat(P),G=!0):it>3&&(ue+=` `.concat(J[oe-2]),ze++),ue+=` `.concat(J[oe-1]),ze++),le=oe,ue+=` `.concat(m,"+").concat(P," ").concat(J[oe]),ze++;else{var ot=X[oe],tt=J[oe],lt=tt!==ot&&(!b(tt,",")||tt.slice(0,-1)!==ot);lt&&b(ot,",")&&ot.slice(0,-1)===tt&&(lt=!1,tt+=","),lt?(it>1&&oe>2&&(it>4?(ue+=` `.concat(u,"...").concat(P),G=!0):it>3&&(ue+=` `.concat(J[oe-2]),ze++),ue+=` `.concat(J[oe-1]),ze++),le=oe,ue+=` `.concat(m,"+").concat(P," ").concat(tt),Q+=` `.concat(h,"-").concat(P," ").concat(ot),ze+=2):(ue+=Q,Q="",(it===1||oe===0)&&(ue+=` `.concat(tt),ze++))}if(ze>20&&oe30)for(j[26]="".concat(u,"...").concat(P);j.length>27;)j.pop();j.length===1?le=W.call(this,"".concat(ie," ").concat(j[0])):le=W.call(this,"".concat(ie,` `).concat(j.join(` `),` `))}else{var ee=B(J),re="",ce=L[G];G==="notDeepEqual"||G==="notEqual"?(ee="".concat(L[G],` `).concat(ee),ee.length>1024&&(ee="".concat(ee.slice(0,1021),"..."))):(re="".concat(B(X)),ee.length>512&&(ee="".concat(ee.slice(0,509),"...")),re.length>512&&(re="".concat(re.slice(0,509),"...")),G==="deepEqual"||G==="equal"?ee="".concat(ce,` `).concat(ee,` should equal `):re=" ".concat(G," ").concat(re)),le=W.call(this,"".concat(ee).concat(re))}return Error.stackTraceLimit=oe,le.generatedMessage=!he,Object.defineProperty(s(le),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),le.code="ERR_ASSERTION",le.actual=J,le.expected=X,le.operator=G,Error.captureStackTrace&&Error.captureStackTrace(s(le),$),le.stack,le.name="AssertionError",n(le)}return t(Q,[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:U,value:function(le,he){return S(this,x(x({},he),{},{customInspect:!1,depth:0}))}}]),Q}(c(Error),S.custom);q.exports=I}}),QS=Ze({"node_modules/object-keys/isArguments.js"(Z,q){"use strict";var d=Object.prototype.toString;q.exports=function(A){var M=d.call(A),e=M==="[object Arguments]";return e||(e=M!=="[object Array]"&&A!==null&&typeof A=="object"&&typeof A.length=="number"&&A.length>=0&&d.call(A.callee)==="[object Function]"),e}}}),ZO=Ze({"node_modules/object-keys/implementation.js"(Z,q){"use strict";var d;Object.keys||(x=Object.prototype.hasOwnProperty,A=Object.prototype.toString,M=QS(),e=Object.prototype.propertyIsEnumerable,t=!e.call({toString:null},"toString"),r=e.call(function(){},"prototype"),o=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],a=function(c){var f=c.constructor;return f&&f.prototype===c},i={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},n=function(){if(typeof window>"u")return!1;for(var c in window)try{if(!i["$"+c]&&x.call(window,c)&&window[c]!==null&&typeof window[c]=="object")try{a(window[c])}catch{return!0}}catch{return!0}return!1}(),s=function(c){if(typeof window>"u"||!n)return a(c);try{return a(c)}catch{return!1}},d=function(f){var g=f!==null&&typeof f=="object",v=A.call(f)==="[object Function]",T=M(f),l=g&&A.call(f)==="[object String]",_=[];if(!g&&!v&&!T)throw new TypeError("Object.keys called on a non-object");var w=r&&v;if(l&&f.length>0&&!x.call(f,0))for(var S=0;S0)for(var E=0;E2?arguments[2]:{},f=d(s);x&&(f=M.call(f,Object.getOwnPropertySymbols(s)));for(var g=0;gEe.length)&&(_e=Ee.length);for(var fe=0,Fe=new Array(_e);fe<_e;fe++)Fe[fe]=Ee[fe];return Fe}function e(Ee,_e){var fe=Ee==null?null:typeof Symbol<"u"&&Ee[Symbol.iterator]||Ee["@@iterator"];if(fe!=null){var Fe,rt,st,Qe,Lt=[],kt=!0,Vt=!1;try{if(st=(fe=fe.call(Ee)).next,_e===0){if(Object(fe)!==fe)return;kt=!1}else for(;!(kt=(Fe=st.call(fe)).done)&&(Lt.push(Fe.value),Lt.length!==_e);kt=!0);}catch(Zt){Vt=!0,rt=Zt}finally{try{if(!kt&&fe.return!=null&&(Qe=fe.return(),Object(Qe)!==Qe))return}finally{if(Vt)throw rt}}return Lt}}function t(Ee){if(Array.isArray(Ee))return Ee}function r(Ee){"@babel/helpers - typeof";return r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(_e){return typeof _e}:function(_e){return _e&&typeof Symbol=="function"&&_e.constructor===Symbol&&_e!==Symbol.prototype?"symbol":typeof _e},r(Ee)}var o=/a/g.flags!==void 0,a=function(_e){var fe=[];return _e.forEach(function(Fe){return fe.push(Fe)}),fe},i=function(_e){var fe=[];return _e.forEach(function(Fe,rt){return fe.push([rt,Fe])}),fe},n=Object.is?Object.is:$O(),s=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols:function(){return[]},c=Number.isNaN?Number.isNaN:eB();function f(Ee){return Ee.call.bind(Ee)}var g=f(Object.prototype.hasOwnProperty),v=f(Object.prototype.propertyIsEnumerable),T=f(Object.prototype.toString),l=_1().types,_=l.isAnyArrayBuffer,w=l.isArrayBufferView,S=l.isDate,E=l.isMap,y=l.isRegExp,b=l.isSet,p=l.isNativeError,u=l.isBoxedPrimitive,m=l.isNumberObject,h=l.isStringObject,P=l.isBooleanObject,L=l.isBigIntObject,z=l.isSymbolObject,F=l.isFloat32Array,B=l.isFloat64Array;function O(Ee){if(Ee.length===0||Ee.length>10)return!0;for(var _e=0;_e57)return!0}return Ee.length===10&&Ee>=Math.pow(2,32)}function I(Ee){return Object.keys(Ee).filter(O).concat(s(Ee).filter(Object.prototype.propertyIsEnumerable.bind(Ee)))}function N(Ee,_e){if(Ee===_e)return 0;for(var fe=Ee.length,Fe=_e.length,rt=0,st=Math.min(fe,Fe);rt1?X-1:0),ie=1;ie1?X-1:0),ie=1;ie1?X-1:0),ie=1;ie1?X-1:0),ie=1;ie0)return t(i);if(s==="number"&&isNaN(i)===!1)return n.long?o(i):r(i);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(i))};function t(i){if(i=String(i),!(i.length>100)){var n=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(i);if(n){var s=parseFloat(n[1]),c=(n[2]||"ms").toLowerCase();switch(c){case"years":case"year":case"yrs":case"yr":case"y":return s*e;case"days":case"day":case"d":return s*M;case"hours":case"hour":case"hrs":case"hr":case"h":return s*A;case"minutes":case"minute":case"mins":case"min":case"m":return s*x;case"seconds":case"second":case"secs":case"sec":case"s":return s*d;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}}}function r(i){return i>=M?Math.round(i/M)+"d":i>=A?Math.round(i/A)+"h":i>=x?Math.round(i/x)+"m":i>=d?Math.round(i/d)+"s":i+"ms"}function o(i){return a(i,M,"day")||a(i,A,"hour")||a(i,x,"minute")||a(i,d,"second")||i+" ms"}function a(i,n,s){if(!(i=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}Z.formatters.j=function(r){try{return JSON.stringify(r)}catch(o){return"[UnexpectedJSONParseError]: "+o.message}};function x(r){var o=this.useColors;if(r[0]=(o?"%c":"")+this.namespace+(o?" %c":" ")+r[0]+(o?"%c ":" ")+"+"+Z.humanize(this.diff),!!o){var a="color: "+this.color;r.splice(1,0,a,"color: inherit");var i=0,n=0;r[0].replace(/%[a-zA-Z%]/g,function(s){s!=="%%"&&(i++,s==="%c"&&(n=i))}),r.splice(n,0,a)}}function A(){return typeof console=="object"&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function M(r){try{r==null?Z.storage.removeItem("debug"):Z.storage.debug=r}catch{}}function e(){var r;try{r=Z.storage.debug}catch{}return!r&&typeof process<"u"&&"env"in process&&(r=process.env.DEBUG),r}Z.enable(e());function t(){try{return window.localStorage}catch{}}}}),nB=Ze({"node_modules/stream-parser/index.js"(Z,q){var d=Y_(),x=iB()("stream-parser");q.exports=r;var A=-1,M=0,e=1,t=2;function r(l){var _=l&&typeof l._transform=="function",w=l&&typeof l._write=="function";if(!_&&!w)throw new Error("must pass a Writable or Transform stream in");x("extending Parser into stream"),l._bytes=a,l._skipBytes=i,_&&(l._passthrough=n),_?l._transform=c:l._write=s}function o(l){x("initializing parser stream"),l._parserBytesLeft=0,l._parserBuffers=[],l._parserBuffered=0,l._parserState=A,l._parserCallback=null,typeof l.push=="function"&&(l._parserOutput=l.push.bind(l)),l._parserInit=!0}function a(l,_){d(!this._parserCallback,'there is already a "callback" set!'),d(isFinite(l)&&l>0,'can only buffer a finite number of bytes > 0, got "'+l+'"'),this._parserInit||o(this),x("buffering %o bytes",l),this._parserBytesLeft=l,this._parserCallback=_,this._parserState=M}function i(l,_){d(!this._parserCallback,'there is already a "callback" set!'),d(l>0,'can only skip > 0 bytes, got "'+l+'"'),this._parserInit||o(this),x("skipping %o bytes",l),this._parserBytesLeft=l,this._parserCallback=_,this._parserState=e}function n(l,_){d(!this._parserCallback,'There is already a "callback" set!'),d(l>0,'can only pass through > 0 bytes, got "'+l+'"'),this._parserInit||o(this),x("passing through %o bytes",l),this._parserBytesLeft=l,this._parserCallback=_,this._parserState=t}function s(l,_,w){this._parserInit||o(this),x("write(%o bytes)",l.length),typeof _=="function"&&(w=_),v(this,l,null,w)}function c(l,_,w){this._parserInit||o(this),x("transform(%o bytes)",l.length),typeof _!="function"&&(_=this._parserOutput),v(this,l,_,w)}function f(l,_,w,S){return l._parserBytesLeft<=0?S(new Error("got data but not currently parsing anything")):_.length<=l._parserBytesLeft?function(){return g(l,_,w,S)}:function(){var E=_.slice(0,l._parserBytesLeft);return g(l,E,w,function(y){if(y)return S(y);if(_.length>E.length)return function(){return f(l,_.slice(E.length),w,S)}})}}function g(l,_,w,S){if(l._parserBytesLeft-=_.length,x("%o bytes left for stream piece",l._parserBytesLeft),l._parserState===M?(l._parserBuffers.push(_),l._parserBuffered+=_.length):l._parserState===t&&w(_),l._parserBytesLeft===0){var E=l._parserCallback;if(E&&l._parserState===M&&l._parserBuffers.length>1&&(_=Buffer.concat(l._parserBuffers,l._parserBuffered)),l._parserState!==M&&(_=null),l._parserCallback=null,l._parserBuffered=0,l._parserState=A,l._parserBuffers.splice(0),E){var y=[];_&&y.push(_),w&&y.push(w);var b=E.length>y.length;b&&y.push(T(S));var p=E.apply(l,y);if(!b||S===p)return S}}else return S}var v=T(f);function T(l){return function(){for(var _=l.apply(this,arguments);typeof _=="function";)_=_();return _}}}}),ac=Ze({"node_modules/probe-image-size/lib/common.js"(Z){"use strict";var q=WO().Transform,d=nB();function x(){q.call(this,{readableObjectMode:!0})}x.prototype=Object.create(q.prototype),x.prototype.constructor=x,d(x.prototype),Z.ParserStream=x,Z.sliceEq=function(M,e,t){for(var r=e,o=0;o>4&15,f=n[4]&15,g=n[5]>>4&15,v=d(n,6),T=8,l=0;lv.width||g.width===v.width&&g.height>v.height?g:v}),c=n.reduce(function(g,v){return g.height>v.height||g.height===v.height&&g.width>v.width?g:v}),f;return s.width>c.height||s.width===c.height&&s.height>c.width?f=s:f=c,f}q.exports.readSizeFromMeta=function(n){var s={sizes:[],transforms:[],item_inf:{},item_loc:{}};if(a(n,s),!!s.sizes.length){var c=i(s.sizes),f=1;s.transforms.forEach(function(v){var T={1:6,2:5,3:8,4:7,5:4,6:3,7:2,8:1},l={1:4,2:3,3:2,4:1,5:6,6:5,7:8,8:7};if(v.type==="imir"&&(v.value===0?f=l[f]:(f=l[f],f=T[f],f=T[f])),v.type==="irot")for(var _=0;_0&&!this.aborted;){var t=this.ifds_to_read.shift();t.offset&&this.scan_ifd(t.id,t.offset,M)}},A.prototype.read_uint16=function(M){var e=this.input;if(M+2>e.length)throw d("unexpected EOF","EBADDATA");return this.big_endian?e[M]*256+e[M+1]:e[M]+e[M+1]*256},A.prototype.read_uint32=function(M){var e=this.input;if(M+4>e.length)throw d("unexpected EOF","EBADDATA");return this.big_endian?e[M]*16777216+e[M+1]*65536+e[M+2]*256+e[M+3]:e[M]+e[M+1]*256+e[M+2]*65536+e[M+3]*16777216},A.prototype.is_subifd_link=function(M,e){return M===0&&e===34665||M===0&&e===34853||M===34665&&e===40965},A.prototype.exif_format_length=function(M){switch(M){case 1:case 2:case 6:case 7:return 1;case 3:case 8:return 2;case 4:case 9:case 11:return 4;case 5:case 10:case 12:return 8;default:return 0}},A.prototype.exif_format_read=function(M,e){var t;switch(M){case 1:case 2:return t=this.input[e],t;case 6:return t=this.input[e],t|(t&128)*33554430;case 3:return t=this.read_uint16(e),t;case 8:return t=this.read_uint16(e),t|(t&32768)*131070;case 4:return t=this.read_uint32(e),t;case 9:return t=this.read_uint32(e),t|0;case 5:case 10:case 11:case 12:return null;case 7:return null;default:return null}},A.prototype.scan_ifd=function(M,e,t){var r=this.read_uint16(e);e+=2;for(var o=0;othis.input.length)throw d("unexpected EOF","EBADDATA");for(var v=[],T=f,l=0;l0&&(this.ifds_to_read.push({id:a,offset:v[0]}),g=!0);var w={is_big_endian:this.big_endian,ifd:M,tag:a,format:i,count:n,entry_offset:e+this.start,data_length:c,data_offset:f+this.start,value:v,is_subifd_link:g};if(t(w)===!1){this.aborted=!0;return}e+=12}M===0&&this.ifds_to_read.push({id:1,offset:this.read_uint32(e)})},q.exports.ExifParser=A,q.exports.get_orientation=function(M){var e=0;try{return new A(M,0,M.length).each(function(t){if(t.ifd===0&&t.tag===274&&Array.isArray(t.value))return e=t.value[0],!1}),e}catch{return-1}}}}),sB=Ze({"node_modules/probe-image-size/lib/parse_sync/avif.js"(Z,q){"use strict";var d=ac().str2arr,x=ac().sliceEq,A=ac().readUInt32BE,M=oB(),e=y3(),t=d("ftyp");q.exports=function(r){if(x(r,4,t)){var o=M.unbox(r,0);if(o){var a=M.getMimeType(o.data);if(a){for(var i,n=o.end;;){var s=M.unbox(r,n);if(!s)break;if(n=s.end,s.boxtype==="mdat")return;if(s.boxtype==="meta"){i=s.data;break}}if(i){var c=M.readSizeFromMeta(i);if(c){var f={width:c.width,height:c.height,type:a.type,mime:a.mime,wUnits:"px",hUnits:"px"};if(c.variants.length>1&&(f.variants=c.variants),c.orientation&&(f.orientation=c.orientation),c.exif_location&&c.exif_location.offset+c.exif_location.length<=r.length){var g=A(r,c.exif_location.offset),v=r.slice(c.exif_location.offset+g+4,c.exif_location.offset+c.exif_location.length),T=e.get_orientation(v);T>0&&(f.orientation=T)}return f}}}}}}}}),lB=Ze({"node_modules/probe-image-size/lib/parse_sync/bmp.js"(Z,q){"use strict";var d=ac().str2arr,x=ac().sliceEq,A=ac().readUInt16LE,M=d("BM");q.exports=function(e){if(!(e.length<26)&&x(e,0,M))return{width:A(e,18),height:A(e,22),type:"bmp",mime:"image/bmp",wUnits:"px",hUnits:"px"}}}}),uB=Ze({"node_modules/probe-image-size/lib/parse_sync/gif.js"(Z,q){"use strict";var d=ac().str2arr,x=ac().sliceEq,A=ac().readUInt16LE,M=d("GIF87a"),e=d("GIF89a");q.exports=function(t){if(!(t.length<10)&&!(!x(t,0,M)&&!x(t,0,e)))return{width:A(t,6),height:A(t,8),type:"gif",mime:"image/gif",wUnits:"px",hUnits:"px"}}}}),cB=Ze({"node_modules/probe-image-size/lib/parse_sync/ico.js"(Z,q){"use strict";var d=ac().readUInt16LE,x=0,A=1,M=16;q.exports=function(e){var t=d(e,0),r=d(e,2),o=d(e,4);if(!(t!==x||r!==A||!o)){for(var a=[],i={width:0,height:0},n=0;ni.width||c>i.height)&&(i=f)}return{width:i.width,height:i.height,variants:a,type:"ico",mime:"image/x-icon",wUnits:"px",hUnits:"px"}}}}}),fB=Ze({"node_modules/probe-image-size/lib/parse_sync/jpeg.js"(Z,q){"use strict";var d=ac().readUInt16BE,x=ac().str2arr,A=ac().sliceEq,M=y3(),e=x("Exif\0\0");q.exports=function(t){if(!(t.length<2)&&!(t[0]!==255||t[1]!==216||t[2]!==255))for(var r=2;;){for(;;){if(t.length-r<2)return;if(t[r++]===255)break}for(var o=t[r++],a;o===255;)o=t[r++];if(208<=o&&o<=217||o===1)a=0;else if(192<=o&&o<=254){if(t.length-r<2)return;a=d(t,r)-2,r+=2}else return;if(o===217||o===218)return;var i;if(o===225&&a>=10&&A(t,r,e)&&(i=M.get_orientation(t.slice(r+6,r+a))),a>=5&&192<=o&&o<=207&&o!==196&&o!==200&&o!==204){if(t.length-r0&&(n.orientation=i),n}r+=a}}}}),hB=Ze({"node_modules/probe-image-size/lib/parse_sync/png.js"(Z,q){"use strict";var d=ac().str2arr,x=ac().sliceEq,A=ac().readUInt32BE,M=d(`\x89PNG\r  `),e=d("IHDR");q.exports=function(t){if(!(t.length<24)&&x(t,0,M)&&x(t,12,e))return{width:A(t,16),height:A(t,20),type:"png",mime:"image/png",wUnits:"px",hUnits:"px"}}}}),pB=Ze({"node_modules/probe-image-size/lib/parse_sync/psd.js"(Z,q){"use strict";var d=ac().str2arr,x=ac().sliceEq,A=ac().readUInt32BE,M=d("8BPS\0");q.exports=function(e){if(!(e.length<22)&&x(e,0,M))return{width:A(e,18),height:A(e,14),type:"psd",mime:"image/vnd.adobe.photoshop",wUnits:"px",hUnits:"px"}}}}),dB=Ze({"node_modules/probe-image-size/lib/parse_sync/svg.js"(Z,q){"use strict";function d(s){return s===32||s===9||s===13||s===10}function x(s){return typeof s=="number"&&isFinite(s)&&s>0}function A(s){var c=0,f=s.length;for(s[0]===239&&s[1]===187&&s[2]===191&&(c=3);c]*>/,e=/^<([-_.:a-zA-Z0-9]+:)?svg\s/,t=/[^-]\bwidth="([^%]+?)"|[^-]\bwidth='([^%]+?)'/,r=/\bheight="([^%]+?)"|\bheight='([^%]+?)'/,o=/\bview[bB]ox="(.+?)"|\bview[bB]ox='(.+?)'/,a=/in$|mm$|cm$|pt$|pc$|px$|em$|ex$/;function i(s){var c=s.match(t),f=s.match(r),g=s.match(o);return{width:c&&(c[1]||c[2]),height:f&&(f[1]||f[2]),viewbox:g&&(g[1]||g[2])}}function n(s){return a.test(s)?s.match(a)[0]:"px"}q.exports=function(s){if(A(s)){for(var c="",f=0;f>14&16383)+1,type:"webp",mime:"image/webp",wUnits:"px",hUnits:"px"}}}function i(n,s){return{width:(n[s+6]<<16|n[s+5]<<8|n[s+4])+1,height:(n[s+9]<n.length)){for(;s+8=10?c=c||o(n,s+8):v==="VP8L"&&T>=9?c=c||a(n,s+8):v==="VP8X"&&T>=10?c=c||i(n,s+8):v==="EXIF"&&(f=e.get_orientation(n.slice(s+8,s+8+T)),s=1/0),s+=8+T}if(c)return f>0&&(c.orientation=f),c}}}}}),gB=Ze({"node_modules/probe-image-size/lib/parsers_sync.js"(Z,q){"use strict";q.exports={avif:sB(),bmp:lB(),gif:uB(),ico:cB(),jpeg:fB(),png:hB(),psd:pB(),svg:dB(),tiff:vB(),webp:mB()}}}),yB=Ze({"node_modules/probe-image-size/sync.js"(Z,q){"use strict";var d=gB();function x(A){for(var M=Object.keys(d),e=0;e0;)P=c.c2p(E+B*u),B--;for(B=0;z===void 0&&B0;)F=f.c2p(y+B*m),B--;if(PG[0];if($||J){var X=h+I/2,oe=z+N/2;le+="transform:"+A(X+"px",oe+"px")+"scale("+($?-1:1)+","+(J?-1:1)+")"+A(-X+"px",-oe+"px")+";"}}ue.attr("style",le);var ie=new Promise(function(j){if(_._hasZ)j();else if(_._hasSource)if(_._canvas&&_._canvas.el.width===b&&_._canvas.el.height===p&&_._canvas.source===_.source)j();else{var ee=document.createElement("canvas");ee.width=b,ee.height=p;var re=ee.getContext("2d",{willReadFrequently:!0});_._image=_._image||new Image;var ce=_._image;ce.onload=function(){re.drawImage(ce,0,0),_._canvas={el:ee,source:_.source},j()},ce.setAttribute("src",_.source)}}).then(function(){var j,ee;if(_._hasZ)ee=Q(function(be,Ae){var ze=S[Ae][be];return x.isTypedArray(ze)&&(ze=Array.from(ze)),ze}),j=ee.toDataURL("image/png");else if(_._hasSource)if(w)j=_.source;else{var re=_._canvas.el.getContext("2d",{willReadFrequently:!0}),ce=re.getImageData(0,0,b,p).data;ee=Q(function(be,Ae){var ze=4*(Ae*b+be);return[ce[ze],ce[ze+1],ce[ze+2],ce[ze+3]]}),j=ee.toDataURL("image/png")}ue.attr({"xlink:href":j,height:N,width:I,x:h,y:z})});a._promises.push(ie)})}}}),wB=Ze({"src/traces/image/style.js"(Z,q){"use strict";var d=On();q.exports=function(A){d.select(A).selectAll(".im image").style("opacity",function(M){return M[0].trace.opacity})}}}),TB=Ze({"src/traces/image/hover.js"(Z,q){"use strict";var d=ef(),x=ca(),A=x.isArrayOrTypedArray,M=v1();q.exports=function(t,r,o){var a=t.cd[0],i=a.trace,n=t.xa,s=t.ya;if(!(d.inbox(r-a.x0,r-(a.x0+a.w*i.dx),0)>0||d.inbox(o-a.y0,o-(a.y0+a.h*i.dy),0)>0)){var c=Math.floor((r-a.x0)/i.dx),f=Math.floor(Math.abs(o-a.y0)/i.dy),g;if(i._hasZ?g=a.z[f][c]:i._hasSource&&(g=i._canvas.el.getContext("2d",{willReadFrequently:!0}).getImageData(c,f,1,1).data),!!g){var v=a.hi||i.hoverinfo,T;if(v){var l=v.split("+");l.indexOf("all")!==-1&&(l=["color"]),l.indexOf("color")!==-1&&(T=!0)}var _=M.colormodel[i.colormodel],w=_.colormodel||i.colormodel,S=w.length,E=i._scaler(g),y=_.suffix,b=[];(i.hovertemplate||T)&&(b.push("["+[E[0]+y[0],E[1]+y[1],E[2]+y[2]].join(", ")),S===4&&b.push(", "+E[3]+y[3]),b.push("]"),b=b.join(""),t.extraText=w.toUpperCase()+": "+b);var p;A(i.hovertext)&&A(i.hovertext[f])?p=i.hovertext[f][c]:A(i.text)&&A(i.text[f])&&(p=i.text[f][c]);var u=s.c2p(a.y0+(f+.5)*i.dy),m=a.x0+(c+.5)*i.dx,h=a.y0+(f+.5)*i.dy,P="["+g.slice(0,i.colormodel.length).join(", ")+"]";return[x.extendFlat(t,{index:[f,c],x0:n.c2p(a.x0+c*i.dx),x1:n.c2p(a.x0+(c+1)*i.dx),y0:u,y1:u,color:E,xVal:m,xLabelVal:m,yVal:h,yLabelVal:h,zLabelVal:P,text:p,hovertemplateLabels:{zLabel:P,colorLabel:b,"color[0]Label":E[0]+y[0],"color[1]Label":E[1]+y[1],"color[2]Label":E[2]+y[2],"color[3]Label":E[3]+y[3]}})]}}}}}),AB=Ze({"src/traces/image/event_data.js"(Z,q){"use strict";q.exports=function(x,A){return"xVal"in A&&(x.x=A.xVal),"yVal"in A&&(x.y=A.yVal),A.xa&&(x.xaxis=A.xa),A.ya&&(x.yaxis=A.ya),x.color=A.color,x.colormodel=A.trace.colormodel,x.z||(x.z=A.color),x}}}),SB=Ze({"src/traces/image/index.js"(Z,q){"use strict";q.exports={attributes:RS(),supplyDefaults:sO(),calc:xB(),plot:bB(),style:wB(),hoverPoints:TB(),eventData:AB(),moduleType:"trace",name:"image",basePlotModule:Zf(),categories:["cartesian","svg","2dMap","noSortingByValue"],animatable:!1,meta:{}}}}),MB=Ze({"lib/image.js"(Z,q){"use strict";q.exports=SB()}}),ng=Ze({"src/traces/pie/attributes.js"(Z,q){"use strict";var d=eu(),x=bc().attributes,A=tc(),M=oh(),e=Cs().hovertemplateAttrs,t=Cs().texttemplateAttrs,r=rs().extendFlat,o=Gh().pattern,a=A({editType:"plot",arrayOk:!0,colorEditType:"plot"});q.exports={labels:{valType:"data_array",editType:"calc"},label0:{valType:"number",dflt:0,editType:"calc"},dlabel:{valType:"number",dflt:1,editType:"calc"},values:{valType:"data_array",editType:"calc"},marker:{colors:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:M.defaultLine,arrayOk:!0,editType:"style"},width:{valType:"number",min:0,dflt:0,arrayOk:!0,editType:"style"},editType:"calc"},pattern:o,editType:"calc"},text:{valType:"data_array",editType:"plot"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"style"},scalegroup:{valType:"string",dflt:"",editType:"calc"},textinfo:{valType:"flaglist",flags:["label","text","value","percent"],extras:["none"],editType:"calc"},hoverinfo:r({},d.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:e({},{keys:["label","color","value","percent","text"]}),texttemplate:t({editType:"plot"},{keys:["label","color","value","percent","text"]}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0,editType:"plot"},textfont:r({},a,{}),insidetextorientation:{valType:"enumerated",values:["horizontal","radial","tangential","auto"],dflt:"auto",editType:"plot"},insidetextfont:r({},a,{}),outsidetextfont:r({},a,{}),automargin:{valType:"boolean",dflt:!1,editType:"plot"},title:{text:{valType:"string",dflt:"",editType:"plot"},font:r({},a,{}),position:{valType:"enumerated",values:["top left","top center","top right","middle center","bottom left","bottom center","bottom right"],editType:"plot"},editType:"plot"},domain:x({name:"pie",trace:!0,editType:"calc"}),hole:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},sort:{valType:"boolean",dflt:!0,editType:"calc"},direction:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"counterclockwise",editType:"calc"},rotation:{valType:"angle",dflt:0,editType:"calc"},pull:{valType:"number",min:0,max:1,dflt:0,arrayOk:!0,editType:"calc"}}}}),og=Ze({"src/traces/pie/defaults.js"(Z,q){"use strict";var d=ns(),x=ca(),A=ng(),M=bc().defaults,e=gd().handleText,t=ca().coercePattern;function r(i,n){var s=x.isArrayOrTypedArray(i),c=x.isArrayOrTypedArray(n),f=Math.min(s?i.length:1/0,c?n.length:1/0);if(isFinite(f)||(f=0),f&&c){for(var g,v=0;v0){g=!0;break}}g||(f=0)}return{hasLabels:s,hasValues:c,len:f}}function o(i,n,s,c,f){var g=c("marker.line.width");g&&c("marker.line.color",f?void 0:s.paper_bgcolor);var v=c("marker.colors");t(c,"marker.pattern",v),i.marker&&!n.marker.pattern.fgcolor&&(n.marker.pattern.fgcolor=i.marker.colors),n.marker.pattern.bgcolor||(n.marker.pattern.bgcolor=s.paper_bgcolor)}function a(i,n,s,c){function f(h,P){return x.coerce(i,n,A,h,P)}var g=f("labels"),v=f("values"),T=r(g,v),l=T.len;if(n._hasLabels=T.hasLabels,n._hasValues=T.hasValues,!n._hasLabels&&n._hasValues&&(f("label0"),f("dlabel")),!l){n.visible=!1;return}n._length=l,o(i,n,c,f,!0),f("scalegroup");var _=f("text"),w=f("texttemplate"),S;if(w||(S=f("textinfo",x.isArrayOrTypedArray(_)?"text+percent":"percent")),f("hovertext"),f("hovertemplate"),w||S&&S!=="none"){var E=f("textposition");e(i,n,c,f,E,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1});var y=Array.isArray(E)||E==="auto",b=y||E==="outside";b&&f("automargin"),(E==="inside"||E==="auto"||Array.isArray(E))&&f("insidetextorientation")}else S==="none"&&f("textposition","none");M(n,c,f);var p=f("hole"),u=f("title.text");if(u){var m=f("title.position",p?"middle center":"top center");!p&&m==="middle center"&&(n.title.position="top center"),x.coerceFont(f,"title.font",c.font)}f("sort"),f("direction"),f("rotation"),f("pull")}q.exports={handleLabelsAndValues:r,handleMarkerDefaults:o,supplyDefaults:a}}}),_3=Ze({"src/traces/pie/layout_attributes.js"(Z,q){"use strict";q.exports={hiddenlabels:{valType:"data_array",editType:"calc"},piecolorway:{valType:"colorlist",editType:"calc"},extendpiecolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),EB=Ze({"src/traces/pie/layout_defaults.js"(Z,q){"use strict";var d=ca(),x=_3();q.exports=function(M,e){function t(r,o){return d.coerce(M,e,x,r,o)}t("hiddenlabels"),t("piecolorway",e.colorway),t("extendpiecolors")}}}),x1=Ze({"src/traces/pie/calc.js"(Z,q){"use strict";var d=ns(),x=Ch(),A=Yn(),M={};function e(a,i){var n=[],s=a._fullLayout,c=s.hiddenlabels||[],f=i.labels,g=i.marker.colors||[],v=i.values,T=i._length,l=i._hasValues&&T,_,w;if(i.dlabel)for(f=new Array(T),_=0;_=0});var P=i.type==="funnelarea"?b:i.sort;return P&&n.sort(function(L,z){return z.v-L.v}),n[0]&&(n[0].vTotal=y),n}function t(a){return function(n,s){return!n||(n=x(n),!n.isValid())?!1:(n=A.addOpacity(n,n.getAlpha()),a[s]||(a[s]=n),n)}}function r(a,i){var n=(i||{}).type;n||(n="pie");var s=a._fullLayout,c=a.calcdata,f=s[n+"colorway"],g=s["_"+n+"colormap"];s["extend"+n+"colors"]&&(f=o(f,M));for(var v=0,T=0;T0&&(rt+=kt*fe.pxmid[0],st+=kt*fe.pxmid[1])}fe.cxFinal=rt,fe.cyFinal=st;function Vt(bt,Be,Ke,Ue){var Me=Ue*(Be[0]-bt[0]),qe=Ue*(Be[1]-bt[1]);return"a"+Ue*ce.r+","+Ue*ce.r+" 0 "+fe.largeArc+(Ke?" 1 ":" 0 ")+Me+","+qe}var Zt=be.hole;if(fe.v===ce.vTotal){var Sr="M"+(rt+fe.px0[0])+","+(st+fe.px0[1])+Vt(fe.px0,fe.pxmid,!0,1)+Vt(fe.pxmid,fe.px0,!0,1)+"Z";Zt?Lt.attr("d","M"+(rt+Zt*fe.px0[0])+","+(st+Zt*fe.px0[1])+Vt(fe.px0,fe.pxmid,!1,Zt)+Vt(fe.pxmid,fe.px0,!1,Zt)+"Z"+Sr):Lt.attr("d",Sr)}else{var xr=Vt(fe.px0,fe.px1,!0,1);if(Zt){var jr=1-Zt;Lt.attr("d","M"+(rt+Zt*fe.px1[0])+","+(st+Zt*fe.px1[1])+Vt(fe.px1,fe.px0,!1,Zt)+"l"+jr*fe.px0[0]+","+jr*fe.px0[1]+xr+"Z")}else Lt.attr("d","M"+rt+","+st+"l"+fe.px0[0]+","+fe.px0[1]+xr+"Z")}he($,fe,ce);var wr=f.castOption(be.textposition,fe.pts),Ir=Qe.selectAll("g.slicetext").data(fe.text&&wr!=="none"?[0]:[]);Ir.enter().append("g").classed("slicetext",!0),Ir.exit().remove(),Ir.each(function(){var bt=t.ensureSingle(d.select(this),"text","",function(Pe){Pe.attr("data-notex",1)}),Be=t.ensureUniformFontSize($,wr==="outside"?w(be,fe,oe.font):S(be,fe,oe.font));bt.text(fe.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(e.font,Be).call(a.convertToTspans,$);var Ke=e.bBox(bt.node()),Ue;if(wr==="outside")Ue=z(Ke,fe);else if(Ue=y(Ke,fe,ce),wr==="auto"&&Ue.scale<1){var Me=t.ensureUniformFontSize($,be.outsidetextfont);bt.call(e.font,Me),Ke=e.bBox(bt.node()),Ue=z(Ke,fe)}var qe=Ue.textPosAngle,Ce=qe===void 0?fe.pxmid:le(ce.r,qe);if(Ue.targetX=rt+Ce[0]*Ue.rCenter+(Ue.x||0),Ue.targetY=st+Ce[1]*Ue.rCenter+(Ue.y||0),G(Ue,Ke),Ue.outside){var Te=Ue.targetY;fe.yLabelMin=Te-Ke.height/2,fe.yLabelMid=Te,fe.yLabelMax=Te+Ke.height/2,fe.labelExtraX=0,fe.labelExtraY=0,Re=!0}Ue.fontSize=Be.size,n(be.type,Ue,oe),ee[Fe].transform=Ue,t.setTransormAndDisplay(bt,Ue)})});var Xe=d.select(this).selectAll("g.titletext").data(be.title.text?[0]:[]);if(Xe.enter().append("g").classed("titletext",!0),Xe.exit().remove(),Xe.each(function(){var fe=t.ensureSingle(d.select(this),"text","",function(st){st.attr("data-notex",1)}),Fe=be.title.text;be._meta&&(Fe=t.templateString(Fe,be._meta)),fe.text(Fe).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(e.font,be.title.font).call(a.convertToTspans,$);var rt;be.title.position==="middle center"?rt=F(ce):rt=B(ce,ie),fe.attr("transform",o(rt.x,rt.y)+r(Math.min(1,rt.scale))+o(rt.tx,rt.ty))}),Re&&U(ze,be),l(Ae,be),Re&&be.automargin){var it=e.bBox(re.node()),ot=be.domain,tt=ie.w*(ot.x[1]-ot.x[0]),lt=ie.h*(ot.y[1]-ot.y[0]),Ee=(.5*tt-ce.r)/ie.w,_e=(.5*lt-ce.r)/ie.h;x.autoMargin($,"pie."+be.uid+".automargin",{xl:ot.x[0]-Ee,xr:ot.x[1]+Ee,yb:ot.y[0]-_e,yt:ot.y[1]+_e,l:Math.max(ce.cx-ce.r-it.left,0),r:Math.max(it.right-(ce.cx+ce.r),0),b:Math.max(it.bottom-(ce.cy+ce.r),0),t:Math.max(ce.cy-ce.r-it.top,0),pad:5})}})});setTimeout(function(){j.selectAll("tspan").each(function(){var ee=d.select(this);ee.attr("dy")&&ee.attr("dy",ee.attr("dy"))})},0)}function l($,J){$.each(function(X){var oe=d.select(this);if(!X.labelExtraX&&!X.labelExtraY){oe.select("path.textline").remove();return}var ie=oe.select("g.slicetext text");X.transform.targetX+=X.labelExtraX,X.transform.targetY+=X.labelExtraY,t.setTransormAndDisplay(ie,X.transform);var j=X.cxFinal+X.pxmid[0],ee=X.cyFinal+X.pxmid[1],re="M"+j+","+ee,ce=(X.yLabelMax-X.yLabelMin)*(X.pxmid[0]<0?-1:1)/4;if(X.labelExtraX){var be=X.labelExtraX*X.pxmid[1]/X.pxmid[0],Ae=X.yLabelMid+X.labelExtraY-(X.cyFinal+X.pxmid[1]);Math.abs(be)>Math.abs(Ae)?re+="l"+Ae*X.pxmid[0]/X.pxmid[1]+","+Ae+"H"+(j+X.labelExtraX+ce):re+="l"+X.labelExtraX+","+be+"v"+(Ae-be)+"h"+ce}else re+="V"+(X.yLabelMid+X.labelExtraY)+"h"+ce;t.ensureSingle(oe,"path","textline").call(M.stroke,J.outsidetextfont.color).attr({"stroke-width":Math.min(2,J.outsidetextfont.size/8),d:re,fill:"none"})})}function _($,J,X){var oe=X[0],ie=oe.cx,j=oe.cy,ee=oe.trace,re=ee.type==="funnelarea";"_hasHoverLabel"in ee||(ee._hasHoverLabel=!1),"_hasHoverEvent"in ee||(ee._hasHoverEvent=!1),$.on("mouseover",function(ce){var be=J._fullLayout,Ae=J._fullData[ee.index];if(!(J._dragging||be.hovermode===!1)){var ze=Ae.hoverinfo;if(Array.isArray(ze)&&(ze=A.castHoverinfo({hoverinfo:[f.castOption(ze,ce.pts)],_module:ee._module},be,0)),ze==="all"&&(ze="label+text+value+percent+name"),Ae.hovertemplate||ze!=="none"&&ze!=="skip"&&ze){var Re=ce.rInscribed||0,Xe=ie+ce.pxmid[0]*(1-Re),it=j+ce.pxmid[1]*(1-Re),ot=be.separators,tt=[];if(ze&&ze.indexOf("label")!==-1&&tt.push(ce.label),ce.text=f.castOption(Ae.hovertext||Ae.text,ce.pts),ze&&ze.indexOf("text")!==-1){var lt=ce.text;t.isValidTextValue(lt)&&tt.push(lt)}ce.value=ce.v,ce.valueLabel=f.formatPieValue(ce.v,ot),ze&&ze.indexOf("value")!==-1&&tt.push(ce.valueLabel),ce.percent=ce.v/oe.vTotal,ce.percentLabel=f.formatPiePercent(ce.percent,ot),ze&&ze.indexOf("percent")!==-1&&tt.push(ce.percentLabel);var Ee=Ae.hoverlabel,_e=Ee.font,fe=[];A.loneHover({trace:ee,x0:Xe-Re*oe.r,x1:Xe+Re*oe.r,y:it,_x0:re?ie+ce.TL[0]:Xe-Re*oe.r,_x1:re?ie+ce.TR[0]:Xe+Re*oe.r,_y0:re?j+ce.TL[1]:it-Re*oe.r,_y1:re?j+ce.BL[1]:it+Re*oe.r,text:tt.join("
"),name:Ae.hovertemplate||ze.indexOf("name")!==-1?Ae.name:void 0,idealAlign:ce.pxmid[0]<0?"left":"right",color:f.castOption(Ee.bgcolor,ce.pts)||ce.color,borderColor:f.castOption(Ee.bordercolor,ce.pts),fontFamily:f.castOption(_e.family,ce.pts),fontSize:f.castOption(_e.size,ce.pts),fontColor:f.castOption(_e.color,ce.pts),nameLength:f.castOption(Ee.namelength,ce.pts),textAlign:f.castOption(Ee.align,ce.pts),hovertemplate:f.castOption(Ae.hovertemplate,ce.pts),hovertemplateLabels:ce,eventData:[g(ce,Ae)]},{container:be._hoverlayer.node(),outerContainer:be._paper.node(),gd:J,inOut_bbox:fe}),ce.bbox=fe[0],ee._hasHoverLabel=!0}ee._hasHoverEvent=!0,J.emit("plotly_hover",{points:[g(ce,Ae)],event:d.event})}}),$.on("mouseout",function(ce){var be=J._fullLayout,Ae=J._fullData[ee.index],ze=d.select(this).datum();ee._hasHoverEvent&&(ce.originalEvent=d.event,J.emit("plotly_unhover",{points:[g(ze,Ae)],event:d.event}),ee._hasHoverEvent=!1),ee._hasHoverLabel&&(A.loneUnhover(be._hoverlayer.node()),ee._hasHoverLabel=!1)}),$.on("click",function(ce){var be=J._fullLayout,Ae=J._fullData[ee.index];J._dragging||be.hovermode===!1||(J._hoverdata=[g(ce,Ae)],A.click(J,d.event))})}function w($,J,X){var oe=f.castOption($.outsidetextfont.color,J.pts)||f.castOption($.textfont.color,J.pts)||X.color,ie=f.castOption($.outsidetextfont.family,J.pts)||f.castOption($.textfont.family,J.pts)||X.family,j=f.castOption($.outsidetextfont.size,J.pts)||f.castOption($.textfont.size,J.pts)||X.size,ee=f.castOption($.outsidetextfont.weight,J.pts)||f.castOption($.textfont.weight,J.pts)||X.weight,re=f.castOption($.outsidetextfont.style,J.pts)||f.castOption($.textfont.style,J.pts)||X.style,ce=f.castOption($.outsidetextfont.variant,J.pts)||f.castOption($.textfont.variant,J.pts)||X.variant,be=f.castOption($.outsidetextfont.textcase,J.pts)||f.castOption($.textfont.textcase,J.pts)||X.textcase,Ae=f.castOption($.outsidetextfont.lineposition,J.pts)||f.castOption($.textfont.lineposition,J.pts)||X.lineposition,ze=f.castOption($.outsidetextfont.shadow,J.pts)||f.castOption($.textfont.shadow,J.pts)||X.shadow;return{color:oe,family:ie,size:j,weight:ee,style:re,variant:ce,textcase:be,lineposition:Ae,shadow:ze}}function S($,J,X){var oe=f.castOption($.insidetextfont.color,J.pts);!oe&&$._input.textfont&&(oe=f.castOption($._input.textfont.color,J.pts));var ie=f.castOption($.insidetextfont.family,J.pts)||f.castOption($.textfont.family,J.pts)||X.family,j=f.castOption($.insidetextfont.size,J.pts)||f.castOption($.textfont.size,J.pts)||X.size,ee=f.castOption($.insidetextfont.weight,J.pts)||f.castOption($.textfont.weight,J.pts)||X.weight,re=f.castOption($.insidetextfont.style,J.pts)||f.castOption($.textfont.style,J.pts)||X.style,ce=f.castOption($.insidetextfont.variant,J.pts)||f.castOption($.textfont.variant,J.pts)||X.variant,be=f.castOption($.insidetextfont.textcase,J.pts)||f.castOption($.textfont.textcase,J.pts)||X.textcase,Ae=f.castOption($.insidetextfont.lineposition,J.pts)||f.castOption($.textfont.lineposition,J.pts)||X.lineposition,ze=f.castOption($.insidetextfont.shadow,J.pts)||f.castOption($.textfont.shadow,J.pts)||X.shadow;return{color:oe||M.contrast(J.color),family:ie,size:j,weight:ee,style:re,variant:ce,textcase:be,lineposition:Ae,shadow:ze}}function E($,J){for(var X,oe,ie=0;ie<$.length;ie++)if(X=$[ie][0],oe=X.trace,oe.title.text){var j=oe.title.text;oe._meta&&(j=t.templateString(j,oe._meta));var ee=e.tester.append("text").attr("data-notex",1).text(j).call(e.font,oe.title.font).call(a.convertToTspans,J),re=e.bBox(ee.node(),!0);X.titleBox={width:re.width,height:re.height},ee.remove()}}function y($,J,X){var oe=X.r||J.rpx1,ie=J.rInscribed,j=J.startangle===J.stopangle;if(j)return{rCenter:1-ie,scale:0,rotate:0,textPosAngle:0};var ee=J.ring,re=ee===1&&Math.abs(J.startangle-J.stopangle)===Math.PI*2,ce=J.halfangle,be=J.midangle,Ae=X.trace.insidetextorientation,ze=Ae==="horizontal",Re=Ae==="tangential",Xe=Ae==="radial",it=Ae==="auto",ot=[],tt;if(!it){var lt=function(Qe,Lt){if(b(J,Qe)){var kt=Math.abs(Qe-J.startangle),Vt=Math.abs(Qe-J.stopangle),Zt=kt=-4;Ee-=2)lt(Math.PI*Ee,"tan");for(Ee=4;Ee>=-4;Ee-=2)lt(Math.PI*(Ee+1),"tan")}if(ze||Xe){for(Ee=4;Ee>=-4;Ee-=2)lt(Math.PI*(Ee+1.5),"rad");for(Ee=4;Ee>=-4;Ee-=2)lt(Math.PI*(Ee+.5),"rad")}}if(re||it||ze){var _e=Math.sqrt($.width*$.width+$.height*$.height);if(tt={scale:ie*oe*2/_e,rCenter:1-ie,rotate:0},tt.textPosAngle=(J.startangle+J.stopangle)/2,tt.scale>=1)return tt;ot.push(tt)}(it||Xe)&&(tt=p($,oe,ee,ce,be),tt.textPosAngle=(J.startangle+J.stopangle)/2,ot.push(tt)),(it||Re)&&(tt=u($,oe,ee,ce,be),tt.textPosAngle=(J.startangle+J.stopangle)/2,ot.push(tt));for(var fe=0,Fe=0,rt=0;rt=1)break}return ot[fe]}function b($,J){var X=$.startangle,oe=$.stopangle;return X>J&&J>oe||X0?1:-1)/2,y:j/(1+X*X/(oe*oe)),outside:!0}}function F($){var J=Math.sqrt($.titleBox.width*$.titleBox.width+$.titleBox.height*$.titleBox.height);return{x:$.cx,y:$.cy,scale:$.trace.hole*$.r*2/J,tx:0,ty:-$.titleBox.height/2+$.trace.title.font.size}}function B($,J){var X=1,oe=1,ie,j=$.trace,ee={x:$.cx,y:$.cy},re={tx:0,ty:0};re.ty+=j.title.font.size,ie=N(j),j.title.position.indexOf("top")!==-1?(ee.y-=(1+ie)*$.r,re.ty-=$.titleBox.height):j.title.position.indexOf("bottom")!==-1&&(ee.y+=(1+ie)*$.r);var ce=O($.r,$.trace.aspectratio),be=J.w*(j.domain.x[1]-j.domain.x[0])/2;return j.title.position.indexOf("left")!==-1?(be=be+ce,ee.x-=(1+ie)*ce,re.tx+=$.titleBox.width/2):j.title.position.indexOf("center")!==-1?be*=2:j.title.position.indexOf("right")!==-1&&(be=be+ce,ee.x+=(1+ie)*ce,re.tx-=$.titleBox.width/2),X=be/$.titleBox.width,oe=I($,J)/$.titleBox.height,{x:ee.x,y:ee.y,scale:Math.min(X,oe),tx:re.tx,ty:re.ty}}function O($,J){return $/(J===void 0?1:J)}function I($,J){var X=$.trace,oe=J.h*(X.domain.y[1]-X.domain.y[0]);return Math.min($.titleBox.height,oe/2)}function N($){var J=$.pull;if(!J)return 0;var X;if(t.isArrayOrTypedArray(J))for(J=0,X=0;X<$.pull.length;X++)$.pull[X]>J&&(J=$.pull[X]);return J}function U($,J){var X,oe,ie,j,ee,re,ce,be,Ae,ze,Re,Xe,it;function ot(_e,fe){return _e.pxmid[1]-fe.pxmid[1]}function tt(_e,fe){return fe.pxmid[1]-_e.pxmid[1]}function lt(_e,fe){fe||(fe={});var Fe=fe.labelExtraY+(oe?fe.yLabelMax:fe.yLabelMin),rt=oe?_e.yLabelMin:_e.yLabelMax,st=oe?_e.yLabelMax:_e.yLabelMin,Qe=_e.cyFinal+ee(_e.px0[1],_e.px1[1]),Lt=Fe-rt,kt,Vt,Zt,Sr,xr,jr;if(Lt*ce>0&&(_e.labelExtraY=Lt),!!t.isArrayOrTypedArray(J.pull))for(Vt=0;Vt=(f.castOption(J.pull,Zt.pts)||0))&&((_e.pxmid[1]-Zt.pxmid[1])*ce>0?(Sr=Zt.cyFinal+ee(Zt.px0[1],Zt.px1[1]),Lt=Sr-rt-_e.labelExtraY,Lt*ce>0&&(_e.labelExtraY+=Lt)):(st+_e.labelExtraY-Qe)*ce>0&&(kt=3*re*Math.abs(Vt-ze.indexOf(_e)),xr=Zt.cxFinal+j(Zt.px0[0],Zt.px1[0]),jr=xr+kt-(_e.cxFinal+_e.pxmid[0])-_e.labelExtraX,jr*re>0&&(_e.labelExtraX+=jr)))}for(oe=0;oe<2;oe++)for(ie=oe?ot:tt,ee=oe?Math.max:Math.min,ce=oe?1:-1,X=0;X<2;X++){for(j=X?Math.max:Math.min,re=X?1:-1,be=$[oe][X],be.sort(ie),Ae=$[1-oe][X],ze=Ae.concat(be),Xe=[],Re=0;Re1?(be=X.r,Ae=be/ie.aspectratio):(Ae=X.r,be=Ae*ie.aspectratio),be*=(1+ie.baseratio)/2,ce=be*Ae}ee=Math.min(ee,ce/X.vTotal)}for(oe=0;oe<$.length;oe++)if(X=$[oe][0],ie=X.trace,ie.scalegroup===re){var ze=ee*X.vTotal;ie.type==="funnelarea"&&(ze/=(1+ie.baseratio)/2,ze/=ie.aspectratio),X.r=Math.sqrt(ze)}}}function ue($){var J=$[0],X=J.r,oe=J.trace,ie=f.getRotationAngle(oe.rotation),j=2*Math.PI/J.vTotal,ee="px0",re="px1",ce,be,Ae;if(oe.direction==="counterclockwise"){for(ce=0;ce<$.length&&$[ce].hidden;ce++);if(ce===$.length)return;ie+=j*$[ce].v,j*=-1,ee="px1",re="px0"}for(Ae=le(X,ie),ce=0;ce<$.length;ce++)be=$[ce],!be.hidden&&(be[ee]=Ae,be.startangle=ie,ie+=j*be.v/2,be.pxmid=le(X,ie),be.midangle=ie,ie+=j*be.v/2,Ae=le(X,ie),be.stopangle=ie,be[re]=Ae,be.largeArc=be.v>J.vTotal/2?1:0,be.halfangle=Math.PI*Math.min(be.v/J.vTotal,.5),be.ring=1-oe.hole,be.rInscribed=L(be,J))}function le($,J){return[$*Math.sin(J),-$*Math.cos(J)]}function he($,J,X){var oe=$._fullLayout,ie=X.trace,j=ie.texttemplate,ee=ie.textinfo;if(!j&&ee&&ee!=="none"){var re=ee.split("+"),ce=function(fe){return re.indexOf(fe)!==-1},be=ce("label"),Ae=ce("text"),ze=ce("value"),Re=ce("percent"),Xe=oe.separators,it;if(it=be?[J.label]:[],Ae){var ot=f.getFirstFilled(ie.text,J.pts);v(ot)&&it.push(ot)}ze&&it.push(f.formatPieValue(J.v,Xe)),Re&&it.push(f.formatPiePercent(J.v/X.vTotal,Xe)),J.text=it.join("
")}function tt(fe){return{label:fe.label,value:fe.v,valueLabel:f.formatPieValue(fe.v,oe.separators),percent:fe.v/X.vTotal,percentLabel:f.formatPiePercent(fe.v/X.vTotal,oe.separators),color:fe.color,text:fe.text,customdata:t.castOption(ie,fe.i,"customdata")}}if(j){var lt=t.castOption(ie,J.i,"texttemplate");if(!lt)J.text="";else{var Ee=tt(J),_e=f.getFirstFilled(ie.text,J.pts);(v(_e)||_e==="")&&(Ee.text=_e),J.text=t.texttemplateString(lt,Ee,$._fullLayout._d3locale,Ee,ie._meta||{})}}}function G($,J){var X=$.rotate*Math.PI/180,oe=Math.cos(X),ie=Math.sin(X),j=(J.left+J.right)/2,ee=(J.top+J.bottom)/2;$.textX=j*oe-ee*ie,$.textY=j*ie+ee*oe,$.noCenter=!0}q.exports={plot:T,formatSliceLabel:he,transformInsideText:y,determineInsideTextFont:S,positionTitleOutside:B,prerenderTitles:E,layoutAreas:W,attachFxHandlers:_,computeTransform:G}}}),kB=Ze({"src/traces/pie/style.js"(Z,q){"use strict";var d=On(),x=i1(),A=Ap().resizeText;q.exports=function(e){var t=e._fullLayout._pielayer.selectAll(".trace");A(e,t,"pie"),t.each(function(r){var o=r[0],a=o.trace,i=d.select(this);i.style({opacity:a.opacity}),i.selectAll("path.surface").each(function(n){d.select(this).call(x,n,a,e)})})}}}),LB=Ze({"src/traces/pie/base_plot.js"(Z){"use strict";var q=xc();Z.name="pie",Z.plot=function(d,x,A,M){q.plotBasePlot(Z.name,d,x,A,M)},Z.clean=function(d,x,A,M){q.cleanBasePlot(Z.name,d,x,A,M)}}}),PB=Ze({"src/traces/pie/index.js"(Z,q){"use strict";q.exports={attributes:ng(),supplyDefaults:og().supplyDefaults,supplyLayoutDefaults:EB(),layoutAttributes:_3(),calc:x1().calc,crossTraceCalc:x1().crossTraceCalc,plot:x3().plot,style:kB(),styleOne:i1(),moduleType:"trace",name:"pie",basePlotModule:LB(),categories:["pie-like","pie","showLegend"],meta:{}}}}),IB=Ze({"lib/pie.js"(Z,q){"use strict";q.exports=PB()}}),RB=Ze({"src/traces/sunburst/base_plot.js"(Z){"use strict";var q=xc();Z.name="sunburst",Z.plot=function(d,x,A,M){q.plotBasePlot(Z.name,d,x,A,M)},Z.clean=function(d,x,A,M){q.cleanBasePlot(Z.name,d,x,A,M)}}}),iM=Ze({"src/traces/sunburst/constants.js"(Z,q){"use strict";q.exports={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:"linear",eventDataKeys:["currentPath","root","entry","percentRoot","percentEntry","percentParent"]}}}),K_=Ze({"src/traces/sunburst/attributes.js"(Z,q){"use strict";var d=eu(),x=Cs().hovertemplateAttrs,A=Cs().texttemplateAttrs,M=Mu(),e=bc().attributes,t=ng(),r=iM(),o=rs().extendFlat,a=Gh().pattern;q.exports={labels:{valType:"data_array",editType:"calc"},parents:{valType:"data_array",editType:"calc"},values:{valType:"data_array",editType:"calc"},branchvalues:{valType:"enumerated",values:["remainder","total"],dflt:"remainder",editType:"calc"},count:{valType:"flaglist",flags:["branches","leaves"],dflt:"leaves",editType:"calc"},level:{valType:"any",editType:"plot",anim:!0},maxdepth:{valType:"integer",editType:"plot",dflt:-1},marker:o({colors:{valType:"data_array",editType:"calc"},line:{color:o({},t.marker.line.color,{dflt:null}),width:o({},t.marker.line.width,{dflt:1}),editType:"calc"},pattern:a,editType:"calc"},M("marker",{colorAttr:"colors",anim:!1})),leaf:{opacity:{valType:"number",editType:"style",min:0,max:1},editType:"plot"},text:t.text,textinfo:{valType:"flaglist",flags:["label","text","value","current path","percent root","percent entry","percent parent"],extras:["none"],editType:"plot"},texttemplate:A({editType:"plot"},{keys:r.eventDataKeys.concat(["label","value"])}),hovertext:t.hovertext,hoverinfo:o({},d.hoverinfo,{flags:["label","text","value","name","current path","percent root","percent entry","percent parent"],dflt:"label+text+value+name"}),hovertemplate:x({},{keys:r.eventDataKeys}),textfont:t.textfont,insidetextorientation:t.insidetextorientation,insidetextfont:t.insidetextfont,outsidetextfont:o({},t.outsidetextfont,{}),rotation:{valType:"angle",dflt:0,editType:"plot"},sort:t.sort,root:{color:{valType:"color",editType:"calc",dflt:"rgba(0,0,0,0)"},editType:"calc"},domain:e({name:"sunburst",trace:!0,editType:"calc"})}}}),nM=Ze({"src/traces/sunburst/layout_attributes.js"(Z,q){"use strict";q.exports={sunburstcolorway:{valType:"colorlist",editType:"calc"},extendsunburstcolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),DB=Ze({"src/traces/sunburst/defaults.js"(Z,q){"use strict";var d=ca(),x=K_(),A=bc().defaults,M=gd().handleText,e=og().handleMarkerDefaults,t=rc(),r=t.hasColorscale,o=t.handleDefaults;q.exports=function(i,n,s,c){function f(S,E){return d.coerce(i,n,x,S,E)}var g=f("labels"),v=f("parents");if(!g||!g.length||!v||!v.length){n.visible=!1;return}var T=f("values");T&&T.length?f("branchvalues"):f("count"),f("level"),f("maxdepth"),e(i,n,c,f);var l=n._hasColorscale=r(i,"marker","colors")||(i.marker||{}).coloraxis;l&&o(i,n,c,f,{prefix:"marker.",cLetter:"c"}),f("leaf.opacity",l?1:.7);var _=f("text");f("texttemplate"),n.texttemplate||f("textinfo",d.isArrayOrTypedArray(_)?"text+label":"label"),f("hovertext"),f("hovertemplate");var w="auto";M(i,n,c,f,w,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),f("insidetextorientation"),f("sort"),f("rotation"),f("root.color"),A(n,c,f),n._length=null}}}),zB=Ze({"src/traces/sunburst/layout_defaults.js"(Z,q){"use strict";var d=ca(),x=nM();q.exports=function(M,e){function t(r,o){return d.coerce(M,e,x,r,o)}t("sunburstcolorway",e.colorway),t("extendsunburstcolors")}}}),J_=Ze({"node_modules/d3-hierarchy/dist/d3-hierarchy.js"(Z,q){(function(d,x){typeof Z=="object"&&typeof q<"u"?x(Z):(d=d||self,x(d.d3=d.d3||{}))})(Z,function(d){"use strict";function x(Ue,Me){return Ue.parent===Me.parent?1:2}function A(Ue){return Ue.reduce(M,0)/Ue.length}function M(Ue,Me){return Ue+Me.x}function e(Ue){return 1+Ue.reduce(t,0)}function t(Ue,Me){return Math.max(Ue,Me.y)}function r(Ue){for(var Me;Me=Ue.children;)Ue=Me[0];return Ue}function o(Ue){for(var Me;Me=Ue.children;)Ue=Me[Me.length-1];return Ue}function a(){var Ue=x,Me=1,qe=1,Ce=!1;function Te(Pe){var at,yt=0;Pe.eachAfter(function(Qt){var Tr=Qt.children;Tr?(Qt.x=A(Tr),Qt.y=e(Tr)):(Qt.x=at?yt+=Ue(Qt,at):0,Qt.y=0,at=Qt)});var Tt=r(Pe),Ot=o(Pe),Gt=Tt.x-Ue(Tt,Ot)/2,rr=Ot.x+Ue(Ot,Tt)/2;return Pe.eachAfter(Ce?function(Qt){Qt.x=(Qt.x-Pe.x)*Me,Qt.y=(Pe.y-Qt.y)*qe}:function(Qt){Qt.x=(Qt.x-Gt)/(rr-Gt)*Me,Qt.y=(1-(Pe.y?Qt.y/Pe.y:1))*qe})}return Te.separation=function(Pe){return arguments.length?(Ue=Pe,Te):Ue},Te.size=function(Pe){return arguments.length?(Ce=!1,Me=+Pe[0],qe=+Pe[1],Te):Ce?null:[Me,qe]},Te.nodeSize=function(Pe){return arguments.length?(Ce=!0,Me=+Pe[0],qe=+Pe[1],Te):Ce?[Me,qe]:null},Te}function i(Ue){var Me=0,qe=Ue.children,Ce=qe&&qe.length;if(!Ce)Me=1;else for(;--Ce>=0;)Me+=qe[Ce].value;Ue.value=Me}function n(){return this.eachAfter(i)}function s(Ue){var Me=this,qe,Ce=[Me],Te,Pe,at;do for(qe=Ce.reverse(),Ce=[];Me=qe.pop();)if(Ue(Me),Te=Me.children,Te)for(Pe=0,at=Te.length;Pe=0;--Te)qe.push(Ce[Te]);return this}function f(Ue){for(var Me=this,qe=[Me],Ce=[],Te,Pe,at;Me=qe.pop();)if(Ce.push(Me),Te=Me.children,Te)for(Pe=0,at=Te.length;Pe=0;)qe+=Ce[Te].value;Me.value=qe})}function v(Ue){return this.eachBefore(function(Me){Me.children&&Me.children.sort(Ue)})}function T(Ue){for(var Me=this,qe=l(Me,Ue),Ce=[Me];Me!==qe;)Me=Me.parent,Ce.push(Me);for(var Te=Ce.length;Ue!==qe;)Ce.splice(Te,0,Ue),Ue=Ue.parent;return Ce}function l(Ue,Me){if(Ue===Me)return Ue;var qe=Ue.ancestors(),Ce=Me.ancestors(),Te=null;for(Ue=qe.pop(),Me=Ce.pop();Ue===Me;)Te=Ue,Ue=qe.pop(),Me=Ce.pop();return Te}function _(){for(var Ue=this,Me=[Ue];Ue=Ue.parent;)Me.push(Ue);return Me}function w(){var Ue=[];return this.each(function(Me){Ue.push(Me)}),Ue}function S(){var Ue=[];return this.eachBefore(function(Me){Me.children||Ue.push(Me)}),Ue}function E(){var Ue=this,Me=[];return Ue.each(function(qe){qe!==Ue&&Me.push({source:qe.parent,target:qe})}),Me}function y(Ue,Me){var qe=new h(Ue),Ce=+Ue.value&&(qe.value=Ue.value),Te,Pe=[qe],at,yt,Tt,Ot;for(Me==null&&(Me=p);Te=Pe.pop();)if(Ce&&(Te.value=+Te.data.value),(yt=Me(Te.data))&&(Ot=yt.length))for(Te.children=new Array(Ot),Tt=Ot-1;Tt>=0;--Tt)Pe.push(at=Te.children[Tt]=new h(yt[Tt])),at.parent=Te,at.depth=Te.depth+1;return qe.eachBefore(m)}function b(){return y(this).eachBefore(u)}function p(Ue){return Ue.children}function u(Ue){Ue.data=Ue.data.data}function m(Ue){var Me=0;do Ue.height=Me;while((Ue=Ue.parent)&&Ue.height<++Me)}function h(Ue){this.data=Ue,this.depth=this.height=0,this.parent=null}h.prototype=y.prototype={constructor:h,count:n,each:s,eachAfter:f,eachBefore:c,sum:g,sort:v,path:T,ancestors:_,descendants:w,leaves:S,links:E,copy:b};var P=Array.prototype.slice;function L(Ue){for(var Me=Ue.length,qe,Ce;Me;)Ce=Math.random()*Me--|0,qe=Ue[Me],Ue[Me]=Ue[Ce],Ue[Ce]=qe;return Ue}function z(Ue){for(var Me=0,qe=(Ue=L(P.call(Ue))).length,Ce=[],Te,Pe;Me0&&qe*qe>Ce*Ce+Te*Te}function I(Ue,Me){for(var qe=0;qeTt?(Te=(Ot+Tt-Pe)/(2*Ot),yt=Math.sqrt(Math.max(0,Tt/Ot-Te*Te)),qe.x=Ue.x-Te*Ce-yt*at,qe.y=Ue.y-Te*at+yt*Ce):(Te=(Ot+Pe-Tt)/(2*Ot),yt=Math.sqrt(Math.max(0,Pe/Ot-Te*Te)),qe.x=Me.x+Te*Ce-yt*at,qe.y=Me.y+Te*at+yt*Ce)):(qe.x=Me.x+qe.r,qe.y=Me.y)}function le(Ue,Me){var qe=Ue.r+Me.r-1e-6,Ce=Me.x-Ue.x,Te=Me.y-Ue.y;return qe>0&&qe*qe>Ce*Ce+Te*Te}function he(Ue){var Me=Ue._,qe=Ue.next._,Ce=Me.r+qe.r,Te=(Me.x*qe.r+qe.x*Me.r)/Ce,Pe=(Me.y*qe.r+qe.y*Me.r)/Ce;return Te*Te+Pe*Pe}function G(Ue){this._=Ue,this.next=null,this.previous=null}function $(Ue){if(!(Te=Ue.length))return 0;var Me,qe,Ce,Te,Pe,at,yt,Tt,Ot,Gt,rr;if(Me=Ue[0],Me.x=0,Me.y=0,!(Te>1))return Me.r;if(qe=Ue[1],Me.x=-qe.r,qe.x=Me.r,qe.y=0,!(Te>2))return Me.r+qe.r;ue(qe,Me,Ce=Ue[2]),Me=new G(Me),qe=new G(qe),Ce=new G(Ce),Me.next=Ce.previous=qe,qe.next=Me.previous=Ce,Ce.next=qe.previous=Me;e:for(yt=3;yt0)throw new Error("cycle");return yt}return qe.id=function(Ce){return arguments.length?(Ue=oe(Ce),qe):Ue},qe.parentId=function(Ce){return arguments.length?(Me=oe(Ce),qe):Me},qe}function fe(Ue,Me){return Ue.parent===Me.parent?1:2}function Fe(Ue){var Me=Ue.children;return Me?Me[0]:Ue.t}function rt(Ue){var Me=Ue.children;return Me?Me[Me.length-1]:Ue.t}function st(Ue,Me,qe){var Ce=qe/(Me.i-Ue.i);Me.c-=Ce,Me.s+=qe,Ue.c+=Ce,Me.z+=qe,Me.m+=qe}function Qe(Ue){for(var Me=0,qe=0,Ce=Ue.children,Te=Ce.length,Pe;--Te>=0;)Pe=Ce[Te],Pe.z+=Me,Pe.m+=Me,Me+=Pe.s+(qe+=Pe.c)}function Lt(Ue,Me,qe){return Ue.a.parent===Me.parent?Ue.a:qe}function kt(Ue,Me){this._=Ue,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=Me}kt.prototype=Object.create(h.prototype);function Vt(Ue){for(var Me=new kt(Ue,0),qe,Ce=[Me],Te,Pe,at,yt;qe=Ce.pop();)if(Pe=qe._.children)for(qe.children=new Array(yt=Pe.length),at=yt-1;at>=0;--at)Ce.push(Te=qe.children[at]=new kt(Pe[at],at)),Te.parent=qe;return(Me.parent=new kt(null,0)).children=[Me],Me}function Zt(){var Ue=fe,Me=1,qe=1,Ce=null;function Te(Ot){var Gt=Vt(Ot);if(Gt.eachAfter(Pe),Gt.parent.m=-Gt.z,Gt.eachBefore(at),Ce)Ot.eachBefore(Tt);else{var rr=Ot,Qt=Ot,Tr=Ot;Ot.eachBefore(function(ei){ei.xQt.x&&(Qt=ei),ei.depth>Tr.depth&&(Tr=ei)});var la=rr===Qt?1:Ue(rr,Qt)/2,Ua=la-rr.x,Ba=Me/(Qt.x+la+Ua),Ra=qe/(Tr.depth||1);Ot.eachBefore(function(ei){ei.x=(ei.x+Ua)*Ba,ei.y=ei.depth*Ra})}return Ot}function Pe(Ot){var Gt=Ot.children,rr=Ot.parent.children,Qt=Ot.i?rr[Ot.i-1]:null;if(Gt){Qe(Ot);var Tr=(Gt[0].z+Gt[Gt.length-1].z)/2;Qt?(Ot.z=Qt.z+Ue(Ot._,Qt._),Ot.m=Ot.z-Tr):Ot.z=Tr}else Qt&&(Ot.z=Qt.z+Ue(Ot._,Qt._));Ot.parent.A=yt(Ot,Qt,Ot.parent.A||rr[0])}function at(Ot){Ot._.x=Ot.z+Ot.parent.m,Ot.m+=Ot.parent.m}function yt(Ot,Gt,rr){if(Gt){for(var Qt=Ot,Tr=Ot,la=Gt,Ua=Qt.parent.children[0],Ba=Qt.m,Ra=Tr.m,ei=la.m,za=Ua.m,ti;la=rt(la),Qt=Fe(Qt),la&&Qt;)Ua=Fe(Ua),Tr=rt(Tr),Tr.a=Ot,ti=la.z+ei-Qt.z-Ba+Ue(la._,Qt._),ti>0&&(st(Lt(la,Ot,rr),Ot,ti),Ba+=ti,Ra+=ti),ei+=la.m,Ba+=Qt.m,za+=Ua.m,Ra+=Tr.m;la&&!rt(Tr)&&(Tr.t=la,Tr.m+=ei-Ra),Qt&&!Fe(Ua)&&(Ua.t=Qt,Ua.m+=Ba-za,rr=Ot)}return rr}function Tt(Ot){Ot.x*=Me,Ot.y=Ot.depth*qe}return Te.separation=function(Ot){return arguments.length?(Ue=Ot,Te):Ue},Te.size=function(Ot){return arguments.length?(Ce=!1,Me=+Ot[0],qe=+Ot[1],Te):Ce?null:[Me,qe]},Te.nodeSize=function(Ot){return arguments.length?(Ce=!0,Me=+Ot[0],qe=+Ot[1],Te):Ce?[Me,qe]:null},Te}function Sr(Ue,Me,qe,Ce,Te){for(var Pe=Ue.children,at,yt=-1,Tt=Pe.length,Ot=Ue.value&&(Te-qe)/Ue.value;++ytei&&(ei=Ot),Jt=Ba*Ba*Ci,za=Math.max(ei/Jt,Jt/Ra),za>ti){Ba-=Ot;break}ti=za}at.push(Tt={value:Ba,dice:Tr1?Ce:1)},qe}(xr);function Ir(){var Ue=wr,Me=!1,qe=1,Ce=1,Te=[0],Pe=ie,at=ie,yt=ie,Tt=ie,Ot=ie;function Gt(Qt){return Qt.x0=Qt.y0=0,Qt.x1=qe,Qt.y1=Ce,Qt.eachBefore(rr),Te=[0],Me&&Qt.eachBefore(ze),Qt}function rr(Qt){var Tr=Te[Qt.depth],la=Qt.x0+Tr,Ua=Qt.y0+Tr,Ba=Qt.x1-Tr,Ra=Qt.y1-Tr;Ba=Qt-1){var ei=Pe[rr];ei.x0=la,ei.y0=Ua,ei.x1=Ba,ei.y1=Ra;return}for(var za=Ot[rr],ti=Tr/2+za,Ci=rr+1,Jt=Qt-1;Ci>>1;Ot[Nt]Ra-Ua){var Pr=(la*Wt+Ba*Kt)/Tr;Gt(rr,Ci,Kt,la,Ua,Pr,Ra),Gt(Ci,Qt,Wt,Pr,Ua,Ba,Ra)}else{var ta=(Ua*Wt+Ra*Kt)/Tr;Gt(rr,Ci,Kt,la,Ua,Ba,ta),Gt(Ci,Qt,Wt,la,ta,Ba,Ra)}}}function Be(Ue,Me,qe,Ce,Te){(Ue.depth&1?Sr:Re)(Ue,Me,qe,Ce,Te)}var Ke=function Ue(Me){function qe(Ce,Te,Pe,at,yt){if((Tt=Ce._squarify)&&Tt.ratio===Me)for(var Tt,Ot,Gt,rr,Qt=-1,Tr,la=Tt.length,Ua=Ce.value;++Qt1?Ce:1)},qe}(xr);d.cluster=a,d.hierarchy=y,d.pack=re,d.packEnclose=z,d.packSiblings=J,d.partition=Xe,d.stratify=_e,d.tree=Zt,d.treemap=Ir,d.treemapBinary=bt,d.treemapDice=Re,d.treemapResquarify=Ke,d.treemapSlice=Sr,d.treemapSliceDice=Be,d.treemapSquarify=wr,Object.defineProperty(d,"__esModule",{value:!0})})}}),$_=Ze({"src/traces/sunburst/calc.js"(Z){"use strict";var q=J_(),d=ns(),x=ca(),A=rc().makeColorScaleFuncFromTrace,M=x1().makePullColorFn,e=x1().generateExtendedColors,t=rc().calc,r=qs().ALMOST_EQUAL,o={},a={},i={};Z.calc=function(s,c){var f=s._fullLayout,g=c.ids,v=x.isArrayOrTypedArray(g),T=c.labels,l=c.parents,_=c.values,w=x.isArrayOrTypedArray(_),S=[],E={},y={},b=function(J,X){E[J]?E[J].push(X):E[J]=[X],y[X]=1},p=function(J){return J||typeof J=="number"},u=function(J){return!w||d(_[J])&&_[J]>=0},m,h,P;v?(m=Math.min(g.length,l.length),h=function(J){return p(g[J])&&u(J)},P=function(J){return String(g[J])}):(m=Math.min(T.length,l.length),h=function(J){return p(T[J])&&u(J)},P=function(J){return String(T[J])}),w&&(m=Math.min(m,_.length));for(var L=0;L1){for(var N=x.randstr(),U=0;U>8&15|q>>4&240,q>>4&15|q&240,(q&15)<<4|q&15,1):d===8?Q_(q>>24&255,q>>16&255,q>>8&255,(q&255)/255):d===4?Q_(q>>12&15|q>>8&240,q>>8&15|q>>4&240,q>>4&15|q&240,((q&15)<<4|q&15)/255):null):(q=vM.exec(Z))?new Xh(q[1],q[2],q[3],1):(q=mM.exec(Z))?new Xh(q[1]*255/100,q[2]*255/100,q[3]*255/100,1):(q=gM.exec(Z))?Q_(q[1],q[2],q[3],q[4]):(q=yM.exec(Z))?Q_(q[1]*255/100,q[2]*255/100,q[3]*255/100,q[4]):(q=_M.exec(Z))?fM(q[1],q[2]/100,q[3]/100,1):(q=xM.exec(Z))?fM(q[1],q[2]/100,q[3]/100,q[4]):S3.hasOwnProperty(Z)?lM(S3[Z]):Z==="transparent"?new Xh(NaN,NaN,NaN,0):null}function lM(Z){return new Xh(Z>>16&255,Z>>8&255,Z&255,1)}function Q_(Z,q,d,x){return x<=0&&(Z=q=d=NaN),new Xh(Z,q,d,x)}function w3(Z){return Z instanceof Kv||(Z=w1(Z)),Z?(Z=Z.rgb(),new Xh(Z.r,Z.g,Z.b,Z.opacity)):new Xh}function ex(Z,q,d,x){return arguments.length===1?w3(Z):new Xh(Z,q,d,x??1)}function Xh(Z,q,d,x){this.r=+Z,this.g=+q,this.b=+d,this.opacity=+x}function uM(){return`#${o0(this.r)}${o0(this.g)}${o0(this.b)}`}function BB(){return`#${o0(this.r)}${o0(this.g)}${o0(this.b)}${o0((isNaN(this.opacity)?1:this.opacity)*255)}`}function cM(){let Z=tx(this.opacity);return`${Z===1?"rgb(":"rgba("}${n0(this.r)}, ${n0(this.g)}, ${n0(this.b)}${Z===1?")":`, ${Z})`}`}function tx(Z){return isNaN(Z)?1:Math.max(0,Math.min(1,Z))}function n0(Z){return Math.max(0,Math.min(255,Math.round(Z)||0))}function o0(Z){return Z=n0(Z),(Z<16?"0":"")+Z.toString(16)}function fM(Z,q,d,x){return x<=0?Z=q=d=NaN:d<=0||d>=1?Z=q=NaN:q<=0&&(Z=NaN),new Ud(Z,q,d,x)}function hM(Z){if(Z instanceof Ud)return new Ud(Z.h,Z.s,Z.l,Z.opacity);if(Z instanceof Kv||(Z=w1(Z)),!Z)return new Ud;if(Z instanceof Ud)return Z;Z=Z.rgb();var q=Z.r/255,d=Z.g/255,x=Z.b/255,A=Math.min(q,d,x),M=Math.max(q,d,x),e=NaN,t=M-A,r=(M+A)/2;return t?(q===M?e=(d-x)/t+(d0&&r<1?0:e,new Ud(e,t,r,Z.opacity)}function T3(Z,q,d,x){return arguments.length===1?hM(Z):new Ud(Z,q,d,x??1)}function Ud(Z,q,d,x){this.h=+Z,this.s=+q,this.l=+d,this.opacity=+x}function pM(Z){return Z=(Z||0)%360,Z<0?Z+360:Z}function rx(Z){return Math.max(0,Math.min(1,Z||0))}function A3(Z,q,d){return(Z<60?q+(d-q)*Z/60:Z<180?d:Z<240?q+(d-q)*(240-Z)/60:q)*255}var Jv,s0,l0,lg,jd,dM,vM,mM,gM,yM,_M,xM,S3,M3=wo({"node_modules/d3-color/src/color.js"(){b3(),Jv=.7,s0=1/Jv,l0="\\s*([+-]?\\d+)\\s*",lg="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",jd="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",dM=/^#([0-9a-f]{3,8})$/,vM=new RegExp(`^rgb\\(${l0},${l0},${l0}\\)$`),mM=new RegExp(`^rgb\\(${jd},${jd},${jd}\\)$`),gM=new RegExp(`^rgba\\(${l0},${l0},${l0},${lg}\\)$`),yM=new RegExp(`^rgba\\(${jd},${jd},${jd},${lg}\\)$`),_M=new RegExp(`^hsl\\(${lg},${jd},${jd}\\)$`),xM=new RegExp(`^hsla\\(${lg},${jd},${jd},${lg}\\)$`),S3={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},sg(Kv,w1,{copy(Z){return Object.assign(new this.constructor,this,Z)},displayable(){return this.rgb().displayable()},hex:oM,formatHex:oM,formatHex8:FB,formatHsl:OB,formatRgb:sM,toString:sM}),sg(Xh,ex,b1(Kv,{brighter(Z){return Z=Z==null?s0:Math.pow(s0,Z),new Xh(this.r*Z,this.g*Z,this.b*Z,this.opacity)},darker(Z){return Z=Z==null?Jv:Math.pow(Jv,Z),new Xh(this.r*Z,this.g*Z,this.b*Z,this.opacity)},rgb(){return this},clamp(){return new Xh(n0(this.r),n0(this.g),n0(this.b),tx(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:uM,formatHex:uM,formatHex8:BB,formatRgb:cM,toString:cM})),sg(Ud,T3,b1(Kv,{brighter(Z){return Z=Z==null?s0:Math.pow(s0,Z),new Ud(this.h,this.s,this.l*Z,this.opacity)},darker(Z){return Z=Z==null?Jv:Math.pow(Jv,Z),new Ud(this.h,this.s,this.l*Z,this.opacity)},rgb(){var Z=this.h%360+(this.h<0)*360,q=isNaN(Z)||isNaN(this.s)?0:this.s,d=this.l,x=d+(d<.5?d:1-d)*q,A=2*d-x;return new Xh(A3(Z>=240?Z-240:Z+120,A,x),A3(Z,A,x),A3(Z<120?Z+240:Z-120,A,x),this.opacity)},clamp(){return new Ud(pM(this.h),rx(this.s),rx(this.l),tx(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let Z=tx(this.opacity);return`${Z===1?"hsl(":"hsla("}${pM(this.h)}, ${rx(this.s)*100}%, ${rx(this.l)*100}%${Z===1?")":`, ${Z})`}`}}))}}),E3,C3,bM=wo({"node_modules/d3-color/src/math.js"(){E3=Math.PI/180,C3=180/Math.PI}});function wM(Z){if(Z instanceof rv)return new rv(Z.l,Z.a,Z.b,Z.opacity);if(Z instanceof Mv)return TM(Z);Z instanceof Xh||(Z=w3(Z));var q=R3(Z.r),d=R3(Z.g),x=R3(Z.b),A=L3((.2225045*q+.7168786*d+.0606169*x)/F3),M,e;return q===d&&d===x?M=e=A:(M=L3((.4360747*q+.3850649*d+.1430804*x)/z3),e=L3((.0139322*q+.0971045*d+.7141733*x)/O3)),new rv(116*A-16,500*(M-A),200*(A-e),Z.opacity)}function k3(Z,q,d,x){return arguments.length===1?wM(Z):new rv(Z,q,d,x??1)}function rv(Z,q,d,x){this.l=+Z,this.a=+q,this.b=+d,this.opacity=+x}function L3(Z){return Z>AM?Math.pow(Z,.3333333333333333):Z/N3+B3}function P3(Z){return Z>u0?Z*Z*Z:N3*(Z-B3)}function I3(Z){return 255*(Z<=.0031308?12.92*Z:1.055*Math.pow(Z,.4166666666666667)-.055)}function R3(Z){return(Z/=255)<=.04045?Z/12.92:Math.pow((Z+.055)/1.055,2.4)}function NB(Z){if(Z instanceof Mv)return new Mv(Z.h,Z.c,Z.l,Z.opacity);if(Z instanceof rv||(Z=wM(Z)),Z.a===0&&Z.b===0)return new Mv(NaN,0=1?(d=1,q-1):Math.floor(d*q),A=Z[x],M=Z[x+1],e=x>0?Z[x-1]:2*A-M,t=x()=>Z}});function LM(Z,q){return function(d){return Z+d*q}}function VB(Z,q,d){return Z=Math.pow(Z,d),q=Math.pow(q,d)-Z,d=1/d,function(x){return Math.pow(Z+x*q,d)}}function nx(Z,q){var d=q-Z;return d?LM(Z,d>180||d<-180?d-360*Math.round(d/360):d):S1(isNaN(Z)?q:Z)}function GB(Z){return(Z=+Z)==1?Zh:function(q,d){return d-q?VB(q,d,Z):S1(isNaN(q)?d:q)}}function Zh(Z,q){var d=q-Z;return d?LM(Z,d):S1(isNaN(Z)?q:Z)}var fg=wo({"node_modules/d3-interpolate/src/color.js"(){kM()}});function PM(Z){return function(q){var d=q.length,x=new Array(d),A=new Array(d),M=new Array(d),e,t;for(e=0;ed&&(M=q.slice(d,M),t[e]?t[e]+=M:t[++e]=M),(x=x[0])===(A=A[0])?t[e]?t[e]+=A:t[++e]=A:(t[++e]=null,r.push({i:e,x:av(x,A)})),d=ux.lastIndex;return d180?a+=360:a-o>180&&(o+=360),n.push({i:i.push(A(i)+"rotate(",null,x)-2,x:av(o,a)})):a&&i.push(A(i)+"rotate("+a+x)}function t(o,a,i,n){o!==a?n.push({i:i.push(A(i)+"skewX(",null,x)-2,x:av(o,a)}):a&&i.push(A(i)+"skewX("+a+x)}function r(o,a,i,n,s,c){if(o!==i||a!==n){var f=s.push(A(s)+"scale(",null,",",null,")");c.push({i:f-4,x:av(o,i)},{i:f-2,x:av(a,n)})}else(i!==1||n!==1)&&s.push(A(s)+"scale("+i+","+n+")")}return function(o,a){var i=[],n=[];return o=Z(o),a=Z(a),M(o.translateX,o.translateY,a.translateX,a.translateY,i,n),e(o.rotate,a.rotate,i,n),t(o.skewX,a.skewX,i,n),r(o.scaleX,o.scaleY,a.scaleX,a.scaleY,i,n),o=a=null,function(s){for(var c=-1,f=n.length,g;++ccx,interpolateArray:()=>HB,interpolateBasis:()=>MM,interpolateBasisClosed:()=>EM,interpolateCubehelix:()=>iE,interpolateCubehelixLong:()=>nE,interpolateDate:()=>BM,interpolateDiscrete:()=>ZB,interpolateHcl:()=>tE,interpolateHclLong:()=>rE,interpolateHsl:()=>$M,interpolateHslLong:()=>QM,interpolateHue:()=>KB,interpolateLab:()=>uN,interpolateNumber:()=>av,interpolateNumberArray:()=>W3,interpolateObject:()=>UM,interpolateRgb:()=>ox,interpolateRgbBasis:()=>IM,interpolateRgbBasisClosed:()=>RM,interpolateRound:()=>$B,interpolateString:()=>qM,interpolateTransformCss:()=>WM,interpolateTransformSvg:()=>XM,interpolateZoom:()=>KM,piecewise:()=>pN,quantize:()=>vN});var hg=wo({"node_modules/d3-interpolate/src/index.js"(){fx(),OM(),H3(),CM(),NM(),YB(),JB(),sx(),X3(),jM(),QB(),VM(),iN(),sN(),DM(),lN(),cN(),fN(),hN(),dN(),mN()}}),Y3=Ze({"src/traces/sunburst/fill_one.js"(Z,q){"use strict";var d=as(),x=Yn();q.exports=function(M,e,t,r,o){var a=e.data.data,i=a.i,n=o||a.color;if(i>=0){e.i=a.i;var s=t.marker;s.pattern?(!s.colors||!s.pattern.shape)&&(s.color=n,e.color=n):(s.color=n,e.color=n),d.pointStyle(M,t,r,e)}else x.fill(M,n)}}}),oE=Ze({"src/traces/sunburst/style.js"(Z,q){"use strict";var d=On(),x=Yn(),A=ca(),M=Ap().resizeText,e=Y3();function t(o){var a=o._fullLayout._sunburstlayer.selectAll(".trace");M(o,a,"sunburst"),a.each(function(i){var n=d.select(this),s=i[0],c=s.trace;n.style("opacity",c.opacity),n.selectAll("path.surface").each(function(f){d.select(this).call(r,f,c,o)})})}function r(o,a,i,n){var s=a.data.data,c=!a.children,f=s.i,g=A.castOption(i,f,"marker.line.color")||x.defaultLine,v=A.castOption(i,f,"marker.line.width")||0;o.call(e,a,i,n).style("stroke-width",v).call(x.stroke,g).style("opacity",c?i.leaf.opacity:null)}q.exports={style:t,styleOne:r}}}),$v=Ze({"src/traces/sunburst/helpers.js"(Z){"use strict";var q=ca(),d=Yn(),x=Kd(),A=e0();Z.findEntryWithLevel=function(r,o){var a;return o&&r.eachAfter(function(i){if(Z.getPtId(i)===o)return a=i.copy()}),a||r},Z.findEntryWithChild=function(r,o){var a;return r.eachAfter(function(i){for(var n=i.children||[],s=0;s0)},Z.getMaxDepth=function(r){return r.maxdepth>=0?r.maxdepth:1/0},Z.isHeader=function(r,o){return!(Z.isLeaf(r)||r.depth===o._maxDepth-1)};function t(r){return r.data.data.pid}Z.getParent=function(r,o){return Z.findEntryWithLevel(r,t(o))},Z.listPath=function(r,o){var a=r.parent;if(!a)return[];var i=o?[a.data[o]]:[a];return Z.listPath(a,o).concat(i)},Z.getPath=function(r){return Z.listPath(r,"label").join("/")+"/"},Z.formatValue=A.formatPieValue,Z.formatPercent=function(r,o){var a=q.formatPercent(r,0);return a==="0%"&&(a=A.formatPiePercent(r,o)),a}}}),dx=Ze({"src/traces/sunburst/fx.js"(Z,q){"use strict";var d=On(),x=oo(),A=Qp().appendArrayPointValue,M=ef(),e=ca(),t=Qy(),r=$v(),o=e0(),a=o.formatPieValue;q.exports=function(s,c,f,g,v){var T=g[0],l=T.trace,_=T.hierarchy,w=l.type==="sunburst",S=l.type==="treemap"||l.type==="icicle";"_hasHoverLabel"in l||(l._hasHoverLabel=!1),"_hasHoverEvent"in l||(l._hasHoverEvent=!1);var E=function(p){var u=f._fullLayout;if(!(f._dragging||u.hovermode===!1)){var m=f._fullData[l.index],h=p.data.data,P=h.i,L=r.isHierarchyRoot(p),z=r.getParent(_,p),F=r.getValue(p),B=function(ee){return e.castOption(m,P,ee)},O=B("hovertemplate"),I=M.castHoverinfo(m,u,P),N=u.separators,U;if(O||I&&I!=="none"&&I!=="skip"){var W,Q;w&&(W=T.cx+p.pxmid[0]*(1-p.rInscribed),Q=T.cy+p.pxmid[1]*(1-p.rInscribed)),S&&(W=p._hoverX,Q=p._hoverY);var ue={},le=[],he=[],G=function(ee){return le.indexOf(ee)!==-1};I&&(le=I==="all"?m._module.attributes.hoverinfo.flags:I.split("+")),ue.label=h.label,G("label")&&ue.label&&he.push(ue.label),h.hasOwnProperty("v")&&(ue.value=h.v,ue.valueLabel=a(ue.value,N),G("value")&&he.push(ue.valueLabel)),ue.currentPath=p.currentPath=r.getPath(p.data),G("current path")&&!L&&he.push(ue.currentPath);var $,J=[],X=function(){J.indexOf($)===-1&&(he.push($),J.push($))};ue.percentParent=p.percentParent=F/r.getValue(z),ue.parent=p.parentString=r.getPtLabel(z),G("percent parent")&&($=r.formatPercent(ue.percentParent,N)+" of "+ue.parent,X()),ue.percentEntry=p.percentEntry=F/r.getValue(c),ue.entry=p.entry=r.getPtLabel(c),G("percent entry")&&!L&&!p.onPathbar&&($=r.formatPercent(ue.percentEntry,N)+" of "+ue.entry,X()),ue.percentRoot=p.percentRoot=F/r.getValue(_),ue.root=p.root=r.getPtLabel(_),G("percent root")&&!L&&($=r.formatPercent(ue.percentRoot,N)+" of "+ue.root,X()),ue.text=B("hovertext")||B("text"),G("text")&&($=ue.text,e.isValidTextValue($)&&he.push($)),U=[i(p,m,v.eventDataKeys)];var oe={trace:m,y:Q,_x0:p._x0,_x1:p._x1,_y0:p._y0,_y1:p._y1,text:he.join("
"),name:O||G("name")?m.name:void 0,color:B("hoverlabel.bgcolor")||h.color,borderColor:B("hoverlabel.bordercolor"),fontFamily:B("hoverlabel.font.family"),fontSize:B("hoverlabel.font.size"),fontColor:B("hoverlabel.font.color"),fontWeight:B("hoverlabel.font.weight"),fontStyle:B("hoverlabel.font.style"),fontVariant:B("hoverlabel.font.variant"),nameLength:B("hoverlabel.namelength"),textAlign:B("hoverlabel.align"),hovertemplate:O,hovertemplateLabels:ue,eventData:U};w&&(oe.x0=W-p.rInscribed*p.rpx1,oe.x1=W+p.rInscribed*p.rpx1,oe.idealAlign=p.pxmid[0]<0?"left":"right"),S&&(oe.x=W,oe.idealAlign=W<0?"left":"right");var ie=[];M.loneHover(oe,{container:u._hoverlayer.node(),outerContainer:u._paper.node(),gd:f,inOut_bbox:ie}),U[0].bbox=ie[0],l._hasHoverLabel=!0}if(S){var j=s.select("path.surface");v.styleOne(j,p,m,f,{hovered:!0})}l._hasHoverEvent=!0,f.emit("plotly_hover",{points:U||[i(p,m,v.eventDataKeys)],event:d.event})}},y=function(p){var u=f._fullLayout,m=f._fullData[l.index],h=d.select(this).datum();if(l._hasHoverEvent&&(p.originalEvent=d.event,f.emit("plotly_unhover",{points:[i(h,m,v.eventDataKeys)],event:d.event}),l._hasHoverEvent=!1),l._hasHoverLabel&&(M.loneUnhover(u._hoverlayer.node()),l._hasHoverLabel=!1),S){var P=s.select("path.surface");v.styleOne(P,h,m,f,{hovered:!1})}},b=function(p){var u=f._fullLayout,m=f._fullData[l.index],h=w&&(r.isHierarchyRoot(p)||r.isLeaf(p)),P=r.getPtId(p),L=r.isEntry(p)?r.findEntryWithChild(_,P):r.findEntryWithLevel(_,P),z=r.getPtId(L),F={points:[i(p,m,v.eventDataKeys)],event:d.event};h||(F.nextLevel=z);var B=t.triggerHandler(f,"plotly_"+l.type+"click",F);if(B!==!1&&u.hovermode&&(f._hoverdata=[i(p,m,v.eventDataKeys)],M.click(f,d.event)),!h&&B!==!1&&!f._dragging&&!f._transitioning){x.call("_storeDirectGUIEdit",m,u._tracePreGUI[m.uid],{level:m.level});var O={data:[{level:z}],traces:[l.index]},I={frame:{redraw:!1,duration:v.transitionTime},transition:{duration:v.transitionTime,easing:v.transitionEasing},mode:"immediate",fromcurrent:!0};M.loneUnhover(u._hoverlayer.node()),x.call("animate",f,O,I)}};s.on("mouseover",E),s.on("mouseout",y),s.on("click",b)};function i(n,s,c){for(var f=n.data.data,g={curveNumber:s.index,pointNumber:f.i,data:s._input,fullData:s},v=0;vst.x1?2*Math.PI:0)+ee;Qe=fe.rpx1Xe?2*Math.PI:0)+ee;rt={x0:Qe,x1:Qe}}else rt={rpx0:le,rpx1:le},M.extendFlat(rt,_e(fe));else rt={rpx0:0,rpx1:0};else rt={x0:ee,x1:ee};return x(rt,st)}function Ee(fe){var Fe=J[T.getPtId(fe)],rt,st=fe.transform;if(Fe)rt=Fe;else if(rt={rpx1:fe.rpx1,transform:{textPosAngle:st.textPosAngle,scale:0,rotate:st.rotate,rCenter:st.rCenter,x:st.x,y:st.y}},$)if(fe.parent)if(Xe){var Qe=fe.x1>Xe?2*Math.PI:0;rt.x0=rt.x1=Qe}else M.extendFlat(rt,_e(fe));else rt.x0=rt.x1=ee;else rt.x0=rt.x1=ee;var Lt=x(rt.transform.textPosAngle,fe.transform.textPosAngle),kt=x(rt.rpx1,fe.rpx1),Vt=x(rt.x0,fe.x0),Zt=x(rt.x1,fe.x1),Sr=x(rt.transform.scale,st.scale),xr=x(rt.transform.rotate,st.rotate),jr=st.rCenter===0?3:rt.transform.rCenter===0?1/3:1,wr=x(rt.transform.rCenter,st.rCenter),Ir=function(bt){return wr(Math.pow(bt,jr))};return function(bt){var Be=kt(bt),Ke=Vt(bt),Ue=Zt(bt),Me=Ir(bt),qe=be(Be,(Ke+Ue)/2),Ce=Lt(bt),Te={pxmid:qe,rpx1:Be,transform:{textPosAngle:Ce,rCenter:Me,x:st.x,y:st.y}};return r(B.type,st,h),{transform:{targetX:ze(Te),targetY:Re(Te),scale:Sr(bt),rotate:xr(bt),rCenter:Me}}}}function _e(fe){var Fe=fe.parent,rt=J[T.getPtId(Fe)],st={};if(rt){var Qe=Fe.children,Lt=Qe.indexOf(fe),kt=Qe.length,Vt=x(rt.x0,rt.x1);st.x0=Vt(Lt/kt),st.x1=Vt(Lt/kt)}else st.x0=st.x1=0;return st}}function _(y){return d.partition().size([2*Math.PI,y.height+1])(y)}Z.formatSliceLabel=function(y,b,p,u,m){var h=p.texttemplate,P=p.textinfo;if(!h&&(!P||P==="none"))return"";var L=m.separators,z=u[0],F=y.data.data,B=z.hierarchy,O=T.isHierarchyRoot(y),I=T.getParent(B,y),N=T.getValue(y);if(!h){var U=P.split("+"),W=function(ie){return U.indexOf(ie)!==-1},Q=[],ue;if(W("label")&&F.label&&Q.push(F.label),F.hasOwnProperty("v")&&W("value")&&Q.push(T.formatValue(F.v,L)),!O){W("current path")&&Q.push(T.getPath(y.data));var le=0;W("percent parent")&&le++,W("percent entry")&&le++,W("percent root")&&le++;var he=le>1;if(le){var G,$=function(ie){ue=T.formatPercent(G,L),he&&(ue+=" of "+ie),Q.push(ue)};W("percent parent")&&!O&&(G=N/T.getValue(I),$("parent")),W("percent entry")&&(G=N/T.getValue(b),$("entry")),W("percent root")&&(G=N/T.getValue(B),$("root"))}}return W("text")&&(ue=M.castOption(p,F.i,"text"),M.isValidTextValue(ue)&&Q.push(ue)),Q.join("
")}var J=M.castOption(p,F.i,"texttemplate");if(!J)return"";var X={};F.label&&(X.label=F.label),F.hasOwnProperty("v")&&(X.value=F.v,X.valueLabel=T.formatValue(F.v,L)),X.currentPath=T.getPath(y.data),O||(X.percentParent=N/T.getValue(I),X.percentParentLabel=T.formatPercent(X.percentParent,L),X.parent=T.getPtLabel(I)),X.percentEntry=N/T.getValue(b),X.percentEntryLabel=T.formatPercent(X.percentEntry,L),X.entry=T.getPtLabel(b),X.percentRoot=N/T.getValue(B),X.percentRootLabel=T.formatPercent(X.percentRoot,L),X.root=T.getPtLabel(B),F.hasOwnProperty("color")&&(X.color=F.color);var oe=M.castOption(p,F.i,"text");return(M.isValidTextValue(oe)||oe==="")&&(X.text=oe),X.customdata=M.castOption(p,F.i,"customdata"),M.texttemplateString(J,X,m._d3locale,X,p._meta||{})};function w(y){return y.rpx0===0&&M.isFullCircle([y.x0,y.x1])?1:Math.max(0,Math.min(1/(1+1/Math.sin(y.halfangle)),y.ring/2))}function S(y){return E(y.rpx1,y.transform.textPosAngle)}function E(y,b){return[y*Math.sin(b),-y*Math.cos(b)]}}}),gN=Ze({"src/traces/sunburst/index.js"(Z,q){"use strict";q.exports={moduleType:"trace",name:"sunburst",basePlotModule:RB(),categories:[],animatable:!0,attributes:K_(),layoutAttributes:nM(),supplyDefaults:DB(),supplyLayoutDefaults:zB(),calc:$_().calc,crossTraceCalc:$_().crossTraceCalc,plot:K3().plot,style:oE().style,colorbar:hp(),meta:{}}}}),yN=Ze({"lib/sunburst.js"(Z,q){"use strict";q.exports=gN()}}),_N=Ze({"src/traces/treemap/base_plot.js"(Z){"use strict";var q=xc();Z.name="treemap",Z.plot=function(d,x,A,M){q.plotBasePlot(Z.name,d,x,A,M)},Z.clean=function(d,x,A,M){q.cleanBasePlot(Z.name,d,x,A,M)}}}),pg=Ze({"src/traces/treemap/constants.js"(Z,q){"use strict";q.exports={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:"poly",eventDataKeys:["currentPath","root","entry","percentRoot","percentEntry","percentParent"],gapWithPathbar:1}}}),J3=Ze({"src/traces/treemap/attributes.js"(Z,q){"use strict";var d=Cs().hovertemplateAttrs,x=Cs().texttemplateAttrs,A=Mu(),M=bc().attributes,e=ng(),t=K_(),r=pg(),o=rs().extendFlat,a=Gh().pattern;q.exports={labels:t.labels,parents:t.parents,values:t.values,branchvalues:t.branchvalues,count:t.count,level:t.level,maxdepth:t.maxdepth,tiling:{packing:{valType:"enumerated",values:["squarify","binary","dice","slice","slice-dice","dice-slice"],dflt:"squarify",editType:"plot"},squarifyratio:{valType:"number",min:1,dflt:1,editType:"plot"},flip:{valType:"flaglist",flags:["x","y"],dflt:"",editType:"plot"},pad:{valType:"number",min:0,dflt:3,editType:"plot"},editType:"calc"},marker:o({pad:{t:{valType:"number",min:0,editType:"plot"},l:{valType:"number",min:0,editType:"plot"},r:{valType:"number",min:0,editType:"plot"},b:{valType:"number",min:0,editType:"plot"},editType:"calc"},colors:t.marker.colors,pattern:a,depthfade:{valType:"enumerated",values:[!0,!1,"reversed"],editType:"style"},line:t.marker.line,cornerradius:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"calc"},A("marker",{colorAttr:"colors",anim:!1})),pathbar:{visible:{valType:"boolean",dflt:!0,editType:"plot"},side:{valType:"enumerated",values:["top","bottom"],dflt:"top",editType:"plot"},edgeshape:{valType:"enumerated",values:[">","<","|","/","\\"],dflt:">",editType:"plot"},thickness:{valType:"number",min:12,editType:"plot"},textfont:o({},e.textfont,{}),editType:"calc"},text:e.text,textinfo:t.textinfo,texttemplate:x({editType:"plot"},{keys:r.eventDataKeys.concat(["label","value"])}),hovertext:e.hovertext,hoverinfo:t.hoverinfo,hovertemplate:d({},{keys:r.eventDataKeys}),textfont:e.textfont,insidetextfont:e.insidetextfont,outsidetextfont:o({},e.outsidetextfont,{}),textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right"],dflt:"top left",editType:"plot"},sort:e.sort,root:t.root,domain:M({name:"treemap",trace:!0,editType:"calc"})}}}),sE=Ze({"src/traces/treemap/layout_attributes.js"(Z,q){"use strict";q.exports={treemapcolorway:{valType:"colorlist",editType:"calc"},extendtreemapcolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),xN=Ze({"src/traces/treemap/defaults.js"(Z,q){"use strict";var d=ca(),x=J3(),A=Yn(),M=bc().defaults,e=gd().handleText,t=Q0().TEXTPAD,r=og().handleMarkerDefaults,o=rc(),a=o.hasColorscale,i=o.handleDefaults;q.exports=function(s,c,f,g){function v(m,h){return d.coerce(s,c,x,m,h)}var T=v("labels"),l=v("parents");if(!T||!T.length||!l||!l.length){c.visible=!1;return}var _=v("values");_&&_.length?v("branchvalues"):v("count"),v("level"),v("maxdepth");var w=v("tiling.packing");w==="squarify"&&v("tiling.squarifyratio"),v("tiling.flip"),v("tiling.pad");var S=v("text");v("texttemplate"),c.texttemplate||v("textinfo",d.isArrayOrTypedArray(S)?"text+label":"label"),v("hovertext"),v("hovertemplate");var E=v("pathbar.visible"),y="auto";e(s,c,g,v,y,{hasPathbar:E,moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),v("textposition");var b=c.textposition.indexOf("bottom")!==-1;r(s,c,g,v);var p=c._hasColorscale=a(s,"marker","colors")||(s.marker||{}).coloraxis;p?i(s,c,g,v,{prefix:"marker.",cLetter:"c"}):v("marker.depthfade",!(c.marker.colors||[]).length);var u=c.textfont.size*2;v("marker.pad.t",b?u/4:u),v("marker.pad.l",u/4),v("marker.pad.r",u/4),v("marker.pad.b",b?u:u/4),v("marker.cornerradius"),c._hovered={marker:{line:{width:2,color:A.contrast(g.paper_bgcolor)}}},E&&(v("pathbar.thickness",c.pathbar.textfont.size+2*t),v("pathbar.side"),v("pathbar.edgeshape")),v("sort"),v("root.color"),M(c,g,v),c._length=null}}}),bN=Ze({"src/traces/treemap/layout_defaults.js"(Z,q){"use strict";var d=ca(),x=sE();q.exports=function(M,e){function t(r,o){return d.coerce(M,e,x,r,o)}t("treemapcolorway",e.colorway),t("extendtreemapcolors")}}}),lE=Ze({"src/traces/treemap/calc.js"(Z){"use strict";var q=$_();Z.calc=function(d,x){return q.calc(d,x)},Z.crossTraceCalc=function(d){return q._runCrossTraceCalc("treemap",d)}}}),uE=Ze({"src/traces/treemap/flip_tree.js"(Z,q){"use strict";q.exports=function d(x,A,M){var e;M.swapXY&&(e=x.x0,x.x0=x.y0,x.y0=e,e=x.x1,x.x1=x.y1,x.y1=e),M.flipX&&(e=x.x0,x.x0=A[0]-x.x1,x.x1=A[0]-e),M.flipY&&(e=x.y0,x.y0=A[1]-x.y1,x.y1=A[1]-e);var t=x.children;if(t)for(var r=0;r0)for(var u=0;u").join(" ")||"";var he=x.ensureSingle(ue,"g","slicetext"),G=x.ensureSingle(he,"text","",function(J){J.attr("data-notex",1)}),$=x.ensureUniformFontSize(s,o.determineTextFont(B,Q,z.font,{onPathbar:!0}));G.text(Q._text||" ").classed("slicetext",!0).attr("text-anchor","start").call(A.font,$).call(M.convertToTspans,s),Q.textBB=A.bBox(G.node()),Q.transform=y(Q,{fontSize:$.size,onPathbar:!0}),Q.transform.fontSize=$.size,p?G.transition().attrTween("transform",function(J){var X=h(J,i,P,[l,_]);return function(oe){return b(X(oe))}}):G.attr("transform",b(Q))})}}}),TN=Ze({"src/traces/treemap/plot_one.js"(Z,q){"use strict";var d=On(),x=(hg(),nh(f0)).interpolate,A=$v(),M=ca(),e=Q0().TEXTPAD,t=eg(),r=t.toMoveInsideBar,o=Ap(),a=o.recordMinTextSize,i=pg(),n=wN();function s(c){return A.isHierarchyRoot(c)?"":A.getPtId(c)}q.exports=function(f,g,v,T,l){var _=f._fullLayout,w=g[0],S=w.trace,E=S.type,y=E==="icicle",b=w.hierarchy,p=A.findEntryWithLevel(b,S.level),u=d.select(v),m=u.selectAll("g.pathbar"),h=u.selectAll("g.slice");if(!p){m.remove(),h.remove();return}var P=A.isHierarchyRoot(p),L=!_.uniformtext.mode&&A.hasTransition(T),z=A.getMaxDepth(S),F=function(wr){return wr.data.depth-p.data.depth-1?N+Q:-(W+Q):0,le={x0:U,x1:U,y0:ue,y1:ue+W},he=function(wr,Ir,bt){var Be=S.tiling.pad,Ke=function(Ce){return Ce-Be<=Ir.x0},Ue=function(Ce){return Ce+Be>=Ir.x1},Me=function(Ce){return Ce-Be<=Ir.y0},qe=function(Ce){return Ce+Be>=Ir.y1};return wr.x0===Ir.x0&&wr.x1===Ir.x1&&wr.y0===Ir.y0&&wr.y1===Ir.y1?{x0:wr.x0,x1:wr.x1,y0:wr.y0,y1:wr.y1}:{x0:Ke(wr.x0-Be)?0:Ue(wr.x0-Be)?bt[0]:wr.x0,x1:Ke(wr.x1+Be)?0:Ue(wr.x1+Be)?bt[0]:wr.x1,y0:Me(wr.y0-Be)?0:qe(wr.y0-Be)?bt[1]:wr.y0,y1:Me(wr.y1+Be)?0:qe(wr.y1+Be)?bt[1]:wr.y1}},G=null,$={},J={},X=null,oe=function(wr,Ir){return Ir?$[s(wr)]:J[s(wr)]},ie=function(wr,Ir,bt,Be){if(Ir)return $[s(b)]||le;var Ke=J[S.level]||bt;return F(wr)?he(wr,Ke,Be):{}};w.hasMultipleRoots&&P&&z++,S._maxDepth=z,S._backgroundColor=_.paper_bgcolor,S._entryDepth=p.data.depth,S._atRootLevel=P;var j=-I/2+B.l+B.w*(O.x[1]+O.x[0])/2,ee=-N/2+B.t+B.h*(1-(O.y[1]+O.y[0])/2),re=function(wr){return j+wr},ce=function(wr){return ee+wr},be=ce(0),Ae=re(0),ze=function(wr){return Ae+wr},Re=function(wr){return be+wr};function Xe(wr,Ir){return wr+","+Ir}var it=ze(0),ot=function(wr){wr.x=Math.max(it,wr.x)},tt=S.pathbar.edgeshape,lt=function(wr){var Ir=ze(Math.max(Math.min(wr.x0,wr.x0),0)),bt=ze(Math.min(Math.max(wr.x1,wr.x1),U)),Be=Re(wr.y0),Ke=Re(wr.y1),Ue=W/2,Me={},qe={};Me.x=Ir,qe.x=bt,Me.y=qe.y=(Be+Ke)/2;var Ce={x:Ir,y:Be},Te={x:bt,y:Be},Pe={x:bt,y:Ke},at={x:Ir,y:Ke};return tt===">"?(Ce.x-=Ue,Te.x-=Ue,Pe.x-=Ue,at.x-=Ue):tt==="/"?(Pe.x-=Ue,at.x-=Ue,Me.x-=Ue/2,qe.x-=Ue/2):tt==="\\"?(Ce.x-=Ue,Te.x-=Ue,Me.x-=Ue/2,qe.x-=Ue/2):tt==="<"&&(Me.x-=Ue,qe.x-=Ue),ot(Ce),ot(at),ot(Me),ot(Te),ot(Pe),ot(qe),"M"+Xe(Ce.x,Ce.y)+"L"+Xe(Te.x,Te.y)+"L"+Xe(qe.x,qe.y)+"L"+Xe(Pe.x,Pe.y)+"L"+Xe(at.x,at.y)+"L"+Xe(Me.x,Me.y)+"Z"},Ee=S[y?"tiling":"marker"].pad,_e=function(wr){return S.textposition.indexOf(wr)!==-1},fe=_e("top"),Fe=_e("left"),rt=_e("right"),st=_e("bottom"),Qe=function(wr){var Ir=re(wr.x0),bt=re(wr.x1),Be=ce(wr.y0),Ke=ce(wr.y1),Ue=bt-Ir,Me=Ke-Be;if(!Ue||!Me)return"";var qe=S.marker.cornerradius||0,Ce=Math.min(qe,Ue/2,Me/2);Ce&&wr.data&&wr.data.data&&wr.data.data.label&&(fe&&(Ce=Math.min(Ce,Ee.t)),Fe&&(Ce=Math.min(Ce,Ee.l)),rt&&(Ce=Math.min(Ce,Ee.r)),st&&(Ce=Math.min(Ce,Ee.b)));var Te=function(Pe,at){return Ce?"a"+Xe(Ce,Ce)+" 0 0 1 "+Xe(Pe,at):""};return"M"+Xe(Ir,Be+Ce)+Te(Ce,-Ce)+"L"+Xe(bt-Ce,Be)+Te(Ce,Ce)+"L"+Xe(bt,Ke-Ce)+Te(-Ce,Ce)+"L"+Xe(Ir+Ce,Ke)+Te(-Ce,-Ce)+"Z"},Lt=function(wr,Ir){var bt=wr.x0,Be=wr.x1,Ke=wr.y0,Ue=wr.y1,Me=wr.textBB,qe=fe||Ir.isHeader&&!st,Ce=qe?"start":st?"end":"middle",Te=_e("right"),Pe=_e("left")||Ir.onPathbar,at=Pe?-1:Te?1:0;if(Ir.isHeader){if(bt+=(y?Ee:Ee.l)-e,Be-=(y?Ee:Ee.r)-e,bt>=Be){var yt=(bt+Be)/2;bt=yt,Be=yt}var Tt;st?(Tt=Ue-(y?Ee:Ee.b),Ke-1,flipY:O.tiling.flip.indexOf("y")>-1,pad:{inner:O.tiling.pad,top:O.marker.pad.t,left:O.marker.pad.l,right:O.marker.pad.r,bottom:O.marker.pad.b}}),ue=Q.descendants(),le=1/0,he=-1/0;ue.forEach(function(oe){var ie=oe.depth;ie>=O._maxDepth?(oe.x0=oe.x1=(oe.x0+oe.x1)/2,oe.y0=oe.y1=(oe.y0+oe.y1)/2):(le=Math.min(le,ie),he=Math.max(he,ie))}),v=v.data(ue,o.getPtId),O._maxVisibleLayers=isFinite(he)?he-le+1:0,v.enter().append("g").classed("slice",!0),u(v,n,L,[l,_],E),v.order();var G=null;if(p&&P){var $=o.getPtId(P);v.each(function(oe){G===null&&o.getPtId(oe)===$&&(G={x0:oe.x0,x1:oe.x1,y0:oe.y0,y1:oe.y1})})}var J=function(){return G||{x0:0,x1:l,y0:0,y1:_}},X=v;return p&&(X=X.transition().each("end",function(){var oe=d.select(this);o.setSliceCursor(oe,c,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})})),X.each(function(oe){var ie=o.isHeader(oe,O);oe._x0=w(oe.x0),oe._x1=w(oe.x1),oe._y0=S(oe.y0),oe._y1=S(oe.y1),oe._hoverX=w(oe.x1-O.marker.pad.r),oe._hoverY=S(U?oe.y1-O.marker.pad.b/2:oe.y0+O.marker.pad.t/2);var j=d.select(this),ee=x.ensureSingle(j,"path","surface",function(Re){Re.style("pointer-events",z?"none":"all")});p?ee.transition().attrTween("d",function(Re){var Xe=m(Re,n,J(),[l,_]);return function(it){return E(Xe(it))}}):ee.attr("d",E),j.call(a,g,c,f,{styleOne:t,eventDataKeys:r.eventDataKeys,transitionTime:r.CLICK_TRANSITION_TIME,transitionEasing:r.CLICK_TRANSITION_EASING}).call(o.setSliceCursor,c,{isTransitioning:c._transitioning}),ee.call(t,oe,O,c,{hovered:!1}),oe.x0===oe.x1||oe.y0===oe.y1?oe._text="":ie?oe._text=W?"":o.getPtLabel(oe)||"":oe._text=i(oe,g,O,f,F)||"";var re=x.ensureSingle(j,"g","slicetext"),ce=x.ensureSingle(re,"text","",function(Re){Re.attr("data-notex",1)}),be=x.ensureUniformFontSize(c,o.determineTextFont(O,oe,F.font)),Ae=oe._text||" ",ze=ie&&Ae.indexOf("
")===-1;ce.text(Ae).classed("slicetext",!0).attr("text-anchor",N?"end":I||ze?"start":"middle").call(A.font,be).call(M.convertToTspans,c),oe.textBB=A.bBox(ce.node()),oe.transform=y(oe,{fontSize:be.size,isHeader:ie}),oe.transform.fontSize=be.size,p?ce.transition().attrTween("transform",function(Re){var Xe=h(Re,n,J(),[l,_]);return function(it){return b(Xe(it))}}):ce.attr("transform",b(oe))}),G}}}),SN=Ze({"src/traces/treemap/plot.js"(Z,q){"use strict";var d=fE(),x=AN();q.exports=function(M,e,t,r){return d(M,e,t,r,{type:"treemap",drawDescendants:x})}}}),MN=Ze({"src/traces/treemap/index.js"(Z,q){"use strict";q.exports={moduleType:"trace",name:"treemap",basePlotModule:_N(),categories:[],animatable:!0,attributes:J3(),layoutAttributes:sE(),supplyDefaults:xN(),supplyLayoutDefaults:bN(),calc:lE().calc,crossTraceCalc:lE().crossTraceCalc,plot:SN(),style:$3().style,colorbar:hp(),meta:{}}}}),EN=Ze({"lib/treemap.js"(Z,q){"use strict";q.exports=MN()}}),CN=Ze({"src/traces/icicle/base_plot.js"(Z){"use strict";var q=xc();Z.name="icicle",Z.plot=function(d,x,A,M){q.plotBasePlot(Z.name,d,x,A,M)},Z.clean=function(d,x,A,M){q.cleanBasePlot(Z.name,d,x,A,M)}}}),hE=Ze({"src/traces/icicle/attributes.js"(Z,q){"use strict";var d=Cs().hovertemplateAttrs,x=Cs().texttemplateAttrs,A=Mu(),M=bc().attributes,e=ng(),t=K_(),r=J3(),o=pg(),a=rs().extendFlat,i=Gh().pattern;q.exports={labels:t.labels,parents:t.parents,values:t.values,branchvalues:t.branchvalues,count:t.count,level:t.level,maxdepth:t.maxdepth,tiling:{orientation:{valType:"enumerated",values:["v","h"],dflt:"h",editType:"plot"},flip:r.tiling.flip,pad:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"calc"},marker:a({colors:t.marker.colors,line:t.marker.line,pattern:i,editType:"calc"},A("marker",{colorAttr:"colors",anim:!1})),leaf:t.leaf,pathbar:r.pathbar,text:e.text,textinfo:t.textinfo,texttemplate:x({editType:"plot"},{keys:o.eventDataKeys.concat(["label","value"])}),hovertext:e.hovertext,hoverinfo:t.hoverinfo,hovertemplate:d({},{keys:o.eventDataKeys}),textfont:e.textfont,insidetextfont:e.insidetextfont,outsidetextfont:r.outsidetextfont,textposition:r.textposition,sort:e.sort,root:t.root,domain:M({name:"icicle",trace:!0,editType:"calc"})}}}),pE=Ze({"src/traces/icicle/layout_attributes.js"(Z,q){"use strict";q.exports={iciclecolorway:{valType:"colorlist",editType:"calc"},extendiciclecolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),kN=Ze({"src/traces/icicle/defaults.js"(Z,q){"use strict";var d=ca(),x=hE(),A=Yn(),M=bc().defaults,e=gd().handleText,t=Q0().TEXTPAD,r=og().handleMarkerDefaults,o=rc(),a=o.hasColorscale,i=o.handleDefaults;q.exports=function(s,c,f,g){function v(b,p){return d.coerce(s,c,x,b,p)}var T=v("labels"),l=v("parents");if(!T||!T.length||!l||!l.length){c.visible=!1;return}var _=v("values");_&&_.length?v("branchvalues"):v("count"),v("level"),v("maxdepth"),v("tiling.orientation"),v("tiling.flip"),v("tiling.pad");var w=v("text");v("texttemplate"),c.texttemplate||v("textinfo",d.isArrayOrTypedArray(w)?"text+label":"label"),v("hovertext"),v("hovertemplate");var S=v("pathbar.visible"),E="auto";e(s,c,g,v,E,{hasPathbar:S,moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),v("textposition"),r(s,c,g,v);var y=c._hasColorscale=a(s,"marker","colors")||(s.marker||{}).coloraxis;y&&i(s,c,g,v,{prefix:"marker.",cLetter:"c"}),v("leaf.opacity",y?1:.7),c._hovered={marker:{line:{width:2,color:A.contrast(g.paper_bgcolor)}}},S&&(v("pathbar.thickness",c.pathbar.textfont.size+2*t),v("pathbar.side"),v("pathbar.edgeshape")),v("sort"),v("root.color"),M(c,g,v),c._length=null}}}),LN=Ze({"src/traces/icicle/layout_defaults.js"(Z,q){"use strict";var d=ca(),x=pE();q.exports=function(M,e){function t(r,o){return d.coerce(M,e,x,r,o)}t("iciclecolorway",e.colorway),t("extendiciclecolors")}}}),dE=Ze({"src/traces/icicle/calc.js"(Z){"use strict";var q=$_();Z.calc=function(d,x){return q.calc(d,x)},Z.crossTraceCalc=function(d){return q._runCrossTraceCalc("icicle",d)}}}),PN=Ze({"src/traces/icicle/partition.js"(Z,q){"use strict";var d=J_(),x=uE();q.exports=function(M,e,t){var r=t.flipX,o=t.flipY,a=t.orientation==="h",i=t.maxDepth,n=e[0],s=e[1];i&&(n=(M.height+1)*e[0]/Math.min(M.height+1,i),s=(M.height+1)*e[1]/Math.min(M.height+1,i));var c=d.partition().padding(t.pad.inner).size(a?[e[1],n]:[e[0],s])(M);return(a||r||o)&&x(c,e,{swapXY:a,flipX:r,flipY:o}),c}}}),vE=Ze({"src/traces/icicle/style.js"(Z,q){"use strict";var d=On(),x=Yn(),A=ca(),M=Ap().resizeText,e=Y3();function t(o){var a=o._fullLayout._iciclelayer.selectAll(".trace");M(o,a,"icicle"),a.each(function(i){var n=d.select(this),s=i[0],c=s.trace;n.style("opacity",c.opacity),n.selectAll("path.surface").each(function(f){d.select(this).call(r,f,c,o)})})}function r(o,a,i,n){var s=a.data.data,c=!a.children,f=s.i,g=A.castOption(i,f,"marker.line.color")||x.defaultLine,v=A.castOption(i,f,"marker.line.width")||0;o.call(e,a,i,n).style("stroke-width",v).call(x.stroke,g).style("opacity",c?i.leaf.opacity:null)}q.exports={style:t,styleOne:r}}}),IN=Ze({"src/traces/icicle/draw_descendants.js"(Z,q){"use strict";var d=On(),x=ca(),A=as(),M=fu(),e=PN(),t=vE().styleOne,r=pg(),o=$v(),a=dx(),i=K3().formatSliceLabel,n=!1;q.exports=function(c,f,g,v,T){var l=T.width,_=T.height,w=T.viewX,S=T.viewY,E=T.pathSlice,y=T.toMoveInsideSlice,b=T.strTransform,p=T.hasTransition,u=T.handleSlicesExit,m=T.makeUpdateSliceInterpolator,h=T.makeUpdateTextInterpolator,P=T.prevEntry,L={},z=c._context.staticPlot,F=c._fullLayout,B=f[0],O=B.trace,I=O.textposition.indexOf("left")!==-1,N=O.textposition.indexOf("right")!==-1,U=O.textposition.indexOf("bottom")!==-1,W=e(g,[l,_],{flipX:O.tiling.flip.indexOf("x")>-1,flipY:O.tiling.flip.indexOf("y")>-1,orientation:O.tiling.orientation,pad:{inner:O.tiling.pad},maxDepth:O._maxDepth}),Q=W.descendants(),ue=1/0,le=-1/0;Q.forEach(function(X){var oe=X.depth;oe>=O._maxDepth?(X.x0=X.x1=(X.x0+X.x1)/2,X.y0=X.y1=(X.y0+X.y1)/2):(ue=Math.min(ue,oe),le=Math.max(le,oe))}),v=v.data(Q,o.getPtId),O._maxVisibleLayers=isFinite(le)?le-ue+1:0,v.enter().append("g").classed("slice",!0),u(v,n,L,[l,_],E),v.order();var he=null;if(p&&P){var G=o.getPtId(P);v.each(function(X){he===null&&o.getPtId(X)===G&&(he={x0:X.x0,x1:X.x1,y0:X.y0,y1:X.y1})})}var $=function(){return he||{x0:0,x1:l,y0:0,y1:_}},J=v;return p&&(J=J.transition().each("end",function(){var X=d.select(this);o.setSliceCursor(X,c,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})})),J.each(function(X){X._x0=w(X.x0),X._x1=w(X.x1),X._y0=S(X.y0),X._y1=S(X.y1),X._hoverX=w(X.x1-O.tiling.pad),X._hoverY=S(U?X.y1-O.tiling.pad/2:X.y0+O.tiling.pad/2);var oe=d.select(this),ie=x.ensureSingle(oe,"path","surface",function(ce){ce.style("pointer-events",z?"none":"all")});p?ie.transition().attrTween("d",function(ce){var be=m(ce,n,$(),[l,_],{orientation:O.tiling.orientation,flipX:O.tiling.flip.indexOf("x")>-1,flipY:O.tiling.flip.indexOf("y")>-1});return function(Ae){return E(be(Ae))}}):ie.attr("d",E),oe.call(a,g,c,f,{styleOne:t,eventDataKeys:r.eventDataKeys,transitionTime:r.CLICK_TRANSITION_TIME,transitionEasing:r.CLICK_TRANSITION_EASING}).call(o.setSliceCursor,c,{isTransitioning:c._transitioning}),ie.call(t,X,O,c,{hovered:!1}),X.x0===X.x1||X.y0===X.y1?X._text="":X._text=i(X,g,O,f,F)||"";var j=x.ensureSingle(oe,"g","slicetext"),ee=x.ensureSingle(j,"text","",function(ce){ce.attr("data-notex",1)}),re=x.ensureUniformFontSize(c,o.determineTextFont(O,X,F.font));ee.text(X._text||" ").classed("slicetext",!0).attr("text-anchor",N?"end":I?"start":"middle").call(A.font,re).call(M.convertToTspans,c),X.textBB=A.bBox(ee.node()),X.transform=y(X,{fontSize:re.size}),X.transform.fontSize=re.size,p?ee.transition().attrTween("transform",function(ce){var be=h(ce,n,$(),[l,_]);return function(Ae){return b(be(Ae))}}):ee.attr("transform",b(X))}),he}}}),RN=Ze({"src/traces/icicle/plot.js"(Z,q){"use strict";var d=fE(),x=IN();q.exports=function(M,e,t,r){return d(M,e,t,r,{type:"icicle",drawDescendants:x})}}}),DN=Ze({"src/traces/icicle/index.js"(Z,q){"use strict";q.exports={moduleType:"trace",name:"icicle",basePlotModule:CN(),categories:[],animatable:!0,attributes:hE(),layoutAttributes:pE(),supplyDefaults:kN(),supplyLayoutDefaults:LN(),calc:dE().calc,crossTraceCalc:dE().crossTraceCalc,plot:RN(),style:vE().style,colorbar:hp(),meta:{}}}}),zN=Ze({"lib/icicle.js"(Z,q){"use strict";q.exports=DN()}}),FN=Ze({"src/traces/funnelarea/base_plot.js"(Z){"use strict";var q=xc();Z.name="funnelarea",Z.plot=function(d,x,A,M){q.plotBasePlot(Z.name,d,x,A,M)},Z.clean=function(d,x,A,M){q.cleanBasePlot(Z.name,d,x,A,M)}}}),mE=Ze({"src/traces/funnelarea/attributes.js"(Z,q){"use strict";var d=ng(),x=eu(),A=bc().attributes,M=Cs().hovertemplateAttrs,e=Cs().texttemplateAttrs,t=rs().extendFlat;q.exports={labels:d.labels,label0:d.label0,dlabel:d.dlabel,values:d.values,marker:{colors:d.marker.colors,line:{color:t({},d.marker.line.color,{dflt:null}),width:t({},d.marker.line.width,{dflt:1}),editType:"calc"},pattern:d.marker.pattern,editType:"calc"},text:d.text,hovertext:d.hovertext,scalegroup:t({},d.scalegroup,{}),textinfo:t({},d.textinfo,{flags:["label","text","value","percent"]}),texttemplate:e({editType:"plot"},{keys:["label","color","value","text","percent"]}),hoverinfo:t({},x.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:M({},{keys:["label","color","value","text","percent"]}),textposition:t({},d.textposition,{values:["inside","none"],dflt:"inside"}),textfont:d.textfont,insidetextfont:d.insidetextfont,title:{text:d.title.text,font:d.title.font,position:t({},d.title.position,{values:["top left","top center","top right"],dflt:"top center"}),editType:"plot"},domain:A({name:"funnelarea",trace:!0,editType:"calc"}),aspectratio:{valType:"number",min:0,dflt:1,editType:"plot"},baseratio:{valType:"number",min:0,max:1,dflt:.333,editType:"plot"}}}}),gE=Ze({"src/traces/funnelarea/layout_attributes.js"(Z,q){"use strict";var d=_3().hiddenlabels;q.exports={hiddenlabels:d,funnelareacolorway:{valType:"colorlist",editType:"calc"},extendfunnelareacolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),ON=Ze({"src/traces/funnelarea/defaults.js"(Z,q){"use strict";var d=ca(),x=mE(),A=bc().defaults,M=gd().handleText,e=og().handleLabelsAndValues,t=og().handleMarkerDefaults;q.exports=function(o,a,i,n){function s(E,y){return d.coerce(o,a,x,E,y)}var c=s("labels"),f=s("values"),g=e(c,f),v=g.len;if(a._hasLabels=g.hasLabels,a._hasValues=g.hasValues,!a._hasLabels&&a._hasValues&&(s("label0"),s("dlabel")),!v){a.visible=!1;return}a._length=v,t(o,a,n,s),s("scalegroup");var T=s("text"),l=s("texttemplate"),_;if(l||(_=s("textinfo",Array.isArray(T)?"text+percent":"percent")),s("hovertext"),s("hovertemplate"),l||_&&_!=="none"){var w=s("textposition");M(o,a,n,s,w,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1})}else _==="none"&&s("textposition","none");A(a,n,s);var S=s("title.text");S&&(s("title.position"),d.coerceFont(s,"title.font",n.font)),s("aspectratio"),s("baseratio")}}}),BN=Ze({"src/traces/funnelarea/layout_defaults.js"(Z,q){"use strict";var d=ca(),x=gE();q.exports=function(M,e){function t(r,o){return d.coerce(M,e,x,r,o)}t("hiddenlabels"),t("funnelareacolorway",e.colorway),t("extendfunnelareacolors")}}}),yE=Ze({"src/traces/funnelarea/calc.js"(Z,q){"use strict";var d=x1();function x(M,e){return d.calc(M,e)}function A(M){d.crossTraceCalc(M,{type:"funnelarea"})}q.exports={calc:x,crossTraceCalc:A}}}),NN=Ze({"src/traces/funnelarea/plot.js"(Z,q){"use strict";var d=On(),x=as(),A=ca(),M=A.strScale,e=A.strTranslate,t=fu(),r=eg(),o=r.toMoveInsideBar,a=Ap(),i=a.recordMinTextSize,n=a.clearMinTextSize,s=e0(),c=x3(),f=c.attachFxHandlers,g=c.determineInsideTextFont,v=c.layoutAreas,T=c.prerenderTitles,l=c.positionTitleOutside,_=c.formatSliceLabel;q.exports=function(b,p){var u=b._context.staticPlot,m=b._fullLayout;n("funnelarea",m),T(p,b),v(p,m._size),A.makeTraceGroups(m._funnelarealayer,p,"trace").each(function(h){var P=d.select(this),L=h[0],z=L.trace;E(h),P.each(function(){var F=d.select(this).selectAll("g.slice").data(h);F.enter().append("g").classed("slice",!0),F.exit().remove(),F.each(function(O,I){if(O.hidden){d.select(this).selectAll("path,g").remove();return}O.pointNumber=O.i,O.curveNumber=z.index;var N=L.cx,U=L.cy,W=d.select(this),Q=W.selectAll("path.surface").data([O]);Q.enter().append("path").classed("surface",!0).style({"pointer-events":u?"none":"all"}),W.call(f,b,h);var ue="M"+(N+O.TR[0])+","+(U+O.TR[1])+w(O.TR,O.BR)+w(O.BR,O.BL)+w(O.BL,O.TL)+"Z";Q.attr("d",ue),_(b,O,L);var le=s.castOption(z.textposition,O.pts),he=W.selectAll("g.slicetext").data(O.text&&le!=="none"?[0]:[]);he.enter().append("g").classed("slicetext",!0),he.exit().remove(),he.each(function(){var G=A.ensureSingle(d.select(this),"text","",function(re){re.attr("data-notex",1)}),$=A.ensureUniformFontSize(b,g(z,O,m.font));G.text(O.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(x.font,$).call(t.convertToTspans,b);var J=x.bBox(G.node()),X,oe,ie,j=Math.min(O.BL[1],O.BR[1])+U,ee=Math.max(O.TL[1],O.TR[1])+U;oe=Math.max(O.TL[0],O.BL[0])+N,ie=Math.min(O.TR[0],O.BR[0])+N,X=o(oe,ie,j,ee,J,{isHorizontal:!0,constrained:!0,angle:0,anchor:"middle"}),X.fontSize=$.size,i(z.type,X,m),h[I].transform=X,A.setTransormAndDisplay(G,X)})});var B=d.select(this).selectAll("g.titletext").data(z.title.text?[0]:[]);B.enter().append("g").classed("titletext",!0),B.exit().remove(),B.each(function(){var O=A.ensureSingle(d.select(this),"text","",function(U){U.attr("data-notex",1)}),I=z.title.text;z._meta&&(I=A.templateString(I,z._meta)),O.text(I).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(x.font,z.title.font).call(t.convertToTspans,b);var N=l(L,m._size);O.attr("transform",e(N.x,N.y)+M(Math.min(1,N.scale))+e(N.tx,N.ty))})})})};function w(y,b){var p=b[0]-y[0],u=b[1]-y[1];return"l"+p+","+u}function S(y,b){return[.5*(y[0]+b[0]),.5*(y[1]+b[1])]}function E(y){if(!y.length)return;var b=y[0],p=b.trace,u=p.aspectratio,m=p.baseratio;m>.999&&(m=.999);var h=Math.pow(m,2),P=b.vTotal,L=P*h/(1-h),z=P,F=L/P;function B(){var ce=Math.sqrt(F);return{x:ce,y:-ce}}function O(){var ce=B();return[ce.x,ce.y]}var I,N=[];N.push(O());var U,W;for(U=y.length-1;U>-1;U--)if(W=y[U],!W.hidden){var Q=W.v/z;F+=Q,N.push(O())}var ue=1/0,le=-1/0;for(U=0;U-1;U--)if(W=y[U],!W.hidden){j+=1;var ee=N[j][0],re=N[j][1];W.TL=[-ee,re],W.TR=[ee,re],W.BL=oe,W.BR=ie,W.pxmid=S(W.TR,W.BR),oe=W.TL,ie=W.TR}}}}),UN=Ze({"src/traces/funnelarea/style.js"(Z,q){"use strict";var d=On(),x=i1(),A=Ap().resizeText;q.exports=function(e){var t=e._fullLayout._funnelarealayer.selectAll(".trace");A(e,t,"funnelarea"),t.each(function(r){var o=r[0],a=o.trace,i=d.select(this);i.style({opacity:a.opacity}),i.selectAll("path.surface").each(function(n){d.select(this).call(x,n,a,e)})})}}}),jN=Ze({"src/traces/funnelarea/index.js"(Z,q){"use strict";q.exports={moduleType:"trace",name:"funnelarea",basePlotModule:FN(),categories:["pie-like","funnelarea","showLegend"],attributes:mE(),layoutAttributes:gE(),supplyDefaults:ON(),supplyLayoutDefaults:BN(),calc:yE().calc,crossTraceCalc:yE().crossTraceCalc,plot:NN(),style:UN(),styleOne:i1(),meta:{}}}}),qN=Ze({"lib/funnelarea.js"(Z,q){"use strict";q.exports=jN()}}),Yh=Ze({"stackgl_modules/index.js"(Z,q){(function(){var d={1964:function(e,t,r){e.exports={alpha_shape:r(3502),convex_hull:r(7352),delaunay_triangulate:r(7642),gl_cone3d:r(6405),gl_error3d:r(9165),gl_line3d:r(5714),gl_mesh3d:r(7201),gl_plot3d:r(4100),gl_scatter3d:r(8418),gl_streamtube3d:r(7815),gl_surface3d:r(9499),ndarray:r(9618),ndarray_linear_interpolate:r(4317)}},4793:function(e,t,r){"use strict";var o;function a(Ce,Te){if(!(Ce instanceof Te))throw new TypeError("Cannot call a class as a function")}function i(Ce,Te){for(var Pe=0;Pep)throw new RangeError('The value "'+Ce+'" is invalid for option "size"');var Te=new Uint8Array(Ce);return Object.setPrototypeOf(Te,h.prototype),Te}function h(Ce,Te,Pe){if(typeof Ce=="number"){if(typeof Te=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return F(Ce)}return P(Ce,Te,Pe)}h.poolSize=8192;function P(Ce,Te,Pe){if(typeof Ce=="string")return B(Ce,Te);if(ArrayBuffer.isView(Ce))return I(Ce);if(Ce==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+S(Ce));if(Be(Ce,ArrayBuffer)||Ce&&Be(Ce.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Be(Ce,SharedArrayBuffer)||Ce&&Be(Ce.buffer,SharedArrayBuffer)))return N(Ce,Te,Pe);if(typeof Ce=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var at=Ce.valueOf&&Ce.valueOf();if(at!=null&&at!==Ce)return h.from(at,Te,Pe);var yt=U(Ce);if(yt)return yt;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof Ce[Symbol.toPrimitive]=="function")return h.from(Ce[Symbol.toPrimitive]("string"),Te,Pe);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+S(Ce))}h.from=function(Ce,Te,Pe){return P(Ce,Te,Pe)},Object.setPrototypeOf(h.prototype,Uint8Array.prototype),Object.setPrototypeOf(h,Uint8Array);function L(Ce){if(typeof Ce!="number")throw new TypeError('"size" argument must be of type number');if(Ce<0)throw new RangeError('The value "'+Ce+'" is invalid for option "size"')}function z(Ce,Te,Pe){return L(Ce),Ce<=0?m(Ce):Te!==void 0?typeof Pe=="string"?m(Ce).fill(Te,Pe):m(Ce).fill(Te):m(Ce)}h.alloc=function(Ce,Te,Pe){return z(Ce,Te,Pe)};function F(Ce){return L(Ce),m(Ce<0?0:W(Ce)|0)}h.allocUnsafe=function(Ce){return F(Ce)},h.allocUnsafeSlow=function(Ce){return F(Ce)};function B(Ce,Te){if((typeof Te!="string"||Te==="")&&(Te="utf8"),!h.isEncoding(Te))throw new TypeError("Unknown encoding: "+Te);var Pe=ue(Ce,Te)|0,at=m(Pe),yt=at.write(Ce,Te);return yt!==Pe&&(at=at.slice(0,yt)),at}function O(Ce){for(var Te=Ce.length<0?0:W(Ce.length)|0,Pe=m(Te),at=0;at=p)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+p.toString(16)+" bytes");return Ce|0}function Q(Ce){return+Ce!=Ce&&(Ce=0),h.alloc(+Ce)}h.isBuffer=function(Te){return Te!=null&&Te._isBuffer===!0&&Te!==h.prototype},h.compare=function(Te,Pe){if(Be(Te,Uint8Array)&&(Te=h.from(Te,Te.offset,Te.byteLength)),Be(Pe,Uint8Array)&&(Pe=h.from(Pe,Pe.offset,Pe.byteLength)),!h.isBuffer(Te)||!h.isBuffer(Pe))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(Te===Pe)return 0;for(var at=Te.length,yt=Pe.length,Tt=0,Ot=Math.min(at,yt);Ttyt.length?(h.isBuffer(Ot)||(Ot=h.from(Ot)),Ot.copy(yt,Tt)):Uint8Array.prototype.set.call(yt,Ot,Tt);else if(h.isBuffer(Ot))Ot.copy(yt,Tt);else throw new TypeError('"list" argument must be an Array of Buffers');Tt+=Ot.length}return yt};function ue(Ce,Te){if(h.isBuffer(Ce))return Ce.length;if(ArrayBuffer.isView(Ce)||Be(Ce,ArrayBuffer))return Ce.byteLength;if(typeof Ce!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+S(Ce));var Pe=Ce.length,at=arguments.length>2&&arguments[2]===!0;if(!at&&Pe===0)return 0;for(var yt=!1;;)switch(Te){case"ascii":case"latin1":case"binary":return Pe;case"utf8":case"utf-8":return xr(Ce).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Pe*2;case"hex":return Pe>>>1;case"base64":return Ir(Ce).length;default:if(yt)return at?-1:xr(Ce).length;Te=(""+Te).toLowerCase(),yt=!0}}h.byteLength=ue;function le(Ce,Te,Pe){var at=!1;if((Te===void 0||Te<0)&&(Te=0),Te>this.length||((Pe===void 0||Pe>this.length)&&(Pe=this.length),Pe<=0)||(Pe>>>=0,Te>>>=0,Pe<=Te))return"";for(Ce||(Ce="utf8");;)switch(Ce){case"hex":return Re(this,Te,Pe);case"utf8":case"utf-8":return re(this,Te,Pe);case"ascii":return Ae(this,Te,Pe);case"latin1":case"binary":return ze(this,Te,Pe);case"base64":return ee(this,Te,Pe);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Xe(this,Te,Pe);default:if(at)throw new TypeError("Unknown encoding: "+Ce);Ce=(Ce+"").toLowerCase(),at=!0}}h.prototype._isBuffer=!0;function he(Ce,Te,Pe){var at=Ce[Te];Ce[Te]=Ce[Pe],Ce[Pe]=at}h.prototype.swap16=function(){var Te=this.length;if(Te%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var Pe=0;PePe&&(Te+=" ... "),""},b&&(h.prototype[b]=h.prototype.inspect),h.prototype.compare=function(Te,Pe,at,yt,Tt){if(Be(Te,Uint8Array)&&(Te=h.from(Te,Te.offset,Te.byteLength)),!h.isBuffer(Te))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+S(Te));if(Pe===void 0&&(Pe=0),at===void 0&&(at=Te?Te.length:0),yt===void 0&&(yt=0),Tt===void 0&&(Tt=this.length),Pe<0||at>Te.length||yt<0||Tt>this.length)throw new RangeError("out of range index");if(yt>=Tt&&Pe>=at)return 0;if(yt>=Tt)return-1;if(Pe>=at)return 1;if(Pe>>>=0,at>>>=0,yt>>>=0,Tt>>>=0,this===Te)return 0;for(var Ot=Tt-yt,Gt=at-Pe,rr=Math.min(Ot,Gt),Qt=this.slice(yt,Tt),Tr=Te.slice(Pe,at),la=0;la2147483647?Pe=2147483647:Pe<-2147483648&&(Pe=-2147483648),Pe=+Pe,Ke(Pe)&&(Pe=yt?0:Ce.length-1),Pe<0&&(Pe=Ce.length+Pe),Pe>=Ce.length){if(yt)return-1;Pe=Ce.length-1}else if(Pe<0)if(yt)Pe=0;else return-1;if(typeof Te=="string"&&(Te=h.from(Te,at)),h.isBuffer(Te))return Te.length===0?-1:$(Ce,Te,Pe,at,yt);if(typeof Te=="number")return Te=Te&255,typeof Uint8Array.prototype.indexOf=="function"?yt?Uint8Array.prototype.indexOf.call(Ce,Te,Pe):Uint8Array.prototype.lastIndexOf.call(Ce,Te,Pe):$(Ce,[Te],Pe,at,yt);throw new TypeError("val must be string, number or Buffer")}function $(Ce,Te,Pe,at,yt){var Tt=1,Ot=Ce.length,Gt=Te.length;if(at!==void 0&&(at=String(at).toLowerCase(),at==="ucs2"||at==="ucs-2"||at==="utf16le"||at==="utf-16le")){if(Ce.length<2||Te.length<2)return-1;Tt=2,Ot/=2,Gt/=2,Pe/=2}function rr(Ba,Ra){return Tt===1?Ba[Ra]:Ba.readUInt16BE(Ra*Tt)}var Qt;if(yt){var Tr=-1;for(Qt=Pe;QtOt&&(Pe=Ot-Gt),Qt=Pe;Qt>=0;Qt--){for(var la=!0,Ua=0;Uayt&&(at=yt)):at=yt;var Tt=Te.length;at>Tt/2&&(at=Tt/2);var Ot;for(Ot=0;Ot>>0,isFinite(at)?(at=at>>>0,yt===void 0&&(yt="utf8")):(yt=at,at=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var Tt=this.length-Pe;if((at===void 0||at>Tt)&&(at=Tt),Te.length>0&&(at<0||Pe<0)||Pe>this.length)throw new RangeError("Attempt to write outside buffer bounds");yt||(yt="utf8");for(var Ot=!1;;)switch(yt){case"hex":return J(this,Te,Pe,at);case"utf8":case"utf-8":return X(this,Te,Pe,at);case"ascii":case"latin1":case"binary":return oe(this,Te,Pe,at);case"base64":return ie(this,Te,Pe,at);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,Te,Pe,at);default:if(Ot)throw new TypeError("Unknown encoding: "+yt);yt=(""+yt).toLowerCase(),Ot=!0}},h.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ee(Ce,Te,Pe){return Te===0&&Pe===Ce.length?E.fromByteArray(Ce):E.fromByteArray(Ce.slice(Te,Pe))}function re(Ce,Te,Pe){Pe=Math.min(Ce.length,Pe);for(var at=[],yt=Te;yt239?4:Tt>223?3:Tt>191?2:1;if(yt+Gt<=Pe){var rr=void 0,Qt=void 0,Tr=void 0,la=void 0;switch(Gt){case 1:Tt<128&&(Ot=Tt);break;case 2:rr=Ce[yt+1],(rr&192)===128&&(la=(Tt&31)<<6|rr&63,la>127&&(Ot=la));break;case 3:rr=Ce[yt+1],Qt=Ce[yt+2],(rr&192)===128&&(Qt&192)===128&&(la=(Tt&15)<<12|(rr&63)<<6|Qt&63,la>2047&&(la<55296||la>57343)&&(Ot=la));break;case 4:rr=Ce[yt+1],Qt=Ce[yt+2],Tr=Ce[yt+3],(rr&192)===128&&(Qt&192)===128&&(Tr&192)===128&&(la=(Tt&15)<<18|(rr&63)<<12|(Qt&63)<<6|Tr&63,la>65535&&la<1114112&&(Ot=la))}}Ot===null?(Ot=65533,Gt=1):Ot>65535&&(Ot-=65536,at.push(Ot>>>10&1023|55296),Ot=56320|Ot&1023),at.push(Ot),yt+=Gt}return be(at)}var ce=4096;function be(Ce){var Te=Ce.length;if(Te<=ce)return String.fromCharCode.apply(String,Ce);for(var Pe="",at=0;atat)&&(Pe=at);for(var yt="",Tt=Te;Ttat&&(Te=at),Pe<0?(Pe+=at,Pe<0&&(Pe=0)):Pe>at&&(Pe=at),PePe)throw new RangeError("Trying to access beyond buffer length")}h.prototype.readUintLE=h.prototype.readUIntLE=function(Te,Pe,at){Te=Te>>>0,Pe=Pe>>>0,at||it(Te,Pe,this.length);for(var yt=this[Te],Tt=1,Ot=0;++Ot>>0,Pe=Pe>>>0,at||it(Te,Pe,this.length);for(var yt=this[Te+--Pe],Tt=1;Pe>0&&(Tt*=256);)yt+=this[Te+--Pe]*Tt;return yt},h.prototype.readUint8=h.prototype.readUInt8=function(Te,Pe){return Te=Te>>>0,Pe||it(Te,1,this.length),this[Te]},h.prototype.readUint16LE=h.prototype.readUInt16LE=function(Te,Pe){return Te=Te>>>0,Pe||it(Te,2,this.length),this[Te]|this[Te+1]<<8},h.prototype.readUint16BE=h.prototype.readUInt16BE=function(Te,Pe){return Te=Te>>>0,Pe||it(Te,2,this.length),this[Te]<<8|this[Te+1]},h.prototype.readUint32LE=h.prototype.readUInt32LE=function(Te,Pe){return Te=Te>>>0,Pe||it(Te,4,this.length),(this[Te]|this[Te+1]<<8|this[Te+2]<<16)+this[Te+3]*16777216},h.prototype.readUint32BE=h.prototype.readUInt32BE=function(Te,Pe){return Te=Te>>>0,Pe||it(Te,4,this.length),this[Te]*16777216+(this[Te+1]<<16|this[Te+2]<<8|this[Te+3])},h.prototype.readBigUInt64LE=Me(function(Te){Te=Te>>>0,kt(Te,"offset");var Pe=this[Te],at=this[Te+7];(Pe===void 0||at===void 0)&&Vt(Te,this.length-8);var yt=Pe+this[++Te]*Math.pow(2,8)+this[++Te]*Math.pow(2,16)+this[++Te]*Math.pow(2,24),Tt=this[++Te]+this[++Te]*Math.pow(2,8)+this[++Te]*Math.pow(2,16)+at*Math.pow(2,24);return BigInt(yt)+(BigInt(Tt)<>>0,kt(Te,"offset");var Pe=this[Te],at=this[Te+7];(Pe===void 0||at===void 0)&&Vt(Te,this.length-8);var yt=Pe*Math.pow(2,24)+this[++Te]*Math.pow(2,16)+this[++Te]*Math.pow(2,8)+this[++Te],Tt=this[++Te]*Math.pow(2,24)+this[++Te]*Math.pow(2,16)+this[++Te]*Math.pow(2,8)+at;return(BigInt(yt)<>>0,Pe=Pe>>>0,at||it(Te,Pe,this.length);for(var yt=this[Te],Tt=1,Ot=0;++Ot=Tt&&(yt-=Math.pow(2,8*Pe)),yt},h.prototype.readIntBE=function(Te,Pe,at){Te=Te>>>0,Pe=Pe>>>0,at||it(Te,Pe,this.length);for(var yt=Pe,Tt=1,Ot=this[Te+--yt];yt>0&&(Tt*=256);)Ot+=this[Te+--yt]*Tt;return Tt*=128,Ot>=Tt&&(Ot-=Math.pow(2,8*Pe)),Ot},h.prototype.readInt8=function(Te,Pe){return Te=Te>>>0,Pe||it(Te,1,this.length),this[Te]&128?(255-this[Te]+1)*-1:this[Te]},h.prototype.readInt16LE=function(Te,Pe){Te=Te>>>0,Pe||it(Te,2,this.length);var at=this[Te]|this[Te+1]<<8;return at&32768?at|4294901760:at},h.prototype.readInt16BE=function(Te,Pe){Te=Te>>>0,Pe||it(Te,2,this.length);var at=this[Te+1]|this[Te]<<8;return at&32768?at|4294901760:at},h.prototype.readInt32LE=function(Te,Pe){return Te=Te>>>0,Pe||it(Te,4,this.length),this[Te]|this[Te+1]<<8|this[Te+2]<<16|this[Te+3]<<24},h.prototype.readInt32BE=function(Te,Pe){return Te=Te>>>0,Pe||it(Te,4,this.length),this[Te]<<24|this[Te+1]<<16|this[Te+2]<<8|this[Te+3]},h.prototype.readBigInt64LE=Me(function(Te){Te=Te>>>0,kt(Te,"offset");var Pe=this[Te],at=this[Te+7];(Pe===void 0||at===void 0)&&Vt(Te,this.length-8);var yt=this[Te+4]+this[Te+5]*Math.pow(2,8)+this[Te+6]*Math.pow(2,16)+(at<<24);return(BigInt(yt)<>>0,kt(Te,"offset");var Pe=this[Te],at=this[Te+7];(Pe===void 0||at===void 0)&&Vt(Te,this.length-8);var yt=(Pe<<24)+this[++Te]*Math.pow(2,16)+this[++Te]*Math.pow(2,8)+this[++Te];return(BigInt(yt)<>>0,Pe||it(Te,4,this.length),y.read(this,Te,!0,23,4)},h.prototype.readFloatBE=function(Te,Pe){return Te=Te>>>0,Pe||it(Te,4,this.length),y.read(this,Te,!1,23,4)},h.prototype.readDoubleLE=function(Te,Pe){return Te=Te>>>0,Pe||it(Te,8,this.length),y.read(this,Te,!0,52,8)},h.prototype.readDoubleBE=function(Te,Pe){return Te=Te>>>0,Pe||it(Te,8,this.length),y.read(this,Te,!1,52,8)};function ot(Ce,Te,Pe,at,yt,Tt){if(!h.isBuffer(Ce))throw new TypeError('"buffer" argument must be a Buffer instance');if(Te>yt||TeCe.length)throw new RangeError("Index out of range")}h.prototype.writeUintLE=h.prototype.writeUIntLE=function(Te,Pe,at,yt){if(Te=+Te,Pe=Pe>>>0,at=at>>>0,!yt){var Tt=Math.pow(2,8*at)-1;ot(this,Te,Pe,at,Tt,0)}var Ot=1,Gt=0;for(this[Pe]=Te&255;++Gt>>0,at=at>>>0,!yt){var Tt=Math.pow(2,8*at)-1;ot(this,Te,Pe,at,Tt,0)}var Ot=at-1,Gt=1;for(this[Pe+Ot]=Te&255;--Ot>=0&&(Gt*=256);)this[Pe+Ot]=Te/Gt&255;return Pe+at},h.prototype.writeUint8=h.prototype.writeUInt8=function(Te,Pe,at){return Te=+Te,Pe=Pe>>>0,at||ot(this,Te,Pe,1,255,0),this[Pe]=Te&255,Pe+1},h.prototype.writeUint16LE=h.prototype.writeUInt16LE=function(Te,Pe,at){return Te=+Te,Pe=Pe>>>0,at||ot(this,Te,Pe,2,65535,0),this[Pe]=Te&255,this[Pe+1]=Te>>>8,Pe+2},h.prototype.writeUint16BE=h.prototype.writeUInt16BE=function(Te,Pe,at){return Te=+Te,Pe=Pe>>>0,at||ot(this,Te,Pe,2,65535,0),this[Pe]=Te>>>8,this[Pe+1]=Te&255,Pe+2},h.prototype.writeUint32LE=h.prototype.writeUInt32LE=function(Te,Pe,at){return Te=+Te,Pe=Pe>>>0,at||ot(this,Te,Pe,4,4294967295,0),this[Pe+3]=Te>>>24,this[Pe+2]=Te>>>16,this[Pe+1]=Te>>>8,this[Pe]=Te&255,Pe+4},h.prototype.writeUint32BE=h.prototype.writeUInt32BE=function(Te,Pe,at){return Te=+Te,Pe=Pe>>>0,at||ot(this,Te,Pe,4,4294967295,0),this[Pe]=Te>>>24,this[Pe+1]=Te>>>16,this[Pe+2]=Te>>>8,this[Pe+3]=Te&255,Pe+4};function tt(Ce,Te,Pe,at,yt){Lt(Te,at,yt,Ce,Pe,7);var Tt=Number(Te&BigInt(4294967295));Ce[Pe++]=Tt,Tt=Tt>>8,Ce[Pe++]=Tt,Tt=Tt>>8,Ce[Pe++]=Tt,Tt=Tt>>8,Ce[Pe++]=Tt;var Ot=Number(Te>>BigInt(32)&BigInt(4294967295));return Ce[Pe++]=Ot,Ot=Ot>>8,Ce[Pe++]=Ot,Ot=Ot>>8,Ce[Pe++]=Ot,Ot=Ot>>8,Ce[Pe++]=Ot,Pe}function lt(Ce,Te,Pe,at,yt){Lt(Te,at,yt,Ce,Pe,7);var Tt=Number(Te&BigInt(4294967295));Ce[Pe+7]=Tt,Tt=Tt>>8,Ce[Pe+6]=Tt,Tt=Tt>>8,Ce[Pe+5]=Tt,Tt=Tt>>8,Ce[Pe+4]=Tt;var Ot=Number(Te>>BigInt(32)&BigInt(4294967295));return Ce[Pe+3]=Ot,Ot=Ot>>8,Ce[Pe+2]=Ot,Ot=Ot>>8,Ce[Pe+1]=Ot,Ot=Ot>>8,Ce[Pe]=Ot,Pe+8}h.prototype.writeBigUInt64LE=Me(function(Te){var Pe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return tt(this,Te,Pe,BigInt(0),BigInt("0xffffffffffffffff"))}),h.prototype.writeBigUInt64BE=Me(function(Te){var Pe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return lt(this,Te,Pe,BigInt(0),BigInt("0xffffffffffffffff"))}),h.prototype.writeIntLE=function(Te,Pe,at,yt){if(Te=+Te,Pe=Pe>>>0,!yt){var Tt=Math.pow(2,8*at-1);ot(this,Te,Pe,at,Tt-1,-Tt)}var Ot=0,Gt=1,rr=0;for(this[Pe]=Te&255;++Ot>0)-rr&255;return Pe+at},h.prototype.writeIntBE=function(Te,Pe,at,yt){if(Te=+Te,Pe=Pe>>>0,!yt){var Tt=Math.pow(2,8*at-1);ot(this,Te,Pe,at,Tt-1,-Tt)}var Ot=at-1,Gt=1,rr=0;for(this[Pe+Ot]=Te&255;--Ot>=0&&(Gt*=256);)Te<0&&rr===0&&this[Pe+Ot+1]!==0&&(rr=1),this[Pe+Ot]=(Te/Gt>>0)-rr&255;return Pe+at},h.prototype.writeInt8=function(Te,Pe,at){return Te=+Te,Pe=Pe>>>0,at||ot(this,Te,Pe,1,127,-128),Te<0&&(Te=255+Te+1),this[Pe]=Te&255,Pe+1},h.prototype.writeInt16LE=function(Te,Pe,at){return Te=+Te,Pe=Pe>>>0,at||ot(this,Te,Pe,2,32767,-32768),this[Pe]=Te&255,this[Pe+1]=Te>>>8,Pe+2},h.prototype.writeInt16BE=function(Te,Pe,at){return Te=+Te,Pe=Pe>>>0,at||ot(this,Te,Pe,2,32767,-32768),this[Pe]=Te>>>8,this[Pe+1]=Te&255,Pe+2},h.prototype.writeInt32LE=function(Te,Pe,at){return Te=+Te,Pe=Pe>>>0,at||ot(this,Te,Pe,4,2147483647,-2147483648),this[Pe]=Te&255,this[Pe+1]=Te>>>8,this[Pe+2]=Te>>>16,this[Pe+3]=Te>>>24,Pe+4},h.prototype.writeInt32BE=function(Te,Pe,at){return Te=+Te,Pe=Pe>>>0,at||ot(this,Te,Pe,4,2147483647,-2147483648),Te<0&&(Te=4294967295+Te+1),this[Pe]=Te>>>24,this[Pe+1]=Te>>>16,this[Pe+2]=Te>>>8,this[Pe+3]=Te&255,Pe+4},h.prototype.writeBigInt64LE=Me(function(Te){var Pe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return tt(this,Te,Pe,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),h.prototype.writeBigInt64BE=Me(function(Te){var Pe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return lt(this,Te,Pe,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Ee(Ce,Te,Pe,at,yt,Tt){if(Pe+at>Ce.length)throw new RangeError("Index out of range");if(Pe<0)throw new RangeError("Index out of range")}function _e(Ce,Te,Pe,at,yt){return Te=+Te,Pe=Pe>>>0,yt||Ee(Ce,Te,Pe,4,34028234663852886e22,-34028234663852886e22),y.write(Ce,Te,Pe,at,23,4),Pe+4}h.prototype.writeFloatLE=function(Te,Pe,at){return _e(this,Te,Pe,!0,at)},h.prototype.writeFloatBE=function(Te,Pe,at){return _e(this,Te,Pe,!1,at)};function fe(Ce,Te,Pe,at,yt){return Te=+Te,Pe=Pe>>>0,yt||Ee(Ce,Te,Pe,8,17976931348623157e292,-17976931348623157e292),y.write(Ce,Te,Pe,at,52,8),Pe+8}h.prototype.writeDoubleLE=function(Te,Pe,at){return fe(this,Te,Pe,!0,at)},h.prototype.writeDoubleBE=function(Te,Pe,at){return fe(this,Te,Pe,!1,at)},h.prototype.copy=function(Te,Pe,at,yt){if(!h.isBuffer(Te))throw new TypeError("argument should be a Buffer");if(at||(at=0),!yt&&yt!==0&&(yt=this.length),Pe>=Te.length&&(Pe=Te.length),Pe||(Pe=0),yt>0&&yt=this.length)throw new RangeError("Index out of range");if(yt<0)throw new RangeError("sourceEnd out of bounds");yt>this.length&&(yt=this.length),Te.length-Pe>>0,at=at===void 0?this.length:at>>>0,Te||(Te=0);var Ot;if(typeof Te=="number")for(Ot=Pe;OtMath.pow(2,32)?yt=st(String(Pe)):typeof Pe=="bigint"&&(yt=String(Pe),(Pe>Math.pow(BigInt(2),BigInt(32))||Pe<-Math.pow(BigInt(2),BigInt(32)))&&(yt=st(yt)),yt+="n"),at+=" It must be ".concat(Te,". Received ").concat(yt),at},RangeError);function st(Ce){for(var Te="",Pe=Ce.length,at=Ce[0]==="-"?1:0;Pe>=at+4;Pe-=3)Te="_".concat(Ce.slice(Pe-3,Pe)).concat(Te);return"".concat(Ce.slice(0,Pe)).concat(Te)}function Qe(Ce,Te,Pe){kt(Te,"offset"),(Ce[Te]===void 0||Ce[Te+Pe]===void 0)&&Vt(Te,Ce.length-(Pe+1))}function Lt(Ce,Te,Pe,at,yt,Tt){if(Ce>Pe||Ce3?Te===0||Te===BigInt(0)?Gt=">= 0".concat(Ot," and < 2").concat(Ot," ** ").concat((Tt+1)*8).concat(Ot):Gt=">= -(2".concat(Ot," ** ").concat((Tt+1)*8-1).concat(Ot,") and < 2 ** ")+"".concat((Tt+1)*8-1).concat(Ot):Gt=">= ".concat(Te).concat(Ot," and <= ").concat(Pe).concat(Ot),new Fe.ERR_OUT_OF_RANGE("value",Gt,Ce)}Qe(at,yt,Tt)}function kt(Ce,Te){if(typeof Ce!="number")throw new Fe.ERR_INVALID_ARG_TYPE(Te,"number",Ce)}function Vt(Ce,Te,Pe){throw Math.floor(Ce)!==Ce?(kt(Ce,Pe),new Fe.ERR_OUT_OF_RANGE(Pe||"offset","an integer",Ce)):Te<0?new Fe.ERR_BUFFER_OUT_OF_BOUNDS:new Fe.ERR_OUT_OF_RANGE(Pe||"offset",">= ".concat(Pe?1:0," and <= ").concat(Te),Ce)}var Zt=/[^+/0-9A-Za-z-_]/g;function Sr(Ce){if(Ce=Ce.split("=")[0],Ce=Ce.trim().replace(Zt,""),Ce.length<2)return"";for(;Ce.length%4!==0;)Ce=Ce+"=";return Ce}function xr(Ce,Te){Te=Te||1/0;for(var Pe,at=Ce.length,yt=null,Tt=[],Ot=0;Ot55295&&Pe<57344){if(!yt){if(Pe>56319){(Te-=3)>-1&&Tt.push(239,191,189);continue}else if(Ot+1===at){(Te-=3)>-1&&Tt.push(239,191,189);continue}yt=Pe;continue}if(Pe<56320){(Te-=3)>-1&&Tt.push(239,191,189),yt=Pe;continue}Pe=(yt-55296<<10|Pe-56320)+65536}else yt&&(Te-=3)>-1&&Tt.push(239,191,189);if(yt=null,Pe<128){if((Te-=1)<0)break;Tt.push(Pe)}else if(Pe<2048){if((Te-=2)<0)break;Tt.push(Pe>>6|192,Pe&63|128)}else if(Pe<65536){if((Te-=3)<0)break;Tt.push(Pe>>12|224,Pe>>6&63|128,Pe&63|128)}else if(Pe<1114112){if((Te-=4)<0)break;Tt.push(Pe>>18|240,Pe>>12&63|128,Pe>>6&63|128,Pe&63|128)}else throw new Error("Invalid code point")}return Tt}function jr(Ce){for(var Te=[],Pe=0;Pe>8,yt=Pe%256,Tt.push(yt),Tt.push(at);return Tt}function Ir(Ce){return E.toByteArray(Sr(Ce))}function bt(Ce,Te,Pe,at){var yt;for(yt=0;yt=Te.length||yt>=Ce.length);++yt)Te[yt+Pe]=Ce[yt];return yt}function Be(Ce,Te){return Ce instanceof Te||Ce!=null&&Ce.constructor!=null&&Ce.constructor.name!=null&&Ce.constructor.name===Te.name}function Ke(Ce){return Ce!==Ce}var Ue=function(){for(var Ce="0123456789abcdef",Te=new Array(256),Pe=0;Pe<16;++Pe)for(var at=Pe*16,yt=0;yt<16;++yt)Te[at+yt]=Ce[Pe]+Ce[yt];return Te}();function Me(Ce){return typeof BigInt>"u"?qe:Ce}function qe(){throw new Error("BigInt not supported")}},9216:function(e){"use strict";e.exports=a,e.exports.isMobile=a,e.exports.default=a;var t=/(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,r=/CrOS/,o=/android|ipad|playbook|silk/i;function a(i){i||(i={});var n=i.ua;if(!n&&typeof navigator<"u"&&(n=navigator.userAgent),n&&n.headers&&typeof n.headers["user-agent"]=="string"&&(n=n.headers["user-agent"]),typeof n!="string")return!1;var s=t.test(n)&&!r.test(n)||!!i.tablet&&o.test(n);return!s&&i.tablet&&i.featureDetect&&navigator&&navigator.maxTouchPoints>1&&n.indexOf("Macintosh")!==-1&&n.indexOf("Safari")!==-1&&(s=!0),s}},6296:function(e,t,r){"use strict";e.exports=c;var o=r(7261),a=r(9977),i=r(1811);function n(f,g){this._controllerNames=Object.keys(f),this._controllerList=this._controllerNames.map(function(v){return f[v]}),this._mode=g,this._active=f[g],this._active||(this._mode="turntable",this._active=f.turntable),this.modes=this._controllerNames,this.computedMatrix=this._active.computedMatrix,this.computedEye=this._active.computedEye,this.computedUp=this._active.computedUp,this.computedCenter=this._active.computedCenter,this.computedRadius=this._active.computedRadius}var s=n.prototype;s.flush=function(f){for(var g=this._controllerList,v=0;v"u"?r(1538):WeakMap,a=r(2762),i=r(8116),n=new o;function s(c){var f=n.get(c),g=f&&(f._triangleBuffer.handle||f._triangleBuffer.buffer);if(!g||!c.isBuffer(g)){var v=a(c,new Float32Array([-1,-1,-1,4,4,-1]));f=i(c,[{buffer:v,type:c.FLOAT,size:2}]),f._triangleBuffer=v,n.set(c,f)}f.bind(),c.drawArrays(c.TRIANGLES,0,3),f.unbind()}e.exports=s},1085:function(e,t,r){var o=r(1371);e.exports=a;function a(i,n,s){n=typeof n=="number"?n:1,s=s||": ";var c=i.split(/\r?\n/),f=String(c.length+n-1).length;return c.map(function(g,v){var T=v+n,l=String(T).length,_=o(T,f-l);return _+s+g}).join(` `)}},3952:function(e,t,r){"use strict";e.exports=i;var o=r(3250);function a(n,s){for(var c=new Array(s+1),f=0;f0)throw new Error("Invalid string. Length must be a multiple of 4");var E=w.indexOf("=");E===-1&&(E=S);var y=E===S?0:4-E%4;return[E,y]}function f(w){var S=c(w),E=S[0],y=S[1];return(E+y)*3/4-y}function g(w,S,E){return(S+E)*3/4-E}function v(w){var S,E=c(w),y=E[0],b=E[1],p=new a(g(w,y,b)),u=0,m=b>0?y-4:y,h;for(h=0;h>16&255,p[u++]=S>>8&255,p[u++]=S&255;return b===2&&(S=o[w.charCodeAt(h)]<<2|o[w.charCodeAt(h+1)]>>4,p[u++]=S&255),b===1&&(S=o[w.charCodeAt(h)]<<10|o[w.charCodeAt(h+1)]<<4|o[w.charCodeAt(h+2)]>>2,p[u++]=S>>8&255,p[u++]=S&255),p}function T(w){return r[w>>18&63]+r[w>>12&63]+r[w>>6&63]+r[w&63]}function l(w,S,E){for(var y,b=[],p=S;pm?m:u+p));return y===1?(S=w[E-1],b.push(r[S>>2]+r[S<<4&63]+"==")):y===2&&(S=(w[E-2]<<8)+w[E-1],b.push(r[S>>10]+r[S>>4&63]+r[S<<2&63]+"=")),b.join("")}},3865:function(e,t,r){"use strict";var o=r(869);e.exports=a;function a(i,n){return o(i[0].mul(n[1]).add(n[0].mul(i[1])),i[1].mul(n[1]))}},1318:function(e){"use strict";e.exports=t;function t(r,o){return r[0].mul(o[1]).cmp(o[0].mul(r[1]))}},8697:function(e,t,r){"use strict";var o=r(869);e.exports=a;function a(i,n){return o(i[0].mul(n[1]),i[1].mul(n[0]))}},7842:function(e,t,r){"use strict";var o=r(6330),a=r(1533),i=r(2651),n=r(6768),s=r(869),c=r(8697);e.exports=f;function f(g,v){if(o(g))return v?c(g,f(v)):[g[0].clone(),g[1].clone()];var T=0,l,_;if(a(g))l=g.clone();else if(typeof g=="string")l=n(g);else{if(g===0)return[i(0),i(1)];if(g===Math.floor(g))l=i(g);else{for(;g!==Math.floor(g);)g=g*Math.pow(2,256),T-=256;l=i(g)}}if(o(v))l.mul(v[1]),_=v[0].clone();else if(a(v))_=v.clone();else if(typeof v=="string")_=n(v);else if(!v)_=i(1);else if(v===Math.floor(v))_=i(v);else{for(;v!==Math.floor(v);)v=v*Math.pow(2,256),T+=256;_=i(v)}return T>0?l=l.ushln(T):T<0&&(_=_.ushln(-T)),s(l,_)}},6330:function(e,t,r){"use strict";var o=r(1533);e.exports=a;function a(i){return Array.isArray(i)&&i.length===2&&o(i[0])&&o(i[1])}},5716:function(e,t,r){"use strict";var o=r(6859);e.exports=a;function a(i){return i.cmp(new o(0))}},1369:function(e,t,r){"use strict";var o=r(5716);e.exports=a;function a(i){var n=i.length,s=i.words,c=0;if(n===1)c=s[0];else if(n===2)c=s[0]+s[1]*67108864;else for(var f=0;f20?52:c+32}},1533:function(e,t,r){"use strict";var o=r(6859);e.exports=a;function a(i){return i&&typeof i=="object"&&!!i.words}},2651:function(e,t,r){"use strict";var o=r(6859),a=r(2361);e.exports=i;function i(n){var s=a.exponent(n);return s<52?new o(n):new o(n*Math.pow(2,52-s)).ushln(s-52)}},869:function(e,t,r){"use strict";var o=r(2651),a=r(5716);e.exports=i;function i(n,s){var c=a(n),f=a(s);if(c===0)return[o(0),o(1)];if(f===0)return[o(0),o(0)];f<0&&(n=n.neg(),s=s.neg());var g=n.gcd(s);return g.cmpn(1)?[n.div(g),s.div(g)]:[n,s]}},6768:function(e,t,r){"use strict";var o=r(6859);e.exports=a;function a(i){return new o(i)}},6504:function(e,t,r){"use strict";var o=r(869);e.exports=a;function a(i,n){return o(i[0].mul(n[0]),i[1].mul(n[1]))}},7721:function(e,t,r){"use strict";var o=r(5716);e.exports=a;function a(i){return o(i[0])*o(i[1])}},5572:function(e,t,r){"use strict";var o=r(869);e.exports=a;function a(i,n){return o(i[0].mul(n[1]).sub(i[1].mul(n[0])),i[1].mul(n[1]))}},946:function(e,t,r){"use strict";var o=r(1369),a=r(4025);e.exports=i;function i(n){var s=n[0],c=n[1];if(s.cmpn(0)===0)return 0;var f=s.abs().divmod(c.abs()),g=f.div,v=o(g),T=f.mod,l=s.negative!==c.negative?-1:1;if(T.cmpn(0)===0)return l*v;if(v){var _=a(v)+4,w=o(T.ushln(_).divRound(c));return l*(v+w*Math.pow(2,-_))}else{var S=c.bitLength()-T.bitLength()+53,w=o(T.ushln(S).divRound(c));return S<1023?l*w*Math.pow(2,-S):(w*=Math.pow(2,-1023),l*w*Math.pow(2,1023-S))}}},2478:function(e){"use strict";function t(s,c,f,g,v){for(var T=v+1;g<=v;){var l=g+v>>>1,_=s[l],w=f!==void 0?f(_,c):_-c;w>=0?(T=l,v=l-1):g=l+1}return T}function r(s,c,f,g,v){for(var T=v+1;g<=v;){var l=g+v>>>1,_=s[l],w=f!==void 0?f(_,c):_-c;w>0?(T=l,v=l-1):g=l+1}return T}function o(s,c,f,g,v){for(var T=g-1;g<=v;){var l=g+v>>>1,_=s[l],w=f!==void 0?f(_,c):_-c;w<0?(T=l,g=l+1):v=l-1}return T}function a(s,c,f,g,v){for(var T=g-1;g<=v;){var l=g+v>>>1,_=s[l],w=f!==void 0?f(_,c):_-c;w<=0?(T=l,g=l+1):v=l-1}return T}function i(s,c,f,g,v){for(;g<=v;){var T=g+v>>>1,l=s[T],_=f!==void 0?f(l,c):l-c;if(_===0)return T;_<=0?g=T+1:v=T-1}return-1}function n(s,c,f,g,v,T){return typeof f=="function"?T(s,c,f,g===void 0?0:g|0,v===void 0?s.length-1:v|0):T(s,c,void 0,f===void 0?0:f|0,g===void 0?s.length-1:g|0)}e.exports={ge:function(s,c,f,g,v){return n(s,c,f,g,v,t)},gt:function(s,c,f,g,v){return n(s,c,f,g,v,r)},lt:function(s,c,f,g,v){return n(s,c,f,g,v,o)},le:function(s,c,f,g,v){return n(s,c,f,g,v,a)},eq:function(s,c,f,g,v){return n(s,c,f,g,v,i)}}},8828:function(e,t){"use strict";"use restrict";var r=32;t.INT_BITS=r,t.INT_MAX=2147483647,t.INT_MIN=-1<0)-(i<0)},t.abs=function(i){var n=i>>r-1;return(i^n)-n},t.min=function(i,n){return n^(i^n)&-(i65535)<<4,i>>>=n,s=(i>255)<<3,i>>>=s,n|=s,s=(i>15)<<2,i>>>=s,n|=s,s=(i>3)<<1,i>>>=s,n|=s,n|i>>1},t.log10=function(i){return i>=1e9?9:i>=1e8?8:i>=1e7?7:i>=1e6?6:i>=1e5?5:i>=1e4?4:i>=1e3?3:i>=100?2:i>=10?1:0},t.popCount=function(i){return i=i-(i>>>1&1431655765),i=(i&858993459)+(i>>>2&858993459),(i+(i>>>4)&252645135)*16843009>>>24};function o(i){var n=32;return i&=-i,i&&n--,i&65535&&(n-=16),i&16711935&&(n-=8),i&252645135&&(n-=4),i&858993459&&(n-=2),i&1431655765&&(n-=1),n}t.countTrailingZeros=o,t.nextPow2=function(i){return i+=i===0,--i,i|=i>>>1,i|=i>>>2,i|=i>>>4,i|=i>>>8,i|=i>>>16,i+1},t.prevPow2=function(i){return i|=i>>>1,i|=i>>>2,i|=i>>>4,i|=i>>>8,i|=i>>>16,i-(i>>>1)},t.parity=function(i){return i^=i>>>16,i^=i>>>8,i^=i>>>4,i&=15,27030>>>i&1};var a=new Array(256);(function(i){for(var n=0;n<256;++n){var s=n,c=n,f=7;for(s>>>=1;s;s>>>=1)c<<=1,c|=s&1,--f;i[n]=c<>>8&255]<<16|a[i>>>16&255]<<8|a[i>>>24&255]},t.interleave2=function(i,n){return i&=65535,i=(i|i<<8)&16711935,i=(i|i<<4)&252645135,i=(i|i<<2)&858993459,i=(i|i<<1)&1431655765,n&=65535,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,i|n<<1},t.deinterleave2=function(i,n){return i=i>>>n&1431655765,i=(i|i>>>1)&858993459,i=(i|i>>>2)&252645135,i=(i|i>>>4)&16711935,i=(i|i>>>16)&65535,i<<16>>16},t.interleave3=function(i,n,s){return i&=1023,i=(i|i<<16)&4278190335,i=(i|i<<8)&251719695,i=(i|i<<4)&3272356035,i=(i|i<<2)&1227133513,n&=1023,n=(n|n<<16)&4278190335,n=(n|n<<8)&251719695,n=(n|n<<4)&3272356035,n=(n|n<<2)&1227133513,i|=n<<1,s&=1023,s=(s|s<<16)&4278190335,s=(s|s<<8)&251719695,s=(s|s<<4)&3272356035,s=(s|s<<2)&1227133513,i|s<<2},t.deinterleave3=function(i,n){return i=i>>>n&1227133513,i=(i|i>>>2)&3272356035,i=(i|i>>>4)&251719695,i=(i|i>>>8)&4278190335,i=(i|i>>>16)&1023,i<<22>>22},t.nextCombination=function(i){var n=i|i-1;return n+1|(~n&-~n)-1>>>o(i)+1}},6859:function(e,t,r){e=r.nmd(e),function(o,a){"use strict";function i(O,I){if(!O)throw new Error(I||"Assertion failed")}function n(O,I){O.super_=I;var N=function(){};N.prototype=I.prototype,O.prototype=new N,O.prototype.constructor=O}function s(O,I,N){if(s.isBN(O))return O;this.negative=0,this.words=null,this.length=0,this.red=null,O!==null&&((I==="le"||I==="be")&&(N=I,I=10),this._init(O||0,I||10,N||"be"))}typeof o=="object"?o.exports=s:a.BN=s,s.BN=s,s.wordSize=26;var c;try{typeof window<"u"&&typeof window.Buffer<"u"?c=window.Buffer:c=r(7790).Buffer}catch{}s.isBN=function(I){return I instanceof s?!0:I!==null&&typeof I=="object"&&I.constructor.wordSize===s.wordSize&&Array.isArray(I.words)},s.max=function(I,N){return I.cmp(N)>0?I:N},s.min=function(I,N){return I.cmp(N)<0?I:N},s.prototype._init=function(I,N,U){if(typeof I=="number")return this._initNumber(I,N,U);if(typeof I=="object")return this._initArray(I,N,U);N==="hex"&&(N=16),i(N===(N|0)&&N>=2&&N<=36),I=I.toString().replace(/\s+/g,"");var W=0;I[0]==="-"&&(W++,this.negative=1),W=0;W-=3)ue=I[W]|I[W-1]<<8|I[W-2]<<16,this.words[Q]|=ue<>>26-le&67108863,le+=24,le>=26&&(le-=26,Q++);else if(U==="le")for(W=0,Q=0;W>>26-le&67108863,le+=24,le>=26&&(le-=26,Q++);return this.strip()};function f(O,I){var N=O.charCodeAt(I);return N>=65&&N<=70?N-55:N>=97&&N<=102?N-87:N-48&15}function g(O,I,N){var U=f(O,N);return N-1>=I&&(U|=f(O,N-1)<<4),U}s.prototype._parseHex=function(I,N,U){this.length=Math.ceil((I.length-N)/6),this.words=new Array(this.length);for(var W=0;W=N;W-=2)le=g(I,N,W)<=18?(Q-=18,ue+=1,this.words[ue]|=le>>>26):Q+=8;else{var he=I.length-N;for(W=he%2===0?N+1:N;W=18?(Q-=18,ue+=1,this.words[ue]|=le>>>26):Q+=8}this.strip()};function v(O,I,N,U){for(var W=0,Q=Math.min(O.length,N),ue=I;ue=49?W+=le-49+10:le>=17?W+=le-17+10:W+=le}return W}s.prototype._parseBase=function(I,N,U){this.words=[0],this.length=1;for(var W=0,Q=1;Q<=67108863;Q*=N)W++;W--,Q=Q/N|0;for(var ue=I.length-U,le=ue%W,he=Math.min(ue,ue-le)+U,G=0,$=U;$1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},s.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},s.prototype.inspect=function(){return(this.red?""};var T=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],_=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];s.prototype.toString=function(I,N){I=I||10,N=N|0||1;var U;if(I===16||I==="hex"){U="";for(var W=0,Q=0,ue=0;ue>>24-W&16777215,Q!==0||ue!==this.length-1?U=T[6-he.length]+he+U:U=he+U,W+=2,W>=26&&(W-=26,ue--)}for(Q!==0&&(U=Q.toString(16)+U);U.length%N!==0;)U="0"+U;return this.negative!==0&&(U="-"+U),U}if(I===(I|0)&&I>=2&&I<=36){var G=l[I],$=_[I];U="";var J=this.clone();for(J.negative=0;!J.isZero();){var X=J.modn($).toString(I);J=J.idivn($),J.isZero()?U=X+U:U=T[G-X.length]+X+U}for(this.isZero()&&(U="0"+U);U.length%N!==0;)U="0"+U;return this.negative!==0&&(U="-"+U),U}i(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var I=this.words[0];return this.length===2?I+=this.words[1]*67108864:this.length===3&&this.words[2]===1?I+=4503599627370496+this.words[1]*67108864:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-I:I},s.prototype.toJSON=function(){return this.toString(16)},s.prototype.toBuffer=function(I,N){return i(typeof c<"u"),this.toArrayLike(c,I,N)},s.prototype.toArray=function(I,N){return this.toArrayLike(Array,I,N)},s.prototype.toArrayLike=function(I,N,U){var W=this.byteLength(),Q=U||Math.max(1,W);i(W<=Q,"byte array longer than desired length"),i(Q>0,"Requested array length <= 0"),this.strip();var ue=N==="le",le=new I(Q),he,G,$=this.clone();if(ue){for(G=0;!$.isZero();G++)he=$.andln(255),$.iushrn(8),le[G]=he;for(;G=4096&&(U+=13,N>>>=13),N>=64&&(U+=7,N>>>=7),N>=8&&(U+=4,N>>>=4),N>=2&&(U+=2,N>>>=2),U+N},s.prototype._zeroBits=function(I){if(I===0)return 26;var N=I,U=0;return N&8191||(U+=13,N>>>=13),N&127||(U+=7,N>>>=7),N&15||(U+=4,N>>>=4),N&3||(U+=2,N>>>=2),N&1||U++,U},s.prototype.bitLength=function(){var I=this.words[this.length-1],N=this._countBits(I);return(this.length-1)*26+N};function w(O){for(var I=new Array(O.bitLength()),N=0;N>>W}return I}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var I=0,N=0;NI.length?this.clone().ior(I):I.clone().ior(this)},s.prototype.uor=function(I){return this.length>I.length?this.clone().iuor(I):I.clone().iuor(this)},s.prototype.iuand=function(I){var N;this.length>I.length?N=I:N=this;for(var U=0;UI.length?this.clone().iand(I):I.clone().iand(this)},s.prototype.uand=function(I){return this.length>I.length?this.clone().iuand(I):I.clone().iuand(this)},s.prototype.iuxor=function(I){var N,U;this.length>I.length?(N=this,U=I):(N=I,U=this);for(var W=0;WI.length?this.clone().ixor(I):I.clone().ixor(this)},s.prototype.uxor=function(I){return this.length>I.length?this.clone().iuxor(I):I.clone().iuxor(this)},s.prototype.inotn=function(I){i(typeof I=="number"&&I>=0);var N=Math.ceil(I/26)|0,U=I%26;this._expand(N),U>0&&N--;for(var W=0;W0&&(this.words[W]=~this.words[W]&67108863>>26-U),this.strip()},s.prototype.notn=function(I){return this.clone().inotn(I)},s.prototype.setn=function(I,N){i(typeof I=="number"&&I>=0);var U=I/26|0,W=I%26;return this._expand(U+1),N?this.words[U]=this.words[U]|1<I.length?(U=this,W=I):(U=I,W=this);for(var Q=0,ue=0;ue>>26;for(;Q!==0&&ue>>26;if(this.length=U.length,Q!==0)this.words[this.length]=Q,this.length++;else if(U!==this)for(;ueI.length?this.clone().iadd(I):I.clone().iadd(this)},s.prototype.isub=function(I){if(I.negative!==0){I.negative=0;var N=this.iadd(I);return I.negative=1,N._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(I),this.negative=1,this._normSign();var U=this.cmp(I);if(U===0)return this.negative=0,this.length=1,this.words[0]=0,this;var W,Q;U>0?(W=this,Q=I):(W=I,Q=this);for(var ue=0,le=0;le>26,this.words[le]=N&67108863;for(;ue!==0&&le>26,this.words[le]=N&67108863;if(ue===0&&le>>26,J=he&67108863,X=Math.min(G,I.length-1),oe=Math.max(0,G-O.length+1);oe<=X;oe++){var ie=G-oe|0;W=O.words[ie]|0,Q=I.words[oe]|0,ue=W*Q+J,$+=ue/67108864|0,J=ue&67108863}N.words[G]=J|0,he=$|0}return he!==0?N.words[G]=he|0:N.length--,N.strip()}var E=function(I,N,U){var W=I.words,Q=N.words,ue=U.words,le=0,he,G,$,J=W[0]|0,X=J&8191,oe=J>>>13,ie=W[1]|0,j=ie&8191,ee=ie>>>13,re=W[2]|0,ce=re&8191,be=re>>>13,Ae=W[3]|0,ze=Ae&8191,Re=Ae>>>13,Xe=W[4]|0,it=Xe&8191,ot=Xe>>>13,tt=W[5]|0,lt=tt&8191,Ee=tt>>>13,_e=W[6]|0,fe=_e&8191,Fe=_e>>>13,rt=W[7]|0,st=rt&8191,Qe=rt>>>13,Lt=W[8]|0,kt=Lt&8191,Vt=Lt>>>13,Zt=W[9]|0,Sr=Zt&8191,xr=Zt>>>13,jr=Q[0]|0,wr=jr&8191,Ir=jr>>>13,bt=Q[1]|0,Be=bt&8191,Ke=bt>>>13,Ue=Q[2]|0,Me=Ue&8191,qe=Ue>>>13,Ce=Q[3]|0,Te=Ce&8191,Pe=Ce>>>13,at=Q[4]|0,yt=at&8191,Tt=at>>>13,Ot=Q[5]|0,Gt=Ot&8191,rr=Ot>>>13,Qt=Q[6]|0,Tr=Qt&8191,la=Qt>>>13,Ua=Q[7]|0,Ba=Ua&8191,Ra=Ua>>>13,ei=Q[8]|0,za=ei&8191,ti=ei>>>13,Ci=Q[9]|0,Jt=Ci&8191,Nt=Ci>>>13;U.negative=I.negative^N.negative,U.length=19,he=Math.imul(X,wr),G=Math.imul(X,Ir),G=G+Math.imul(oe,wr)|0,$=Math.imul(oe,Ir);var Kt=(le+he|0)+((G&8191)<<13)|0;le=($+(G>>>13)|0)+(Kt>>>26)|0,Kt&=67108863,he=Math.imul(j,wr),G=Math.imul(j,Ir),G=G+Math.imul(ee,wr)|0,$=Math.imul(ee,Ir),he=he+Math.imul(X,Be)|0,G=G+Math.imul(X,Ke)|0,G=G+Math.imul(oe,Be)|0,$=$+Math.imul(oe,Ke)|0;var Wt=(le+he|0)+((G&8191)<<13)|0;le=($+(G>>>13)|0)+(Wt>>>26)|0,Wt&=67108863,he=Math.imul(ce,wr),G=Math.imul(ce,Ir),G=G+Math.imul(be,wr)|0,$=Math.imul(be,Ir),he=he+Math.imul(j,Be)|0,G=G+Math.imul(j,Ke)|0,G=G+Math.imul(ee,Be)|0,$=$+Math.imul(ee,Ke)|0,he=he+Math.imul(X,Me)|0,G=G+Math.imul(X,qe)|0,G=G+Math.imul(oe,Me)|0,$=$+Math.imul(oe,qe)|0;var Pr=(le+he|0)+((G&8191)<<13)|0;le=($+(G>>>13)|0)+(Pr>>>26)|0,Pr&=67108863,he=Math.imul(ze,wr),G=Math.imul(ze,Ir),G=G+Math.imul(Re,wr)|0,$=Math.imul(Re,Ir),he=he+Math.imul(ce,Be)|0,G=G+Math.imul(ce,Ke)|0,G=G+Math.imul(be,Be)|0,$=$+Math.imul(be,Ke)|0,he=he+Math.imul(j,Me)|0,G=G+Math.imul(j,qe)|0,G=G+Math.imul(ee,Me)|0,$=$+Math.imul(ee,qe)|0,he=he+Math.imul(X,Te)|0,G=G+Math.imul(X,Pe)|0,G=G+Math.imul(oe,Te)|0,$=$+Math.imul(oe,Pe)|0;var ta=(le+he|0)+((G&8191)<<13)|0;le=($+(G>>>13)|0)+(ta>>>26)|0,ta&=67108863,he=Math.imul(it,wr),G=Math.imul(it,Ir),G=G+Math.imul(ot,wr)|0,$=Math.imul(ot,Ir),he=he+Math.imul(ze,Be)|0,G=G+Math.imul(ze,Ke)|0,G=G+Math.imul(Re,Be)|0,$=$+Math.imul(Re,Ke)|0,he=he+Math.imul(ce,Me)|0,G=G+Math.imul(ce,qe)|0,G=G+Math.imul(be,Me)|0,$=$+Math.imul(be,qe)|0,he=he+Math.imul(j,Te)|0,G=G+Math.imul(j,Pe)|0,G=G+Math.imul(ee,Te)|0,$=$+Math.imul(ee,Pe)|0,he=he+Math.imul(X,yt)|0,G=G+Math.imul(X,Tt)|0,G=G+Math.imul(oe,yt)|0,$=$+Math.imul(oe,Tt)|0;var ma=(le+he|0)+((G&8191)<<13)|0;le=($+(G>>>13)|0)+(ma>>>26)|0,ma&=67108863,he=Math.imul(lt,wr),G=Math.imul(lt,Ir),G=G+Math.imul(Ee,wr)|0,$=Math.imul(Ee,Ir),he=he+Math.imul(it,Be)|0,G=G+Math.imul(it,Ke)|0,G=G+Math.imul(ot,Be)|0,$=$+Math.imul(ot,Ke)|0,he=he+Math.imul(ze,Me)|0,G=G+Math.imul(ze,qe)|0,G=G+Math.imul(Re,Me)|0,$=$+Math.imul(Re,qe)|0,he=he+Math.imul(ce,Te)|0,G=G+Math.imul(ce,Pe)|0,G=G+Math.imul(be,Te)|0,$=$+Math.imul(be,Pe)|0,he=he+Math.imul(j,yt)|0,G=G+Math.imul(j,Tt)|0,G=G+Math.imul(ee,yt)|0,$=$+Math.imul(ee,Tt)|0,he=he+Math.imul(X,Gt)|0,G=G+Math.imul(X,rr)|0,G=G+Math.imul(oe,Gt)|0,$=$+Math.imul(oe,rr)|0;var ra=(le+he|0)+((G&8191)<<13)|0;le=($+(G>>>13)|0)+(ra>>>26)|0,ra&=67108863,he=Math.imul(fe,wr),G=Math.imul(fe,Ir),G=G+Math.imul(Fe,wr)|0,$=Math.imul(Fe,Ir),he=he+Math.imul(lt,Be)|0,G=G+Math.imul(lt,Ke)|0,G=G+Math.imul(Ee,Be)|0,$=$+Math.imul(Ee,Ke)|0,he=he+Math.imul(it,Me)|0,G=G+Math.imul(it,qe)|0,G=G+Math.imul(ot,Me)|0,$=$+Math.imul(ot,qe)|0,he=he+Math.imul(ze,Te)|0,G=G+Math.imul(ze,Pe)|0,G=G+Math.imul(Re,Te)|0,$=$+Math.imul(Re,Pe)|0,he=he+Math.imul(ce,yt)|0,G=G+Math.imul(ce,Tt)|0,G=G+Math.imul(be,yt)|0,$=$+Math.imul(be,Tt)|0,he=he+Math.imul(j,Gt)|0,G=G+Math.imul(j,rr)|0,G=G+Math.imul(ee,Gt)|0,$=$+Math.imul(ee,rr)|0,he=he+Math.imul(X,Tr)|0,G=G+Math.imul(X,la)|0,G=G+Math.imul(oe,Tr)|0,$=$+Math.imul(oe,la)|0;var Ia=(le+he|0)+((G&8191)<<13)|0;le=($+(G>>>13)|0)+(Ia>>>26)|0,Ia&=67108863,he=Math.imul(st,wr),G=Math.imul(st,Ir),G=G+Math.imul(Qe,wr)|0,$=Math.imul(Qe,Ir),he=he+Math.imul(fe,Be)|0,G=G+Math.imul(fe,Ke)|0,G=G+Math.imul(Fe,Be)|0,$=$+Math.imul(Fe,Ke)|0,he=he+Math.imul(lt,Me)|0,G=G+Math.imul(lt,qe)|0,G=G+Math.imul(Ee,Me)|0,$=$+Math.imul(Ee,qe)|0,he=he+Math.imul(it,Te)|0,G=G+Math.imul(it,Pe)|0,G=G+Math.imul(ot,Te)|0,$=$+Math.imul(ot,Pe)|0,he=he+Math.imul(ze,yt)|0,G=G+Math.imul(ze,Tt)|0,G=G+Math.imul(Re,yt)|0,$=$+Math.imul(Re,Tt)|0,he=he+Math.imul(ce,Gt)|0,G=G+Math.imul(ce,rr)|0,G=G+Math.imul(be,Gt)|0,$=$+Math.imul(be,rr)|0,he=he+Math.imul(j,Tr)|0,G=G+Math.imul(j,la)|0,G=G+Math.imul(ee,Tr)|0,$=$+Math.imul(ee,la)|0,he=he+Math.imul(X,Ba)|0,G=G+Math.imul(X,Ra)|0,G=G+Math.imul(oe,Ba)|0,$=$+Math.imul(oe,Ra)|0;var Ha=(le+he|0)+((G&8191)<<13)|0;le=($+(G>>>13)|0)+(Ha>>>26)|0,Ha&=67108863,he=Math.imul(kt,wr),G=Math.imul(kt,Ir),G=G+Math.imul(Vt,wr)|0,$=Math.imul(Vt,Ir),he=he+Math.imul(st,Be)|0,G=G+Math.imul(st,Ke)|0,G=G+Math.imul(Qe,Be)|0,$=$+Math.imul(Qe,Ke)|0,he=he+Math.imul(fe,Me)|0,G=G+Math.imul(fe,qe)|0,G=G+Math.imul(Fe,Me)|0,$=$+Math.imul(Fe,qe)|0,he=he+Math.imul(lt,Te)|0,G=G+Math.imul(lt,Pe)|0,G=G+Math.imul(Ee,Te)|0,$=$+Math.imul(Ee,Pe)|0,he=he+Math.imul(it,yt)|0,G=G+Math.imul(it,Tt)|0,G=G+Math.imul(ot,yt)|0,$=$+Math.imul(ot,Tt)|0,he=he+Math.imul(ze,Gt)|0,G=G+Math.imul(ze,rr)|0,G=G+Math.imul(Re,Gt)|0,$=$+Math.imul(Re,rr)|0,he=he+Math.imul(ce,Tr)|0,G=G+Math.imul(ce,la)|0,G=G+Math.imul(be,Tr)|0,$=$+Math.imul(be,la)|0,he=he+Math.imul(j,Ba)|0,G=G+Math.imul(j,Ra)|0,G=G+Math.imul(ee,Ba)|0,$=$+Math.imul(ee,Ra)|0,he=he+Math.imul(X,za)|0,G=G+Math.imul(X,ti)|0,G=G+Math.imul(oe,za)|0,$=$+Math.imul(oe,ti)|0;var $a=(le+he|0)+((G&8191)<<13)|0;le=($+(G>>>13)|0)+($a>>>26)|0,$a&=67108863,he=Math.imul(Sr,wr),G=Math.imul(Sr,Ir),G=G+Math.imul(xr,wr)|0,$=Math.imul(xr,Ir),he=he+Math.imul(kt,Be)|0,G=G+Math.imul(kt,Ke)|0,G=G+Math.imul(Vt,Be)|0,$=$+Math.imul(Vt,Ke)|0,he=he+Math.imul(st,Me)|0,G=G+Math.imul(st,qe)|0,G=G+Math.imul(Qe,Me)|0,$=$+Math.imul(Qe,qe)|0,he=he+Math.imul(fe,Te)|0,G=G+Math.imul(fe,Pe)|0,G=G+Math.imul(Fe,Te)|0,$=$+Math.imul(Fe,Pe)|0,he=he+Math.imul(lt,yt)|0,G=G+Math.imul(lt,Tt)|0,G=G+Math.imul(Ee,yt)|0,$=$+Math.imul(Ee,Tt)|0,he=he+Math.imul(it,Gt)|0,G=G+Math.imul(it,rr)|0,G=G+Math.imul(ot,Gt)|0,$=$+Math.imul(ot,rr)|0,he=he+Math.imul(ze,Tr)|0,G=G+Math.imul(ze,la)|0,G=G+Math.imul(Re,Tr)|0,$=$+Math.imul(Re,la)|0,he=he+Math.imul(ce,Ba)|0,G=G+Math.imul(ce,Ra)|0,G=G+Math.imul(be,Ba)|0,$=$+Math.imul(be,Ra)|0,he=he+Math.imul(j,za)|0,G=G+Math.imul(j,ti)|0,G=G+Math.imul(ee,za)|0,$=$+Math.imul(ee,ti)|0,he=he+Math.imul(X,Jt)|0,G=G+Math.imul(X,Nt)|0,G=G+Math.imul(oe,Jt)|0,$=$+Math.imul(oe,Nt)|0;var ai=(le+he|0)+((G&8191)<<13)|0;le=($+(G>>>13)|0)+(ai>>>26)|0,ai&=67108863,he=Math.imul(Sr,Be),G=Math.imul(Sr,Ke),G=G+Math.imul(xr,Be)|0,$=Math.imul(xr,Ke),he=he+Math.imul(kt,Me)|0,G=G+Math.imul(kt,qe)|0,G=G+Math.imul(Vt,Me)|0,$=$+Math.imul(Vt,qe)|0,he=he+Math.imul(st,Te)|0,G=G+Math.imul(st,Pe)|0,G=G+Math.imul(Qe,Te)|0,$=$+Math.imul(Qe,Pe)|0,he=he+Math.imul(fe,yt)|0,G=G+Math.imul(fe,Tt)|0,G=G+Math.imul(Fe,yt)|0,$=$+Math.imul(Fe,Tt)|0,he=he+Math.imul(lt,Gt)|0,G=G+Math.imul(lt,rr)|0,G=G+Math.imul(Ee,Gt)|0,$=$+Math.imul(Ee,rr)|0,he=he+Math.imul(it,Tr)|0,G=G+Math.imul(it,la)|0,G=G+Math.imul(ot,Tr)|0,$=$+Math.imul(ot,la)|0,he=he+Math.imul(ze,Ba)|0,G=G+Math.imul(ze,Ra)|0,G=G+Math.imul(Re,Ba)|0,$=$+Math.imul(Re,Ra)|0,he=he+Math.imul(ce,za)|0,G=G+Math.imul(ce,ti)|0,G=G+Math.imul(be,za)|0,$=$+Math.imul(be,ti)|0,he=he+Math.imul(j,Jt)|0,G=G+Math.imul(j,Nt)|0,G=G+Math.imul(ee,Jt)|0,$=$+Math.imul(ee,Nt)|0;var mi=(le+he|0)+((G&8191)<<13)|0;le=($+(G>>>13)|0)+(mi>>>26)|0,mi&=67108863,he=Math.imul(Sr,Me),G=Math.imul(Sr,qe),G=G+Math.imul(xr,Me)|0,$=Math.imul(xr,qe),he=he+Math.imul(kt,Te)|0,G=G+Math.imul(kt,Pe)|0,G=G+Math.imul(Vt,Te)|0,$=$+Math.imul(Vt,Pe)|0,he=he+Math.imul(st,yt)|0,G=G+Math.imul(st,Tt)|0,G=G+Math.imul(Qe,yt)|0,$=$+Math.imul(Qe,Tt)|0,he=he+Math.imul(fe,Gt)|0,G=G+Math.imul(fe,rr)|0,G=G+Math.imul(Fe,Gt)|0,$=$+Math.imul(Fe,rr)|0,he=he+Math.imul(lt,Tr)|0,G=G+Math.imul(lt,la)|0,G=G+Math.imul(Ee,Tr)|0,$=$+Math.imul(Ee,la)|0,he=he+Math.imul(it,Ba)|0,G=G+Math.imul(it,Ra)|0,G=G+Math.imul(ot,Ba)|0,$=$+Math.imul(ot,Ra)|0,he=he+Math.imul(ze,za)|0,G=G+Math.imul(ze,ti)|0,G=G+Math.imul(Re,za)|0,$=$+Math.imul(Re,ti)|0,he=he+Math.imul(ce,Jt)|0,G=G+Math.imul(ce,Nt)|0,G=G+Math.imul(be,Jt)|0,$=$+Math.imul(be,Nt)|0;var xt=(le+he|0)+((G&8191)<<13)|0;le=($+(G>>>13)|0)+(xt>>>26)|0,xt&=67108863,he=Math.imul(Sr,Te),G=Math.imul(Sr,Pe),G=G+Math.imul(xr,Te)|0,$=Math.imul(xr,Pe),he=he+Math.imul(kt,yt)|0,G=G+Math.imul(kt,Tt)|0,G=G+Math.imul(Vt,yt)|0,$=$+Math.imul(Vt,Tt)|0,he=he+Math.imul(st,Gt)|0,G=G+Math.imul(st,rr)|0,G=G+Math.imul(Qe,Gt)|0,$=$+Math.imul(Qe,rr)|0,he=he+Math.imul(fe,Tr)|0,G=G+Math.imul(fe,la)|0,G=G+Math.imul(Fe,Tr)|0,$=$+Math.imul(Fe,la)|0,he=he+Math.imul(lt,Ba)|0,G=G+Math.imul(lt,Ra)|0,G=G+Math.imul(Ee,Ba)|0,$=$+Math.imul(Ee,Ra)|0,he=he+Math.imul(it,za)|0,G=G+Math.imul(it,ti)|0,G=G+Math.imul(ot,za)|0,$=$+Math.imul(ot,ti)|0,he=he+Math.imul(ze,Jt)|0,G=G+Math.imul(ze,Nt)|0,G=G+Math.imul(Re,Jt)|0,$=$+Math.imul(Re,Nt)|0;var ct=(le+he|0)+((G&8191)<<13)|0;le=($+(G>>>13)|0)+(ct>>>26)|0,ct&=67108863,he=Math.imul(Sr,yt),G=Math.imul(Sr,Tt),G=G+Math.imul(xr,yt)|0,$=Math.imul(xr,Tt),he=he+Math.imul(kt,Gt)|0,G=G+Math.imul(kt,rr)|0,G=G+Math.imul(Vt,Gt)|0,$=$+Math.imul(Vt,rr)|0,he=he+Math.imul(st,Tr)|0,G=G+Math.imul(st,la)|0,G=G+Math.imul(Qe,Tr)|0,$=$+Math.imul(Qe,la)|0,he=he+Math.imul(fe,Ba)|0,G=G+Math.imul(fe,Ra)|0,G=G+Math.imul(Fe,Ba)|0,$=$+Math.imul(Fe,Ra)|0,he=he+Math.imul(lt,za)|0,G=G+Math.imul(lt,ti)|0,G=G+Math.imul(Ee,za)|0,$=$+Math.imul(Ee,ti)|0,he=he+Math.imul(it,Jt)|0,G=G+Math.imul(it,Nt)|0,G=G+Math.imul(ot,Jt)|0,$=$+Math.imul(ot,Nt)|0;var Nr=(le+he|0)+((G&8191)<<13)|0;le=($+(G>>>13)|0)+(Nr>>>26)|0,Nr&=67108863,he=Math.imul(Sr,Gt),G=Math.imul(Sr,rr),G=G+Math.imul(xr,Gt)|0,$=Math.imul(xr,rr),he=he+Math.imul(kt,Tr)|0,G=G+Math.imul(kt,la)|0,G=G+Math.imul(Vt,Tr)|0,$=$+Math.imul(Vt,la)|0,he=he+Math.imul(st,Ba)|0,G=G+Math.imul(st,Ra)|0,G=G+Math.imul(Qe,Ba)|0,$=$+Math.imul(Qe,Ra)|0,he=he+Math.imul(fe,za)|0,G=G+Math.imul(fe,ti)|0,G=G+Math.imul(Fe,za)|0,$=$+Math.imul(Fe,ti)|0,he=he+Math.imul(lt,Jt)|0,G=G+Math.imul(lt,Nt)|0,G=G+Math.imul(Ee,Jt)|0,$=$+Math.imul(Ee,Nt)|0;var Or=(le+he|0)+((G&8191)<<13)|0;le=($+(G>>>13)|0)+(Or>>>26)|0,Or&=67108863,he=Math.imul(Sr,Tr),G=Math.imul(Sr,la),G=G+Math.imul(xr,Tr)|0,$=Math.imul(xr,la),he=he+Math.imul(kt,Ba)|0,G=G+Math.imul(kt,Ra)|0,G=G+Math.imul(Vt,Ba)|0,$=$+Math.imul(Vt,Ra)|0,he=he+Math.imul(st,za)|0,G=G+Math.imul(st,ti)|0,G=G+Math.imul(Qe,za)|0,$=$+Math.imul(Qe,ti)|0,he=he+Math.imul(fe,Jt)|0,G=G+Math.imul(fe,Nt)|0,G=G+Math.imul(Fe,Jt)|0,$=$+Math.imul(Fe,Nt)|0;var Rr=(le+he|0)+((G&8191)<<13)|0;le=($+(G>>>13)|0)+(Rr>>>26)|0,Rr&=67108863,he=Math.imul(Sr,Ba),G=Math.imul(Sr,Ra),G=G+Math.imul(xr,Ba)|0,$=Math.imul(xr,Ra),he=he+Math.imul(kt,za)|0,G=G+Math.imul(kt,ti)|0,G=G+Math.imul(Vt,za)|0,$=$+Math.imul(Vt,ti)|0,he=he+Math.imul(st,Jt)|0,G=G+Math.imul(st,Nt)|0,G=G+Math.imul(Qe,Jt)|0,$=$+Math.imul(Qe,Nt)|0;var Lr=(le+he|0)+((G&8191)<<13)|0;le=($+(G>>>13)|0)+(Lr>>>26)|0,Lr&=67108863,he=Math.imul(Sr,za),G=Math.imul(Sr,ti),G=G+Math.imul(xr,za)|0,$=Math.imul(xr,ti),he=he+Math.imul(kt,Jt)|0,G=G+Math.imul(kt,Nt)|0,G=G+Math.imul(Vt,Jt)|0,$=$+Math.imul(Vt,Nt)|0;var Gr=(le+he|0)+((G&8191)<<13)|0;le=($+(G>>>13)|0)+(Gr>>>26)|0,Gr&=67108863,he=Math.imul(Sr,Jt),G=Math.imul(Sr,Nt),G=G+Math.imul(xr,Jt)|0,$=Math.imul(xr,Nt);var Kr=(le+he|0)+((G&8191)<<13)|0;return le=($+(G>>>13)|0)+(Kr>>>26)|0,Kr&=67108863,ue[0]=Kt,ue[1]=Wt,ue[2]=Pr,ue[3]=ta,ue[4]=ma,ue[5]=ra,ue[6]=Ia,ue[7]=Ha,ue[8]=$a,ue[9]=ai,ue[10]=mi,ue[11]=xt,ue[12]=ct,ue[13]=Nr,ue[14]=Or,ue[15]=Rr,ue[16]=Lr,ue[17]=Gr,ue[18]=Kr,le!==0&&(ue[19]=le,U.length++),U};Math.imul||(E=S);function y(O,I,N){N.negative=I.negative^O.negative,N.length=O.length+I.length;for(var U=0,W=0,Q=0;Q>>26)|0,W+=ue>>>26,ue&=67108863}N.words[Q]=le,U=ue,ue=W}return U!==0?N.words[Q]=U:N.length--,N.strip()}function b(O,I,N){var U=new p;return U.mulp(O,I,N)}s.prototype.mulTo=function(I,N){var U,W=this.length+I.length;return this.length===10&&I.length===10?U=E(this,I,N):W<63?U=S(this,I,N):W<1024?U=y(this,I,N):U=b(this,I,N),U};function p(O,I){this.x=O,this.y=I}p.prototype.makeRBT=function(I){for(var N=new Array(I),U=s.prototype._countBits(I)-1,W=0;W>=1;return W},p.prototype.permute=function(I,N,U,W,Q,ue){for(var le=0;le>>1)Q++;return 1<>>13,U[2*ue+1]=Q&8191,Q=Q>>>13;for(ue=2*N;ue>=26,N+=W/67108864|0,N+=Q>>>26,this.words[U]=Q&67108863}return N!==0&&(this.words[U]=N,this.length++),this},s.prototype.muln=function(I){return this.clone().imuln(I)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(I){var N=w(I);if(N.length===0)return new s(1);for(var U=this,W=0;W=0);var N=I%26,U=(I-N)/26,W=67108863>>>26-N<<26-N,Q;if(N!==0){var ue=0;for(Q=0;Q>>26-N}ue&&(this.words[Q]=ue,this.length++)}if(U!==0){for(Q=this.length-1;Q>=0;Q--)this.words[Q+U]=this.words[Q];for(Q=0;Q=0);var W;N?W=(N-N%26)/26:W=0;var Q=I%26,ue=Math.min((I-Q)/26,this.length),le=67108863^67108863>>>Q<ue)for(this.length-=ue,G=0;G=0&&($!==0||G>=W);G--){var J=this.words[G]|0;this.words[G]=$<<26-Q|J>>>Q,$=J&le}return he&&$!==0&&(he.words[he.length++]=$),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},s.prototype.ishrn=function(I,N,U){return i(this.negative===0),this.iushrn(I,N,U)},s.prototype.shln=function(I){return this.clone().ishln(I)},s.prototype.ushln=function(I){return this.clone().iushln(I)},s.prototype.shrn=function(I){return this.clone().ishrn(I)},s.prototype.ushrn=function(I){return this.clone().iushrn(I)},s.prototype.testn=function(I){i(typeof I=="number"&&I>=0);var N=I%26,U=(I-N)/26,W=1<=0);var N=I%26,U=(I-N)/26;if(i(this.negative===0,"imaskn works only with positive numbers"),this.length<=U)return this;if(N!==0&&U++,this.length=Math.min(U,this.length),N!==0){var W=67108863^67108863>>>N<=67108864;N++)this.words[N]-=67108864,N===this.length-1?this.words[N+1]=1:this.words[N+1]++;return this.length=Math.max(this.length,N+1),this},s.prototype.isubn=function(I){if(i(typeof I=="number"),i(I<67108864),I<0)return this.iaddn(-I);if(this.negative!==0)return this.negative=0,this.iaddn(I),this.negative=1,this;if(this.words[0]-=I,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var N=0;N>26)-(he/67108864|0),this.words[Q+U]=ue&67108863}for(;Q>26,this.words[Q+U]=ue&67108863;if(le===0)return this.strip();for(i(le===-1),le=0,Q=0;Q>26,this.words[Q]=ue&67108863;return this.negative=1,this.strip()},s.prototype._wordDiv=function(I,N){var U=this.length-I.length,W=this.clone(),Q=I,ue=Q.words[Q.length-1]|0,le=this._countBits(ue);U=26-le,U!==0&&(Q=Q.ushln(U),W.iushln(U),ue=Q.words[Q.length-1]|0);var he=W.length-Q.length,G;if(N!=="mod"){G=new s(null),G.length=he+1,G.words=new Array(G.length);for(var $=0;$=0;X--){var oe=(W.words[Q.length+X]|0)*67108864+(W.words[Q.length+X-1]|0);for(oe=Math.min(oe/ue|0,67108863),W._ishlnsubmul(Q,oe,X);W.negative!==0;)oe--,W.negative=0,W._ishlnsubmul(Q,1,X),W.isZero()||(W.negative^=1);G&&(G.words[X]=oe)}return G&&G.strip(),W.strip(),N!=="div"&&U!==0&&W.iushrn(U),{div:G||null,mod:W}},s.prototype.divmod=function(I,N,U){if(i(!I.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var W,Q,ue;return this.negative!==0&&I.negative===0?(ue=this.neg().divmod(I,N),N!=="mod"&&(W=ue.div.neg()),N!=="div"&&(Q=ue.mod.neg(),U&&Q.negative!==0&&Q.iadd(I)),{div:W,mod:Q}):this.negative===0&&I.negative!==0?(ue=this.divmod(I.neg(),N),N!=="mod"&&(W=ue.div.neg()),{div:W,mod:ue.mod}):this.negative&I.negative?(ue=this.neg().divmod(I.neg(),N),N!=="div"&&(Q=ue.mod.neg(),U&&Q.negative!==0&&Q.isub(I)),{div:ue.div,mod:Q}):I.length>this.length||this.cmp(I)<0?{div:new s(0),mod:this}:I.length===1?N==="div"?{div:this.divn(I.words[0]),mod:null}:N==="mod"?{div:null,mod:new s(this.modn(I.words[0]))}:{div:this.divn(I.words[0]),mod:new s(this.modn(I.words[0]))}:this._wordDiv(I,N)},s.prototype.div=function(I){return this.divmod(I,"div",!1).div},s.prototype.mod=function(I){return this.divmod(I,"mod",!1).mod},s.prototype.umod=function(I){return this.divmod(I,"mod",!0).mod},s.prototype.divRound=function(I){var N=this.divmod(I);if(N.mod.isZero())return N.div;var U=N.div.negative!==0?N.mod.isub(I):N.mod,W=I.ushrn(1),Q=I.andln(1),ue=U.cmp(W);return ue<0||Q===1&&ue===0?N.div:N.div.negative!==0?N.div.isubn(1):N.div.iaddn(1)},s.prototype.modn=function(I){i(I<=67108863);for(var N=(1<<26)%I,U=0,W=this.length-1;W>=0;W--)U=(N*U+(this.words[W]|0))%I;return U},s.prototype.idivn=function(I){i(I<=67108863);for(var N=0,U=this.length-1;U>=0;U--){var W=(this.words[U]|0)+N*67108864;this.words[U]=W/I|0,N=W%I}return this.strip()},s.prototype.divn=function(I){return this.clone().idivn(I)},s.prototype.egcd=function(I){i(I.negative===0),i(!I.isZero());var N=this,U=I.clone();N.negative!==0?N=N.umod(I):N=N.clone();for(var W=new s(1),Q=new s(0),ue=new s(0),le=new s(1),he=0;N.isEven()&&U.isEven();)N.iushrn(1),U.iushrn(1),++he;for(var G=U.clone(),$=N.clone();!N.isZero();){for(var J=0,X=1;!(N.words[0]&X)&&J<26;++J,X<<=1);if(J>0)for(N.iushrn(J);J-- >0;)(W.isOdd()||Q.isOdd())&&(W.iadd(G),Q.isub($)),W.iushrn(1),Q.iushrn(1);for(var oe=0,ie=1;!(U.words[0]&ie)&&oe<26;++oe,ie<<=1);if(oe>0)for(U.iushrn(oe);oe-- >0;)(ue.isOdd()||le.isOdd())&&(ue.iadd(G),le.isub($)),ue.iushrn(1),le.iushrn(1);N.cmp(U)>=0?(N.isub(U),W.isub(ue),Q.isub(le)):(U.isub(N),ue.isub(W),le.isub(Q))}return{a:ue,b:le,gcd:U.iushln(he)}},s.prototype._invmp=function(I){i(I.negative===0),i(!I.isZero());var N=this,U=I.clone();N.negative!==0?N=N.umod(I):N=N.clone();for(var W=new s(1),Q=new s(0),ue=U.clone();N.cmpn(1)>0&&U.cmpn(1)>0;){for(var le=0,he=1;!(N.words[0]&he)&&le<26;++le,he<<=1);if(le>0)for(N.iushrn(le);le-- >0;)W.isOdd()&&W.iadd(ue),W.iushrn(1);for(var G=0,$=1;!(U.words[0]&$)&&G<26;++G,$<<=1);if(G>0)for(U.iushrn(G);G-- >0;)Q.isOdd()&&Q.iadd(ue),Q.iushrn(1);N.cmp(U)>=0?(N.isub(U),W.isub(Q)):(U.isub(N),Q.isub(W))}var J;return N.cmpn(1)===0?J=W:J=Q,J.cmpn(0)<0&&J.iadd(I),J},s.prototype.gcd=function(I){if(this.isZero())return I.abs();if(I.isZero())return this.abs();var N=this.clone(),U=I.clone();N.negative=0,U.negative=0;for(var W=0;N.isEven()&&U.isEven();W++)N.iushrn(1),U.iushrn(1);do{for(;N.isEven();)N.iushrn(1);for(;U.isEven();)U.iushrn(1);var Q=N.cmp(U);if(Q<0){var ue=N;N=U,U=ue}else if(Q===0||U.cmpn(1)===0)break;N.isub(U)}while(!0);return U.iushln(W)},s.prototype.invm=function(I){return this.egcd(I).a.umod(I)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(I){return this.words[0]&I},s.prototype.bincn=function(I){i(typeof I=="number");var N=I%26,U=(I-N)/26,W=1<>>26,le&=67108863,this.words[ue]=le}return Q!==0&&(this.words[ue]=Q,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(I){var N=I<0;if(this.negative!==0&&!N)return-1;if(this.negative===0&&N)return 1;this.strip();var U;if(this.length>1)U=1;else{N&&(I=-I),i(I<=67108863,"Number is too big");var W=this.words[0]|0;U=W===I?0:WI.length)return 1;if(this.length=0;U--){var W=this.words[U]|0,Q=I.words[U]|0;if(W!==Q){WQ&&(N=1);break}}return N},s.prototype.gtn=function(I){return this.cmpn(I)===1},s.prototype.gt=function(I){return this.cmp(I)===1},s.prototype.gten=function(I){return this.cmpn(I)>=0},s.prototype.gte=function(I){return this.cmp(I)>=0},s.prototype.ltn=function(I){return this.cmpn(I)===-1},s.prototype.lt=function(I){return this.cmp(I)===-1},s.prototype.lten=function(I){return this.cmpn(I)<=0},s.prototype.lte=function(I){return this.cmp(I)<=0},s.prototype.eqn=function(I){return this.cmpn(I)===0},s.prototype.eq=function(I){return this.cmp(I)===0},s.red=function(I){return new F(I)},s.prototype.toRed=function(I){return i(!this.red,"Already a number in reduction context"),i(this.negative===0,"red works only with positives"),I.convertTo(this)._forceRed(I)},s.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(I){return this.red=I,this},s.prototype.forceRed=function(I){return i(!this.red,"Already a number in reduction context"),this._forceRed(I)},s.prototype.redAdd=function(I){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,I)},s.prototype.redIAdd=function(I){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,I)},s.prototype.redSub=function(I){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,I)},s.prototype.redISub=function(I){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,I)},s.prototype.redShl=function(I){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,I)},s.prototype.redMul=function(I){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,I),this.red.mul(this,I)},s.prototype.redIMul=function(I){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,I),this.red.imul(this,I)},s.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(I){return i(this.red&&!I.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,I)};var u={k256:null,p224:null,p192:null,p25519:null};function m(O,I){this.name=O,this.p=new s(I,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}m.prototype._tmp=function(){var I=new s(null);return I.words=new Array(Math.ceil(this.n/13)),I},m.prototype.ireduce=function(I){var N=I,U;do this.split(N,this.tmp),N=this.imulK(N),N=N.iadd(this.tmp),U=N.bitLength();while(U>this.n);var W=U0?N.isub(this.p):N.strip!==void 0?N.strip():N._strip(),N},m.prototype.split=function(I,N){I.iushrn(this.n,0,N)},m.prototype.imulK=function(I){return I.imul(this.k)};function h(){m.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}n(h,m),h.prototype.split=function(I,N){for(var U=4194303,W=Math.min(I.length,9),Q=0;Q>>22,ue=le}ue>>>=22,I.words[Q-10]=ue,ue===0&&I.length>10?I.length-=10:I.length-=9},h.prototype.imulK=function(I){I.words[I.length]=0,I.words[I.length+1]=0,I.length+=2;for(var N=0,U=0;U>>=26,I.words[U]=Q,N=W}return N!==0&&(I.words[I.length++]=N),I},s._prime=function(I){if(u[I])return u[I];var N;if(I==="k256")N=new h;else if(I==="p224")N=new P;else if(I==="p192")N=new L;else if(I==="p25519")N=new z;else throw new Error("Unknown prime "+I);return u[I]=N,N};function F(O){if(typeof O=="string"){var I=s._prime(O);this.m=I.p,this.prime=I}else i(O.gtn(1),"modulus must be greater than 1"),this.m=O,this.prime=null}F.prototype._verify1=function(I){i(I.negative===0,"red works only with positives"),i(I.red,"red works only with red numbers")},F.prototype._verify2=function(I,N){i((I.negative|N.negative)===0,"red works only with positives"),i(I.red&&I.red===N.red,"red works only with red numbers")},F.prototype.imod=function(I){return this.prime?this.prime.ireduce(I)._forceRed(this):I.umod(this.m)._forceRed(this)},F.prototype.neg=function(I){return I.isZero()?I.clone():this.m.sub(I)._forceRed(this)},F.prototype.add=function(I,N){this._verify2(I,N);var U=I.add(N);return U.cmp(this.m)>=0&&U.isub(this.m),U._forceRed(this)},F.prototype.iadd=function(I,N){this._verify2(I,N);var U=I.iadd(N);return U.cmp(this.m)>=0&&U.isub(this.m),U},F.prototype.sub=function(I,N){this._verify2(I,N);var U=I.sub(N);return U.cmpn(0)<0&&U.iadd(this.m),U._forceRed(this)},F.prototype.isub=function(I,N){this._verify2(I,N);var U=I.isub(N);return U.cmpn(0)<0&&U.iadd(this.m),U},F.prototype.shl=function(I,N){return this._verify1(I),this.imod(I.ushln(N))},F.prototype.imul=function(I,N){return this._verify2(I,N),this.imod(I.imul(N))},F.prototype.mul=function(I,N){return this._verify2(I,N),this.imod(I.mul(N))},F.prototype.isqr=function(I){return this.imul(I,I.clone())},F.prototype.sqr=function(I){return this.mul(I,I)},F.prototype.sqrt=function(I){if(I.isZero())return I.clone();var N=this.m.andln(3);if(i(N%2===1),N===3){var U=this.m.add(new s(1)).iushrn(2);return this.pow(I,U)}for(var W=this.m.subn(1),Q=0;!W.isZero()&&W.andln(1)===0;)Q++,W.iushrn(1);i(!W.isZero());var ue=new s(1).toRed(this),le=ue.redNeg(),he=this.m.subn(1).iushrn(1),G=this.m.bitLength();for(G=new s(2*G*G).toRed(this);this.pow(G,he).cmp(le)!==0;)G.redIAdd(le);for(var $=this.pow(G,W),J=this.pow(I,W.addn(1).iushrn(1)),X=this.pow(I,W),oe=Q;X.cmp(ue)!==0;){for(var ie=X,j=0;ie.cmp(ue)!==0;j++)ie=ie.redSqr();i(j=0;Q--){for(var $=N.words[Q],J=G-1;J>=0;J--){var X=$>>J&1;if(ue!==W[0]&&(ue=this.sqr(ue)),X===0&&le===0){he=0;continue}le<<=1,le|=X,he++,!(he!==U&&(Q!==0||J!==0))&&(ue=this.mul(ue,W[le]),he=0,le=0)}G=26}return ue},F.prototype.convertTo=function(I){var N=I.umod(this.m);return N===I?N.clone():N},F.prototype.convertFrom=function(I){var N=I.clone();return N.red=null,N},s.mont=function(I){return new B(I)};function B(O){F.call(this,O),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}n(B,F),B.prototype.convertTo=function(I){return this.imod(I.ushln(this.shift))},B.prototype.convertFrom=function(I){var N=this.imod(I.mul(this.rinv));return N.red=null,N},B.prototype.imul=function(I,N){if(I.isZero()||N.isZero())return I.words[0]=0,I.length=1,I;var U=I.imul(N),W=U.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Q=U.isub(W).iushrn(this.shift),ue=Q;return Q.cmp(this.m)>=0?ue=Q.isub(this.m):Q.cmpn(0)<0&&(ue=Q.iadd(this.m)),ue._forceRed(this)},B.prototype.mul=function(I,N){if(I.isZero()||N.isZero())return new s(0)._forceRed(this);var U=I.mul(N),W=U.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Q=U.isub(W).iushrn(this.shift),ue=Q;return Q.cmp(this.m)>=0?ue=Q.isub(this.m):Q.cmpn(0)<0&&(ue=Q.iadd(this.m)),ue._forceRed(this)},B.prototype.invm=function(I){var N=this.imod(I._invmp(this.m).mul(this.r2));return N._forceRed(this)}}(e,this)},6204:function(e){"use strict";e.exports=t;function t(r){var o,a,i,n=r.length,s=0;for(o=0;o>>1;if(!(p<=0)){var u,m=o.mallocDouble(2*p*y),h=o.mallocInt32(y);if(y=s(_,p,m,h),y>0){if(p===1&&E)a.init(y),u=a.sweepComplete(p,S,0,y,m,h,0,y,m,h);else{var P=o.mallocDouble(2*p*b),L=o.mallocInt32(b);b=s(w,p,P,L),b>0&&(a.init(y+b),p===1?u=a.sweepBipartite(p,S,0,y,m,h,0,b,P,L):u=i(p,S,E,y,m,h,b,P,L),o.free(P),o.free(L))}o.free(m),o.free(h)}return u}}}var f;function g(_,w){f.push([_,w])}function v(_){return f=[],c(_,_,g,!0),f}function T(_,w){return f=[],c(_,w,g,!1),f}function l(_,w,S){switch(arguments.length){case 1:return v(_);case 2:return typeof w=="function"?c(_,_,w,!0):T(_,w);case 3:return c(_,w,S,!1);default:throw new Error("box-intersect: Invalid arguments")}}},2455:function(e,t){"use strict";function r(){function i(c,f,g,v,T,l,_,w,S,E,y){for(var b=2*c,p=v,u=b*v;pS-w?i(c,f,g,v,T,l,_,w,S,E,y):n(c,f,g,v,T,l,_,w,S,E,y)}return s}function o(){function i(g,v,T,l,_,w,S,E,y,b,p){for(var u=2*g,m=l,h=u*l;m<_;++m,h+=u){var P=w[v+h],L=w[v+h+g],z=S[m];e:for(var F=E,B=u*E;Fb-y?l?i(g,v,T,_,w,S,E,y,b,p,u):n(g,v,T,_,w,S,E,y,b,p,u):l?s(g,v,T,_,w,S,E,y,b,p,u):c(g,v,T,_,w,S,E,y,b,p,u)}return f}function a(i){return i?r():o()}t.partial=a(!1),t.full=a(!0)},7150:function(e,t,r){"use strict";e.exports=O;var o=r(1888),a=r(8828),i=r(2455),n=i.partial,s=i.full,c=r(855),f=r(3545),g=r(8105),v=128,T=1<<22,l=1<<22,_=g("!(lo>=p0)&&!(p1>=hi)"),w=g("lo===p0"),S=g("lo0;){$-=1;var oe=$*p,ie=h[oe],j=h[oe+1],ee=h[oe+2],re=h[oe+3],ce=h[oe+4],be=h[oe+5],Ae=$*u,ze=P[Ae],Re=P[Ae+1],Xe=be&1,it=!!(be&16),ot=Q,tt=ue,lt=he,Ee=G;if(Xe&&(ot=he,tt=G,lt=Q,Ee=ue),!(be&2&&(ee=S(I,ie,j,ee,ot,tt,Re),j>=ee))&&!(be&4&&(j=E(I,ie,j,ee,ot,tt,ze),j>=ee))){var _e=ee-j,fe=ce-re;if(it){if(I*_e*(_e+fe)g&&T[b+f]>E;--y,b-=_){for(var p=b,u=b+_,m=0;m<_;++m,++p,++u){var h=T[p];T[p]=T[u],T[u]=h}var P=l[y];l[y]=l[y-1],l[y-1]=P}}function s(c,f,g,v,T,l){if(v<=g+1)return g;for(var _=g,w=v,S=v+g>>>1,E=2*c,y=S,b=T[E*S+f];_=P?(y=h,b=P):m>=z?(y=u,b=m):(y=L,b=z):P>=z?(y=h,b=P):z>=m?(y=u,b=m):(y=L,b=z);for(var O=E*(w-1),I=E*y,F=0;F=p0)&&!(p1>=hi)":f};function r(g){return t[g]}function o(g,v,T,l,_,w,S){for(var E=2*g,y=E*T,b=y,p=T,u=v,m=g+v,h=T;l>h;++h,y+=E){var P=_[y+u];if(P===S)if(p===h)p+=1,b+=E;else{for(var L=0;E>L;++L){var z=_[y+L];_[y+L]=_[b],_[b++]=z}var F=w[h];w[h]=w[p],w[p++]=F}}return p}function a(g,v,T,l,_,w,S){for(var E=2*g,y=E*T,b=y,p=T,u=v,m=g+v,h=T;l>h;++h,y+=E){var P=_[y+u];if(PL;++L){var z=_[y+L];_[y+L]=_[b],_[b++]=z}var F=w[h];w[h]=w[p],w[p++]=F}}return p}function i(g,v,T,l,_,w,S){for(var E=2*g,y=E*T,b=y,p=T,u=v,m=g+v,h=T;l>h;++h,y+=E){var P=_[y+m];if(P<=S)if(p===h)p+=1,b+=E;else{for(var L=0;E>L;++L){var z=_[y+L];_[y+L]=_[b],_[b++]=z}var F=w[h];w[h]=w[p],w[p++]=F}}return p}function n(g,v,T,l,_,w,S){for(var E=2*g,y=E*T,b=y,p=T,u=v,m=g+v,h=T;l>h;++h,y+=E){var P=_[y+m];if(P<=S)if(p===h)p+=1,b+=E;else{for(var L=0;E>L;++L){var z=_[y+L];_[y+L]=_[b],_[b++]=z}var F=w[h];w[h]=w[p],w[p++]=F}}return p}function s(g,v,T,l,_,w,S){for(var E=2*g,y=E*T,b=y,p=T,u=v,m=g+v,h=T;l>h;++h,y+=E){var P=_[y+u],L=_[y+m];if(P<=S&&S<=L)if(p===h)p+=1,b+=E;else{for(var z=0;E>z;++z){var F=_[y+z];_[y+z]=_[b],_[b++]=F}var B=w[h];w[h]=w[p],w[p++]=B}}return p}function c(g,v,T,l,_,w,S){for(var E=2*g,y=E*T,b=y,p=T,u=v,m=g+v,h=T;l>h;++h,y+=E){var P=_[y+u],L=_[y+m];if(Pz;++z){var F=_[y+z];_[y+z]=_[b],_[b++]=F}var B=w[h];w[h]=w[p],w[p++]=B}}return p}function f(g,v,T,l,_,w,S,E){for(var y=2*g,b=y*T,p=b,u=T,m=v,h=g+v,P=T;l>P;++P,b+=y){var L=_[b+m],z=_[b+h];if(!(L>=S)&&!(E>=z))if(u===P)u+=1,p+=y;else{for(var F=0;y>F;++F){var B=_[b+F];_[b+F]=_[p],_[p++]=B}var O=w[P];w[P]=w[u],w[u++]=O}}return u}},4192:function(e){"use strict";e.exports=r;var t=32;function r(v,T){T<=4*t?o(0,T-1,v):g(0,T-1,v)}function o(v,T,l){for(var _=2*(v+1),w=v+1;w<=T;++w){for(var S=l[_++],E=l[_++],y=w,b=_-2;y-- >v;){var p=l[b-2],u=l[b-1];if(pl[T+1]:!0}function f(v,T,l,_){v*=2;var w=_[v];return w>1,y=E-_,b=E+_,p=w,u=y,m=E,h=b,P=S,L=v+1,z=T-1,F=0;c(p,u,l)&&(F=p,p=u,u=F),c(h,P,l)&&(F=h,h=P,P=F),c(p,m,l)&&(F=p,p=m,m=F),c(u,m,l)&&(F=u,u=m,m=F),c(p,h,l)&&(F=p,p=h,h=F),c(m,h,l)&&(F=m,m=h,h=F),c(u,P,l)&&(F=u,u=P,P=F),c(u,m,l)&&(F=u,u=m,m=F),c(h,P,l)&&(F=h,h=P,P=F);for(var B=l[2*u],O=l[2*u+1],I=l[2*h],N=l[2*h+1],U=2*p,W=2*m,Q=2*P,ue=2*w,le=2*E,he=2*S,G=0;G<2;++G){var $=l[U+G],J=l[W+G],X=l[Q+G];l[ue+G]=$,l[le+G]=J,l[he+G]=X}i(y,v,l),i(b,T,l);for(var oe=L;oe<=z;++oe)if(f(oe,B,O,l))oe!==L&&a(oe,L,l),++L;else if(!f(oe,I,N,l))for(;;)if(f(z,I,N,l)){f(z,B,O,l)?(n(oe,L,z,l),++L,--z):(a(oe,z,l),--z);break}else{if(--z>>1;i(_,J);for(var X=0,oe=0,le=0;le=n)ie=ie-n|0,S(g,v,oe--,ie);else if(ie>=0)S(c,f,X--,ie);else if(ie<=-n){ie=-ie-n|0;for(var j=0;j>>1;i(_,J);for(var X=0,oe=0,ie=0,le=0;le>1===_[2*le+3]>>1&&(ee=2,le+=1),j<0){for(var re=-(j>>1)-1,ce=0;ce>1)-1;ee===0?S(c,f,X--,re):ee===1?S(g,v,oe--,re):ee===2&&S(T,l,ie--,re)}}}function p(m,h,P,L,z,F,B,O,I,N,U,W){var Q=0,ue=2*m,le=h,he=h+m,G=1,$=1;L?$=n:G=n;for(var J=z;J>>1;i(_,j);for(var ee=0,J=0;J=n?(ce=!L,X-=n):(ce=!!L,X-=1),ce)E(c,f,ee++,X);else{var be=W[X],Ae=ue*X,ze=U[Ae+h+1],Re=U[Ae+h+1+m];e:for(var Xe=0;Xe>>1;i(_,X);for(var oe=0,he=0;he=n)c[oe++]=G-n;else{G-=1;var j=U[G],ee=Q*G,re=N[ee+h+1],ce=N[ee+h+1+m];e:for(var be=0;be=0;--be)if(c[be]===G){for(var Xe=be+1;Xe0;){for(var w=f.pop(),T=f.pop(),S=-1,E=-1,l=v[T],b=1;b=0||(c.flip(T,w),i(s,c,f,S,T,E),i(s,c,f,T,E,S),i(s,c,f,E,w,S),i(s,c,f,w,S,E))}}},5023:function(e,t,r){"use strict";var o=r(2478);e.exports=f;function a(g,v,T,l,_,w,S){this.cells=g,this.neighbor=v,this.flags=l,this.constraint=T,this.active=_,this.next=w,this.boundary=S}var i=a.prototype;function n(g,v){return g[0]-v[0]||g[1]-v[1]||g[2]-v[2]}i.locate=function(){var g=[0,0,0];return function(v,T,l){var _=v,w=T,S=l;return T0||S.length>0;){for(;w.length>0;){var u=w.pop();if(E[u]!==-_){E[u]=_;for(var m=y[u],h=0;h<3;++h){var P=p[3*u+h];P>=0&&E[P]===0&&(b[3*u+h]?S.push(P):(w.push(P),E[P]=_))}}}var L=S;S=w,w=L,S.length=0,_=-_}var z=c(y,E,v);return T?z.concat(l.boundary):z}},8902:function(e,t,r){"use strict";var o=r(2478),a=r(3250)[3],i=0,n=1,s=2;e.exports=S;function c(E,y,b,p,u){this.a=E,this.b=y,this.idx=b,this.lowerIds=p,this.upperIds=u}function f(E,y,b,p){this.a=E,this.b=y,this.type=b,this.idx=p}function g(E,y){var b=E.a[0]-y.a[0]||E.a[1]-y.a[1]||E.type-y.type;return b||E.type!==i&&(b=a(E.a,E.b,y.b),b)?b:E.idx-y.idx}function v(E,y){return a(E.a,E.b,y)}function T(E,y,b,p,u){for(var m=o.lt(y,p,v),h=o.gt(y,p,v),P=m;P1&&a(b[z[B-2]],b[z[B-1]],p)>0;)E.push([z[B-1],z[B-2],u]),B-=1;z.length=B,z.push(u);for(var F=L.upperIds,B=F.length;B>1&&a(b[F[B-2]],b[F[B-1]],p)<0;)E.push([F[B-2],F[B-1],u]),B-=1;F.length=B,F.push(u)}}function l(E,y){var b;return E.a[0]L[0]&&u.push(new f(L,P,s,m),new f(P,L,n,m))}u.sort(g);for(var z=u[0].a[0]-(1+Math.abs(u[0].a[0]))*Math.pow(2,-52),F=[new c([z,1],[z,0],-1,[],[],[],[])],B=[],m=0,O=u.length;m=0}}(),i.removeTriangle=function(c,f,g){var v=this.stars;n(v[c],f,g),n(v[f],g,c),n(v[g],c,f)},i.addTriangle=function(c,f,g){var v=this.stars;v[c].push(f,g),v[f].push(g,c),v[g].push(c,f)},i.opposite=function(c,f){for(var g=this.stars[f],v=1,T=g.length;v=0;--I){var $=B[I];N=$[0];var J=z[N],X=J[0],oe=J[1],ie=L[X],j=L[oe];if((ie[0]-j[0]||ie[1]-j[1])<0){var ee=X;X=oe,oe=ee}J[0]=X;var re=J[1]=$[1],ce;for(O&&(ce=J[2]);I>0&&B[I-1][0]===N;){var $=B[--I],be=$[1];O?z.push([re,be,ce]):z.push([re,be]),re=be}O?z.push([re,oe,ce]):z.push([re,oe])}return U}function y(L,z,F){for(var B=z.length,O=new o(B),I=[],N=0;Nz[2]?1:0)}function u(L,z,F){if(L.length!==0){if(z)for(var B=0;B0||N.length>0}function P(L,z,F){var B;if(F){B=z;for(var O=new Array(z.length),I=0;IE+1)throw new Error(w+" map requires nshades to be at least size "+_.length);Array.isArray(f.alpha)?f.alpha.length!==2?y=[1,1]:y=f.alpha.slice():typeof f.alpha=="number"?y=[f.alpha,f.alpha]:y=[1,1],g=_.map(function(P){return Math.round(P.index*E)}),y[0]=Math.min(Math.max(y[0],0),1),y[1]=Math.min(Math.max(y[1],0),1);var p=_.map(function(P,L){var z=_[L].index,F=_[L].rgb.slice();return F.length===4&&F[3]>=0&&F[3]<=1||(F[3]=y[0]+(y[1]-y[0])*z),F}),u=[];for(b=0;b=0}function f(g,v,T,l){var _=o(v,T,l);if(_===0){var w=a(o(g,v,T)),S=a(o(g,v,l));if(w===S){if(w===0){var E=c(g,v,T),y=c(g,v,l);return E===y?0:E?1:-1}return 0}else{if(S===0)return w>0||c(g,v,l)?-1:1;if(w===0)return S>0||c(g,v,T)?1:-1}return a(S-w)}var b=o(g,v,T);if(b>0)return _>0&&o(g,v,l)>0?1:-1;if(b<0)return _>0||o(g,v,l)>0?1:-1;var p=o(g,v,l);return p>0||c(g,v,T)?1:-1}},8572:function(e){"use strict";e.exports=function(r){return r<0?-1:r>0?1:0}},8507:function(e){e.exports=o;var t=Math.min;function r(a,i){return a-i}function o(a,i){var n=a.length,s=a.length-i.length;if(s)return s;switch(n){case 0:return 0;case 1:return a[0]-i[0];case 2:return a[0]+a[1]-i[0]-i[1]||t(a[0],a[1])-t(i[0],i[1]);case 3:var c=a[0]+a[1],f=i[0]+i[1];if(s=c+a[2]-(f+i[2]),s)return s;var g=t(a[0],a[1]),v=t(i[0],i[1]);return t(g,a[2])-t(v,i[2])||t(g+a[2],c)-t(v+i[2],f);case 4:var T=a[0],l=a[1],_=a[2],w=a[3],S=i[0],E=i[1],y=i[2],b=i[3];return T+l+_+w-(S+E+y+b)||t(T,l,_,w)-t(S,E,y,b,S)||t(T+l,T+_,T+w,l+_,l+w,_+w)-t(S+E,S+y,S+b,E+y,E+b,y+b)||t(T+l+_,T+l+w,T+_+w,l+_+w)-t(S+E+y,S+E+b,S+y+b,E+y+b);default:for(var p=a.slice().sort(r),u=i.slice().sort(r),m=0;mr[a][0]&&(a=i);return oa?[[a],[o]]:[[o]]}},4750:function(e,t,r){"use strict";e.exports=a;var o=r(3090);function a(i){var n=o(i),s=n.length;if(s<=2)return[];for(var c=new Array(s),f=n[s-1],g=0;g=f[S]&&(w+=1);l[_]=w}}return c}function s(c,f){try{return o(c,!0)}catch{var g=a(c);if(g.length<=f)return[];var v=i(c,g),T=o(v,!0);return n(T,g)}}},4769:function(e){"use strict";function t(o,a,i,n,s,c){var f=6*s*s-6*s,g=3*s*s-4*s+1,v=-6*s*s+6*s,T=3*s*s-2*s;if(o.length){c||(c=new Array(o.length));for(var l=o.length-1;l>=0;--l)c[l]=f*o[l]+g*a[l]+v*i[l]+T*n[l];return c}return f*o+g*a+v*i[l]+T*n}function r(o,a,i,n,s,c){var f=s-1,g=s*s,v=f*f,T=(1+2*s)*v,l=s*v,_=g*(3-2*s),w=g*f;if(o.length){c||(c=new Array(o.length));for(var S=o.length-1;S>=0;--S)c[S]=T*o[S]+l*a[S]+_*i[S]+w*n[S];return c}return T*o+l*a+_*i+w*n}e.exports=r,e.exports.derivative=t},7642:function(e,t,r){"use strict";var o=r(8954),a=r(1682);e.exports=c;function i(f,g){this.point=f,this.index=g}function n(f,g){for(var v=f.point,T=g.point,l=v.length,_=0;_=2)return!1;F[O]=I}return!0}):z=z.filter(function(F){for(var B=0;B<=T;++B){var O=m[F[B]];if(O<0)return!1;F[B]=O}return!0}),T&1)for(var w=0;w>>31},e.exports.exponent=function(_){var w=e.exports.hi(_);return(w<<1>>>21)-1023},e.exports.fraction=function(_){var w=e.exports.lo(_),S=e.exports.hi(_),E=S&(1<<20)-1;return S&2146435072&&(E+=1048576),[w,E]},e.exports.denormalized=function(_){var w=e.exports.hi(_);return!(w&2146435072)}},1338:function(e){"use strict";function t(a,i,n){var s=a[n]|0;if(s<=0)return[];var c=new Array(s),f;if(n===a.length-1)for(f=0;f"u"&&(i=0),typeof a){case"number":if(a>0)return r(a|0,i);break;case"object":if(typeof a.length=="number")return t(a,i,0);break}return[]}e.exports=o},3134:function(e,t,r){"use strict";e.exports=a;var o=r(1682);function a(i,n){var s=i.length;if(typeof n!="number"){n=0;for(var c=0;c=T-1)for(var b=w.length-1,u=g-v[T-1],p=0;p=T-1)for(var y=w.length-1,b=g-v[T-1],p=0;p=0;--T)if(g[--v])return!1;return!0},s.jump=function(g){var v=this.lastT(),T=this.dimension;if(!(g0;--p)l.push(i(E[p-1],y[p-1],arguments[p])),_.push(0)}},s.push=function(g){var v=this.lastT(),T=this.dimension;if(!(g1e-6?1/S:0;this._time.push(g);for(var u=T;u>0;--u){var m=i(y[u-1],b[u-1],arguments[u]);l.push(m),_.push((m-l[w++])*p)}}},s.set=function(g){var v=this.dimension;if(!(g0;--E)T.push(i(w[E-1],S[E-1],arguments[E])),l.push(0)}},s.move=function(g){var v=this.lastT(),T=this.dimension;if(!(g<=v||arguments.length!==T+1)){var l=this._state,_=this._velocity,w=l.length-this.dimension,S=this.bounds,E=S[0],y=S[1],b=g-v,p=b>1e-6?1/b:0;this._time.push(g);for(var u=T;u>0;--u){var m=arguments[u];l.push(i(E[u-1],y[u-1],l[w++]+m)),_.push(m*p)}}},s.idle=function(g){var v=this.lastT();if(!(g=0;--p)l.push(i(E[p],y[p],l[w]+b*_[w])),_.push(0),w+=1}};function c(g){for(var v=new Array(g),T=0;T=0;--L){var u=m[L];h[L]<=0?m[L]=new o(u._color,u.key,u.value,m[L+1],u.right,u._count+1):m[L]=new o(u._color,u.key,u.value,u.left,m[L+1],u._count+1)}for(var L=m.length-1;L>1;--L){var z=m[L-1],u=m[L];if(z._color===r||u._color===r)break;var F=m[L-2];if(F.left===z)if(z.left===u){var B=F.right;if(B&&B._color===t)z._color=r,F.right=i(r,B),F._color=t,L-=1;else{if(F._color=t,F.left=z.right,z._color=r,z.right=F,m[L-2]=z,m[L-1]=u,n(F),n(z),L>=3){var O=m[L-3];O.left===F?O.left=z:O.right=z}break}}else{var B=F.right;if(B&&B._color===t)z._color=r,F.right=i(r,B),F._color=t,L-=1;else{if(z.right=u.left,F._color=t,F.left=u.right,u._color=r,u.left=z,u.right=F,m[L-2]=u,m[L-1]=z,n(F),n(z),n(u),L>=3){var O=m[L-3];O.left===F?O.left=u:O.right=u}break}}else if(z.right===u){var B=F.left;if(B&&B._color===t)z._color=r,F.left=i(r,B),F._color=t,L-=1;else{if(F._color=t,F.right=z.left,z._color=r,z.left=F,m[L-2]=z,m[L-1]=u,n(F),n(z),L>=3){var O=m[L-3];O.right===F?O.right=z:O.left=z}break}}else{var B=F.left;if(B&&B._color===t)z._color=r,F.left=i(r,B),F._color=t,L-=1;else{if(z.left=u.right,F._color=t,F.right=u.left,u._color=r,u.right=z,u.left=F,m[L-2]=u,m[L-1]=z,n(F),n(z),n(u),L>=3){var O=m[L-3];O.right===F?O.right=u:O.left=u}break}}}return m[0]._color=r,new s(p,m[0])};function f(y,b){if(b.left){var p=f(y,b.left);if(p)return p}var p=y(b.key,b.value);if(p)return p;if(b.right)return f(y,b.right)}function g(y,b,p,u){var m=b(y,u.key);if(m<=0){if(u.left){var h=g(y,b,p,u.left);if(h)return h}var h=p(u.key,u.value);if(h)return h}if(u.right)return g(y,b,p,u.right)}function v(y,b,p,u,m){var h=p(y,m.key),P=p(b,m.key),L;if(h<=0&&(m.left&&(L=v(y,b,p,u,m.left),L)||P>0&&(L=u(m.key,m.value),L)))return L;if(P>0&&m.right)return v(y,b,p,u,m.right)}c.forEach=function(b,p,u){if(this.root)switch(arguments.length){case 1:return f(b,this.root);case 2:return g(p,this._compare,b,this.root);case 3:return this._compare(p,u)>=0?void 0:v(p,u,this._compare,b,this.root)}},Object.defineProperty(c,"begin",{get:function(){for(var y=[],b=this.root;b;)y.push(b),b=b.left;return new T(this,y)}}),Object.defineProperty(c,"end",{get:function(){for(var y=[],b=this.root;b;)y.push(b),b=b.right;return new T(this,y)}}),c.at=function(y){if(y<0)return new T(this,[]);for(var b=this.root,p=[];;){if(p.push(b),b.left){if(y=b.right._count)break;b=b.right}else break}return new T(this,[])},c.ge=function(y){for(var b=this._compare,p=this.root,u=[],m=0;p;){var h=b(y,p.key);u.push(p),h<=0&&(m=u.length),h<=0?p=p.left:p=p.right}return u.length=m,new T(this,u)},c.gt=function(y){for(var b=this._compare,p=this.root,u=[],m=0;p;){var h=b(y,p.key);u.push(p),h<0&&(m=u.length),h<0?p=p.left:p=p.right}return u.length=m,new T(this,u)},c.lt=function(y){for(var b=this._compare,p=this.root,u=[],m=0;p;){var h=b(y,p.key);u.push(p),h>0&&(m=u.length),h<=0?p=p.left:p=p.right}return u.length=m,new T(this,u)},c.le=function(y){for(var b=this._compare,p=this.root,u=[],m=0;p;){var h=b(y,p.key);u.push(p),h>=0&&(m=u.length),h<0?p=p.left:p=p.right}return u.length=m,new T(this,u)},c.find=function(y){for(var b=this._compare,p=this.root,u=[];p;){var m=b(y,p.key);if(u.push(p),m===0)return new T(this,u);m<=0?p=p.left:p=p.right}return new T(this,[])},c.remove=function(y){var b=this.find(y);return b?b.remove():this},c.get=function(y){for(var b=this._compare,p=this.root;p;){var u=b(y,p.key);if(u===0)return p.value;u<=0?p=p.left:p=p.right}};function T(y,b){this.tree=y,this._stack=b}var l=T.prototype;Object.defineProperty(l,"valid",{get:function(){return this._stack.length>0}}),Object.defineProperty(l,"node",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1]:null},enumerable:!0}),l.clone=function(){return new T(this.tree,this._stack.slice())};function _(y,b){y.key=b.key,y.value=b.value,y.left=b.left,y.right=b.right,y._color=b._color,y._count=b._count}function w(y){for(var b,p,u,m,h=y.length-1;h>=0;--h){if(b=y[h],h===0){b._color=r;return}if(p=y[h-1],p.left===b){if(u=p.right,u.right&&u.right._color===t){if(u=p.right=a(u),m=u.right=a(u.right),p.right=u.left,u.left=p,u.right=m,u._color=p._color,b._color=r,p._color=r,m._color=r,n(p),n(u),h>1){var P=y[h-2];P.left===p?P.left=u:P.right=u}y[h-1]=u;return}else if(u.left&&u.left._color===t){if(u=p.right=a(u),m=u.left=a(u.left),p.right=m.left,u.left=m.right,m.left=p,m.right=u,m._color=p._color,p._color=r,u._color=r,b._color=r,n(p),n(u),n(m),h>1){var P=y[h-2];P.left===p?P.left=m:P.right=m}y[h-1]=m;return}if(u._color===r)if(p._color===t){p._color=r,p.right=i(t,u);return}else{p.right=i(t,u);continue}else{if(u=a(u),p.right=u.left,u.left=p,u._color=p._color,p._color=t,n(p),n(u),h>1){var P=y[h-2];P.left===p?P.left=u:P.right=u}y[h-1]=u,y[h]=p,h+11){var P=y[h-2];P.right===p?P.right=u:P.left=u}y[h-1]=u;return}else if(u.right&&u.right._color===t){if(u=p.left=a(u),m=u.right=a(u.right),p.left=m.right,u.right=m.left,m.right=p,m.left=u,m._color=p._color,p._color=r,u._color=r,b._color=r,n(p),n(u),n(m),h>1){var P=y[h-2];P.right===p?P.right=m:P.left=m}y[h-1]=m;return}if(u._color===r)if(p._color===t){p._color=r,p.left=i(t,u);return}else{p.left=i(t,u);continue}else{if(u=a(u),p.left=u.right,u.right=p,u._color=p._color,p._color=t,n(p),n(u),h>1){var P=y[h-2];P.right===p?P.right=u:P.left=u}y[h-1]=u,y[h]=p,h+1=0;--u){var p=y[u];p.left===y[u+1]?b[u]=new o(p._color,p.key,p.value,b[u+1],p.right,p._count):b[u]=new o(p._color,p.key,p.value,p.left,b[u+1],p._count)}if(p=b[b.length-1],p.left&&p.right){var m=b.length;for(p=p.left;p.right;)b.push(p),p=p.right;var h=b[m-1];b.push(new o(p._color,h.key,h.value,p.left,p.right,p._count)),b[m-1].key=p.key,b[m-1].value=p.value;for(var u=b.length-2;u>=m;--u)p=b[u],b[u]=new o(p._color,p.key,p.value,p.left,b[u+1],p._count);b[m-1].left=b[m]}if(p=b[b.length-1],p._color===t){var P=b[b.length-2];P.left===p?P.left=null:P.right===p&&(P.right=null),b.pop();for(var u=0;u0)return this._stack[this._stack.length-1].key},enumerable:!0}),Object.defineProperty(l,"value",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].value},enumerable:!0}),Object.defineProperty(l,"index",{get:function(){var y=0,b=this._stack;if(b.length===0){var p=this.tree.root;return p?p._count:0}else b[b.length-1].left&&(y=b[b.length-1].left._count);for(var u=b.length-2;u>=0;--u)b[u+1]===b[u].right&&(++y,b[u].left&&(y+=b[u].left._count));return y},enumerable:!0}),l.next=function(){var y=this._stack;if(y.length!==0){var b=y[y.length-1];if(b.right)for(b=b.right;b;)y.push(b),b=b.left;else for(y.pop();y.length>0&&y[y.length-1].right===b;)b=y[y.length-1],y.pop()}},Object.defineProperty(l,"hasNext",{get:function(){var y=this._stack;if(y.length===0)return!1;if(y[y.length-1].right)return!0;for(var b=y.length-1;b>0;--b)if(y[b-1].left===y[b])return!0;return!1}}),l.update=function(y){var b=this._stack;if(b.length===0)throw new Error("Can't update empty node!");var p=new Array(b.length),u=b[b.length-1];p[p.length-1]=new o(u._color,u.key,y,u.left,u.right,u._count);for(var m=b.length-2;m>=0;--m)u=b[m],u.left===b[m+1]?p[m]=new o(u._color,u.key,u.value,p[m+1],u.right,u._count):p[m]=new o(u._color,u.key,u.value,u.left,p[m+1],u._count);return new s(this.tree._compare,p[0])},l.prev=function(){var y=this._stack;if(y.length!==0){var b=y[y.length-1];if(b.left)for(b=b.left;b;)y.push(b),b=b.right;else for(y.pop();y.length>0&&y[y.length-1].left===b;)b=y[y.length-1],y.pop()}},Object.defineProperty(l,"hasPrev",{get:function(){var y=this._stack;if(y.length===0)return!1;if(y[y.length-1].left)return!0;for(var b=y.length-1;b>0;--b)if(y[b-1].right===y[b])return!0;return!1}});function S(y,b){return yb?1:0}function E(y){return new s(y||S,null)}},3837:function(e,t,r){"use strict";e.exports=L;var o=r(4935),a=r(501),i=r(5304),n=r(6429),s=r(6444),c=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),f=ArrayBuffer,g=DataView;function v(z){return f.isView(z)&&!(z instanceof g)}function T(z){return Array.isArray(z)||v(z)}function l(z,F){return z[0]=F[0],z[1]=F[1],z[2]=F[2],z}function _(z){this.gl=z,this.pixelRatio=1,this.bounds=[[-10,-10,-10],[10,10,10]],this.ticks=[[],[],[]],this.autoTicks=!0,this.tickSpacing=[1,1,1],this.tickEnable=[!0,!0,!0],this.tickFont=["sans-serif","sans-serif","sans-serif"],this.tickFontStyle=["normal","normal","normal"],this.tickFontWeight=["normal","normal","normal"],this.tickFontVariant=["normal","normal","normal"],this.tickSize=[12,12,12],this.tickAngle=[0,0,0],this.tickAlign=["auto","auto","auto"],this.tickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.tickPad=[10,10,10],this.lastCubeProps={cubeEdges:[0,0,0],axis:[0,0,0]},this.labels=["x","y","z"],this.labelEnable=[!0,!0,!0],this.labelFont=["sans-serif","sans-serif","sans-serif"],this.labelFontStyle=["normal","normal","normal"],this.labelFontWeight=["normal","normal","normal"],this.labelFontVariant=["normal","normal","normal"],this.labelSize=[20,20,20],this.labelAngle=[0,0,0],this.labelAlign=["auto","auto","auto"],this.labelColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.labelPad=[10,10,10],this.lineEnable=[!0,!0,!0],this.lineMirror=[!1,!1,!1],this.lineWidth=[1,1,1],this.lineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.lineTickEnable=[!0,!0,!0],this.lineTickMirror=[!1,!1,!1],this.lineTickLength=[0,0,0],this.lineTickWidth=[1,1,1],this.lineTickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.gridEnable=[!0,!0,!0],this.gridWidth=[1,1,1],this.gridColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroEnable=[!0,!0,!0],this.zeroLineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroLineWidth=[2,2,2],this.backgroundEnable=[!1,!1,!1],this.backgroundColor=[[.8,.8,.8,.5],[.8,.8,.8,.5],[.8,.8,.8,.5]],this._firstInit=!0,this._text=null,this._lines=null,this._background=i(z)}var w=_.prototype;w.update=function(z){z=z||{};function F(X,oe,ie){if(ie in z){var j=z[ie],ee=this[ie],re;(X?T(j)&&T(j[0]):T(j))?this[ie]=re=[oe(j[0]),oe(j[1]),oe(j[2])]:this[ie]=re=[oe(j),oe(j),oe(j)];for(var ce=0;ce<3;++ce)if(re[ce]!==ee[ce])return!0}return!1}var B=F.bind(this,!1,Number),O=F.bind(this,!1,Boolean),I=F.bind(this,!1,String),N=F.bind(this,!0,function(X){if(T(X)){if(X.length===3)return[+X[0],+X[1],+X[2],1];if(X.length===4)return[+X[0],+X[1],+X[2],+X[3]]}return[0,0,0,1]}),U,W=!1,Q=!1;if("bounds"in z)for(var ue=z.bounds,le=0;le<2;++le)for(var he=0;he<3;++he)ue[le][he]!==this.bounds[le][he]&&(Q=!0),this.bounds[le][he]=ue[le][he];if("ticks"in z){U=z.ticks,W=!0,this.autoTicks=!1;for(var le=0;le<3;++le)this.tickSpacing[le]=0}else B("tickSpacing")&&(this.autoTicks=!0,Q=!0);if(this._firstInit&&("ticks"in z||"tickSpacing"in z||(this.autoTicks=!0),Q=!0,W=!0,this._firstInit=!1),Q&&this.autoTicks&&(U=s.create(this.bounds,this.tickSpacing),W=!0),W){for(var le=0;le<3;++le)U[le].sort(function(oe,ie){return oe.x-ie.x});s.equal(U,this.ticks)?W=!1:this.ticks=U}O("tickEnable"),I("tickFont")&&(W=!0),I("tickFontStyle")&&(W=!0),I("tickFontWeight")&&(W=!0),I("tickFontVariant")&&(W=!0),B("tickSize"),B("tickAngle"),B("tickPad"),N("tickColor");var G=I("labels");I("labelFont")&&(G=!0),I("labelFontStyle")&&(G=!0),I("labelFontWeight")&&(G=!0),I("labelFontVariant")&&(G=!0),O("labelEnable"),B("labelSize"),B("labelPad"),N("labelColor"),O("lineEnable"),O("lineMirror"),B("lineWidth"),N("lineColor"),O("lineTickEnable"),O("lineTickMirror"),B("lineTickLength"),B("lineTickWidth"),N("lineTickColor"),O("gridEnable"),B("gridWidth"),N("gridColor"),O("zeroEnable"),N("zeroLineColor"),B("zeroLineWidth"),O("backgroundEnable"),N("backgroundColor");var $=[{family:this.labelFont[0],style:this.labelFontStyle[0],weight:this.labelFontWeight[0],variant:this.labelFontVariant[0]},{family:this.labelFont[1],style:this.labelFontStyle[1],weight:this.labelFontWeight[1],variant:this.labelFontVariant[1]},{family:this.labelFont[2],style:this.labelFontStyle[2],weight:this.labelFontWeight[2],variant:this.labelFontVariant[2]}],J=[{family:this.tickFont[0],style:this.tickFontStyle[0],weight:this.tickFontWeight[0],variant:this.tickFontVariant[0]},{family:this.tickFont[1],style:this.tickFontStyle[1],weight:this.tickFontWeight[1],variant:this.tickFontVariant[1]},{family:this.tickFont[2],style:this.tickFontStyle[2],weight:this.tickFontWeight[2],variant:this.tickFontVariant[2]}];this._text?this._text&&(G||W)&&this._text.update(this.bounds,this.labels,$,this.ticks,J):this._text=o(this.gl,this.bounds,this.labels,$,this.ticks,J),this._lines&&W&&(this._lines.dispose(),this._lines=null),this._lines||(this._lines=a(this.gl,this.bounds,this.ticks))};function S(){this.primalOffset=[0,0,0],this.primalMinor=[0,0,0],this.mirrorOffset=[0,0,0],this.mirrorMinor=[0,0,0]}var E=[new S,new S,new S];function y(z,F,B,O,I){for(var N=z.primalOffset,U=z.primalMinor,W=z.mirrorOffset,Q=z.mirrorMinor,ue=O[F],le=0;le<3;++le)if(F!==le){var he=N,G=W,$=U,J=Q;ue&1<0?($[le]=-1,J[le]=0):($[le]=0,J[le]=1)}}var b=[0,0,0],p={model:c,view:c,projection:c,_ortho:!1};w.isOpaque=function(){return!0},w.isTransparent=function(){return!1},w.drawTransparent=function(z){};var u=0,m=[0,0,0],h=[0,0,0],P=[0,0,0];w.draw=function(z){z=z||p;for(var ie=this.gl,F=z.model||c,B=z.view||c,O=z.projection||c,I=this.bounds,N=z._ortho||!1,U=n(F,B,O,I,N),W=U.cubeEdges,Q=U.axis,ue=B[12],le=B[13],he=B[14],G=B[15],$=N?2:1,J=$*this.pixelRatio*(O[3]*ue+O[7]*le+O[11]*he+O[15]*G)/ie.drawingBufferHeight,X=0;X<3;++X)this.lastCubeProps.cubeEdges[X]=W[X],this.lastCubeProps.axis[X]=Q[X];for(var oe=E,X=0;X<3;++X)y(E[X],X,this.bounds,W,Q);for(var ie=this.gl,j=b,X=0;X<3;++X)this.backgroundEnable[X]?j[X]=Q[X]:j[X]=0;this._background.draw(F,B,O,I,j,this.backgroundColor),this._lines.bind(F,B,O,this);for(var X=0;X<3;++X){var ee=[0,0,0];Q[X]>0?ee[X]=I[1][X]:ee[X]=I[0][X];for(var re=0;re<2;++re){var ce=(X+1+re)%3,be=(X+1+(re^1))%3;this.gridEnable[ce]&&this._lines.drawGrid(ce,be,this.bounds,ee,this.gridColor[ce],this.gridWidth[ce]*this.pixelRatio)}for(var re=0;re<2;++re){var ce=(X+1+re)%3,be=(X+1+(re^1))%3;this.zeroEnable[be]&&Math.min(I[0][be],I[1][be])<=0&&Math.max(I[0][be],I[1][be])>=0&&this._lines.drawZero(ce,be,this.bounds,ee,this.zeroLineColor[be],this.zeroLineWidth[be]*this.pixelRatio)}}for(var X=0;X<3;++X){this.lineEnable[X]&&this._lines.drawAxisLine(X,this.bounds,oe[X].primalOffset,this.lineColor[X],this.lineWidth[X]*this.pixelRatio),this.lineMirror[X]&&this._lines.drawAxisLine(X,this.bounds,oe[X].mirrorOffset,this.lineColor[X],this.lineWidth[X]*this.pixelRatio);for(var Ae=l(m,oe[X].primalMinor),ze=l(h,oe[X].mirrorMinor),Re=this.lineTickLength,re=0;re<3;++re){var Xe=J/F[5*re];Ae[re]*=Re[re]*Xe,ze[re]*=Re[re]*Xe}this.lineTickEnable[X]&&this._lines.drawAxisTicks(X,oe[X].primalOffset,Ae,this.lineTickColor[X],this.lineTickWidth[X]*this.pixelRatio),this.lineTickMirror[X]&&this._lines.drawAxisTicks(X,oe[X].mirrorOffset,ze,this.lineTickColor[X],this.lineTickWidth[X]*this.pixelRatio)}this._lines.unbind(),this._text.bind(F,B,O,this.pixelRatio);var it,ot=.5,tt,lt;function Ee(Qe){lt=[0,0,0],lt[Qe]=1}function _e(Qe,Lt,kt){var Vt=(Qe+1)%3,Zt=(Qe+2)%3,Sr=Lt[Vt],xr=Lt[Zt],jr=kt[Vt],wr=kt[Zt];if(Sr>0&&wr>0){Ee(Vt);return}else if(Sr>0&&wr<0){Ee(Vt);return}else if(Sr<0&&wr>0){Ee(Vt);return}else if(Sr<0&&wr<0){Ee(Vt);return}else if(xr>0&&jr>0){Ee(Zt);return}else if(xr>0&&jr<0){Ee(Zt);return}else if(xr<0&&jr>0){Ee(Zt);return}else if(xr<0&&jr<0){Ee(Zt);return}}for(var X=0;X<3;++X){for(var fe=oe[X].primalMinor,Fe=oe[X].mirrorMinor,rt=l(P,oe[X].primalOffset),re=0;re<3;++re)this.lineTickEnable[X]&&(rt[re]+=J*fe[re]*Math.max(this.lineTickLength[re],0)/F[5*re]);var st=[0,0,0];if(st[X]=1,this.tickEnable[X]){this.tickAngle[X]===-3600?(this.tickAngle[X]=0,this.tickAlign[X]="auto"):this.tickAlign[X]=-1,tt=1,it=[this.tickAlign[X],ot,tt],it[0]==="auto"?it[0]=u:it[0]=parseInt(""+it[0]),lt=[0,0,0],_e(X,fe,Fe);for(var re=0;re<3;++re)rt[re]+=J*fe[re]*this.tickPad[re]/F[5*re];this._text.drawTicks(X,this.tickSize[X],this.tickAngle[X],rt,this.tickColor[X],st,lt,it)}if(this.labelEnable[X]){tt=0,lt=[0,0,0],this.labels[X].length>4&&(Ee(X),tt=1),it=[this.labelAlign[X],ot,tt],it[0]==="auto"?it[0]=u:it[0]=parseInt(""+it[0]);for(var re=0;re<3;++re)rt[re]+=J*fe[re]*this.labelPad[re]/F[5*re];rt[X]+=.5*(I[0][X]+I[1][X]),this._text.drawLabel(X,this.labelSize[X],this.labelAngle[X],rt,this.labelColor[X],[0,0,0],lt,it)}}this._text.unbind()},w.dispose=function(){this._text.dispose(),this._lines.dispose(),this._background.dispose(),this._lines=null,this._text=null,this._background=null,this.gl=null};function L(z,F){var B=new _(z);return B.update(F),B}},5304:function(e,t,r){"use strict";e.exports=c;var o=r(2762),a=r(8116),i=r(1879).bg;function n(f,g,v,T){this.gl=f,this.buffer=g,this.vao=v,this.shader=T}var s=n.prototype;s.draw=function(f,g,v,T,l,_){for(var w=!1,S=0;S<3;++S)w=w||l[S];if(w){var E=this.gl;E.enable(E.POLYGON_OFFSET_FILL),E.polygonOffset(1,2),this.shader.bind(),this.shader.uniforms={model:f,view:g,projection:v,bounds:T,enable:l,colors:_},this.vao.bind(),this.vao.draw(this.gl.TRIANGLES,36),this.vao.unbind(),E.disable(E.POLYGON_OFFSET_FILL)}},s.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()};function c(f){for(var g=[],v=[],T=0,l=0;l<3;++l)for(var _=(l+1)%3,w=(l+2)%3,S=[0,0,0],E=[0,0,0],y=-1;y<=1;y+=2){v.push(T,T+2,T+1,T+1,T+2,T+3),S[l]=y,E[l]=y;for(var b=-1;b<=1;b+=2){S[_]=b;for(var p=-1;p<=1;p+=2)S[w]=p,g.push(S[0],S[1],S[2],E[0],E[1],E[2]),T+=1}var u=_;_=w,w=u}var m=o(f,new Float32Array(g)),h=o(f,new Uint16Array(v),f.ELEMENT_ARRAY_BUFFER),P=a(f,[{buffer:m,type:f.FLOAT,size:3,offset:0,stride:24},{buffer:m,type:f.FLOAT,size:3,offset:12,stride:24}],h),L=i(f);return L.attributes.position.location=0,L.attributes.normal.location=1,new n(f,m,P,L)}},6429:function(e,t,r){"use strict";e.exports=y;var o=r(8828),a=r(6760),i=r(5202),n=r(3250),s=new Array(16),c=new Array(8),f=new Array(8),g=new Array(3),v=[0,0,0];(function(){for(var b=0;b<8;++b)c[b]=[1,1,1,1],f[b]=[1,1,1]})();function T(b,p,u){for(var m=0;m<4;++m){b[m]=u[12+m];for(var h=0;h<3;++h)b[m]+=p[h]*u[4*h+m]}}var l=[[0,0,1,0,0],[0,0,-1,1,0],[0,-1,0,1,0],[0,1,0,1,0],[-1,0,0,1,0],[1,0,0,1,0]];function _(b){for(var p=0;pQ&&(B|=1<Q){B|=1<f[L][1])&&(oe=L);for(var ie=-1,L=0;L<3;++L){var j=oe^1<f[ee][0]&&(ee=j)}}var re=w;re[0]=re[1]=re[2]=0,re[o.log2(ie^oe)]=oe&ie,re[o.log2(oe^ee)]=oeⅇvar ce=ee^7;ce===B||ce===X?(ce=ie^7,re[o.log2(ee^ce)]=ce&ee):re[o.log2(ie^ce)]=ce&ie;for(var be=S,Ae=B,N=0;N<3;++N)Ae&1< HALF_PI) && (b <= ONE_AND_HALF_PI)) ? b - PI : b; } float look_horizontal_or_vertical(float a, float ratio) { // ratio controls the ratio between being horizontal to (vertical + horizontal) // if ratio is set to 0.5 then it is 50%, 50%. // when using a higher ratio e.g. 0.75 the result would // likely be more horizontal than vertical. float b = positive_angle(a); return (b < ( ratio) * HALF_PI) ? 0.0 : (b < (2.0 - ratio) * HALF_PI) ? -HALF_PI : (b < (2.0 + ratio) * HALF_PI) ? 0.0 : (b < (4.0 - ratio) * HALF_PI) ? HALF_PI : 0.0; } float roundTo(float a, float b) { return float(b * floor((a + 0.5 * b) / b)); } float look_round_n_directions(float a, int n) { float b = positive_angle(a); float div = TWO_PI / float(n); float c = roundTo(b, div); return look_upwards(c); } float applyAlignOption(float rawAngle, float delta) { return (option > 2) ? look_round_n_directions(rawAngle + delta, option) : // option 3-n: round to n directions (option == 2) ? look_horizontal_or_vertical(rawAngle + delta, hv_ratio) : // horizontal or vertical (option == 1) ? rawAngle + delta : // use free angle, and flip to align with one direction of the axis (option == 0) ? look_upwards(rawAngle) : // use free angle, and stay upwards (option ==-1) ? 0.0 : // useful for backward compatibility, all texts remains horizontal rawAngle; // otherwise return back raw input angle } bool isAxisTitle = (axis.x == 0.0) && (axis.y == 0.0) && (axis.z == 0.0); void main() { //Compute world offset float axisDistance = position.z; vec3 dataPosition = axisDistance * axis + offset; float beta = angle; // i.e. user defined attributes for each tick float axisAngle; float clipAngle; float flip; if (enableAlign) { axisAngle = (isAxisTitle) ? HALF_PI : computeViewAngle(dataPosition, dataPosition + axis); clipAngle = computeViewAngle(dataPosition, dataPosition + alignDir); axisAngle += (sin(axisAngle) < 0.0) ? PI : 0.0; clipAngle += (sin(clipAngle) < 0.0) ? PI : 0.0; flip = (dot(vec2(cos(axisAngle), sin(axisAngle)), vec2(sin(clipAngle),-cos(clipAngle))) > 0.0) ? 1.0 : 0.0; beta += applyAlignOption(clipAngle, flip * PI); } //Compute plane offset vec2 planeCoord = position.xy * pixelScale; mat2 planeXform = scale * mat2( cos(beta), sin(beta), -sin(beta), cos(beta) ); vec2 viewOffset = 2.0 * planeXform * planeCoord / resolution; //Compute clip position vec3 clipPosition = project(dataPosition); //Apply text offset in clip coordinates clipPosition += vec3(viewOffset, 0.0); //Done gl_Position = vec4(clipPosition, 1.0); } `]),c=o([`precision highp float; #define GLSLIFY 1 uniform vec4 color; void main() { gl_FragColor = color; }`]);t.Q=function(v){return a(v,s,c,null,[{name:"position",type:"vec3"}])};var f=o([`precision highp float; #define GLSLIFY 1 attribute vec3 position; attribute vec3 normal; uniform mat4 model, view, projection; uniform vec3 enable; uniform vec3 bounds[2]; varying vec3 colorChannel; void main() { vec3 signAxis = sign(bounds[1] - bounds[0]); vec3 realNormal = signAxis * normal; if(dot(realNormal, enable) > 0.0) { vec3 minRange = min(bounds[0], bounds[1]); vec3 maxRange = max(bounds[0], bounds[1]); vec3 nPosition = mix(minRange, maxRange, 0.5 * (position + 1.0)); gl_Position = projection * (view * (model * vec4(nPosition, 1.0))); } else { gl_Position = vec4(0,0,0,0); } colorChannel = abs(realNormal); } `]),g=o([`precision highp float; #define GLSLIFY 1 uniform vec4 colors[3]; varying vec3 colorChannel; void main() { gl_FragColor = colorChannel.x * colors[0] + colorChannel.y * colors[1] + colorChannel.z * colors[2]; }`]);t.bg=function(v){return a(v,f,g,null,[{name:"position",type:"vec3"},{name:"normal",type:"vec3"}])}},4935:function(e,t,r){"use strict";e.exports=_;var o=r(2762),a=r(8116),i=r(4359),n=r(1879).Q,s=window||process.global||{},c=s.__TEXT_CACHE||{};s.__TEXT_CACHE={};var f=3;function g(w,S,E,y){this.gl=w,this.shader=S,this.buffer=E,this.vao=y,this.tickOffset=this.tickCount=this.labelOffset=this.labelCount=null}var v=g.prototype,T=[0,0];v.bind=function(w,S,E,y){this.vao.bind(),this.shader.bind();var b=this.shader.uniforms;b.model=w,b.view=S,b.projection=E,b.pixelScale=y,T[0]=this.gl.drawingBufferWidth,T[1]=this.gl.drawingBufferHeight,this.shader.uniforms.resolution=T},v.unbind=function(){this.vao.unbind()},v.update=function(w,S,E,y,b){var p=[];function u(N,U,W,Q,ue,le){var he=[W.style,W.weight,W.variant,W.family].join("_"),G=c[he];G||(G=c[he]={});var $=G[U];$||($=G[U]=l(U,{triangles:!0,font:W.family,fontStyle:W.style,fontWeight:W.weight,fontVariant:W.variant,textAlign:"center",textBaseline:"middle",lineSpacing:ue,styletags:le}));for(var J=(Q||12)/12,X=$.positions,oe=$.cells,ie=0,j=oe.length;ie=0;--re){var ce=X[ee[re]];p.push(J*ce[0],-J*ce[1],N)}}for(var m=[0,0,0],h=[0,0,0],P=[0,0,0],L=[0,0,0],z=1.25,F={breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0},B=0;B<3;++B){P[B]=p.length/f|0,u(.5*(w[0][B]+w[1][B]),S[B],E[B],12,z,F),L[B]=(p.length/f|0)-P[B],m[B]=p.length/f|0;for(var O=0;O=0&&(f=s.length-c-1);var g=Math.pow(10,f),v=Math.round(i*n*g),T=v+"";if(T.indexOf("e")>=0)return T;var l=v/g,_=v%g;v<0?(l=-Math.ceil(l)|0,_=-_|0):(l=Math.floor(l)|0,_=_|0);var w=""+l;if(v<0&&(w="-"+w),f){for(var S=""+_;S.length=i[0][c];--v)f.push({x:v*n[c],text:r(n[c],v)});s.push(f)}return s}function a(i,n){for(var s=0;s<3;++s){if(i[s].length!==n[s].length)return!1;for(var c=0;cw)throw new Error("gl-buffer: If resizing buffer, must not specify offset");return l.bufferSubData(_,y,E),w}function g(l,_){for(var w=o.malloc(l.length,_),S=l.length,E=0;E=0;--S){if(_[S]!==w)return!1;w*=l[S]}return!0}c.update=function(l,_){if(typeof _!="number"&&(_=-1),this.bind(),typeof l=="object"&&typeof l.shape<"u"){var w=l.dtype;if(n.indexOf(w)<0&&(w="float32"),this.type===this.gl.ELEMENT_ARRAY_BUFFER){var S=gl.getExtension("OES_element_index_uint");S&&w!=="uint16"?w="uint32":w="uint16"}if(w===l.dtype&&v(l.shape,l.stride))l.offset===0&&l.data.length===l.shape[0]?this.length=f(this.gl,this.type,this.length,this.usage,l.data,_):this.length=f(this.gl,this.type,this.length,this.usage,l.data.subarray(l.offset,l.shape[0]),_);else{var E=o.malloc(l.size,w),y=i(E,l.shape);a.assign(y,l),_<0?this.length=f(this.gl,this.type,this.length,this.usage,E,_):this.length=f(this.gl,this.type,this.length,this.usage,E.subarray(0,l.size),_),o.free(E)}}else if(Array.isArray(l)){var b;this.type===this.gl.ELEMENT_ARRAY_BUFFER?b=g(l,"uint16"):b=g(l,"float32"),_<0?this.length=f(this.gl,this.type,this.length,this.usage,b,_):this.length=f(this.gl,this.type,this.length,this.usage,b.subarray(0,l.length),_),o.free(b)}else if(typeof l=="object"&&typeof l.length=="number")this.length=f(this.gl,this.type,this.length,this.usage,l,_);else if(typeof l=="number"||l===void 0){if(_>=0)throw new Error("gl-buffer: Cannot specify offset when resizing buffer");l=l|0,l<=0&&(l=1),this.gl.bufferData(this.type,l|0,this.usage),this.length=l}else throw new Error("gl-buffer: Invalid data type")};function T(l,_,w,S){if(w=w||l.ARRAY_BUFFER,S=S||l.DYNAMIC_DRAW,w!==l.ARRAY_BUFFER&&w!==l.ELEMENT_ARRAY_BUFFER)throw new Error("gl-buffer: Invalid type for webgl buffer, must be either gl.ARRAY_BUFFER or gl.ELEMENT_ARRAY_BUFFER");if(S!==l.DYNAMIC_DRAW&&S!==l.STATIC_DRAW&&S!==l.STREAM_DRAW)throw new Error("gl-buffer: Invalid usage for buffer, must be either gl.DYNAMIC_DRAW, gl.STATIC_DRAW or gl.STREAM_DRAW");var E=l.createBuffer(),y=new s(l,w,E,0,S);return y.update(_),y}e.exports=T},6405:function(e,t,r){"use strict";var o=r(2931);e.exports=function(i,n){var s=i.positions,c=i.vectors,f={positions:[],vertexIntensity:[],vertexIntensityBounds:i.vertexIntensityBounds,vectors:[],cells:[],coneOffset:i.coneOffset,colormap:i.colormap};if(i.positions.length===0)return n&&(n[0]=[0,0,0],n[1]=[0,0,0]),f;for(var g=0,v=1/0,T=-1/0,l=1/0,_=-1/0,w=1/0,S=-1/0,E=null,y=null,b=[],p=1/0,u=!1,m=i.coneSizemode==="raw",h=0;hg&&(g=o.length(L)),h&&!m){var z=2*o.distance(E,P)/(o.length(y)+o.length(L));z?(p=Math.min(p,z),u=!1):u=!0}u||(E=P,y=L),b.push(L)}var F=[v,l,w],B=[T,_,S];n&&(n[0]=F,n[1]=B),g===0&&(g=1);var O=1/g;isFinite(p)||(p=1),f.vectorScale=p;var I=i.coneSize||(m?1:.5);i.absoluteConeSize&&(I=i.absoluteConeSize*O),f.coneScale=I;for(var h=0,N=0;h=1},l.isTransparent=function(){return this.opacity<1},l.pickSlots=1,l.setPickBase=function(b){this.pickId=b};function _(b){for(var p=g({colormap:b,nshades:256,format:"rgba"}),u=new Uint8Array(256*4),m=0;m<256;++m){for(var h=p[m],P=0;P<3;++P)u[4*m+P]=h[P];u[4*m+3]=h[3]*255}return f(u,[256,256,4],[4,0,1])}function w(b){for(var p=b.length,u=new Array(p),m=0;m0){var N=this.triShader;N.bind(),N.uniforms=z,this.triangleVAO.bind(),p.drawArrays(p.TRIANGLES,0,this.triangleCount*3),this.triangleVAO.unbind()}},l.drawPick=function(b){b=b||{};for(var p=this.gl,u=b.model||v,m=b.view||v,h=b.projection||v,P=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],L=0;L<3;++L)P[0][L]=Math.max(P[0][L],this.clipBounds[0][L]),P[1][L]=Math.min(P[1][L],this.clipBounds[1][L]);this._model=[].slice.call(u),this._view=[].slice.call(m),this._projection=[].slice.call(h),this._resolution=[p.drawingBufferWidth,p.drawingBufferHeight];var z={model:u,view:m,projection:h,clipBounds:P,tubeScale:this.tubeScale,vectorScale:this.vectorScale,coneScale:this.coneScale,coneOffset:this.coneOffset,pickId:this.pickId/255},F=this.pickShader;F.bind(),F.uniforms=z,this.triangleCount>0&&(this.triangleVAO.bind(),p.drawArrays(p.TRIANGLES,0,this.triangleCount*3),this.triangleVAO.unbind())},l.pick=function(b){if(!b||b.id!==this.pickId)return null;var p=b.value[0]+256*b.value[1]+65536*b.value[2],u=this.cells[p],m=this.positions[u[1]].slice(0,3),h={position:m,dataCoordinate:m,index:Math.floor(u[1]/48)};return this.traceType==="cone"?h.index=Math.floor(u[1]/48):this.traceType==="streamtube"&&(h.intensity=this.intensity[u[1]],h.velocity=this.vectors[u[1]].slice(0,3),h.divergence=this.vectors[u[1]][3],h.index=p),h},l.dispose=function(){this.texture.dispose(),this.triShader.dispose(),this.pickShader.dispose(),this.triangleVAO.dispose(),this.trianglePositions.dispose(),this.triangleVectors.dispose(),this.triangleColors.dispose(),this.triangleUVs.dispose(),this.triangleIds.dispose()};function S(b,p){var u=o(b,p.meshShader.vertex,p.meshShader.fragment,null,p.meshShader.attributes);return u.attributes.position.location=0,u.attributes.color.location=2,u.attributes.uv.location=3,u.attributes.vector.location=4,u}function E(b,p){var u=o(b,p.pickShader.vertex,p.pickShader.fragment,null,p.pickShader.attributes);return u.attributes.position.location=0,u.attributes.id.location=1,u.attributes.vector.location=4,u}function y(b,p,u){var m=u.shaders;arguments.length===1&&(p=b,b=p.gl);var h=S(b,m),P=E(b,m),L=n(b,f(new Uint8Array([255,255,255,255]),[1,1,4]));L.generateMipmap(),L.minFilter=b.LINEAR_MIPMAP_LINEAR,L.magFilter=b.LINEAR;var z=a(b),F=a(b),B=a(b),O=a(b),I=a(b),N=i(b,[{buffer:z,type:b.FLOAT,size:4},{buffer:I,type:b.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:B,type:b.FLOAT,size:4},{buffer:O,type:b.FLOAT,size:2},{buffer:F,type:b.FLOAT,size:4}]),U=new T(b,L,h,P,z,F,I,B,O,N,u.traceType||"cone");return U.update(p),U}e.exports=y},614:function(e,t,r){var o=r(3236),a=o([`precision highp float; precision highp float; #define GLSLIFY 1 vec3 getOrthogonalVector(vec3 v) { // Return up-vector for only-z vector. // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0). // From the above if-statement we have ||a|| > 0 U ||b|| > 0. // Assign z = 0, x = -b, y = a: // a*-b + b*a + c*0 = -ba + ba + 0 = 0 if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) { return normalize(vec3(-v.y, v.x, 0.0)); } else { return normalize(vec3(0.0, v.z, -v.y)); } } // Calculate the cone vertex and normal at the given index. // // The returned vertex is for a cone with its top at origin and height of 1.0, // pointing in the direction of the vector attribute. // // Each cone is made up of a top vertex, a center base vertex and base perimeter vertices. // These vertices are used to make up the triangles of the cone by the following: // segment + 0 top vertex // segment + 1 perimeter vertex a+1 // segment + 2 perimeter vertex a // segment + 3 center base vertex // segment + 4 perimeter vertex a // segment + 5 perimeter vertex a+1 // Where segment is the number of the radial segment * 6 and a is the angle at that radial segment. // To go from index to segment, floor(index / 6) // To go from segment to angle, 2*pi * (segment/segmentCount) // To go from index to segment index, index - (segment*6) // vec3 getConePosition(vec3 d, float rawIndex, float coneOffset, out vec3 normal) { const float segmentCount = 8.0; float index = rawIndex - floor(rawIndex / (segmentCount * 6.0)) * (segmentCount * 6.0); float segment = floor(0.001 + index/6.0); float segmentIndex = index - (segment*6.0); normal = -normalize(d); if (segmentIndex > 2.99 && segmentIndex < 3.01) { return mix(vec3(0.0), -d, coneOffset); } float nextAngle = ( (segmentIndex > 0.99 && segmentIndex < 1.01) || (segmentIndex > 4.99 && segmentIndex < 5.01) ) ? 1.0 : 0.0; float angle = 2.0 * 3.14159 * ((segment + nextAngle) / segmentCount); vec3 v1 = mix(d, vec3(0.0), coneOffset); vec3 v2 = v1 - d; vec3 u = getOrthogonalVector(d); vec3 v = normalize(cross(u, d)); vec3 x = u * cos(angle) * length(d)*0.25; vec3 y = v * sin(angle) * length(d)*0.25; vec3 v3 = v2 + x + y; if (segmentIndex < 3.0) { vec3 tx = u * sin(angle); vec3 ty = v * -cos(angle); vec3 tangent = tx + ty; normal = normalize(cross(v3 - v1, tangent)); } if (segmentIndex == 0.0) { return mix(d, vec3(0.0), coneOffset); } return v3; } attribute vec3 vector; attribute vec4 color, position; attribute vec2 uv; uniform float vectorScale, coneScale, coneOffset; uniform mat4 model, view, projection, inverseModel; uniform vec3 eyePosition, lightPosition; varying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position; varying vec4 f_color; varying vec2 f_uv; void main() { // Scale the vector magnitude to stay constant with // model & view changes. vec3 normal; vec3 XYZ = getConePosition(mat3(model) * ((vectorScale * coneScale) * vector), position.w, coneOffset, normal); vec4 conePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0); //Lighting geometry parameters vec4 cameraCoordinate = view * conePosition; cameraCoordinate.xyz /= cameraCoordinate.w; f_lightDirection = lightPosition - cameraCoordinate.xyz; f_eyeDirection = eyePosition - cameraCoordinate.xyz; f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz); // vec4 m_position = model * vec4(conePosition, 1.0); vec4 t_position = view * conePosition; gl_Position = projection * t_position; f_color = color; f_data = conePosition.xyz; f_position = position.xyz; f_uv = uv; } `]),i=o([`#extension GL_OES_standard_derivatives : enable precision highp float; #define GLSLIFY 1 float beckmannDistribution(float x, float roughness) { float NdotH = max(x, 0.0001); float cos2Alpha = NdotH * NdotH; float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha; float roughness2 = roughness * roughness; float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha; return exp(tan2Alpha / roughness2) / denom; } float cookTorranceSpecular( vec3 lightDirection, vec3 viewDirection, vec3 surfaceNormal, float roughness, float fresnel) { float VdotN = max(dot(viewDirection, surfaceNormal), 0.0); float LdotN = max(dot(lightDirection, surfaceNormal), 0.0); //Half angle vector vec3 H = normalize(lightDirection + viewDirection); //Geometric term float NdotH = max(dot(surfaceNormal, H), 0.0); float VdotH = max(dot(viewDirection, H), 0.000001); float LdotH = max(dot(lightDirection, H), 0.000001); float G1 = (2.0 * NdotH * VdotN) / VdotH; float G2 = (2.0 * NdotH * LdotN) / LdotH; float G = min(1.0, min(G1, G2)); //Distribution term float D = beckmannDistribution(NdotH, roughness); //Fresnel term float F = pow(1.0 - VdotN, fresnel); //Multiply terms and done return G * F * D / max(3.14159265 * VdotN, 0.000001); } bool outOfRange(float a, float b, float p) { return ((p > max(a, b)) || (p < min(a, b))); } bool outOfRange(vec2 a, vec2 b, vec2 p) { return (outOfRange(a.x, b.x, p.x) || outOfRange(a.y, b.y, p.y)); } bool outOfRange(vec3 a, vec3 b, vec3 p) { return (outOfRange(a.x, b.x, p.x) || outOfRange(a.y, b.y, p.y) || outOfRange(a.z, b.z, p.z)); } bool outOfRange(vec4 a, vec4 b, vec4 p) { return outOfRange(a.xyz, b.xyz, p.xyz); } uniform vec3 clipBounds[2]; uniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity; uniform sampler2D texture; varying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position; varying vec4 f_color; varying vec2 f_uv; void main() { if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard; vec3 N = normalize(f_normal); vec3 L = normalize(f_lightDirection); vec3 V = normalize(f_eyeDirection); if(gl_FrontFacing) { N = -N; } float specular = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel))); float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0); vec4 surfaceColor = f_color * texture2D(texture, f_uv); vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0); gl_FragColor = litColor * opacity; } `]),n=o([`precision highp float; precision highp float; #define GLSLIFY 1 vec3 getOrthogonalVector(vec3 v) { // Return up-vector for only-z vector. // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0). // From the above if-statement we have ||a|| > 0 U ||b|| > 0. // Assign z = 0, x = -b, y = a: // a*-b + b*a + c*0 = -ba + ba + 0 = 0 if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) { return normalize(vec3(-v.y, v.x, 0.0)); } else { return normalize(vec3(0.0, v.z, -v.y)); } } // Calculate the cone vertex and normal at the given index. // // The returned vertex is for a cone with its top at origin and height of 1.0, // pointing in the direction of the vector attribute. // // Each cone is made up of a top vertex, a center base vertex and base perimeter vertices. // These vertices are used to make up the triangles of the cone by the following: // segment + 0 top vertex // segment + 1 perimeter vertex a+1 // segment + 2 perimeter vertex a // segment + 3 center base vertex // segment + 4 perimeter vertex a // segment + 5 perimeter vertex a+1 // Where segment is the number of the radial segment * 6 and a is the angle at that radial segment. // To go from index to segment, floor(index / 6) // To go from segment to angle, 2*pi * (segment/segmentCount) // To go from index to segment index, index - (segment*6) // vec3 getConePosition(vec3 d, float rawIndex, float coneOffset, out vec3 normal) { const float segmentCount = 8.0; float index = rawIndex - floor(rawIndex / (segmentCount * 6.0)) * (segmentCount * 6.0); float segment = floor(0.001 + index/6.0); float segmentIndex = index - (segment*6.0); normal = -normalize(d); if (segmentIndex > 2.99 && segmentIndex < 3.01) { return mix(vec3(0.0), -d, coneOffset); } float nextAngle = ( (segmentIndex > 0.99 && segmentIndex < 1.01) || (segmentIndex > 4.99 && segmentIndex < 5.01) ) ? 1.0 : 0.0; float angle = 2.0 * 3.14159 * ((segment + nextAngle) / segmentCount); vec3 v1 = mix(d, vec3(0.0), coneOffset); vec3 v2 = v1 - d; vec3 u = getOrthogonalVector(d); vec3 v = normalize(cross(u, d)); vec3 x = u * cos(angle) * length(d)*0.25; vec3 y = v * sin(angle) * length(d)*0.25; vec3 v3 = v2 + x + y; if (segmentIndex < 3.0) { vec3 tx = u * sin(angle); vec3 ty = v * -cos(angle); vec3 tangent = tx + ty; normal = normalize(cross(v3 - v1, tangent)); } if (segmentIndex == 0.0) { return mix(d, vec3(0.0), coneOffset); } return v3; } attribute vec4 vector; attribute vec4 position; attribute vec4 id; uniform mat4 model, view, projection; uniform float vectorScale, coneScale, coneOffset; varying vec3 f_position; varying vec4 f_id; void main() { vec3 normal; vec3 XYZ = getConePosition(mat3(model) * ((vectorScale * coneScale) * vector.xyz), position.w, coneOffset, normal); vec4 conePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0); gl_Position = projection * (view * conePosition); f_id = id; f_position = position.xyz; } `]),s=o([`precision highp float; #define GLSLIFY 1 bool outOfRange(float a, float b, float p) { return ((p > max(a, b)) || (p < min(a, b))); } bool outOfRange(vec2 a, vec2 b, vec2 p) { return (outOfRange(a.x, b.x, p.x) || outOfRange(a.y, b.y, p.y)); } bool outOfRange(vec3 a, vec3 b, vec3 p) { return (outOfRange(a.x, b.x, p.x) || outOfRange(a.y, b.y, p.y) || outOfRange(a.z, b.z, p.z)); } bool outOfRange(vec4 a, vec4 b, vec4 p) { return outOfRange(a.xyz, b.xyz, p.xyz); } uniform vec3 clipBounds[2]; uniform float pickId; varying vec3 f_position; varying vec4 f_id; void main() { if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard; gl_FragColor = vec4(pickId, f_id.xyz); }`]);t.meshShader={vertex:a,fragment:i,attributes:[{name:"position",type:"vec4"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"vector",type:"vec3"}]},t.pickShader={vertex:n,fragment:s,attributes:[{name:"position",type:"vec4"},{name:"id",type:"vec4"},{name:"vector",type:"vec3"}]}},737:function(e){e.exports={0:"NONE",1:"ONE",2:"LINE_LOOP",3:"LINE_STRIP",4:"TRIANGLES",5:"TRIANGLE_STRIP",6:"TRIANGLE_FAN",256:"DEPTH_BUFFER_BIT",512:"NEVER",513:"LESS",514:"EQUAL",515:"LEQUAL",516:"GREATER",517:"NOTEQUAL",518:"GEQUAL",519:"ALWAYS",768:"SRC_COLOR",769:"ONE_MINUS_SRC_COLOR",770:"SRC_ALPHA",771:"ONE_MINUS_SRC_ALPHA",772:"DST_ALPHA",773:"ONE_MINUS_DST_ALPHA",774:"DST_COLOR",775:"ONE_MINUS_DST_COLOR",776:"SRC_ALPHA_SATURATE",1024:"STENCIL_BUFFER_BIT",1028:"FRONT",1029:"BACK",1032:"FRONT_AND_BACK",1280:"INVALID_ENUM",1281:"INVALID_VALUE",1282:"INVALID_OPERATION",1285:"OUT_OF_MEMORY",1286:"INVALID_FRAMEBUFFER_OPERATION",2304:"CW",2305:"CCW",2849:"LINE_WIDTH",2884:"CULL_FACE",2885:"CULL_FACE_MODE",2886:"FRONT_FACE",2928:"DEPTH_RANGE",2929:"DEPTH_TEST",2930:"DEPTH_WRITEMASK",2931:"DEPTH_CLEAR_VALUE",2932:"DEPTH_FUNC",2960:"STENCIL_TEST",2961:"STENCIL_CLEAR_VALUE",2962:"STENCIL_FUNC",2963:"STENCIL_VALUE_MASK",2964:"STENCIL_FAIL",2965:"STENCIL_PASS_DEPTH_FAIL",2966:"STENCIL_PASS_DEPTH_PASS",2967:"STENCIL_REF",2968:"STENCIL_WRITEMASK",2978:"VIEWPORT",3024:"DITHER",3042:"BLEND",3088:"SCISSOR_BOX",3089:"SCISSOR_TEST",3106:"COLOR_CLEAR_VALUE",3107:"COLOR_WRITEMASK",3317:"UNPACK_ALIGNMENT",3333:"PACK_ALIGNMENT",3379:"MAX_TEXTURE_SIZE",3386:"MAX_VIEWPORT_DIMS",3408:"SUBPIXEL_BITS",3410:"RED_BITS",3411:"GREEN_BITS",3412:"BLUE_BITS",3413:"ALPHA_BITS",3414:"DEPTH_BITS",3415:"STENCIL_BITS",3553:"TEXTURE_2D",4352:"DONT_CARE",4353:"FASTEST",4354:"NICEST",5120:"BYTE",5121:"UNSIGNED_BYTE",5122:"SHORT",5123:"UNSIGNED_SHORT",5124:"INT",5125:"UNSIGNED_INT",5126:"FLOAT",5386:"INVERT",5890:"TEXTURE",6401:"STENCIL_INDEX",6402:"DEPTH_COMPONENT",6406:"ALPHA",6407:"RGB",6408:"RGBA",6409:"LUMINANCE",6410:"LUMINANCE_ALPHA",7680:"KEEP",7681:"REPLACE",7682:"INCR",7683:"DECR",7936:"VENDOR",7937:"RENDERER",7938:"VERSION",9728:"NEAREST",9729:"LINEAR",9984:"NEAREST_MIPMAP_NEAREST",9985:"LINEAR_MIPMAP_NEAREST",9986:"NEAREST_MIPMAP_LINEAR",9987:"LINEAR_MIPMAP_LINEAR",10240:"TEXTURE_MAG_FILTER",10241:"TEXTURE_MIN_FILTER",10242:"TEXTURE_WRAP_S",10243:"TEXTURE_WRAP_T",10497:"REPEAT",10752:"POLYGON_OFFSET_UNITS",16384:"COLOR_BUFFER_BIT",32769:"CONSTANT_COLOR",32770:"ONE_MINUS_CONSTANT_COLOR",32771:"CONSTANT_ALPHA",32772:"ONE_MINUS_CONSTANT_ALPHA",32773:"BLEND_COLOR",32774:"FUNC_ADD",32777:"BLEND_EQUATION_RGB",32778:"FUNC_SUBTRACT",32779:"FUNC_REVERSE_SUBTRACT",32819:"UNSIGNED_SHORT_4_4_4_4",32820:"UNSIGNED_SHORT_5_5_5_1",32823:"POLYGON_OFFSET_FILL",32824:"POLYGON_OFFSET_FACTOR",32854:"RGBA4",32855:"RGB5_A1",32873:"TEXTURE_BINDING_2D",32926:"SAMPLE_ALPHA_TO_COVERAGE",32928:"SAMPLE_COVERAGE",32936:"SAMPLE_BUFFERS",32937:"SAMPLES",32938:"SAMPLE_COVERAGE_VALUE",32939:"SAMPLE_COVERAGE_INVERT",32968:"BLEND_DST_RGB",32969:"BLEND_SRC_RGB",32970:"BLEND_DST_ALPHA",32971:"BLEND_SRC_ALPHA",33071:"CLAMP_TO_EDGE",33170:"GENERATE_MIPMAP_HINT",33189:"DEPTH_COMPONENT16",33306:"DEPTH_STENCIL_ATTACHMENT",33635:"UNSIGNED_SHORT_5_6_5",33648:"MIRRORED_REPEAT",33901:"ALIASED_POINT_SIZE_RANGE",33902:"ALIASED_LINE_WIDTH_RANGE",33984:"TEXTURE0",33985:"TEXTURE1",33986:"TEXTURE2",33987:"TEXTURE3",33988:"TEXTURE4",33989:"TEXTURE5",33990:"TEXTURE6",33991:"TEXTURE7",33992:"TEXTURE8",33993:"TEXTURE9",33994:"TEXTURE10",33995:"TEXTURE11",33996:"TEXTURE12",33997:"TEXTURE13",33998:"TEXTURE14",33999:"TEXTURE15",34e3:"TEXTURE16",34001:"TEXTURE17",34002:"TEXTURE18",34003:"TEXTURE19",34004:"TEXTURE20",34005:"TEXTURE21",34006:"TEXTURE22",34007:"TEXTURE23",34008:"TEXTURE24",34009:"TEXTURE25",34010:"TEXTURE26",34011:"TEXTURE27",34012:"TEXTURE28",34013:"TEXTURE29",34014:"TEXTURE30",34015:"TEXTURE31",34016:"ACTIVE_TEXTURE",34024:"MAX_RENDERBUFFER_SIZE",34041:"DEPTH_STENCIL",34055:"INCR_WRAP",34056:"DECR_WRAP",34067:"TEXTURE_CUBE_MAP",34068:"TEXTURE_BINDING_CUBE_MAP",34069:"TEXTURE_CUBE_MAP_POSITIVE_X",34070:"TEXTURE_CUBE_MAP_NEGATIVE_X",34071:"TEXTURE_CUBE_MAP_POSITIVE_Y",34072:"TEXTURE_CUBE_MAP_NEGATIVE_Y",34073:"TEXTURE_CUBE_MAP_POSITIVE_Z",34074:"TEXTURE_CUBE_MAP_NEGATIVE_Z",34076:"MAX_CUBE_MAP_TEXTURE_SIZE",34338:"VERTEX_ATTRIB_ARRAY_ENABLED",34339:"VERTEX_ATTRIB_ARRAY_SIZE",34340:"VERTEX_ATTRIB_ARRAY_STRIDE",34341:"VERTEX_ATTRIB_ARRAY_TYPE",34342:"CURRENT_VERTEX_ATTRIB",34373:"VERTEX_ATTRIB_ARRAY_POINTER",34466:"NUM_COMPRESSED_TEXTURE_FORMATS",34467:"COMPRESSED_TEXTURE_FORMATS",34660:"BUFFER_SIZE",34661:"BUFFER_USAGE",34816:"STENCIL_BACK_FUNC",34817:"STENCIL_BACK_FAIL",34818:"STENCIL_BACK_PASS_DEPTH_FAIL",34819:"STENCIL_BACK_PASS_DEPTH_PASS",34877:"BLEND_EQUATION_ALPHA",34921:"MAX_VERTEX_ATTRIBS",34922:"VERTEX_ATTRIB_ARRAY_NORMALIZED",34930:"MAX_TEXTURE_IMAGE_UNITS",34962:"ARRAY_BUFFER",34963:"ELEMENT_ARRAY_BUFFER",34964:"ARRAY_BUFFER_BINDING",34965:"ELEMENT_ARRAY_BUFFER_BINDING",34975:"VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",35040:"STREAM_DRAW",35044:"STATIC_DRAW",35048:"DYNAMIC_DRAW",35632:"FRAGMENT_SHADER",35633:"VERTEX_SHADER",35660:"MAX_VERTEX_TEXTURE_IMAGE_UNITS",35661:"MAX_COMBINED_TEXTURE_IMAGE_UNITS",35663:"SHADER_TYPE",35664:"FLOAT_VEC2",35665:"FLOAT_VEC3",35666:"FLOAT_VEC4",35667:"INT_VEC2",35668:"INT_VEC3",35669:"INT_VEC4",35670:"BOOL",35671:"BOOL_VEC2",35672:"BOOL_VEC3",35673:"BOOL_VEC4",35674:"FLOAT_MAT2",35675:"FLOAT_MAT3",35676:"FLOAT_MAT4",35678:"SAMPLER_2D",35680:"SAMPLER_CUBE",35712:"DELETE_STATUS",35713:"COMPILE_STATUS",35714:"LINK_STATUS",35715:"VALIDATE_STATUS",35716:"INFO_LOG_LENGTH",35717:"ATTACHED_SHADERS",35718:"ACTIVE_UNIFORMS",35719:"ACTIVE_UNIFORM_MAX_LENGTH",35720:"SHADER_SOURCE_LENGTH",35721:"ACTIVE_ATTRIBUTES",35722:"ACTIVE_ATTRIBUTE_MAX_LENGTH",35724:"SHADING_LANGUAGE_VERSION",35725:"CURRENT_PROGRAM",36003:"STENCIL_BACK_REF",36004:"STENCIL_BACK_VALUE_MASK",36005:"STENCIL_BACK_WRITEMASK",36006:"FRAMEBUFFER_BINDING",36007:"RENDERBUFFER_BINDING",36048:"FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",36049:"FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",36050:"FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",36051:"FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",36053:"FRAMEBUFFER_COMPLETE",36054:"FRAMEBUFFER_INCOMPLETE_ATTACHMENT",36055:"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",36057:"FRAMEBUFFER_INCOMPLETE_DIMENSIONS",36061:"FRAMEBUFFER_UNSUPPORTED",36064:"COLOR_ATTACHMENT0",36096:"DEPTH_ATTACHMENT",36128:"STENCIL_ATTACHMENT",36160:"FRAMEBUFFER",36161:"RENDERBUFFER",36162:"RENDERBUFFER_WIDTH",36163:"RENDERBUFFER_HEIGHT",36164:"RENDERBUFFER_INTERNAL_FORMAT",36168:"STENCIL_INDEX8",36176:"RENDERBUFFER_RED_SIZE",36177:"RENDERBUFFER_GREEN_SIZE",36178:"RENDERBUFFER_BLUE_SIZE",36179:"RENDERBUFFER_ALPHA_SIZE",36180:"RENDERBUFFER_DEPTH_SIZE",36181:"RENDERBUFFER_STENCIL_SIZE",36194:"RGB565",36336:"LOW_FLOAT",36337:"MEDIUM_FLOAT",36338:"HIGH_FLOAT",36339:"LOW_INT",36340:"MEDIUM_INT",36341:"HIGH_INT",36346:"SHADER_COMPILER",36347:"MAX_VERTEX_UNIFORM_VECTORS",36348:"MAX_VARYING_VECTORS",36349:"MAX_FRAGMENT_UNIFORM_VECTORS",37440:"UNPACK_FLIP_Y_WEBGL",37441:"UNPACK_PREMULTIPLY_ALPHA_WEBGL",37442:"CONTEXT_LOST_WEBGL",37443:"UNPACK_COLORSPACE_CONVERSION_WEBGL",37444:"BROWSER_DEFAULT_WEBGL"}},5171:function(e,t,r){var o=r(737);e.exports=function(i){return o[i]}},9165:function(e,t,r){"use strict";e.exports=T;var o=r(2762),a=r(8116),i=r(3436),n=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function s(l,_,w,S){this.gl=l,this.shader=S,this.buffer=_,this.vao=w,this.pixelRatio=1,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.lineWidth=[1,1,1],this.capSize=[10,10,10],this.lineCount=[0,0,0],this.lineOffset=[0,0,0],this.opacity=1,this.hasAlpha=!1}var c=s.prototype;c.isOpaque=function(){return!this.hasAlpha},c.isTransparent=function(){return this.hasAlpha},c.drawTransparent=c.draw=function(l){var _=this.gl,w=this.shader.uniforms;this.shader.bind();var S=w.view=l.view||n,E=w.projection=l.projection||n;w.model=l.model||n,w.clipBounds=this.clipBounds,w.opacity=this.opacity;var y=S[12],b=S[13],p=S[14],u=S[15],m=l._ortho||!1,h=m?2:1,P=h*this.pixelRatio*(E[3]*y+E[7]*b+E[11]*p+E[15]*u)/_.drawingBufferHeight;this.vao.bind();for(var L=0;L<3;++L)_.lineWidth(this.lineWidth[L]*this.pixelRatio),w.capSize=this.capSize[L]*P,this.lineCount[L]&&_.drawArrays(_.LINES,this.lineOffset[L],this.lineCount[L]);this.vao.unbind()};function f(l,_){for(var w=0;w<3;++w)l[0][w]=Math.min(l[0][w],_[w]),l[1][w]=Math.max(l[1][w],_[w])}var g=function(){for(var l=new Array(3),_=0;_<3;++_){for(var w=[],S=1;S<=2;++S)for(var E=-1;E<=1;E+=2){var y=(S+_)%3,b=[0,0,0];b[y]=E,w.push(b)}l[_]=w}return l}();function v(l,_,w,S){for(var E=g[S],y=0;y0){var z=m.slice();z[p]+=P[1][p],E.push(m[0],m[1],m[2],L[0],L[1],L[2],L[3],0,0,0,z[0],z[1],z[2],L[0],L[1],L[2],L[3],0,0,0),f(this.bounds,z),b+=2+v(E,z,L,p)}}}this.lineCount[p]=b-this.lineOffset[p]}this.buffer.update(E)}},c.dispose=function(){this.shader.dispose(),this.buffer.dispose(),this.vao.dispose()};function T(l){var _=l.gl,w=o(_),S=a(_,[{buffer:w,type:_.FLOAT,size:3,offset:0,stride:40},{buffer:w,type:_.FLOAT,size:4,offset:12,stride:40},{buffer:w,type:_.FLOAT,size:3,offset:28,stride:40}]),E=i(_);E.attributes.position.location=0,E.attributes.color.location=1,E.attributes.offset.location=2;var y=new s(_,w,S,E);return y.update(l),y}},3436:function(e,t,r){"use strict";var o=r(3236),a=r(9405),i=o([`precision highp float; #define GLSLIFY 1 attribute vec3 position, offset; attribute vec4 color; uniform mat4 model, view, projection; uniform float capSize; varying vec4 fragColor; varying vec3 fragPosition; void main() { vec4 worldPosition = model * vec4(position, 1.0); worldPosition = (worldPosition / worldPosition.w) + vec4(capSize * offset, 0.0); gl_Position = projection * (view * worldPosition); fragColor = color; fragPosition = position; }`]),n=o([`precision highp float; #define GLSLIFY 1 bool outOfRange(float a, float b, float p) { return ((p > max(a, b)) || (p < min(a, b))); } bool outOfRange(vec2 a, vec2 b, vec2 p) { return (outOfRange(a.x, b.x, p.x) || outOfRange(a.y, b.y, p.y)); } bool outOfRange(vec3 a, vec3 b, vec3 p) { return (outOfRange(a.x, b.x, p.x) || outOfRange(a.y, b.y, p.y) || outOfRange(a.z, b.z, p.z)); } bool outOfRange(vec4 a, vec4 b, vec4 p) { return outOfRange(a.xyz, b.xyz, p.xyz); } uniform vec3 clipBounds[2]; uniform float opacity; varying vec3 fragPosition; varying vec4 fragColor; void main() { if ( outOfRange(clipBounds[0], clipBounds[1], fragPosition) || fragColor.a * opacity == 0. ) discard; gl_FragColor = opacity * fragColor; }`]);e.exports=function(s){return a(s,i,n,null,[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"offset",type:"vec3"}])}},2260:function(e,t,r){"use strict";var o=r(7766);e.exports=b;var a=null,i,n,s,c;function f(p){var u=p.getParameter(p.FRAMEBUFFER_BINDING),m=p.getParameter(p.RENDERBUFFER_BINDING),h=p.getParameter(p.TEXTURE_BINDING_2D);return[u,m,h]}function g(p,u){p.bindFramebuffer(p.FRAMEBUFFER,u[0]),p.bindRenderbuffer(p.RENDERBUFFER,u[1]),p.bindTexture(p.TEXTURE_2D,u[2])}function v(p,u){var m=p.getParameter(u.MAX_COLOR_ATTACHMENTS_WEBGL);a=new Array(m+1);for(var h=0;h<=m;++h){for(var P=new Array(m),L=0;L1&&F.drawBuffersWEBGL(a[z]);var U=m.getExtension("WEBGL_depth_texture");U?B?p.depth=l(m,P,L,U.UNSIGNED_INT_24_8_WEBGL,m.DEPTH_STENCIL,m.DEPTH_STENCIL_ATTACHMENT):O&&(p.depth=l(m,P,L,m.UNSIGNED_SHORT,m.DEPTH_COMPONENT,m.DEPTH_ATTACHMENT)):O&&B?p._depth_rb=_(m,P,L,m.DEPTH_STENCIL,m.DEPTH_STENCIL_ATTACHMENT):O?p._depth_rb=_(m,P,L,m.DEPTH_COMPONENT16,m.DEPTH_ATTACHMENT):B&&(p._depth_rb=_(m,P,L,m.STENCIL_INDEX,m.STENCIL_ATTACHMENT));var W=m.checkFramebufferStatus(m.FRAMEBUFFER);if(W!==m.FRAMEBUFFER_COMPLETE){p._destroyed=!0,m.bindFramebuffer(m.FRAMEBUFFER,null),m.deleteFramebuffer(p.handle),p.handle=null,p.depth&&(p.depth.dispose(),p.depth=null),p._depth_rb&&(m.deleteRenderbuffer(p._depth_rb),p._depth_rb=null);for(var N=0;NP||m<0||m>P)throw new Error("gl-fbo: Can't resize FBO, invalid dimensions");p._shape[0]=u,p._shape[1]=m;for(var L=f(h),z=0;zL||m<0||m>L)throw new Error("gl-fbo: Parameters are too large for FBO");h=h||{};var z=1;if("color"in h){if(z=Math.max(h.color|0,0),z<0)throw new Error("gl-fbo: Must specify a nonnegative number of colors");if(z>1)if(P){if(z>p.getParameter(P.MAX_COLOR_ATTACHMENTS_WEBGL))throw new Error("gl-fbo: Context does not support "+z+" draw buffers")}else throw new Error("gl-fbo: Multiple draw buffer extension not supported")}var F=p.UNSIGNED_BYTE,B=p.getExtension("OES_texture_float");if(h.float&&z>0){if(!B)throw new Error("gl-fbo: Context does not support floating point textures");F=p.FLOAT}else h.preferFloat&&z>0&&B&&(F=p.FLOAT);var O=!0;"depth"in h&&(O=!!h.depth);var I=!1;return"stencil"in h&&(I=!!h.stencil),new S(p,u,m,F,z,O,I,P)}},2992:function(e,t,r){var o=r(3387).sprintf,a=r(5171),i=r(1848),n=r(1085);e.exports=s;function s(c,f,g){"use strict";var v=i(f)||"of unknown name (see npm glsl-shader-name)",T="unknown type";g!==void 0&&(T=g===a.FRAGMENT_SHADER?"fragment":"vertex");for(var l=o(`Error compiling %s shader %s: `,T,v),_=o("%s%s",l,c),w=c.split(` `),S={},E=0;E max(a, b)) || (p < min(a, b))); } bool outOfRange(vec2 a, vec2 b, vec2 p) { return (outOfRange(a.x, b.x, p.x) || outOfRange(a.y, b.y, p.y)); } bool outOfRange(vec3 a, vec3 b, vec3 p) { return (outOfRange(a.x, b.x, p.x) || outOfRange(a.y, b.y, p.y) || outOfRange(a.z, b.z, p.z)); } bool outOfRange(vec4 a, vec4 b, vec4 p) { return outOfRange(a.xyz, b.xyz, p.xyz); } uniform vec3 clipBounds[2]; uniform sampler2D dashTexture; uniform float dashScale; uniform float opacity; varying vec3 worldPosition; varying float pixelArcLength; varying vec4 fragColor; void main() { if ( outOfRange(clipBounds[0], clipBounds[1], worldPosition) || fragColor.a * opacity == 0. ) discard; float dashWeight = texture2D(dashTexture, vec2(dashScale * pixelArcLength, 0)).r; if(dashWeight < 0.5) { discard; } gl_FragColor = fragColor * opacity; } `]),s=o([`precision highp float; #define GLSLIFY 1 #define FLOAT_MAX 1.70141184e38 #define FLOAT_MIN 1.17549435e-38 // https://github.com/mikolalysenko/glsl-read-float/blob/master/index.glsl vec4 packFloat(float v) { float av = abs(v); //Handle special cases if(av < FLOAT_MIN) { return vec4(0.0, 0.0, 0.0, 0.0); } else if(v > FLOAT_MAX) { return vec4(127.0, 128.0, 0.0, 0.0) / 255.0; } else if(v < -FLOAT_MAX) { return vec4(255.0, 128.0, 0.0, 0.0) / 255.0; } vec4 c = vec4(0,0,0,0); //Compute exponent and mantissa float e = floor(log2(av)); float m = av * pow(2.0, -e) - 1.0; //Unpack mantissa c[1] = floor(128.0 * m); m -= c[1] / 128.0; c[2] = floor(32768.0 * m); m -= c[2] / 32768.0; c[3] = floor(8388608.0 * m); //Unpack exponent float ebias = e + 127.0; c[0] = floor(ebias / 2.0); ebias -= c[0] * 2.0; c[1] += floor(ebias) * 128.0; //Unpack sign bit c[0] += 128.0 * step(0.0, -v); //Scale back to range return c / 255.0; } bool outOfRange(float a, float b, float p) { return ((p > max(a, b)) || (p < min(a, b))); } bool outOfRange(vec2 a, vec2 b, vec2 p) { return (outOfRange(a.x, b.x, p.x) || outOfRange(a.y, b.y, p.y)); } bool outOfRange(vec3 a, vec3 b, vec3 p) { return (outOfRange(a.x, b.x, p.x) || outOfRange(a.y, b.y, p.y) || outOfRange(a.z, b.z, p.z)); } bool outOfRange(vec4 a, vec4 b, vec4 p) { return outOfRange(a.xyz, b.xyz, p.xyz); } uniform float pickId; uniform vec3 clipBounds[2]; varying vec3 worldPosition; varying float pixelArcLength; varying vec4 fragColor; void main() { if (outOfRange(clipBounds[0], clipBounds[1], worldPosition)) discard; gl_FragColor = vec4(pickId/255.0, packFloat(pixelArcLength).xyz); }`]),c=[{name:"position",type:"vec3"},{name:"nextPosition",type:"vec3"},{name:"arcLength",type:"float"},{name:"lineWidth",type:"float"},{name:"color",type:"vec4"}];t.createShader=function(f){return a(f,i,n,null,c)},t.createPickShader=function(f){return a(f,i,s,null,c)}},5714:function(e,t,r){"use strict";e.exports=p;var o=r(2762),a=r(8116),i=r(7766),n=new Uint8Array(4),s=new Float32Array(n.buffer);function c(u,m,h,P){return n[0]=P,n[1]=h,n[2]=m,n[3]=u,s[0]}var f=r(2478),g=r(9618),v=r(7319),T=v.createShader,l=v.createPickShader,_=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function w(u,m){for(var h=0,P=0;P<3;++P){var L=u[P]-m[P];h+=L*L}return Math.sqrt(h)}function S(u){for(var m=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],h=0;h<3;++h)m[0][h]=Math.max(u[0][h],m[0][h]),m[1][h]=Math.min(u[1][h],m[1][h]);return m}function E(u,m,h,P){this.arcLength=u,this.position=m,this.index=h,this.dataCoordinate=P}function y(u,m,h,P,L,z){this.gl=u,this.shader=m,this.pickShader=h,this.buffer=P,this.vao=L,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.points=[],this.arcLength=[],this.vertexCount=0,this.bounds=[[0,0,0],[0,0,0]],this.pickId=0,this.lineWidth=1,this.texture=z,this.dashScale=1,this.opacity=1,this.hasAlpha=!1,this.dirty=!0,this.pixelRatio=1}var b=y.prototype;b.isTransparent=function(){return this.hasAlpha},b.isOpaque=function(){return!this.hasAlpha},b.pickSlots=1,b.setPickBase=function(u){this.pickId=u},b.drawTransparent=b.draw=function(u){if(this.vertexCount){var m=this.gl,h=this.shader,P=this.vao;h.bind(),h.uniforms={model:u.model||_,view:u.view||_,projection:u.projection||_,clipBounds:S(this.clipBounds),dashTexture:this.texture.bind(),dashScale:this.dashScale/this.arcLength[this.arcLength.length-1],opacity:this.opacity,screenShape:[m.drawingBufferWidth,m.drawingBufferHeight],pixelRatio:this.pixelRatio},P.bind(),P.draw(m.TRIANGLE_STRIP,this.vertexCount),P.unbind()}},b.drawPick=function(u){if(this.vertexCount){var m=this.gl,h=this.pickShader,P=this.vao;h.bind(),h.uniforms={model:u.model||_,view:u.view||_,projection:u.projection||_,pickId:this.pickId,clipBounds:S(this.clipBounds),screenShape:[m.drawingBufferWidth,m.drawingBufferHeight],pixelRatio:this.pixelRatio},P.bind(),P.draw(m.TRIANGLE_STRIP,this.vertexCount),P.unbind()}},b.update=function(u){var m,h;this.dirty=!0;var P=!!u.connectGaps;"dashScale"in u&&(this.dashScale=u.dashScale),this.hasAlpha=!1,"opacity"in u&&(this.opacity=+u.opacity,this.opacity<1&&(this.hasAlpha=!0));var L=[],z=[],F=[],B=0,O=0,I=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],N=u.position||u.positions;if(N){var U=u.color||u.colors||[0,0,0,1],W=u.lineWidth||1,Q=!1;e:for(m=1;m0){for(var he=0;he<24;++he)L.push(L[L.length-12]);O+=2,Q=!0}continue e}I[0][h]=Math.min(I[0][h],ue[h],le[h]),I[1][h]=Math.max(I[1][h],ue[h],le[h])}var G,$;Array.isArray(U[0])?(G=U.length>m-1?U[m-1]:U.length>0?U[U.length-1]:[0,0,0,1],$=U.length>m?U[m]:U.length>0?U[U.length-1]:[0,0,0,1]):G=$=U,G.length===3&&(G=[G[0],G[1],G[2],1]),$.length===3&&($=[$[0],$[1],$[2],1]),!this.hasAlpha&&G[3]<1&&(this.hasAlpha=!0);var J;Array.isArray(W)?J=W.length>m-1?W[m-1]:W.length>0?W[W.length-1]:[0,0,0,1]:J=W;var X=B;if(B+=w(ue,le),Q){for(h=0;h<2;++h)L.push(ue[0],ue[1],ue[2],le[0],le[1],le[2],X,J,G[0],G[1],G[2],G[3]);O+=2,Q=!1}L.push(ue[0],ue[1],ue[2],le[0],le[1],le[2],X,J,G[0],G[1],G[2],G[3],ue[0],ue[1],ue[2],le[0],le[1],le[2],X,-J,G[0],G[1],G[2],G[3],le[0],le[1],le[2],ue[0],ue[1],ue[2],B,-J,$[0],$[1],$[2],$[3],le[0],le[1],le[2],ue[0],ue[1],ue[2],B,J,$[0],$[1],$[2],$[3]),O+=4}}if(this.buffer.update(L),z.push(B),F.push(N[N.length-1].slice()),this.bounds=I,this.vertexCount=O,this.points=F,this.arcLength=z,"dashes"in u){var oe=u.dashes,ie=oe.slice();for(ie.unshift(0),m=1;m1.0001)return null;h+=m[E]}return Math.abs(h-1)>.001?null:[y,c(g,m),m]}},840:function(e,t,r){var o=r(3236),a=o([`precision highp float; #define GLSLIFY 1 attribute vec3 position, normal; attribute vec4 color; attribute vec2 uv; uniform mat4 model , view , projection , inverseModel; uniform vec3 eyePosition , lightPosition; varying vec3 f_normal , f_lightDirection , f_eyeDirection , f_data; varying vec4 f_color; varying vec2 f_uv; vec4 project(vec3 p) { return projection * (view * (model * vec4(p, 1.0))); } void main() { gl_Position = project(position); //Lighting geometry parameters vec4 cameraCoordinate = view * vec4(position , 1.0); cameraCoordinate.xyz /= cameraCoordinate.w; f_lightDirection = lightPosition - cameraCoordinate.xyz; f_eyeDirection = eyePosition - cameraCoordinate.xyz; f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz); f_color = color; f_data = position; f_uv = uv; } `]),i=o([`#extension GL_OES_standard_derivatives : enable precision highp float; #define GLSLIFY 1 float beckmannDistribution(float x, float roughness) { float NdotH = max(x, 0.0001); float cos2Alpha = NdotH * NdotH; float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha; float roughness2 = roughness * roughness; float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha; return exp(tan2Alpha / roughness2) / denom; } float cookTorranceSpecular( vec3 lightDirection, vec3 viewDirection, vec3 surfaceNormal, float roughness, float fresnel) { float VdotN = max(dot(viewDirection, surfaceNormal), 0.0); float LdotN = max(dot(lightDirection, surfaceNormal), 0.0); //Half angle vector vec3 H = normalize(lightDirection + viewDirection); //Geometric term float NdotH = max(dot(surfaceNormal, H), 0.0); float VdotH = max(dot(viewDirection, H), 0.000001); float LdotH = max(dot(lightDirection, H), 0.000001); float G1 = (2.0 * NdotH * VdotN) / VdotH; float G2 = (2.0 * NdotH * LdotN) / LdotH; float G = min(1.0, min(G1, G2)); //Distribution term float D = beckmannDistribution(NdotH, roughness); //Fresnel term float F = pow(1.0 - VdotN, fresnel); //Multiply terms and done return G * F * D / max(3.14159265 * VdotN, 0.000001); } //#pragma glslify: beckmann = require(glsl-specular-beckmann) // used in gl-surface3d bool outOfRange(float a, float b, float p) { return ((p > max(a, b)) || (p < min(a, b))); } bool outOfRange(vec2 a, vec2 b, vec2 p) { return (outOfRange(a.x, b.x, p.x) || outOfRange(a.y, b.y, p.y)); } bool outOfRange(vec3 a, vec3 b, vec3 p) { return (outOfRange(a.x, b.x, p.x) || outOfRange(a.y, b.y, p.y) || outOfRange(a.z, b.z, p.z)); } bool outOfRange(vec4 a, vec4 b, vec4 p) { return outOfRange(a.xyz, b.xyz, p.xyz); } uniform vec3 clipBounds[2]; uniform float roughness , fresnel , kambient , kdiffuse , kspecular; uniform sampler2D texture; varying vec3 f_normal , f_lightDirection , f_eyeDirection , f_data; varying vec4 f_color; varying vec2 f_uv; void main() { if (f_color.a == 0.0 || outOfRange(clipBounds[0], clipBounds[1], f_data) ) discard; vec3 N = normalize(f_normal); vec3 L = normalize(f_lightDirection); vec3 V = normalize(f_eyeDirection); if(gl_FrontFacing) { N = -N; } float specular = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel))); //float specular = max(0.0, beckmann(L, V, N, roughness)); // used in gl-surface3d float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0); vec4 surfaceColor = vec4(f_color.rgb, 1.0) * texture2D(texture, f_uv); vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0); gl_FragColor = litColor * f_color.a; } `]),n=o([`precision highp float; #define GLSLIFY 1 attribute vec3 position; attribute vec4 color; attribute vec2 uv; uniform mat4 model, view, projection; varying vec4 f_color; varying vec3 f_data; varying vec2 f_uv; void main() { gl_Position = projection * (view * (model * vec4(position, 1.0))); f_color = color; f_data = position; f_uv = uv; }`]),s=o([`precision highp float; #define GLSLIFY 1 bool outOfRange(float a, float b, float p) { return ((p > max(a, b)) || (p < min(a, b))); } bool outOfRange(vec2 a, vec2 b, vec2 p) { return (outOfRange(a.x, b.x, p.x) || outOfRange(a.y, b.y, p.y)); } bool outOfRange(vec3 a, vec3 b, vec3 p) { return (outOfRange(a.x, b.x, p.x) || outOfRange(a.y, b.y, p.y) || outOfRange(a.z, b.z, p.z)); } bool outOfRange(vec4 a, vec4 b, vec4 p) { return outOfRange(a.xyz, b.xyz, p.xyz); } uniform vec3 clipBounds[2]; uniform sampler2D texture; uniform float opacity; varying vec4 f_color; varying vec3 f_data; varying vec2 f_uv; void main() { if (outOfRange(clipBounds[0], clipBounds[1], f_data)) discard; gl_FragColor = f_color * texture2D(texture, f_uv) * opacity; }`]),c=o([`precision highp float; #define GLSLIFY 1 bool outOfRange(float a, float b, float p) { return ((p > max(a, b)) || (p < min(a, b))); } bool outOfRange(vec2 a, vec2 b, vec2 p) { return (outOfRange(a.x, b.x, p.x) || outOfRange(a.y, b.y, p.y)); } bool outOfRange(vec3 a, vec3 b, vec3 p) { return (outOfRange(a.x, b.x, p.x) || outOfRange(a.y, b.y, p.y) || outOfRange(a.z, b.z, p.z)); } bool outOfRange(vec4 a, vec4 b, vec4 p) { return outOfRange(a.xyz, b.xyz, p.xyz); } attribute vec3 position; attribute vec4 color; attribute vec2 uv; attribute float pointSize; uniform mat4 model, view, projection; uniform vec3 clipBounds[2]; varying vec4 f_color; varying vec2 f_uv; void main() { if (outOfRange(clipBounds[0], clipBounds[1], position)) { gl_Position = vec4(0.0, 0.0 ,0.0 ,0.0); } else { gl_Position = projection * (view * (model * vec4(position, 1.0))); } gl_PointSize = pointSize; f_color = color; f_uv = uv; }`]),f=o([`precision highp float; #define GLSLIFY 1 uniform sampler2D texture; uniform float opacity; varying vec4 f_color; varying vec2 f_uv; void main() { vec2 pointR = gl_PointCoord.xy - vec2(0.5, 0.5); if(dot(pointR, pointR) > 0.25) { discard; } gl_FragColor = f_color * texture2D(texture, f_uv) * opacity; }`]),g=o([`precision highp float; #define GLSLIFY 1 attribute vec3 position; attribute vec4 id; uniform mat4 model, view, projection; varying vec3 f_position; varying vec4 f_id; void main() { gl_Position = projection * (view * (model * vec4(position, 1.0))); f_id = id; f_position = position; }`]),v=o([`precision highp float; #define GLSLIFY 1 bool outOfRange(float a, float b, float p) { return ((p > max(a, b)) || (p < min(a, b))); } bool outOfRange(vec2 a, vec2 b, vec2 p) { return (outOfRange(a.x, b.x, p.x) || outOfRange(a.y, b.y, p.y)); } bool outOfRange(vec3 a, vec3 b, vec3 p) { return (outOfRange(a.x, b.x, p.x) || outOfRange(a.y, b.y, p.y) || outOfRange(a.z, b.z, p.z)); } bool outOfRange(vec4 a, vec4 b, vec4 p) { return outOfRange(a.xyz, b.xyz, p.xyz); } uniform vec3 clipBounds[2]; uniform float pickId; varying vec3 f_position; varying vec4 f_id; void main() { if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard; gl_FragColor = vec4(pickId, f_id.xyz); }`]),T=o([`precision highp float; #define GLSLIFY 1 bool outOfRange(float a, float b, float p) { return ((p > max(a, b)) || (p < min(a, b))); } bool outOfRange(vec2 a, vec2 b, vec2 p) { return (outOfRange(a.x, b.x, p.x) || outOfRange(a.y, b.y, p.y)); } bool outOfRange(vec3 a, vec3 b, vec3 p) { return (outOfRange(a.x, b.x, p.x) || outOfRange(a.y, b.y, p.y) || outOfRange(a.z, b.z, p.z)); } bool outOfRange(vec4 a, vec4 b, vec4 p) { return outOfRange(a.xyz, b.xyz, p.xyz); } attribute vec3 position; attribute float pointSize; attribute vec4 id; uniform mat4 model, view, projection; uniform vec3 clipBounds[2]; varying vec3 f_position; varying vec4 f_id; void main() { if (outOfRange(clipBounds[0], clipBounds[1], position)) { gl_Position = vec4(0.0, 0.0, 0.0, 0.0); } else { gl_Position = projection * (view * (model * vec4(position, 1.0))); gl_PointSize = pointSize; } f_id = id; f_position = position; }`]),l=o([`precision highp float; #define GLSLIFY 1 attribute vec3 position; uniform mat4 model, view, projection; void main() { gl_Position = projection * (view * (model * vec4(position, 1.0))); }`]),_=o([`precision highp float; #define GLSLIFY 1 uniform vec3 contourColor; void main() { gl_FragColor = vec4(contourColor, 1.0); } `]);t.meshShader={vertex:a,fragment:i,attributes:[{name:"position",type:"vec3"},{name:"normal",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},t.wireShader={vertex:n,fragment:s,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},t.pointShader={vertex:c,fragment:f,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"pointSize",type:"float"}]},t.pickShader={vertex:g,fragment:v,attributes:[{name:"position",type:"vec3"},{name:"id",type:"vec4"}]},t.pointPickShader={vertex:T,fragment:v,attributes:[{name:"position",type:"vec3"},{name:"pointSize",type:"float"},{name:"id",type:"vec4"}]},t.contourShader={vertex:l,fragment:_,attributes:[{name:"position",type:"vec3"}]}},7201:function(e,t,r){"use strict";var o=1e-6,a=1e-6,i=r(9405),n=r(2762),s=r(8116),c=r(7766),f=r(8406),g=r(6760),v=r(7608),T=r(9618),l=r(6729),_=r(7765),w=r(1888),S=r(840),E=r(7626),y=S.meshShader,b=S.wireShader,p=S.pointShader,u=S.pickShader,m=S.pointPickShader,h=S.contourShader,P=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function L(he,G,$,J,X,oe,ie,j,ee,re,ce,be,Ae,ze,Re,Xe,it,ot,tt,lt,Ee,_e,fe,Fe,rt,st,Qe){this.gl=he,this.pixelRatio=1,this.cells=[],this.positions=[],this.intensity=[],this.texture=G,this.dirty=!0,this.triShader=$,this.lineShader=J,this.pointShader=X,this.pickShader=oe,this.pointPickShader=ie,this.contourShader=j,this.trianglePositions=ee,this.triangleColors=ce,this.triangleNormals=Ae,this.triangleUVs=be,this.triangleIds=re,this.triangleVAO=ze,this.triangleCount=0,this.lineWidth=1,this.edgePositions=Re,this.edgeColors=it,this.edgeUVs=ot,this.edgeIds=Xe,this.edgeVAO=tt,this.edgeCount=0,this.pointPositions=lt,this.pointColors=_e,this.pointUVs=fe,this.pointSizes=Fe,this.pointIds=Ee,this.pointVAO=rt,this.pointCount=0,this.contourLineWidth=1,this.contourPositions=st,this.contourVAO=Qe,this.contourCount=0,this.contourColor=[0,0,0],this.contourEnable=!0,this.pickVertex=!0,this.pickId=1,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.lightPosition=[1e5,1e5,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.opacity=1,this.hasAlpha=!1,this.opacityscale=!1,this._model=P,this._view=P,this._projection=P,this._resolution=[1,1]}var z=L.prototype;z.isOpaque=function(){return!this.hasAlpha},z.isTransparent=function(){return this.hasAlpha},z.pickSlots=1,z.setPickBase=function(he){this.pickId=he};function F(he,G){if(!G||!G.length)return 1;for(var $=0;$he&&$>0){var J=(G[$][0]-he)/(G[$][0]-G[$-1][0]);return G[$][1]*(1-J)+J*G[$-1][1]}}return 1}function B(he,G){for(var $=l({colormap:he,nshades:256,format:"rgba"}),J=new Uint8Array(256*4),X=0;X<256;++X){for(var oe=$[X],ie=0;ie<3;++ie)J[4*X+ie]=oe[ie];G?J[4*X+3]=255*F(X/255,G):J[4*X+3]=255*oe[3]}return T(J,[256,256,4],[4,0,1])}function O(he){for(var G=he.length,$=new Array(G),J=0;J0){var Ae=this.triShader;Ae.bind(),Ae.uniforms=j,this.triangleVAO.bind(),G.drawArrays(G.TRIANGLES,0,this.triangleCount*3),this.triangleVAO.unbind()}if(this.edgeCount>0&&this.lineWidth>0){var Ae=this.lineShader;Ae.bind(),Ae.uniforms=j,this.edgeVAO.bind(),G.lineWidth(this.lineWidth*this.pixelRatio),G.drawArrays(G.LINES,0,this.edgeCount*2),this.edgeVAO.unbind()}if(this.pointCount>0){var Ae=this.pointShader;Ae.bind(),Ae.uniforms=j,this.pointVAO.bind(),G.drawArrays(G.POINTS,0,this.pointCount),this.pointVAO.unbind()}if(this.contourEnable&&this.contourCount>0&&this.contourLineWidth>0){var Ae=this.contourShader;Ae.bind(),Ae.uniforms=j,this.contourVAO.bind(),G.drawArrays(G.LINES,0,this.contourCount),this.contourVAO.unbind()}},z.drawPick=function(he){he=he||{};for(var G=this.gl,$=he.model||P,J=he.view||P,X=he.projection||P,oe=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],ie=0;ie<3;++ie)oe[0][ie]=Math.max(oe[0][ie],this.clipBounds[0][ie]),oe[1][ie]=Math.min(oe[1][ie],this.clipBounds[1][ie]);this._model=[].slice.call($),this._view=[].slice.call(J),this._projection=[].slice.call(X),this._resolution=[G.drawingBufferWidth,G.drawingBufferHeight];var j={model:$,view:J,projection:X,clipBounds:oe,pickId:this.pickId/255},ee=this.pickShader;if(ee.bind(),ee.uniforms=j,this.triangleCount>0&&(this.triangleVAO.bind(),G.drawArrays(G.TRIANGLES,0,this.triangleCount*3),this.triangleVAO.unbind()),this.edgeCount>0&&(this.edgeVAO.bind(),G.lineWidth(this.lineWidth*this.pixelRatio),G.drawArrays(G.LINES,0,this.edgeCount*2),this.edgeVAO.unbind()),this.pointCount>0){var ee=this.pointPickShader;ee.bind(),ee.uniforms=j,this.pointVAO.bind(),G.drawArrays(G.POINTS,0,this.pointCount),this.pointVAO.unbind()}},z.pick=function(he){if(!he||he.id!==this.pickId)return null;for(var G=he.value[0]+256*he.value[1]+65536*he.value[2],$=this.cells[G],J=this.positions,X=new Array($.length),oe=0;oe<$.length;++oe)X[oe]=J[$[oe]];var ie=he.coord[0],j=he.coord[1];if(!this.pickVertex){var ee=this.positions[$[0]],re=this.positions[$[1]],ce=this.positions[$[2]],be=[(ee[0]+re[0]+ce[0])/3,(ee[1]+re[1]+ce[1])/3,(ee[2]+re[2]+ce[2])/3];return{_cellCenter:!0,position:[ie,j],index:G,cell:$,cellId:G,intensity:this.intensity[G],dataCoordinate:be}}var Ae=E(X,[ie*this.pixelRatio,this._resolution[1]-j*this.pixelRatio],this._model,this._view,this._projection,this._resolution);if(!Ae)return null;for(var ze=Ae[2],Re=0,oe=0;oe<$.length;++oe)Re+=ze[oe]*this.intensity[$[oe]];return{position:Ae[1],index:$[Ae[0]],cell:$,cellId:G,intensity:Re,dataCoordinate:this.positions[$[Ae[0]]]}},z.dispose=function(){this.texture.dispose(),this.triShader.dispose(),this.lineShader.dispose(),this.pointShader.dispose(),this.pickShader.dispose(),this.pointPickShader.dispose(),this.triangleVAO.dispose(),this.trianglePositions.dispose(),this.triangleColors.dispose(),this.triangleUVs.dispose(),this.triangleNormals.dispose(),this.triangleIds.dispose(),this.edgeVAO.dispose(),this.edgePositions.dispose(),this.edgeColors.dispose(),this.edgeUVs.dispose(),this.edgeIds.dispose(),this.pointVAO.dispose(),this.pointPositions.dispose(),this.pointColors.dispose(),this.pointUVs.dispose(),this.pointSizes.dispose(),this.pointIds.dispose(),this.contourVAO.dispose(),this.contourPositions.dispose(),this.contourShader.dispose()};function I(he){var G=i(he,y.vertex,y.fragment);return G.attributes.position.location=0,G.attributes.color.location=2,G.attributes.uv.location=3,G.attributes.normal.location=4,G}function N(he){var G=i(he,b.vertex,b.fragment);return G.attributes.position.location=0,G.attributes.color.location=2,G.attributes.uv.location=3,G}function U(he){var G=i(he,p.vertex,p.fragment);return G.attributes.position.location=0,G.attributes.color.location=2,G.attributes.uv.location=3,G.attributes.pointSize.location=4,G}function W(he){var G=i(he,u.vertex,u.fragment);return G.attributes.position.location=0,G.attributes.id.location=1,G}function Q(he){var G=i(he,m.vertex,m.fragment);return G.attributes.position.location=0,G.attributes.id.location=1,G.attributes.pointSize.location=4,G}function ue(he){var G=i(he,h.vertex,h.fragment);return G.attributes.position.location=0,G}function le(he,G){arguments.length===1&&(G=he,he=G.gl);var $=he.getExtension("OES_standard_derivatives")||he.getExtension("MOZ_OES_standard_derivatives")||he.getExtension("WEBKIT_OES_standard_derivatives");if(!$)throw new Error("derivatives not supported");var J=I(he),X=N(he),oe=U(he),ie=W(he),j=Q(he),ee=ue(he),re=c(he,T(new Uint8Array([255,255,255,255]),[1,1,4]));re.generateMipmap(),re.minFilter=he.LINEAR_MIPMAP_LINEAR,re.magFilter=he.LINEAR;var ce=n(he),be=n(he),Ae=n(he),ze=n(he),Re=n(he),Xe=s(he,[{buffer:ce,type:he.FLOAT,size:3},{buffer:Re,type:he.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:be,type:he.FLOAT,size:4},{buffer:Ae,type:he.FLOAT,size:2},{buffer:ze,type:he.FLOAT,size:3}]),it=n(he),ot=n(he),tt=n(he),lt=n(he),Ee=s(he,[{buffer:it,type:he.FLOAT,size:3},{buffer:lt,type:he.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:ot,type:he.FLOAT,size:4},{buffer:tt,type:he.FLOAT,size:2}]),_e=n(he),fe=n(he),Fe=n(he),rt=n(he),st=n(he),Qe=s(he,[{buffer:_e,type:he.FLOAT,size:3},{buffer:st,type:he.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:fe,type:he.FLOAT,size:4},{buffer:Fe,type:he.FLOAT,size:2},{buffer:rt,type:he.FLOAT,size:1}]),Lt=n(he),kt=s(he,[{buffer:Lt,type:he.FLOAT,size:3}]),Vt=new L(he,re,J,X,oe,ie,j,ee,ce,Re,be,Ae,ze,Xe,it,lt,ot,tt,Ee,_e,st,fe,Fe,rt,Qe,Lt,kt);return Vt.update(G),Vt}e.exports=le},4437:function(e,t,r){"use strict";e.exports=f;var o=r(3025),a=r(6296),i=r(351),n=r(8512),s=r(24),c=r(7520);function f(g,v){g=g||document.body,v=v||{};var T=[.01,1/0];"distanceLimits"in v&&(T[0]=v.distanceLimits[0],T[1]=v.distanceLimits[1]),"zoomMin"in v&&(T[0]=v.zoomMin),"zoomMax"in v&&(T[1]=v.zoomMax);var l=a({center:v.center||[0,0,0],up:v.up||[0,1,0],eye:v.eye||[0,0,10],mode:v.mode||"orbit",distanceLimits:T}),_=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],w=0,S=g.clientWidth,E=g.clientHeight,y={keyBindingMode:"rotate",enableWheel:!0,view:l,element:g,delay:v.delay||16,rotateSpeed:v.rotateSpeed||1,zoomSpeed:v.zoomSpeed||1,translateSpeed:v.translateSpeed||1,flipX:!!v.flipX,flipY:!!v.flipY,modes:l.modes,_ortho:v._ortho||v.projection&&v.projection.type==="orthographic"||!1,tick:function(){var b=o(),p=this.delay,u=b-2*p;l.idle(b-p),l.recalcMatrix(u),l.flush(b-(100+p*2));for(var m=!0,h=l.computedMatrix,P=0;P<16;++P)m=m&&_[P]===h[P],_[P]=h[P];var L=g.clientWidth===S&&g.clientHeight===E;return S=g.clientWidth,E=g.clientHeight,m?!L:(w=Math.exp(l.computedRadius[0]),!0)},lookAt:function(b,p,u){l.lookAt(l.lastT(),b,p,u)},rotate:function(b,p,u){l.rotate(l.lastT(),b,p,u)},pan:function(b,p,u){l.pan(l.lastT(),b,p,u)},translate:function(b,p,u){l.translate(l.lastT(),b,p,u)}};return Object.defineProperties(y,{matrix:{get:function(){return l.computedMatrix},set:function(b){return l.setMatrix(l.lastT(),b),l.computedMatrix},enumerable:!0},mode:{get:function(){return l.getMode()},set:function(b){var p=l.computedUp.slice(),u=l.computedEye.slice(),m=l.computedCenter.slice();if(l.setMode(b),b==="turntable"){var h=o();l._active.lookAt(h,u,m,p),l._active.lookAt(h+500,u,m,[0,0,1]),l._active.flush(h)}return l.getMode()},enumerable:!0},center:{get:function(){return l.computedCenter},set:function(b){return l.lookAt(l.lastT(),null,b),l.computedCenter},enumerable:!0},eye:{get:function(){return l.computedEye},set:function(b){return l.lookAt(l.lastT(),b),l.computedEye},enumerable:!0},up:{get:function(){return l.computedUp},set:function(b){return l.lookAt(l.lastT(),null,null,b),l.computedUp},enumerable:!0},distance:{get:function(){return w},set:function(b){return l.setDistance(l.lastT(),b),b},enumerable:!0},distanceLimits:{get:function(){return l.getDistanceLimits(T)},set:function(b){return l.setDistanceLimits(b),b},enumerable:!0}}),g.addEventListener("contextmenu",function(b){return b.preventDefault(),!1}),y._lastX=-1,y._lastY=-1,y._lastMods={shift:!1,control:!1,alt:!1,meta:!1},y.enableMouseListeners=function(){y.mouseListener=i(g,b),g.addEventListener("touchstart",function(p){var u=s(p.changedTouches[0],g);b(0,u[0],u[1],y._lastMods),b(1,u[0],u[1],y._lastMods)},c?{passive:!0}:!1),g.addEventListener("touchmove",function(p){var u=s(p.changedTouches[0],g);b(1,u[0],u[1],y._lastMods),p.preventDefault()},c?{passive:!1}:!1),g.addEventListener("touchend",function(p){b(0,y._lastX,y._lastY,y._lastMods)},c?{passive:!0}:!1);function b(p,u,m,h){var P=y.keyBindingMode;if(P!==!1){var L=P==="rotate",z=P==="pan",F=P==="zoom",B=!!h.control,O=!!h.alt,I=!!h.shift,N=!!(p&1),U=!!(p&2),W=!!(p&4),Q=1/g.clientHeight,ue=Q*(u-y._lastX),le=Q*(m-y._lastY),he=y.flipX?1:-1,G=y.flipY?1:-1,$=Math.PI*y.rotateSpeed,J=o();if(y._lastX!==-1&&y._lastY!==-1&&((L&&N&&!B&&!O&&!I||N&&!B&&!O&&I)&&l.rotate(J,he*$*ue,-G*$*le,0),(z&&N&&!B&&!O&&!I||U||N&&B&&!O&&!I)&&l.pan(J,-y.translateSpeed*ue*w,y.translateSpeed*le*w,0),F&&N&&!B&&!O&&!I||W||N&&!B&&O&&!I)){var X=-y.zoomSpeed*le/window.innerHeight*(J-l.lastT())*100;l.pan(J,0,0,w*(Math.exp(X)-1))}return y._lastX=u,y._lastY=m,y._lastMods=h,!0}}y.wheelListener=n(g,function(p,u){if(y.keyBindingMode!==!1&&y.enableWheel){var m=y.flipX?1:-1,h=y.flipY?1:-1,P=o();if(Math.abs(p)>Math.abs(u))l.rotate(P,0,0,-p*m*Math.PI*y.rotateSpeed/window.innerWidth);else if(!y._ortho){var L=-y.zoomSpeed*h*u/window.innerHeight*(P-l.lastT())/20;l.pan(P,0,0,w*(Math.exp(L)-1))}}},!0)},y.enableMouseListeners(),y}},799:function(e,t,r){var o=r(3236),a=r(9405),i=o([`precision mediump float; #define GLSLIFY 1 attribute vec2 position; varying vec2 uv; void main() { uv = position; gl_Position = vec4(position, 0, 1); }`]),n=o([`precision mediump float; #define GLSLIFY 1 uniform sampler2D accumBuffer; varying vec2 uv; void main() { vec4 accum = texture2D(accumBuffer, 0.5 * (uv + 1.0)); gl_FragColor = min(vec4(1,1,1,1), accum); }`]);e.exports=function(s){return a(s,i,n,null,[{name:"position",type:"vec2"}])}},4100:function(e,t,r){"use strict";var o=r(4437),a=r(3837),i=r(5445),n=r(4449),s=r(3589),c=r(2260),f=r(7169),g=r(351),v=r(4772),T=r(4040),l=r(799),_=r(9216)({tablet:!0,featureDetect:!0});e.exports={createScene:b,createCamera:o};function w(){this.mouse=[-1,-1],this.screen=null,this.distance=1/0,this.index=null,this.dataCoordinate=null,this.dataPosition=null,this.object=null,this.data=null}function S(u,m){var h=null;try{h=u.getContext("webgl",m),h||(h=u.getContext("experimental-webgl",m))}catch{return null}return h}function E(u){var m=Math.round(Math.log(Math.abs(u))/Math.log(10));if(m<0){var h=Math.round(Math.pow(10,-m));return Math.ceil(u*h)/h}else if(m>0){var h=Math.round(Math.pow(10,m));return Math.ceil(u/h)*h}return Math.ceil(u)}function y(u){return typeof u=="boolean"?u:!0}function b(u){u=u||{},u.camera=u.camera||{};var m=u.canvas;if(!m)if(m=document.createElement("canvas"),u.container){var h=u.container;h.appendChild(m)}else document.body.appendChild(m);var P=u.gl;if(P||(u.glOptions&&(_=!!u.glOptions.preserveDrawingBuffer),P=S(m,u.glOptions||{premultipliedAlpha:!0,antialias:!0,preserveDrawingBuffer:_})),!P)throw new Error("webgl not supported");var L=u.bounds||[[-10,-10,-10],[10,10,10]],z=new w,F=c(P,P.drawingBufferWidth,P.drawingBufferHeight,{preferFloat:!_}),B=l(P),O=u.cameraObject&&u.cameraObject._ortho===!0||u.camera.projection&&u.camera.projection.type==="orthographic"||!1,I={eye:u.camera.eye||[2,0,0],center:u.camera.center||[0,0,0],up:u.camera.up||[0,1,0],zoomMin:u.camera.zoomMax||.1,zoomMax:u.camera.zoomMin||100,mode:u.camera.mode||"turntable",_ortho:O},N=u.axes||{},U=a(P,N);U.enable=!N.disable;var W=u.spikes||{},Q=n(P,W),ue=[],le=[],he=[],G=[],$=!0,ie=!0,J=new Array(16),X=new Array(16),oe={view:null,projection:J,model:X,_ortho:!1},ie=!0,j=[P.drawingBufferWidth,P.drawingBufferHeight],ee=u.cameraObject||o(m,I),re={gl:P,contextLost:!1,pixelRatio:u.pixelRatio||1,canvas:m,selection:z,camera:ee,axes:U,axesPixels:null,spikes:Q,bounds:L,objects:ue,shape:j,aspect:u.aspectRatio||[1,1,1],pickRadius:u.pickRadius||10,zNear:u.zNear||.01,zFar:u.zFar||1e3,fovy:u.fovy||Math.PI/4,clearColor:u.clearColor||[0,0,0,0],autoResize:y(u.autoResize),autoBounds:y(u.autoBounds),autoScale:!!u.autoScale,autoCenter:y(u.autoCenter),clipToBounds:y(u.clipToBounds),snapToData:!!u.snapToData,onselect:u.onselect||null,onrender:u.onrender||null,onclick:u.onclick||null,cameraParams:oe,oncontextloss:null,mouseListener:null,_stopped:!1,getAspectratio:function(){return{x:this.aspect[0],y:this.aspect[1],z:this.aspect[2]}},setAspectratio:function(lt){this.aspect[0]=lt.x,this.aspect[1]=lt.y,this.aspect[2]=lt.z,ie=!0},setBounds:function(lt,Ee){this.bounds[0][lt]=Ee.min,this.bounds[1][lt]=Ee.max},setClearColor:function(lt){this.clearColor=lt},clearRGBA:function(){this.gl.clearColor(this.clearColor[0],this.clearColor[1],this.clearColor[2],this.clearColor[3]),this.gl.clear(this.gl.COLOR_BUFFER_BIT|this.gl.DEPTH_BUFFER_BIT)}},ce=[P.drawingBufferWidth/re.pixelRatio|0,P.drawingBufferHeight/re.pixelRatio|0];function be(){if(!re._stopped&&re.autoResize){var lt=m.parentNode,Ee=1,_e=1;lt&<!==document.body?(Ee=lt.clientWidth,_e=lt.clientHeight):(Ee=window.innerWidth,_e=window.innerHeight);var fe=Math.ceil(Ee*re.pixelRatio)|0,Fe=Math.ceil(_e*re.pixelRatio)|0;if(fe!==m.width||Fe!==m.height){m.width=fe,m.height=Fe;var rt=m.style;rt.position=rt.position||"absolute",rt.left="0px",rt.top="0px",rt.width=Ee+"px",rt.height=_e+"px",$=!0}}}re.autoResize&&be(),window.addEventListener("resize",be);function Ae(){for(var lt=ue.length,Ee=G.length,_e=0;_e0&&he[Ee-1]===0;)he.pop(),G.pop().dispose()}re.update=function(lt){re._stopped||(lt=lt||{},$=!0,ie=!0)},re.add=function(lt){re._stopped||(lt.axes=U,ue.push(lt),le.push(-1),$=!0,ie=!0,Ae())},re.remove=function(lt){if(!re._stopped){var Ee=ue.indexOf(lt);Ee<0||(ue.splice(Ee,1),le.pop(),$=!0,ie=!0,Ae())}},re.dispose=function(){if(!re._stopped&&(re._stopped=!0,window.removeEventListener("resize",be),m.removeEventListener("webglcontextlost",ze),re.mouseListener.enabled=!1,!re.contextLost)){U.dispose(),Q.dispose();for(var lt=0;ltz.distance)continue;for(var kt=0;kt1e-6?(_=Math.acos(w),S=Math.sin(_),E=Math.sin((1-i)*_)/S,y=Math.sin(i*_)/S):(E=1-i,y=i),r[0]=E*n+y*g,r[1]=E*s+y*v,r[2]=E*c+y*T,r[3]=E*f+y*l,r}},5964:function(e){"use strict";e.exports=function(t){return!t&&t!==0?"":t.toString()}},9366:function(e,t,r){"use strict";var o=r(4359);e.exports=i;var a={};function i(n,s,c){var f=[s.style,s.weight,s.variant,s.family].join("_"),g=a[f];if(g||(g=a[f]={}),n in g)return g[n];var v={textAlign:"center",textBaseline:"middle",lineHeight:1,font:s.family,fontStyle:s.style,fontWeight:s.weight,fontVariant:s.variant,lineSpacing:1.25,styletags:{breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0}};v.triangles=!0;var T=o(n,v);v.triangles=!1;var l=o(n,v),_,w;if(c&&c!==1){for(_=0;_ max(a, b)) || (p < min(a, b))); } bool outOfRange(vec2 a, vec2 b, vec2 p) { return (outOfRange(a.x, b.x, p.x) || outOfRange(a.y, b.y, p.y)); } bool outOfRange(vec3 a, vec3 b, vec3 p) { return (outOfRange(a.x, b.x, p.x) || outOfRange(a.y, b.y, p.y) || outOfRange(a.z, b.z, p.z)); } bool outOfRange(vec4 a, vec4 b, vec4 p) { return outOfRange(a.xyz, b.xyz, p.xyz); } attribute vec3 position; attribute vec4 color; attribute vec2 glyph; attribute vec4 id; uniform vec4 highlightId; uniform float highlightScale; uniform mat4 model, view, projection; uniform vec3 clipBounds[2]; varying vec4 interpColor; varying vec4 pickId; varying vec3 dataCoordinate; void main() { if (outOfRange(clipBounds[0], clipBounds[1], position)) { gl_Position = vec4(0,0,0,0); } else { float scale = 1.0; if(distance(highlightId, id) < 0.0001) { scale = highlightScale; } vec4 worldPosition = model * vec4(position, 1); vec4 viewPosition = view * worldPosition; viewPosition = viewPosition / viewPosition.w; vec4 clipPosition = projection * (viewPosition + scale * vec4(glyph.x, -glyph.y, 0, 0)); gl_Position = clipPosition; interpColor = color; pickId = id; dataCoordinate = position; } }`]),n=a([`precision highp float; #define GLSLIFY 1 bool outOfRange(float a, float b, float p) { return ((p > max(a, b)) || (p < min(a, b))); } bool outOfRange(vec2 a, vec2 b, vec2 p) { return (outOfRange(a.x, b.x, p.x) || outOfRange(a.y, b.y, p.y)); } bool outOfRange(vec3 a, vec3 b, vec3 p) { return (outOfRange(a.x, b.x, p.x) || outOfRange(a.y, b.y, p.y) || outOfRange(a.z, b.z, p.z)); } bool outOfRange(vec4 a, vec4 b, vec4 p) { return outOfRange(a.xyz, b.xyz, p.xyz); } attribute vec3 position; attribute vec4 color; attribute vec2 glyph; attribute vec4 id; uniform mat4 model, view, projection; uniform vec2 screenSize; uniform vec3 clipBounds[2]; uniform float highlightScale, pixelRatio; uniform vec4 highlightId; varying vec4 interpColor; varying vec4 pickId; varying vec3 dataCoordinate; void main() { if (outOfRange(clipBounds[0], clipBounds[1], position)) { gl_Position = vec4(0,0,0,0); } else { float scale = pixelRatio; if(distance(highlightId.bgr, id.bgr) < 0.001) { scale *= highlightScale; } vec4 worldPosition = model * vec4(position, 1.0); vec4 viewPosition = view * worldPosition; vec4 clipPosition = projection * viewPosition; clipPosition /= clipPosition.w; gl_Position = clipPosition + vec4(screenSize * scale * vec2(glyph.x, -glyph.y), 0.0, 0.0); interpColor = color; pickId = id; dataCoordinate = position; } }`]),s=a([`precision highp float; #define GLSLIFY 1 bool outOfRange(float a, float b, float p) { return ((p > max(a, b)) || (p < min(a, b))); } bool outOfRange(vec2 a, vec2 b, vec2 p) { return (outOfRange(a.x, b.x, p.x) || outOfRange(a.y, b.y, p.y)); } bool outOfRange(vec3 a, vec3 b, vec3 p) { return (outOfRange(a.x, b.x, p.x) || outOfRange(a.y, b.y, p.y) || outOfRange(a.z, b.z, p.z)); } bool outOfRange(vec4 a, vec4 b, vec4 p) { return outOfRange(a.xyz, b.xyz, p.xyz); } attribute vec3 position; attribute vec4 color; attribute vec2 glyph; attribute vec4 id; uniform float highlightScale; uniform vec4 highlightId; uniform vec3 axes[2]; uniform mat4 model, view, projection; uniform vec2 screenSize; uniform vec3 clipBounds[2]; uniform float scale, pixelRatio; varying vec4 interpColor; varying vec4 pickId; varying vec3 dataCoordinate; void main() { if (outOfRange(clipBounds[0], clipBounds[1], position)) { gl_Position = vec4(0,0,0,0); } else { float lscale = pixelRatio * scale; if(distance(highlightId, id) < 0.0001) { lscale *= highlightScale; } vec4 clipCenter = projection * (view * (model * vec4(position, 1))); vec3 dataPosition = position + 0.5*lscale*(axes[0] * glyph.x + axes[1] * glyph.y) * clipCenter.w * screenSize.y; vec4 clipPosition = projection * (view * (model * vec4(dataPosition, 1))); gl_Position = clipPosition; interpColor = color; pickId = id; dataCoordinate = dataPosition; } } `]),c=a([`precision highp float; #define GLSLIFY 1 bool outOfRange(float a, float b, float p) { return ((p > max(a, b)) || (p < min(a, b))); } bool outOfRange(vec2 a, vec2 b, vec2 p) { return (outOfRange(a.x, b.x, p.x) || outOfRange(a.y, b.y, p.y)); } bool outOfRange(vec3 a, vec3 b, vec3 p) { return (outOfRange(a.x, b.x, p.x) || outOfRange(a.y, b.y, p.y) || outOfRange(a.z, b.z, p.z)); } bool outOfRange(vec4 a, vec4 b, vec4 p) { return outOfRange(a.xyz, b.xyz, p.xyz); } uniform vec3 fragClipBounds[2]; uniform float opacity; varying vec4 interpColor; varying vec3 dataCoordinate; void main() { if ( outOfRange(fragClipBounds[0], fragClipBounds[1], dataCoordinate) || interpColor.a * opacity == 0. ) discard; gl_FragColor = interpColor * opacity; } `]),f=a([`precision highp float; #define GLSLIFY 1 bool outOfRange(float a, float b, float p) { return ((p > max(a, b)) || (p < min(a, b))); } bool outOfRange(vec2 a, vec2 b, vec2 p) { return (outOfRange(a.x, b.x, p.x) || outOfRange(a.y, b.y, p.y)); } bool outOfRange(vec3 a, vec3 b, vec3 p) { return (outOfRange(a.x, b.x, p.x) || outOfRange(a.y, b.y, p.y) || outOfRange(a.z, b.z, p.z)); } bool outOfRange(vec4 a, vec4 b, vec4 p) { return outOfRange(a.xyz, b.xyz, p.xyz); } uniform vec3 fragClipBounds[2]; uniform float pickGroup; varying vec4 pickId; varying vec3 dataCoordinate; void main() { if (outOfRange(fragClipBounds[0], fragClipBounds[1], dataCoordinate)) discard; gl_FragColor = vec4(pickGroup, pickId.bgr); }`]),g=[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"glyph",type:"vec2"},{name:"id",type:"vec4"}],v={vertex:i,fragment:c,attributes:g},T={vertex:n,fragment:c,attributes:g},l={vertex:s,fragment:c,attributes:g},_={vertex:i,fragment:f,attributes:g},w={vertex:n,fragment:f,attributes:g},S={vertex:s,fragment:f,attributes:g};function E(y,b){var p=o(y,b),u=p.attributes;return u.position.location=0,u.color.location=1,u.glyph.location=2,u.id.location=3,p}t.createPerspective=function(y){return E(y,v)},t.createOrtho=function(y){return E(y,T)},t.createProject=function(y){return E(y,l)},t.createPickPerspective=function(y){return E(y,_)},t.createPickOrtho=function(y){return E(y,w)},t.createPickProject=function(y){return E(y,S)}},8418:function(e,t,r){"use strict";var o=r(5219),a=r(2762),i=r(8116),n=r(1888),s=r(6760),c=r(1283),f=r(9366),g=r(5964),v=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],T=ArrayBuffer,l=DataView;function _(X){return T.isView(X)&&!(X instanceof l)}function w(X){return Array.isArray(X)||_(X)}e.exports=J;function S(X,oe){var ie=X[0],j=X[1],ee=X[2],re=X[3];return X[0]=oe[0]*ie+oe[4]*j+oe[8]*ee+oe[12]*re,X[1]=oe[1]*ie+oe[5]*j+oe[9]*ee+oe[13]*re,X[2]=oe[2]*ie+oe[6]*j+oe[10]*ee+oe[14]*re,X[3]=oe[3]*ie+oe[7]*j+oe[11]*ee+oe[15]*re,X}function E(X,oe,ie,j){return S(j,j,ie),S(j,j,oe),S(j,j,X)}function y(X,oe){this.index=X,this.dataCoordinate=this.position=oe}function b(X){return X===!0||X>1?1:X}function p(X,oe,ie,j,ee,re,ce,be,Ae,ze,Re,Xe){this.gl=X,this.pixelRatio=1,this.shader=oe,this.orthoShader=ie,this.projectShader=j,this.pointBuffer=ee,this.colorBuffer=re,this.glyphBuffer=ce,this.idBuffer=be,this.vao=Ae,this.vertexCount=0,this.lineVertexCount=0,this.opacity=1,this.hasAlpha=!1,this.lineWidth=0,this.projectScale=[.6666666666666666,.6666666666666666,.6666666666666666],this.projectOpacity=[1,1,1],this.projectHasAlpha=!1,this.pickId=0,this.pickPerspectiveShader=ze,this.pickOrthoShader=Re,this.pickProjectShader=Xe,this.points=[],this._selectResult=new y(0,[0,0,0]),this.useOrtho=!0,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.axesProject=[!0,!0,!0],this.axesBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.highlightId=[1,1,1,1],this.highlightScale=2,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.dirty=!0}var u=p.prototype;u.pickSlots=1,u.setPickBase=function(X){this.pickId=X},u.isTransparent=function(){if(this.hasAlpha)return!0;for(var X=0;X<3;++X)if(this.axesProject[X]&&this.projectHasAlpha)return!0;return!1},u.isOpaque=function(){if(!this.hasAlpha)return!0;for(var X=0;X<3;++X)if(this.axesProject[X]&&!this.projectHasAlpha)return!0;return!1};var m=[0,0],h=[0,0,0],P=[0,0,0],L=[0,0,0,1],z=[0,0,0,1],F=v.slice(),B=[0,0,0],O=[[0,0,0],[0,0,0]];function I(X){return X[0]=X[1]=X[2]=0,X}function N(X,oe){return X[0]=oe[0],X[1]=oe[1],X[2]=oe[2],X[3]=1,X}function U(X,oe,ie,j){return X[0]=oe[0],X[1]=oe[1],X[2]=oe[2],X[ie]=j,X}function W(X){for(var oe=O,ie=0;ie<2;++ie)for(var j=0;j<3;++j)oe[ie][j]=Math.max(Math.min(X[ie][j],1e8),-1e8);return oe}function Q(X,oe,ie,j){var ee=oe.axesProject,re=oe.gl,ce=X.uniforms,be=ie.model||v,Ae=ie.view||v,ze=ie.projection||v,Re=oe.axesBounds,Xe=W(oe.clipBounds),it;oe.axes&&oe.axes.lastCubeProps?it=oe.axes.lastCubeProps.axis:it=[1,1,1],m[0]=2/re.drawingBufferWidth,m[1]=2/re.drawingBufferHeight,X.bind(),ce.view=Ae,ce.projection=ze,ce.screenSize=m,ce.highlightId=oe.highlightId,ce.highlightScale=oe.highlightScale,ce.clipBounds=Xe,ce.pickGroup=oe.pickId/255,ce.pixelRatio=j;for(var ot=0;ot<3;++ot)if(ee[ot]){ce.scale=oe.projectScale[ot],ce.opacity=oe.projectOpacity[ot];for(var tt=F,lt=0;lt<16;++lt)tt[lt]=0;for(var lt=0;lt<4;++lt)tt[5*lt]=1;tt[5*ot]=0,it[ot]<0?tt[12+ot]=Re[0][ot]:tt[12+ot]=Re[1][ot],s(tt,be,tt),ce.model=tt;var Ee=(ot+1)%3,_e=(ot+2)%3,fe=I(h),Fe=I(P);fe[Ee]=1,Fe[_e]=1;var rt=E(ze,Ae,be,N(L,fe)),st=E(ze,Ae,be,N(z,Fe));if(Math.abs(rt[1])>Math.abs(st[1])){var Qe=rt;rt=st,st=Qe,Qe=fe,fe=Fe,Fe=Qe;var Lt=Ee;Ee=_e,_e=Lt}rt[0]<0&&(fe[Ee]=-1),st[1]>0&&(Fe[_e]=-1);for(var kt=0,Vt=0,lt=0;lt<4;++lt)kt+=Math.pow(be[4*Ee+lt],2),Vt+=Math.pow(be[4*_e+lt],2);fe[Ee]/=Math.sqrt(kt),Fe[_e]/=Math.sqrt(Vt),ce.axes[0]=fe,ce.axes[1]=Fe,ce.fragClipBounds[0]=U(B,Xe[0],ot,-1e8),ce.fragClipBounds[1]=U(B,Xe[1],ot,1e8),oe.vao.bind(),oe.vao.draw(re.TRIANGLES,oe.vertexCount),oe.lineWidth>0&&(re.lineWidth(oe.lineWidth*j),oe.vao.draw(re.LINES,oe.lineVertexCount,oe.vertexCount)),oe.vao.unbind()}}var ue=[-1e8,-1e8,-1e8],le=[1e8,1e8,1e8],he=[ue,le];function G(X,oe,ie,j,ee,re,ce){var be=ie.gl;if((re===ie.projectHasAlpha||ce)&&Q(oe,ie,j,ee),re===ie.hasAlpha||ce){X.bind();var Ae=X.uniforms;Ae.model=j.model||v,Ae.view=j.view||v,Ae.projection=j.projection||v,m[0]=2/be.drawingBufferWidth,m[1]=2/be.drawingBufferHeight,Ae.screenSize=m,Ae.highlightId=ie.highlightId,Ae.highlightScale=ie.highlightScale,Ae.fragClipBounds=he,Ae.clipBounds=ie.axes.bounds,Ae.opacity=ie.opacity,Ae.pickGroup=ie.pickId/255,Ae.pixelRatio=ee,ie.vao.bind(),ie.vao.draw(be.TRIANGLES,ie.vertexCount),ie.lineWidth>0&&(be.lineWidth(ie.lineWidth*ee),ie.vao.draw(be.LINES,ie.lineVertexCount,ie.vertexCount)),ie.vao.unbind()}}u.draw=function(X){var oe=this.useOrtho?this.orthoShader:this.shader;G(oe,this.projectShader,this,X,this.pixelRatio,!1,!1)},u.drawTransparent=function(X){var oe=this.useOrtho?this.orthoShader:this.shader;G(oe,this.projectShader,this,X,this.pixelRatio,!0,!1)},u.drawPick=function(X){var oe=this.useOrtho?this.pickOrthoShader:this.pickPerspectiveShader;G(oe,this.pickProjectShader,this,X,1,!0,!0)},u.pick=function(X){if(!X||X.id!==this.pickId)return null;var oe=X.value[2]+(X.value[1]<<8)+(X.value[0]<<16);if(oe>=this.pointCount||oe<0)return null;var ie=this.points[oe],j=this._selectResult;j.index=oe;for(var ee=0;ee<3;++ee)j.position[ee]=j.dataCoordinate[ee]=ie[ee];return j},u.highlight=function(X){if(!X)this.highlightId=[1,1,1,1];else{var oe=X.index,ie=oe&255,j=oe>>8&255,ee=oe>>16&255;this.highlightId=[ie/255,j/255,ee/255,0]}};function $(X,oe,ie,j){var ee;w(X)?oe0){var Ir=0,bt=_e,Be=[0,0,0,1],Ke=[0,0,0,1],Ue=w(it)&&w(it[0]),Me=w(lt)&&w(lt[0]);e:for(var j=0;j0?1-Vt[0][0]:Tt<0?1+Vt[1][0]:1,Ot*=Ot>0?1-Vt[0][1]:Ot<0?1+Vt[1][1]:1;for(var Gt=[Tt,Ot],Ua=Lt.cells||[],Ba=Lt.positions||[],st=0;stthis.buffer.length){a.free(this.buffer);for(var w=this.buffer=a.mallocUint8(n(_*l*4)),S=0;S<_*l*4;++S)w[S]=255}return T}}}),g.begin=function(){var T=this.gl,l=this.shape;T&&(this.fbo.bind(),T.clearColor(1,1,1,1),T.clear(T.COLOR_BUFFER_BIT|T.DEPTH_BUFFER_BIT))},g.end=function(){var T=this.gl;T&&(T.bindFramebuffer(T.FRAMEBUFFER,null),this._readTimeout||clearTimeout(this._readTimeout),this._readTimeout=setTimeout(this._readCallback,1))},g.query=function(T,l,_){if(!this.gl)return null;var w=this.fbo.shape.slice();T=T|0,l=l|0,typeof _!="number"&&(_=1);var S=Math.min(Math.max(T-_,0),w[0])|0,E=Math.min(Math.max(T+_,0),w[0])|0,y=Math.min(Math.max(l-_,0),w[1])|0,b=Math.min(Math.max(l+_,0),w[1])|0;if(E<=S||b<=y)return null;var p=[E-S,b-y],u=i(this.buffer,[p[0],p[1],4],[4,w[0]*4,1],4*(S+w[0]*y)),m=s(u.hi(p[0],p[1],1),_,_),h=m[0],P=m[1];if(h<0||Math.pow(this.radius,2)w)for(l=w;l<_;l++)this.gl.enableVertexAttribArray(l);else if(w>_)for(l=_;l=0){for(var O=B.type.charAt(B.type.length-1)|0,I=new Array(O),N=0;N=0;)U+=1;z[F]=U}var W=new Array(w.length);function Q(){y.program=n.program(b,y._vref,y._fref,L,z);for(var ue=0;ue=0){var u=b.charCodeAt(b.length-1)-48;if(u<2||u>4)throw new o("","Invalid data type for attribute "+y+": "+b);s(g,v,p[0],l,u,_,y)}else if(b.indexOf("mat")>=0){var u=b.charCodeAt(b.length-1)-48;if(u<2||u>4)throw new o("","Invalid data type for attribute "+y+": "+b);c(g,v,p,l,u,_,y)}else throw new o("","Unknown data type for attribute "+y+": "+b);break}}return _}},3327:function(e,t,r){"use strict";var o=r(216),a=r(8866);e.exports=s;function i(c){return function(){return c}}function n(c,f){for(var g=new Array(c),v=0;v4)throw new a("","Invalid data type");switch(U.charAt(0)){case"b":case"i":c["uniform"+W+"iv"](v[z],F);break;case"v":c["uniform"+W+"fv"](v[z],F);break;default:throw new a("","Unrecognized data type for vector "+name+": "+U)}}else if(U.indexOf("mat")===0&&U.length===4){if(W=U.charCodeAt(U.length-1)-48,W<2||W>4)throw new a("","Invalid uniform dimension type for matrix "+name+": "+U);c["uniformMatrix"+W+"fv"](v[z],!1,F);break}else throw new a("","Unknown uniform data type for "+name+": "+U)}}}}}function _(b,p){if(typeof p!="object")return[[b,p]];var u=[];for(var m in p){var h=p[m],P=b;parseInt(m)+""===m?P+="["+m+"]":P+="."+m,typeof h=="object"?u.push.apply(u,_(P,h)):u.push([P,h])}return u}function w(b){switch(b){case"bool":return!1;case"int":case"sampler2D":case"samplerCube":return 0;case"float":return 0;default:var p=b.indexOf("vec");if(0<=p&&p<=1&&b.length===4+p){var u=b.charCodeAt(b.length-1)-48;if(u<2||u>4)throw new a("","Invalid data type");return b.charAt(0)==="b"?n(u,!1):n(u,0)}else if(b.indexOf("mat")===0&&b.length===4){var u=b.charCodeAt(b.length-1)-48;if(u<2||u>4)throw new a("","Invalid uniform dimension type for matrix "+name+": "+b);return n(u*u,0)}else throw new a("","Unknown uniform data type for "+name+": "+b)}}function S(b,p,u){if(typeof u=="object"){var m=E(u);Object.defineProperty(b,p,{get:i(m),set:l(u),enumerable:!0,configurable:!1})}else v[u]?Object.defineProperty(b,p,{get:T(u),set:l(u),enumerable:!0,configurable:!1}):b[p]=w(g[u].type)}function E(b){var p;if(Array.isArray(b)){p=new Array(b.length);for(var u=0;u1){g[0]in c||(c[g[0]]=[]),c=c[g[0]];for(var v=1;v1)for(var _=0;_"u"?r(606):WeakMap,n=new i,s=0;function c(S,E,y,b,p,u,m){this.id=S,this.src=E,this.type=y,this.shader=b,this.count=u,this.programs=[],this.cache=m}c.prototype.dispose=function(){if(--this.count===0){for(var S=this.cache,E=S.gl,y=this.programs,b=0,p=y.length;b 0 U ||b|| > 0. // Assign z = 0, x = -b, y = a: // a*-b + b*a + c*0 = -ba + ba + 0 = 0 if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) { return normalize(vec3(-v.y, v.x, 0.0)); } else { return normalize(vec3(0.0, v.z, -v.y)); } } // Calculate the tube vertex and normal at the given index. // // The returned vertex is for a tube ring with its center at origin, radius of length(d), pointing in the direction of d. // // Each tube segment is made up of a ring of vertices. // These vertices are used to make up the triangles of the tube by connecting them together in the vertex array. // The indexes of tube segments run from 0 to 8. // vec3 getTubePosition(vec3 d, float index, out vec3 normal) { float segmentCount = 8.0; float angle = 2.0 * 3.14159 * (index / segmentCount); vec3 u = getOrthogonalVector(d); vec3 v = normalize(cross(u, d)); vec3 x = u * cos(angle) * length(d); vec3 y = v * sin(angle) * length(d); vec3 v3 = x + y; normal = normalize(v3); return v3; } attribute vec4 vector; attribute vec4 color, position; attribute vec2 uv; uniform float vectorScale, tubeScale; uniform mat4 model, view, projection, inverseModel; uniform vec3 eyePosition, lightPosition; varying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position; varying vec4 f_color; varying vec2 f_uv; void main() { // Scale the vector magnitude to stay constant with // model & view changes. vec3 normal; vec3 XYZ = getTubePosition(mat3(model) * (tubeScale * vector.w * normalize(vector.xyz)), position.w, normal); vec4 tubePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0); //Lighting geometry parameters vec4 cameraCoordinate = view * tubePosition; cameraCoordinate.xyz /= cameraCoordinate.w; f_lightDirection = lightPosition - cameraCoordinate.xyz; f_eyeDirection = eyePosition - cameraCoordinate.xyz; f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz); // vec4 m_position = model * vec4(tubePosition, 1.0); vec4 t_position = view * tubePosition; gl_Position = projection * t_position; f_color = color; f_data = tubePosition.xyz; f_position = position.xyz; f_uv = uv; } `]),i=o([`#extension GL_OES_standard_derivatives : enable precision highp float; #define GLSLIFY 1 float beckmannDistribution(float x, float roughness) { float NdotH = max(x, 0.0001); float cos2Alpha = NdotH * NdotH; float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha; float roughness2 = roughness * roughness; float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha; return exp(tan2Alpha / roughness2) / denom; } float cookTorranceSpecular( vec3 lightDirection, vec3 viewDirection, vec3 surfaceNormal, float roughness, float fresnel) { float VdotN = max(dot(viewDirection, surfaceNormal), 0.0); float LdotN = max(dot(lightDirection, surfaceNormal), 0.0); //Half angle vector vec3 H = normalize(lightDirection + viewDirection); //Geometric term float NdotH = max(dot(surfaceNormal, H), 0.0); float VdotH = max(dot(viewDirection, H), 0.000001); float LdotH = max(dot(lightDirection, H), 0.000001); float G1 = (2.0 * NdotH * VdotN) / VdotH; float G2 = (2.0 * NdotH * LdotN) / LdotH; float G = min(1.0, min(G1, G2)); //Distribution term float D = beckmannDistribution(NdotH, roughness); //Fresnel term float F = pow(1.0 - VdotN, fresnel); //Multiply terms and done return G * F * D / max(3.14159265 * VdotN, 0.000001); } bool outOfRange(float a, float b, float p) { return ((p > max(a, b)) || (p < min(a, b))); } bool outOfRange(vec2 a, vec2 b, vec2 p) { return (outOfRange(a.x, b.x, p.x) || outOfRange(a.y, b.y, p.y)); } bool outOfRange(vec3 a, vec3 b, vec3 p) { return (outOfRange(a.x, b.x, p.x) || outOfRange(a.y, b.y, p.y) || outOfRange(a.z, b.z, p.z)); } bool outOfRange(vec4 a, vec4 b, vec4 p) { return outOfRange(a.xyz, b.xyz, p.xyz); } uniform vec3 clipBounds[2]; uniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity; uniform sampler2D texture; varying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position; varying vec4 f_color; varying vec2 f_uv; void main() { if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard; vec3 N = normalize(f_normal); vec3 L = normalize(f_lightDirection); vec3 V = normalize(f_eyeDirection); if(gl_FrontFacing) { N = -N; } float specular = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel))); float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0); vec4 surfaceColor = f_color * texture2D(texture, f_uv); vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0); gl_FragColor = litColor * opacity; } `]),n=o([`precision highp float; precision highp float; #define GLSLIFY 1 vec3 getOrthogonalVector(vec3 v) { // Return up-vector for only-z vector. // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0). // From the above if-statement we have ||a|| > 0 U ||b|| > 0. // Assign z = 0, x = -b, y = a: // a*-b + b*a + c*0 = -ba + ba + 0 = 0 if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) { return normalize(vec3(-v.y, v.x, 0.0)); } else { return normalize(vec3(0.0, v.z, -v.y)); } } // Calculate the tube vertex and normal at the given index. // // The returned vertex is for a tube ring with its center at origin, radius of length(d), pointing in the direction of d. // // Each tube segment is made up of a ring of vertices. // These vertices are used to make up the triangles of the tube by connecting them together in the vertex array. // The indexes of tube segments run from 0 to 8. // vec3 getTubePosition(vec3 d, float index, out vec3 normal) { float segmentCount = 8.0; float angle = 2.0 * 3.14159 * (index / segmentCount); vec3 u = getOrthogonalVector(d); vec3 v = normalize(cross(u, d)); vec3 x = u * cos(angle) * length(d); vec3 y = v * sin(angle) * length(d); vec3 v3 = x + y; normal = normalize(v3); return v3; } attribute vec4 vector; attribute vec4 position; attribute vec4 id; uniform mat4 model, view, projection; uniform float tubeScale; varying vec3 f_position; varying vec4 f_id; void main() { vec3 normal; vec3 XYZ = getTubePosition(mat3(model) * (tubeScale * vector.w * normalize(vector.xyz)), position.w, normal); vec4 tubePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0); gl_Position = projection * (view * tubePosition); f_id = id; f_position = position.xyz; } `]),s=o([`precision highp float; #define GLSLIFY 1 bool outOfRange(float a, float b, float p) { return ((p > max(a, b)) || (p < min(a, b))); } bool outOfRange(vec2 a, vec2 b, vec2 p) { return (outOfRange(a.x, b.x, p.x) || outOfRange(a.y, b.y, p.y)); } bool outOfRange(vec3 a, vec3 b, vec3 p) { return (outOfRange(a.x, b.x, p.x) || outOfRange(a.y, b.y, p.y) || outOfRange(a.z, b.z, p.z)); } bool outOfRange(vec4 a, vec4 b, vec4 p) { return outOfRange(a.xyz, b.xyz, p.xyz); } uniform vec3 clipBounds[2]; uniform float pickId; varying vec3 f_position; varying vec4 f_id; void main() { if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard; gl_FragColor = vec4(pickId, f_id.xyz); }`]);t.meshShader={vertex:a,fragment:i,attributes:[{name:"position",type:"vec4"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"vector",type:"vec4"}]},t.pickShader={vertex:n,fragment:s,attributes:[{name:"position",type:"vec4"},{name:"id",type:"vec4"},{name:"vector",type:"vec4"}]}},7815:function(e,t,r){"use strict";var o=r(2931),a=r(9970),i=["xyz","xzy","yxz","yzx","zxy","zyx"],n=function(S,E,y,b){for(var p=S.points,u=S.velocities,m=S.divergences,h=[],P=[],L=[],z=[],F=[],B=[],O=0,I=0,N=a.create(),U=a.create(),W=8,Q=0;Q0)for(var G=0;GE)return b-1}return b},f=function(S,E,y){return Sy?y:S},g=function(S,E,y){var b=E.vectors,p=E.meshgrid,u=S[0],m=S[1],h=S[2],P=p[0].length,L=p[1].length,z=p[2].length,F=c(p[0],u),B=c(p[1],m),O=c(p[2],h),I=F+1,N=B+1,U=O+1;if(F=f(F,0,P-1),I=f(I,0,P-1),B=f(B,0,L-1),N=f(N,0,L-1),O=f(O,0,z-1),U=f(U,0,z-1),F<0||B<0||O<0||I>P-1||N>L-1||U>z-1)return o.create();var W=p[0][F],Q=p[0][I],ue=p[1][B],le=p[1][N],he=p[2][O],G=p[2][U],$=(u-W)/(Q-W),J=(m-ue)/(le-ue),X=(h-he)/(G-he);isFinite($)||($=.5),isFinite(J)||(J=.5),isFinite(X)||(X=.5);var oe,ie,j,ee,re,ce;switch(y.reversedX&&(F=P-1-F,I=P-1-I),y.reversedY&&(B=L-1-B,N=L-1-N),y.reversedZ&&(O=z-1-O,U=z-1-U),y.filled){case 5:re=O,ce=U,j=B*z,ee=N*z,oe=F*z*L,ie=I*z*L;break;case 4:re=O,ce=U,oe=F*z,ie=I*z,j=B*z*P,ee=N*z*P;break;case 3:j=B,ee=N,re=O*L,ce=U*L,oe=F*L*z,ie=I*L*z;break;case 2:j=B,ee=N,oe=F*L,ie=I*L,re=O*L*P,ce=U*L*P;break;case 1:oe=F,ie=I,re=O*P,ce=U*P,j=B*P*z,ee=N*P*z;break;default:oe=F,ie=I,j=B*P,ee=N*P,re=O*P*L,ce=U*P*L;break}var be=b[oe+j+re],Ae=b[oe+j+ce],ze=b[oe+ee+re],Re=b[oe+ee+ce],Xe=b[ie+j+re],it=b[ie+j+ce],ot=b[ie+ee+re],tt=b[ie+ee+ce],lt=o.create(),Ee=o.create(),_e=o.create(),fe=o.create();o.lerp(lt,be,Xe,$),o.lerp(Ee,Ae,it,$),o.lerp(_e,ze,ot,$),o.lerp(fe,Re,tt,$);var Fe=o.create(),rt=o.create();o.lerp(Fe,lt,_e,J),o.lerp(rt,Ee,fe,J);var st=o.create();return o.lerp(st,Fe,rt,X),st},v=function(S,E){var y=E[0],b=E[1],p=E[2];return S[0]=y<0?-y:y,S[1]=b<0?-b:b,S[2]=p<0?-p:p,S},T=function(S){var E=1/0;S.sort(function(u,m){return u-m});for(var y=S.length,b=1;bI||ttN||ltU)},Q=o.distance(E[0],E[1]),ue=10*Q/b,le=ue*ue,he=1,G=0,$=y.length;$>1&&(he=l(y));for(var J=0;J<$;J++){var X=o.create();o.copy(X,y[J]);var oe=[X],ie=[],j=P(X),ee=X;ie.push(j);var re=[],ce=L(X,j),be=o.length(ce);isFinite(be)&&be>G&&(G=be),re.push(be),z.push({points:oe,velocities:ie,divergences:re});for(var Ae=0;Aele&&o.scale(ze,ze,ue/Math.sqrt(Re)),o.add(ze,ze,X),j=P(ze),o.squaredDistance(ee,ze)-le>-1e-4*le){oe.push(ze),ee=ze,ie.push(j);var ce=L(ze,j),be=o.length(ce);isFinite(be)&&be>G&&(G=be),re.push(be)}X=ze}}var Xe=s(z,S.colormap,G,he);return u?Xe.tubeScale=u:(G===0&&(G=1),Xe.tubeScale=p*.5*he/G),Xe};var _=r(6740),w=r(6405).createMesh;e.exports.createTubeMesh=function(S,E){return w(S,E,{shaders:_,traceType:"streamtube"})}},990:function(e,t,r){var o=r(9405),a=r(3236),i=a([`precision highp float; #define GLSLIFY 1 attribute vec4 uv; attribute vec3 f; attribute vec3 normal; uniform vec3 objectOffset; uniform mat4 model, view, projection, inverseModel; uniform vec3 lightPosition, eyePosition; uniform sampler2D colormap; varying float value, kill; varying vec3 worldCoordinate; varying vec2 planeCoordinate; varying vec3 lightDirection, eyeDirection, surfaceNormal; varying vec4 vColor; void main() { vec3 localCoordinate = vec3(uv.zw, f.x); worldCoordinate = objectOffset + localCoordinate; mat4 objectOffsetTranslation = mat4(1.0) + mat4(vec4(0), vec4(0), vec4(0), vec4(objectOffset, 0)); vec4 worldPosition = (model * objectOffsetTranslation) * vec4(localCoordinate, 1.0); vec4 clipPosition = projection * (view * worldPosition); gl_Position = clipPosition; kill = f.y; value = f.z; planeCoordinate = uv.xy; vColor = texture2D(colormap, vec2(value, value)); //Lighting geometry parameters vec4 cameraCoordinate = view * worldPosition; cameraCoordinate.xyz /= cameraCoordinate.w; lightDirection = lightPosition - cameraCoordinate.xyz; eyeDirection = eyePosition - cameraCoordinate.xyz; surfaceNormal = normalize((vec4(normal,0) * inverseModel).xyz); } `]),n=a([`precision highp float; #define GLSLIFY 1 float beckmannDistribution(float x, float roughness) { float NdotH = max(x, 0.0001); float cos2Alpha = NdotH * NdotH; float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha; float roughness2 = roughness * roughness; float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha; return exp(tan2Alpha / roughness2) / denom; } float beckmannSpecular( vec3 lightDirection, vec3 viewDirection, vec3 surfaceNormal, float roughness) { return beckmannDistribution(dot(surfaceNormal, normalize(lightDirection + viewDirection)), roughness); } bool outOfRange(float a, float b, float p) { return ((p > max(a, b)) || (p < min(a, b))); } bool outOfRange(vec2 a, vec2 b, vec2 p) { return (outOfRange(a.x, b.x, p.x) || outOfRange(a.y, b.y, p.y)); } bool outOfRange(vec3 a, vec3 b, vec3 p) { return (outOfRange(a.x, b.x, p.x) || outOfRange(a.y, b.y, p.y) || outOfRange(a.z, b.z, p.z)); } bool outOfRange(vec4 a, vec4 b, vec4 p) { return outOfRange(a.xyz, b.xyz, p.xyz); } uniform vec3 lowerBound, upperBound; uniform float contourTint; uniform vec4 contourColor; uniform sampler2D colormap; uniform vec3 clipBounds[2]; uniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity; uniform float vertexColor; varying float value, kill; varying vec3 worldCoordinate; varying vec3 lightDirection, eyeDirection, surfaceNormal; varying vec4 vColor; void main() { if ( kill > 0.0 || vColor.a == 0.0 || outOfRange(clipBounds[0], clipBounds[1], worldCoordinate) ) discard; vec3 N = normalize(surfaceNormal); vec3 V = normalize(eyeDirection); vec3 L = normalize(lightDirection); if(gl_FrontFacing) { N = -N; } float specular = max(beckmannSpecular(L, V, N, roughness), 0.); float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0); //decide how to interpolate color \u2014 in vertex or in fragment vec4 surfaceColor = step(vertexColor, .5) * texture2D(colormap, vec2(value, value)) + step(.5, vertexColor) * vColor; vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0); gl_FragColor = mix(litColor, contourColor, contourTint) * opacity; } `]),s=a([`precision highp float; #define GLSLIFY 1 attribute vec4 uv; attribute float f; uniform vec3 objectOffset; uniform mat3 permutation; uniform mat4 model, view, projection; uniform float height, zOffset; uniform sampler2D colormap; varying float value, kill; varying vec3 worldCoordinate; varying vec2 planeCoordinate; varying vec3 lightDirection, eyeDirection, surfaceNormal; varying vec4 vColor; void main() { vec3 dataCoordinate = permutation * vec3(uv.xy, height); worldCoordinate = objectOffset + dataCoordinate; mat4 objectOffsetTranslation = mat4(1.0) + mat4(vec4(0), vec4(0), vec4(0), vec4(objectOffset, 0)); vec4 worldPosition = (model * objectOffsetTranslation) * vec4(dataCoordinate, 1.0); vec4 clipPosition = projection * (view * worldPosition); clipPosition.z += zOffset; gl_Position = clipPosition; value = f + objectOffset.z; kill = -1.0; planeCoordinate = uv.zw; vColor = texture2D(colormap, vec2(value, value)); //Don't do lighting for contours surfaceNormal = vec3(1,0,0); eyeDirection = vec3(0,1,0); lightDirection = vec3(0,0,1); } `]),c=a([`precision highp float; #define GLSLIFY 1 bool outOfRange(float a, float b, float p) { return ((p > max(a, b)) || (p < min(a, b))); } bool outOfRange(vec2 a, vec2 b, vec2 p) { return (outOfRange(a.x, b.x, p.x) || outOfRange(a.y, b.y, p.y)); } bool outOfRange(vec3 a, vec3 b, vec3 p) { return (outOfRange(a.x, b.x, p.x) || outOfRange(a.y, b.y, p.y) || outOfRange(a.z, b.z, p.z)); } bool outOfRange(vec4 a, vec4 b, vec4 p) { return outOfRange(a.xyz, b.xyz, p.xyz); } uniform vec2 shape; uniform vec3 clipBounds[2]; uniform float pickId; varying float value, kill; varying vec3 worldCoordinate; varying vec2 planeCoordinate; varying vec3 surfaceNormal; vec2 splitFloat(float v) { float vh = 255.0 * v; float upper = floor(vh); float lower = fract(vh); return vec2(upper / 255.0, floor(lower * 16.0) / 16.0); } void main() { if ((kill > 0.0) || (outOfRange(clipBounds[0], clipBounds[1], worldCoordinate))) discard; vec2 ux = splitFloat(planeCoordinate.x / shape.x); vec2 uy = splitFloat(planeCoordinate.y / shape.y); gl_FragColor = vec4(pickId, ux.x, uy.x, ux.y + (uy.y/16.0)); } `]);t.createShader=function(f){var g=o(f,i,n,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return g.attributes.uv.location=0,g.attributes.f.location=1,g.attributes.normal.location=2,g},t.createPickShader=function(f){var g=o(f,i,c,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return g.attributes.uv.location=0,g.attributes.f.location=1,g.attributes.normal.location=2,g},t.createContourShader=function(f){var g=o(f,s,n,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return g.attributes.uv.location=0,g.attributes.f.location=1,g},t.createPickContourShader=function(f){var g=o(f,s,c,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return g.attributes.uv.location=0,g.attributes.f.location=1,g}},9499:function(e,t,r){"use strict";e.exports=oe;var o=r(8828),a=r(2762),i=r(8116),n=r(7766),s=r(1888),c=r(6729),f=r(5298),g=r(9994),v=r(9618),T=r(3711),l=r(6760),_=r(7608),w=r(2478),S=r(6199),E=r(990),y=E.createShader,b=E.createContourShader,p=E.createPickShader,u=E.createPickContourShader,m=4*10,h=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],P=[[0,0],[0,1],[1,0],[1,1],[1,0],[0,1]],L=[[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0]];(function(){for(var ie=0;ie<3;++ie){var j=L[ie],ee=(ie+1)%3,re=(ie+2)%3;j[ee+0]=1,j[re+3]=1,j[ie+6]=1}})();function z(ie,j,ee,re,ce){this.position=ie,this.index=j,this.uv=ee,this.level=re,this.dataCoordinate=ce}var F=256;function B(ie,j,ee,re,ce,be,Ae,ze,Re,Xe,it,ot,tt,lt,Ee){this.gl=ie,this.shape=j,this.bounds=ee,this.objectOffset=Ee,this.intensityBounds=[],this._shader=re,this._pickShader=ce,this._coordinateBuffer=be,this._vao=Ae,this._colorMap=ze,this._contourShader=Re,this._contourPickShader=Xe,this._contourBuffer=it,this._contourVAO=ot,this._contourOffsets=[[],[],[]],this._contourCounts=[[],[],[]],this._vertexCount=0,this._pickResult=new z([0,0,0],[0,0],[0,0],[0,0,0],[0,0,0]),this._dynamicBuffer=tt,this._dynamicVAO=lt,this._dynamicOffsets=[0,0,0],this._dynamicCounts=[0,0,0],this.contourWidth=[1,1,1],this.contourLevels=[[1],[1],[1]],this.contourTint=[0,0,0],this.contourColor=[[.5,.5,.5,1],[.5,.5,.5,1],[.5,.5,.5,1]],this.showContour=!0,this.showSurface=!0,this.enableHighlight=[!0,!0,!0],this.highlightColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.highlightTint=[1,1,1],this.highlightLevel=[-1,-1,-1],this.enableDynamic=[!0,!0,!0],this.dynamicLevel=[NaN,NaN,NaN],this.dynamicColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.dynamicTint=[1,1,1],this.dynamicWidth=[1,1,1],this.axesBounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.surfaceProject=[!1,!1,!1],this.contourProject=[[!1,!1,!1],[!1,!1,!1],[!1,!1,!1]],this.colorBounds=[!1,!1],this._field=[v(s.mallocFloat(1024),[0,0]),v(s.mallocFloat(1024),[0,0]),v(s.mallocFloat(1024),[0,0])],this.pickId=1,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.snapToData=!1,this.pixelRatio=1,this.opacity=1,this.lightPosition=[10,1e4,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.vertexColor=0,this.dirty=!0}var O=B.prototype;O.genColormap=function(ie,j){var ee=!1,re=g([c({colormap:ie,nshades:F,format:"rgba"}).map(function(ce,be){var Ae=j?I(be/255,j):ce[3];return Ae<1&&(ee=!0),[ce[0],ce[1],ce[2],255*Ae]})]);return f.divseq(re,255),this.hasAlphaScale=ee,re},O.isTransparent=function(){return this.opacity<1||this.hasAlphaScale},O.isOpaque=function(){return!this.isTransparent()},O.pickSlots=1,O.setPickBase=function(ie){this.pickId=ie};function I(ie,j){if(!j||!j.length)return 1;for(var ee=0;eeie&&ee>0){var re=(j[ee][0]-ie)/(j[ee][0]-j[ee-1][0]);return j[ee][1]*(1-re)+re*j[ee-1][1]}}return 1}var N=[0,0,0],U={showSurface:!1,showContour:!1,projections:[h.slice(),h.slice(),h.slice()],clipBounds:[[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]]]};function W(ie,j){var ee,re,ce,be=j.axes&&j.axes.lastCubeProps.axis||N,Ae=j.showSurface,ze=j.showContour;for(ee=0;ee<3;++ee)for(Ae=Ae||j.surfaceProject[ee],re=0;re<3;++re)ze=ze||j.contourProject[ee][re];for(ee=0;ee<3;++ee){var Re=U.projections[ee];for(re=0;re<16;++re)Re[re]=0;for(re=0;re<4;++re)Re[5*re]=1;Re[5*ee]=0,Re[12+ee]=j.axesBounds[+(be[ee]>0)][ee],l(Re,ie.model,Re);var Xe=U.clipBounds[ee];for(ce=0;ce<2;++ce)for(re=0;re<3;++re)Xe[ce][re]=ie.clipBounds[ce][re];Xe[0][ee]=-1e8,Xe[1][ee]=1e8}return U.showSurface=Ae,U.showContour=ze,U}var Q={model:h,view:h,projection:h,inverseModel:h.slice(),lowerBound:[0,0,0],upperBound:[0,0,0],colorMap:0,clipBounds:[[0,0,0],[0,0,0]],height:0,contourTint:0,contourColor:[0,0,0,1],permutation:[1,0,0,0,1,0,0,0,1],zOffset:-1e-4,objectOffset:[0,0,0],kambient:1,kdiffuse:1,kspecular:1,lightPosition:[1e3,1e3,1e3],eyePosition:[0,0,0],roughness:1,fresnel:1,opacity:1,vertexColor:0},ue=h.slice(),le=[1,0,0,0,1,0,0,0,1];function he(ie,j){ie=ie||{};var ee=this.gl;ee.disable(ee.CULL_FACE),this._colorMap.bind(0);var re=Q;re.model=ie.model||h,re.view=ie.view||h,re.projection=ie.projection||h,re.lowerBound=[this.bounds[0][0],this.bounds[0][1],this.colorBounds[0]||this.bounds[0][2]],re.upperBound=[this.bounds[1][0],this.bounds[1][1],this.colorBounds[1]||this.bounds[1][2]],re.objectOffset=this.objectOffset,re.contourColor=this.contourColor[0],re.inverseModel=_(re.inverseModel,re.model);for(var ce=0;ce<2;++ce)for(var be=re.clipBounds[ce],Ae=0;Ae<3;++Ae)be[Ae]=Math.min(Math.max(this.clipBounds[ce][Ae],-1e8),1e8);re.kambient=this.ambientLight,re.kdiffuse=this.diffuseLight,re.kspecular=this.specularLight,re.roughness=this.roughness,re.fresnel=this.fresnel,re.opacity=this.opacity,re.height=0,re.permutation=le,re.vertexColor=this.vertexColor;var ze=ue;for(l(ze,re.view,re.model),l(ze,re.projection,ze),_(ze,ze),ce=0;ce<3;++ce)re.eyePosition[ce]=ze[12+ce]/ze[15];var Re=ze[15];for(ce=0;ce<3;++ce)Re+=this.lightPosition[ce]*ze[4*ce+3];for(ce=0;ce<3;++ce){var Xe=ze[12+ce];for(Ae=0;Ae<3;++Ae)Xe+=ze[4*Ae+ce]*this.lightPosition[Ae];re.lightPosition[ce]=Xe/Re}var it=W(re,this);if(it.showSurface){for(this._shader.bind(),this._shader.uniforms=re,this._vao.bind(),this.showSurface&&this._vertexCount&&this._vao.draw(ee.TRIANGLES,this._vertexCount),ce=0;ce<3;++ce)!this.surfaceProject[ce]||!this.vertexCount||(this._shader.uniforms.model=it.projections[ce],this._shader.uniforms.clipBounds=it.clipBounds[ce],this._vao.draw(ee.TRIANGLES,this._vertexCount));this._vao.unbind()}if(it.showContour){var ot=this._contourShader;re.kambient=1,re.kdiffuse=0,re.kspecular=0,re.opacity=1,ot.bind(),ot.uniforms=re;var tt=this._contourVAO;for(tt.bind(),ce=0;ce<3;++ce)for(ot.uniforms.permutation=L[ce],ee.lineWidth(this.contourWidth[ce]*this.pixelRatio),Ae=0;Ae>4)/16)/255,ce=Math.floor(re),be=re-ce,Ae=j[1]*(ie.value[1]+(ie.value[2]&15)/16)/255,ze=Math.floor(Ae),Re=Ae-ze;ce+=1,ze+=1;var Xe=ee.position;Xe[0]=Xe[1]=Xe[2]=0;for(var it=0;it<2;++it)for(var ot=it?be:1-be,tt=0;tt<2;++tt)for(var lt=tt?Re:1-Re,Ee=ce+it,_e=ze+tt,fe=ot*lt,Fe=0;Fe<3;++Fe)Xe[Fe]+=this._field[Fe].get(Ee,_e)*fe;for(var rt=this._pickResult.level,st=0;st<3;++st)if(rt[st]=w.le(this.contourLevels[st],Xe[st]),rt[st]<0)this.contourLevels[st].length>0&&(rt[st]=0);else if(rt[st]Math.abs(Lt-Xe[st])&&(rt[st]+=1)}for(ee.index[0]=be<.5?ce:ce+1,ee.index[1]=Re<.5?ze:ze+1,ee.uv[0]=re/j[0],ee.uv[1]=Ae/j[1],Fe=0;Fe<3;++Fe)ee.dataCoordinate[Fe]=this._field[Fe].get(ee.index[0],ee.index[1]);return ee},O.padField=function(ie,j){var ee=j.shape.slice(),re=ie.shape.slice();f.assign(ie.lo(1,1).hi(ee[0],ee[1]),j),f.assign(ie.lo(1).hi(ee[0],1),j.hi(ee[0],1)),f.assign(ie.lo(1,re[1]-1).hi(ee[0],1),j.lo(0,ee[1]-1).hi(ee[0],1)),f.assign(ie.lo(0,1).hi(1,ee[1]),j.hi(1)),f.assign(ie.lo(re[0]-1,1).hi(1,ee[1]),j.lo(ee[0]-1)),ie.set(0,0,j.get(0,0)),ie.set(0,re[1]-1,j.get(0,ee[1]-1)),ie.set(re[0]-1,0,j.get(ee[0]-1,0)),ie.set(re[0]-1,re[1]-1,j.get(ee[0]-1,ee[1]-1))};function $(ie,j){return Array.isArray(ie)?[j(ie[0]),j(ie[1]),j(ie[2])]:[j(ie),j(ie),j(ie)]}function J(ie){return Array.isArray(ie)?ie.length===3?[ie[0],ie[1],ie[2],1]:[ie[0],ie[1],ie[2],ie[3]]:[0,0,0,1]}function X(ie){if(Array.isArray(ie)){if(Array.isArray(ie))return[J(ie[0]),J(ie[1]),J(ie[2])];var j=J(ie);return[j.slice(),j.slice(),j.slice()]}}O.update=function(ie){ie=ie||{},this.objectOffset=ie.objectOffset||this.objectOffset,this.dirty=!0,"contourWidth"in ie&&(this.contourWidth=$(ie.contourWidth,Number)),"showContour"in ie&&(this.showContour=$(ie.showContour,Boolean)),"showSurface"in ie&&(this.showSurface=!!ie.showSurface),"contourTint"in ie&&(this.contourTint=$(ie.contourTint,Boolean)),"contourColor"in ie&&(this.contourColor=X(ie.contourColor)),"contourProject"in ie&&(this.contourProject=$(ie.contourProject,function(mi){return $(mi,Boolean)})),"surfaceProject"in ie&&(this.surfaceProject=ie.surfaceProject),"dynamicColor"in ie&&(this.dynamicColor=X(ie.dynamicColor)),"dynamicTint"in ie&&(this.dynamicTint=$(ie.dynamicTint,Number)),"dynamicWidth"in ie&&(this.dynamicWidth=$(ie.dynamicWidth,Number)),"opacity"in ie&&(this.opacity=ie.opacity),"opacityscale"in ie&&(this.opacityscale=ie.opacityscale),"colorBounds"in ie&&(this.colorBounds=ie.colorBounds),"vertexColor"in ie&&(this.vertexColor=ie.vertexColor?1:0),"colormap"in ie&&this._colorMap.setPixels(this.genColormap(ie.colormap,this.opacityscale));var j=ie.field||ie.coords&&ie.coords[2]||null,ee=!1;if(j||(this._field[2].shape[0]||this._field[2].shape[2]?j=this._field[2].lo(1,1).hi(this._field[2].shape[0]-2,this._field[2].shape[1]-2):j=this._field[2].hi(0,0)),"field"in ie||"coords"in ie){var re=(j.shape[0]+2)*(j.shape[1]+2);re>this._field[2].data.length&&(s.freeFloat(this._field[2].data),this._field[2].data=s.mallocFloat(o.nextPow2(re))),this._field[2]=v(this._field[2].data,[j.shape[0]+2,j.shape[1]+2]),this.padField(this._field[2],j),this.shape=j.shape.slice();for(var ce=this.shape,be=0;be<2;++be)this._field[2].size>this._field[be].data.length&&(s.freeFloat(this._field[be].data),this._field[be].data=s.mallocFloat(this._field[2].size)),this._field[be]=v(this._field[be].data,[ce[0]+2,ce[1]+2]);if(ie.coords){var Ae=ie.coords;if(!Array.isArray(Ae)||Ae.length!==3)throw new Error("gl-surface: invalid coordinates for x/y");for(be=0;be<2;++be){var ze=Ae[be];for(tt=0;tt<2;++tt)if(ze.shape[tt]!==ce[tt])throw new Error("gl-surface: coords have incorrect shape");this.padField(this._field[be],ze)}}else if(ie.ticks){var Re=ie.ticks;if(!Array.isArray(Re)||Re.length!==2)throw new Error("gl-surface: invalid ticks");for(be=0;be<2;++be){var Xe=Re[be];if((Array.isArray(Xe)||Xe.length)&&(Xe=v(Xe)),Xe.shape[0]!==ce[be])throw new Error("gl-surface: invalid tick length");var it=v(Xe.data,ce);it.stride[be]=Xe.stride[0],it.stride[be^1]=0,this.padField(this._field[be],it)}}else{for(be=0;be<2;++be){var ot=[0,0];ot[be]=1,this._field[be]=v(this._field[be].data,[ce[0]+2,ce[1]+2],ot,0)}this._field[0].set(0,0,0);for(var tt=0;tt0){for(var $a=0;$a<5;++$a)rr.pop();Ue-=1}continue e}}}Ua.push(Ue)}this._contourOffsets[Qt]=la,this._contourCounts[Qt]=Ua}var ai=s.mallocFloat(rr.length);for(be=0;bez||P<0||P>z)throw new Error("gl-texture2d: Invalid texture size");return m._shape=[h,P],m.bind(),L.texImage2D(L.TEXTURE_2D,0,m.format,h,P,0,m.format,m.type,null),m._mipLevels=[0],m}function l(m,h,P,L,z,F){this.gl=m,this.handle=h,this.format=z,this.type=F,this._shape=[P,L],this._mipLevels=[0],this._magFilter=m.NEAREST,this._minFilter=m.NEAREST,this._wrapS=m.CLAMP_TO_EDGE,this._wrapT=m.CLAMP_TO_EDGE,this._anisoSamples=1;var B=this,O=[this._wrapS,this._wrapT];Object.defineProperties(O,[{get:function(){return B._wrapS},set:function(N){return B.wrapS=N}},{get:function(){return B._wrapT},set:function(N){return B.wrapT=N}}]),this._wrapVector=O;var I=[this._shape[0],this._shape[1]];Object.defineProperties(I,[{get:function(){return B._shape[0]},set:function(N){return B.width=N}},{get:function(){return B._shape[1]},set:function(N){return B.height=N}}]),this._shapeVector=I}var _=l.prototype;Object.defineProperties(_,{minFilter:{get:function(){return this._minFilter},set:function(m){this.bind();var h=this.gl;if(this.type===h.FLOAT&&n.indexOf(m)>=0&&(h.getExtension("OES_texture_float_linear")||(m=h.NEAREST)),s.indexOf(m)<0)throw new Error("gl-texture2d: Unknown filter mode "+m);return h.texParameteri(h.TEXTURE_2D,h.TEXTURE_MIN_FILTER,m),this._minFilter=m}},magFilter:{get:function(){return this._magFilter},set:function(m){this.bind();var h=this.gl;if(this.type===h.FLOAT&&n.indexOf(m)>=0&&(h.getExtension("OES_texture_float_linear")||(m=h.NEAREST)),s.indexOf(m)<0)throw new Error("gl-texture2d: Unknown filter mode "+m);return h.texParameteri(h.TEXTURE_2D,h.TEXTURE_MAG_FILTER,m),this._magFilter=m}},mipSamples:{get:function(){return this._anisoSamples},set:function(m){var h=this._anisoSamples;if(this._anisoSamples=Math.max(m,1)|0,h!==this._anisoSamples){var P=this.gl.getExtension("EXT_texture_filter_anisotropic");P&&this.gl.texParameterf(this.gl.TEXTURE_2D,P.TEXTURE_MAX_ANISOTROPY_EXT,this._anisoSamples)}return this._anisoSamples}},wrapS:{get:function(){return this._wrapS},set:function(m){if(this.bind(),c.indexOf(m)<0)throw new Error("gl-texture2d: Unknown wrap mode "+m);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,m),this._wrapS=m}},wrapT:{get:function(){return this._wrapT},set:function(m){if(this.bind(),c.indexOf(m)<0)throw new Error("gl-texture2d: Unknown wrap mode "+m);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,m),this._wrapT=m}},wrap:{get:function(){return this._wrapVector},set:function(m){if(Array.isArray(m)||(m=[m,m]),m.length!==2)throw new Error("gl-texture2d: Must specify wrap mode for rows and columns");for(var h=0;h<2;++h)if(c.indexOf(m[h])<0)throw new Error("gl-texture2d: Unknown wrap mode "+m);this._wrapS=m[0],this._wrapT=m[1];var P=this.gl;return this.bind(),P.texParameteri(P.TEXTURE_2D,P.TEXTURE_WRAP_S,this._wrapS),P.texParameteri(P.TEXTURE_2D,P.TEXTURE_WRAP_T,this._wrapT),m}},shape:{get:function(){return this._shapeVector},set:function(m){if(!Array.isArray(m))m=[m|0,m|0];else if(m.length!==2)throw new Error("gl-texture2d: Invalid texture shape");return T(this,m[0]|0,m[1]|0),[m[0]|0,m[1]|0]}},width:{get:function(){return this._shape[0]},set:function(m){return m=m|0,T(this,m,this._shape[1]),m}},height:{get:function(){return this._shape[1]},set:function(m){return m=m|0,T(this,this._shape[0],m),m}}}),_.bind=function(m){var h=this.gl;return m!==void 0&&h.activeTexture(h.TEXTURE0+(m|0)),h.bindTexture(h.TEXTURE_2D,this.handle),m!==void 0?m|0:h.getParameter(h.ACTIVE_TEXTURE)-h.TEXTURE0},_.dispose=function(){this.gl.deleteTexture(this.handle)},_.generateMipmap=function(){this.bind(),this.gl.generateMipmap(this.gl.TEXTURE_2D);for(var m=Math.min(this._shape[0],this._shape[1]),h=0;m>0;++h,m>>>=1)this._mipLevels.indexOf(h)<0&&this._mipLevels.push(h)},_.setPixels=function(m,h,P,L){var z=this.gl;this.bind(),Array.isArray(h)?(L=P,P=h[1]|0,h=h[0]|0):(h=h||0,P=P||0),L=L||0;var F=g(m)?m:m.raw;if(F){var B=this._mipLevels.indexOf(L)<0;B?(z.texImage2D(z.TEXTURE_2D,0,this.format,this.format,this.type,F),this._mipLevels.push(L)):z.texSubImage2D(z.TEXTURE_2D,L,h,P,this.format,this.type,F)}else if(m.shape&&m.stride&&m.data){if(m.shape.length<2||h+m.shape[1]>this._shape[1]>>>L||P+m.shape[0]>this._shape[0]>>>L||h<0||P<0)throw new Error("gl-texture2d: Texture dimensions are out of bounds");S(z,h,P,L,this.format,this.type,this._mipLevels,m)}else throw new Error("gl-texture2d: Unsupported data type")};function w(m,h){return m.length===3?h[2]===1&&h[1]===m[0]*m[2]&&h[0]===m[2]:h[0]===1&&h[1]===m[0]}function S(m,h,P,L,z,F,B,O){var I=O.dtype,N=O.shape.slice();if(N.length<2||N.length>3)throw new Error("gl-texture2d: Invalid ndarray, must be 2d or 3d");var U=0,W=0,Q=w(N,O.stride.slice());I==="float32"?U=m.FLOAT:I==="float64"?(U=m.FLOAT,Q=!1,I="float32"):I==="uint8"?U=m.UNSIGNED_BYTE:(U=m.UNSIGNED_BYTE,Q=!1,I="uint8");var ue=1;if(N.length===2)W=m.LUMINANCE,N=[N[0],N[1],1],O=o(O.data,N,[O.stride[0],O.stride[1],1],O.offset);else if(N.length===3){if(N[2]===1)W=m.ALPHA;else if(N[2]===2)W=m.LUMINANCE_ALPHA;else if(N[2]===3)W=m.RGB;else if(N[2]===4)W=m.RGBA;else throw new Error("gl-texture2d: Invalid shape for pixel coords");ue=N[2]}else throw new Error("gl-texture2d: Invalid shape for texture");if((W===m.LUMINANCE||W===m.ALPHA)&&(z===m.LUMINANCE||z===m.ALPHA)&&(W=z),W!==z)throw new Error("gl-texture2d: Incompatible texture format for setPixels");var le=O.size,he=B.indexOf(L)<0;if(he&&B.push(L),U===F&&Q)O.offset===0&&O.data.length===le?he?m.texImage2D(m.TEXTURE_2D,L,z,N[0],N[1],0,z,F,O.data):m.texSubImage2D(m.TEXTURE_2D,L,h,P,N[0],N[1],z,F,O.data):he?m.texImage2D(m.TEXTURE_2D,L,z,N[0],N[1],0,z,F,O.data.subarray(O.offset,O.offset+le)):m.texSubImage2D(m.TEXTURE_2D,L,h,P,N[0],N[1],z,F,O.data.subarray(O.offset,O.offset+le));else{var G;F===m.FLOAT?G=i.mallocFloat32(le):G=i.mallocUint8(le);var $=o(G,N,[N[2],N[2]*N[0],1]);U===m.FLOAT&&F===m.UNSIGNED_BYTE?v($,O):a.assign($,O),he?m.texImage2D(m.TEXTURE_2D,L,z,N[0],N[1],0,z,F,G.subarray(0,le)):m.texSubImage2D(m.TEXTURE_2D,L,h,P,N[0],N[1],z,F,G.subarray(0,le)),F===m.FLOAT?i.freeFloat32(G):i.freeUint8(G)}}function E(m){var h=m.createTexture();return m.bindTexture(m.TEXTURE_2D,h),m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MIN_FILTER,m.NEAREST),m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MAG_FILTER,m.NEAREST),m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_S,m.CLAMP_TO_EDGE),m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_T,m.CLAMP_TO_EDGE),h}function y(m,h,P,L,z){var F=m.getParameter(m.MAX_TEXTURE_SIZE);if(h<0||h>F||P<0||P>F)throw new Error("gl-texture2d: Invalid texture shape");if(z===m.FLOAT&&!m.getExtension("OES_texture_float"))throw new Error("gl-texture2d: Floating point textures not supported on this platform");var B=E(m);return m.texImage2D(m.TEXTURE_2D,0,L,h,P,0,L,z,null),new l(m,B,h,P,L,z)}function b(m,h,P,L,z,F){var B=E(m);return m.texImage2D(m.TEXTURE_2D,0,z,z,F,h),new l(m,B,P,L,z,F)}function p(m,h){var P=h.dtype,L=h.shape.slice(),z=m.getParameter(m.MAX_TEXTURE_SIZE);if(L[0]<0||L[0]>z||L[1]<0||L[1]>z)throw new Error("gl-texture2d: Invalid texture size");var F=w(L,h.stride.slice()),B=0;P==="float32"?B=m.FLOAT:P==="float64"?(B=m.FLOAT,F=!1,P="float32"):P==="uint8"?B=m.UNSIGNED_BYTE:(B=m.UNSIGNED_BYTE,F=!1,P="uint8");var O=0;if(L.length===2)O=m.LUMINANCE,L=[L[0],L[1],1],h=o(h.data,L,[h.stride[0],h.stride[1],1],h.offset);else if(L.length===3)if(L[2]===1)O=m.ALPHA;else if(L[2]===2)O=m.LUMINANCE_ALPHA;else if(L[2]===3)O=m.RGB;else if(L[2]===4)O=m.RGBA;else throw new Error("gl-texture2d: Invalid shape for pixel coords");else throw new Error("gl-texture2d: Invalid shape for texture");B===m.FLOAT&&!m.getExtension("OES_texture_float")&&(B=m.UNSIGNED_BYTE,F=!1);var I,N,U=h.size;if(F)h.offset===0&&h.data.length===U?I=h.data:I=h.data.subarray(h.offset,h.offset+U);else{var W=[L[2],L[2]*L[0],1];N=i.malloc(U,P);var Q=o(N,L,W,0);(P==="float32"||P==="float64")&&B===m.UNSIGNED_BYTE?v(Q,h):a.assign(Q,h),I=N.subarray(0,U)}var ue=E(m);return m.texImage2D(m.TEXTURE_2D,0,O,L[0],L[1],0,O,B,I),F||i.free(N),new l(m,ue,L[0],L[1],O,B)}function u(m){if(arguments.length<=1)throw new Error("gl-texture2d: Missing arguments for texture2d constructor");if(n||f(m),typeof arguments[1]=="number")return y(m,arguments[1],arguments[2],arguments[3]||m.RGBA,arguments[4]||m.UNSIGNED_BYTE);if(Array.isArray(arguments[1]))return y(m,arguments[1][0]|0,arguments[1][1]|0,arguments[2]||m.RGBA,arguments[3]||m.UNSIGNED_BYTE);if(typeof arguments[1]=="object"){var h=arguments[1],P=g(h)?h:h.raw;if(P)return b(m,P,h.width|0,h.height|0,arguments[2]||m.RGBA,arguments[3]||m.UNSIGNED_BYTE);if(h.shape&&h.data&&h.stride)return p(m,h)}throw new Error("gl-texture2d: Invalid arguments for texture2d constructor")}},1433:function(e){"use strict";function t(r,o,a){o?o.bind():r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,null);var i=r.getParameter(r.MAX_VERTEX_ATTRIBS)|0;if(a){if(a.length>i)throw new Error("gl-vao: Too many vertex attributes");for(var n=0;n1?0:Math.acos(v)}},9226:function(e){e.exports=t;function t(r,o){return r[0]=Math.ceil(o[0]),r[1]=Math.ceil(o[1]),r[2]=Math.ceil(o[2]),r}},3126:function(e){e.exports=t;function t(r){var o=new Float32Array(3);return o[0]=r[0],o[1]=r[1],o[2]=r[2],o}},3990:function(e){e.exports=t;function t(r,o){return r[0]=o[0],r[1]=o[1],r[2]=o[2],r}},1091:function(e){e.exports=t;function t(){var r=new Float32Array(3);return r[0]=0,r[1]=0,r[2]=0,r}},5911:function(e){e.exports=t;function t(r,o,a){var i=o[0],n=o[1],s=o[2],c=a[0],f=a[1],g=a[2];return r[0]=n*g-s*f,r[1]=s*c-i*g,r[2]=i*f-n*c,r}},5455:function(e,t,r){e.exports=r(7056)},7056:function(e){e.exports=t;function t(r,o){var a=o[0]-r[0],i=o[1]-r[1],n=o[2]-r[2];return Math.sqrt(a*a+i*i+n*n)}},4008:function(e,t,r){e.exports=r(6690)},6690:function(e){e.exports=t;function t(r,o,a){return r[0]=o[0]/a[0],r[1]=o[1]/a[1],r[2]=o[2]/a[2],r}},244:function(e){e.exports=t;function t(r,o){return r[0]*o[0]+r[1]*o[1]+r[2]*o[2]}},2613:function(e){e.exports=1e-6},9922:function(e,t,r){e.exports=a;var o=r(2613);function a(i,n){var s=i[0],c=i[1],f=i[2],g=n[0],v=n[1],T=n[2];return Math.abs(s-g)<=o*Math.max(1,Math.abs(s),Math.abs(g))&&Math.abs(c-v)<=o*Math.max(1,Math.abs(c),Math.abs(v))&&Math.abs(f-T)<=o*Math.max(1,Math.abs(f),Math.abs(T))}},9265:function(e){e.exports=t;function t(r,o){return r[0]===o[0]&&r[1]===o[1]&&r[2]===o[2]}},2681:function(e){e.exports=t;function t(r,o){return r[0]=Math.floor(o[0]),r[1]=Math.floor(o[1]),r[2]=Math.floor(o[2]),r}},5137:function(e,t,r){e.exports=a;var o=r(1091)();function a(i,n,s,c,f,g){var v,T;for(n||(n=3),s||(s=0),c?T=Math.min(c*n+s,i.length):T=i.length,v=s;v0&&(s=1/Math.sqrt(s),r[0]=o[0]*s,r[1]=o[1]*s,r[2]=o[2]*s),r}},7636:function(e){e.exports=t;function t(r,o){o=o||1;var a=Math.random()*2*Math.PI,i=Math.random()*2-1,n=Math.sqrt(1-i*i)*o;return r[0]=Math.cos(a)*n,r[1]=Math.sin(a)*n,r[2]=i*o,r}},6894:function(e){e.exports=t;function t(r,o,a,i){var n=a[1],s=a[2],c=o[1]-n,f=o[2]-s,g=Math.sin(i),v=Math.cos(i);return r[0]=o[0],r[1]=n+c*v-f*g,r[2]=s+c*g+f*v,r}},109:function(e){e.exports=t;function t(r,o,a,i){var n=a[0],s=a[2],c=o[0]-n,f=o[2]-s,g=Math.sin(i),v=Math.cos(i);return r[0]=n+f*g+c*v,r[1]=o[1],r[2]=s+f*v-c*g,r}},8692:function(e){e.exports=t;function t(r,o,a,i){var n=a[0],s=a[1],c=o[0]-n,f=o[1]-s,g=Math.sin(i),v=Math.cos(i);return r[0]=n+c*v-f*g,r[1]=s+c*g+f*v,r[2]=o[2],r}},2447:function(e){e.exports=t;function t(r,o){return r[0]=Math.round(o[0]),r[1]=Math.round(o[1]),r[2]=Math.round(o[2]),r}},6621:function(e){e.exports=t;function t(r,o,a){return r[0]=o[0]*a,r[1]=o[1]*a,r[2]=o[2]*a,r}},8489:function(e){e.exports=t;function t(r,o,a,i){return r[0]=o[0]+a[0]*i,r[1]=o[1]+a[1]*i,r[2]=o[2]+a[2]*i,r}},1463:function(e){e.exports=t;function t(r,o,a,i){return r[0]=o,r[1]=a,r[2]=i,r}},6141:function(e,t,r){e.exports=r(2953)},5486:function(e,t,r){e.exports=r(3066)},2953:function(e){e.exports=t;function t(r,o){var a=o[0]-r[0],i=o[1]-r[1],n=o[2]-r[2];return a*a+i*i+n*n}},3066:function(e){e.exports=t;function t(r){var o=r[0],a=r[1],i=r[2];return o*o+a*a+i*i}},2229:function(e,t,r){e.exports=r(6843)},6843:function(e){e.exports=t;function t(r,o,a){return r[0]=o[0]-a[0],r[1]=o[1]-a[1],r[2]=o[2]-a[2],r}},492:function(e){e.exports=t;function t(r,o,a){var i=o[0],n=o[1],s=o[2];return r[0]=i*a[0]+n*a[3]+s*a[6],r[1]=i*a[1]+n*a[4]+s*a[7],r[2]=i*a[2]+n*a[5]+s*a[8],r}},5673:function(e){e.exports=t;function t(r,o,a){var i=o[0],n=o[1],s=o[2],c=a[3]*i+a[7]*n+a[11]*s+a[15];return c=c||1,r[0]=(a[0]*i+a[4]*n+a[8]*s+a[12])/c,r[1]=(a[1]*i+a[5]*n+a[9]*s+a[13])/c,r[2]=(a[2]*i+a[6]*n+a[10]*s+a[14])/c,r}},264:function(e){e.exports=t;function t(r,o,a){var i=o[0],n=o[1],s=o[2],c=a[0],f=a[1],g=a[2],v=a[3],T=v*i+f*s-g*n,l=v*n+g*i-c*s,_=v*s+c*n-f*i,w=-c*i-f*n-g*s;return r[0]=T*v+w*-c+l*-g-_*-f,r[1]=l*v+w*-f+_*-c-T*-g,r[2]=_*v+w*-g+T*-f-l*-c,r}},4361:function(e){e.exports=t;function t(r,o,a){return r[0]=o[0]+a[0],r[1]=o[1]+a[1],r[2]=o[2]+a[2],r[3]=o[3]+a[3],r}},2335:function(e){e.exports=t;function t(r){var o=new Float32Array(4);return o[0]=r[0],o[1]=r[1],o[2]=r[2],o[3]=r[3],o}},2933:function(e){e.exports=t;function t(r,o){return r[0]=o[0],r[1]=o[1],r[2]=o[2],r[3]=o[3],r}},7536:function(e){e.exports=t;function t(){var r=new Float32Array(4);return r[0]=0,r[1]=0,r[2]=0,r[3]=0,r}},4691:function(e){e.exports=t;function t(r,o){var a=o[0]-r[0],i=o[1]-r[1],n=o[2]-r[2],s=o[3]-r[3];return Math.sqrt(a*a+i*i+n*n+s*s)}},1373:function(e){e.exports=t;function t(r,o,a){return r[0]=o[0]/a[0],r[1]=o[1]/a[1],r[2]=o[2]/a[2],r[3]=o[3]/a[3],r}},3750:function(e){e.exports=t;function t(r,o){return r[0]*o[0]+r[1]*o[1]+r[2]*o[2]+r[3]*o[3]}},3390:function(e){e.exports=t;function t(r,o,a,i){var n=new Float32Array(4);return n[0]=r,n[1]=o,n[2]=a,n[3]=i,n}},9970:function(e,t,r){e.exports={create:r(7536),clone:r(2335),fromValues:r(3390),copy:r(2933),set:r(4578),add:r(4361),subtract:r(6860),multiply:r(3576),divide:r(1373),min:r(2334),max:r(160),scale:r(9288),scaleAndAdd:r(4844),distance:r(4691),squaredDistance:r(7960),length:r(6808),squaredLength:r(483),negate:r(1498),inverse:r(4494),normalize:r(5177),dot:r(3750),lerp:r(2573),random:r(9131),transformMat4:r(5352),transformQuat:r(4041)}},4494:function(e){e.exports=t;function t(r,o){return r[0]=1/o[0],r[1]=1/o[1],r[2]=1/o[2],r[3]=1/o[3],r}},6808:function(e){e.exports=t;function t(r){var o=r[0],a=r[1],i=r[2],n=r[3];return Math.sqrt(o*o+a*a+i*i+n*n)}},2573:function(e){e.exports=t;function t(r,o,a,i){var n=o[0],s=o[1],c=o[2],f=o[3];return r[0]=n+i*(a[0]-n),r[1]=s+i*(a[1]-s),r[2]=c+i*(a[2]-c),r[3]=f+i*(a[3]-f),r}},160:function(e){e.exports=t;function t(r,o,a){return r[0]=Math.max(o[0],a[0]),r[1]=Math.max(o[1],a[1]),r[2]=Math.max(o[2],a[2]),r[3]=Math.max(o[3],a[3]),r}},2334:function(e){e.exports=t;function t(r,o,a){return r[0]=Math.min(o[0],a[0]),r[1]=Math.min(o[1],a[1]),r[2]=Math.min(o[2],a[2]),r[3]=Math.min(o[3],a[3]),r}},3576:function(e){e.exports=t;function t(r,o,a){return r[0]=o[0]*a[0],r[1]=o[1]*a[1],r[2]=o[2]*a[2],r[3]=o[3]*a[3],r}},1498:function(e){e.exports=t;function t(r,o){return r[0]=-o[0],r[1]=-o[1],r[2]=-o[2],r[3]=-o[3],r}},5177:function(e){e.exports=t;function t(r,o){var a=o[0],i=o[1],n=o[2],s=o[3],c=a*a+i*i+n*n+s*s;return c>0&&(c=1/Math.sqrt(c),r[0]=a*c,r[1]=i*c,r[2]=n*c,r[3]=s*c),r}},9131:function(e,t,r){var o=r(5177),a=r(9288);e.exports=i;function i(n,s){return s=s||1,n[0]=Math.random(),n[1]=Math.random(),n[2]=Math.random(),n[3]=Math.random(),o(n,n),a(n,n,s),n}},9288:function(e){e.exports=t;function t(r,o,a){return r[0]=o[0]*a,r[1]=o[1]*a,r[2]=o[2]*a,r[3]=o[3]*a,r}},4844:function(e){e.exports=t;function t(r,o,a,i){return r[0]=o[0]+a[0]*i,r[1]=o[1]+a[1]*i,r[2]=o[2]+a[2]*i,r[3]=o[3]+a[3]*i,r}},4578:function(e){e.exports=t;function t(r,o,a,i,n){return r[0]=o,r[1]=a,r[2]=i,r[3]=n,r}},7960:function(e){e.exports=t;function t(r,o){var a=o[0]-r[0],i=o[1]-r[1],n=o[2]-r[2],s=o[3]-r[3];return a*a+i*i+n*n+s*s}},483:function(e){e.exports=t;function t(r){var o=r[0],a=r[1],i=r[2],n=r[3];return o*o+a*a+i*i+n*n}},6860:function(e){e.exports=t;function t(r,o,a){return r[0]=o[0]-a[0],r[1]=o[1]-a[1],r[2]=o[2]-a[2],r[3]=o[3]-a[3],r}},5352:function(e){e.exports=t;function t(r,o,a){var i=o[0],n=o[1],s=o[2],c=o[3];return r[0]=a[0]*i+a[4]*n+a[8]*s+a[12]*c,r[1]=a[1]*i+a[5]*n+a[9]*s+a[13]*c,r[2]=a[2]*i+a[6]*n+a[10]*s+a[14]*c,r[3]=a[3]*i+a[7]*n+a[11]*s+a[15]*c,r}},4041:function(e){e.exports=t;function t(r,o,a){var i=o[0],n=o[1],s=o[2],c=a[0],f=a[1],g=a[2],v=a[3],T=v*i+f*s-g*n,l=v*n+g*i-c*s,_=v*s+c*n-f*i,w=-c*i-f*n-g*s;return r[0]=T*v+w*-c+l*-g-_*-f,r[1]=l*v+w*-f+_*-c-T*-g,r[2]=_*v+w*-g+T*-f-l*-c,r[3]=o[3],r}},1848:function(e,t,r){var o=r(4905),a=r(6468);e.exports=i;function i(n){for(var s=Array.isArray(n)?n:o(n),c=0;c0)continue;st=fe.slice(0,1).join("")}return ee(st),le+=st.length,I=I.slice(st.length),I.length}while(!0)}function tt(){return/[^a-fA-F0-9]/.test(B)?(ee(I.join("")),F=c,L):(I.push(B),O=B,L+1)}function lt(){return B==="."||/[eE]/.test(B)?(I.push(B),F=w,O=B,L+1):B==="x"&&I.length===1&&I[0]==="0"?(F=u,I.push(B),O=B,L+1):/[^\d]/.test(B)?(ee(I.join("")),F=c,L):(I.push(B),O=B,L+1)}function Ee(){return B==="f"&&(I.push(B),O=B,L+=1),/[eE]/.test(B)||(B==="-"||B==="+")&&/[eE]/.test(O)?(I.push(B),O=B,L+1):/[^\d]/.test(B)?(ee(I.join("")),F=c,L):(I.push(B),O=B,L+1)}function _e(){if(/[^\d\w_]/.test(B)){var fe=I.join("");return j[fe]?F=y:ie[fe]?F=E:F=S,ee(I.join("")),F=c,L}return I.push(B),O=B,L+1}}},3508:function(e,t,r){var o=r(6852);o=o.slice().filter(function(a){return!/^(gl\_|texture)/.test(a)}),e.exports=o.concat(["gl_VertexID","gl_InstanceID","gl_Position","gl_PointSize","gl_FragCoord","gl_FrontFacing","gl_FragDepth","gl_PointCoord","gl_MaxVertexAttribs","gl_MaxVertexUniformVectors","gl_MaxVertexOutputVectors","gl_MaxFragmentInputVectors","gl_MaxVertexTextureImageUnits","gl_MaxCombinedTextureImageUnits","gl_MaxTextureImageUnits","gl_MaxFragmentUniformVectors","gl_MaxDrawBuffers","gl_MinProgramTexelOffset","gl_MaxProgramTexelOffset","gl_DepthRangeParameters","gl_DepthRange","trunc","round","roundEven","isnan","isinf","floatBitsToInt","floatBitsToUint","intBitsToFloat","uintBitsToFloat","packSnorm2x16","unpackSnorm2x16","packUnorm2x16","unpackUnorm2x16","packHalf2x16","unpackHalf2x16","outerProduct","transpose","determinant","inverse","texture","textureSize","textureProj","textureLod","textureOffset","texelFetch","texelFetchOffset","textureProjOffset","textureLodOffset","textureProjLod","textureProjLodOffset","textureGrad","textureGradOffset","textureProjGrad","textureProjGradOffset"])},6852:function(e){e.exports=["abs","acos","all","any","asin","atan","ceil","clamp","cos","cross","dFdx","dFdy","degrees","distance","dot","equal","exp","exp2","faceforward","floor","fract","gl_BackColor","gl_BackLightModelProduct","gl_BackLightProduct","gl_BackMaterial","gl_BackSecondaryColor","gl_ClipPlane","gl_ClipVertex","gl_Color","gl_DepthRange","gl_DepthRangeParameters","gl_EyePlaneQ","gl_EyePlaneR","gl_EyePlaneS","gl_EyePlaneT","gl_Fog","gl_FogCoord","gl_FogFragCoord","gl_FogParameters","gl_FragColor","gl_FragCoord","gl_FragData","gl_FragDepth","gl_FragDepthEXT","gl_FrontColor","gl_FrontFacing","gl_FrontLightModelProduct","gl_FrontLightProduct","gl_FrontMaterial","gl_FrontSecondaryColor","gl_LightModel","gl_LightModelParameters","gl_LightModelProducts","gl_LightProducts","gl_LightSource","gl_LightSourceParameters","gl_MaterialParameters","gl_MaxClipPlanes","gl_MaxCombinedTextureImageUnits","gl_MaxDrawBuffers","gl_MaxFragmentUniformComponents","gl_MaxLights","gl_MaxTextureCoords","gl_MaxTextureImageUnits","gl_MaxTextureUnits","gl_MaxVaryingFloats","gl_MaxVertexAttribs","gl_MaxVertexTextureImageUnits","gl_MaxVertexUniformComponents","gl_ModelViewMatrix","gl_ModelViewMatrixInverse","gl_ModelViewMatrixInverseTranspose","gl_ModelViewMatrixTranspose","gl_ModelViewProjectionMatrix","gl_ModelViewProjectionMatrixInverse","gl_ModelViewProjectionMatrixInverseTranspose","gl_ModelViewProjectionMatrixTranspose","gl_MultiTexCoord0","gl_MultiTexCoord1","gl_MultiTexCoord2","gl_MultiTexCoord3","gl_MultiTexCoord4","gl_MultiTexCoord5","gl_MultiTexCoord6","gl_MultiTexCoord7","gl_Normal","gl_NormalMatrix","gl_NormalScale","gl_ObjectPlaneQ","gl_ObjectPlaneR","gl_ObjectPlaneS","gl_ObjectPlaneT","gl_Point","gl_PointCoord","gl_PointParameters","gl_PointSize","gl_Position","gl_ProjectionMatrix","gl_ProjectionMatrixInverse","gl_ProjectionMatrixInverseTranspose","gl_ProjectionMatrixTranspose","gl_SecondaryColor","gl_TexCoord","gl_TextureEnvColor","gl_TextureMatrix","gl_TextureMatrixInverse","gl_TextureMatrixInverseTranspose","gl_TextureMatrixTranspose","gl_Vertex","greaterThan","greaterThanEqual","inversesqrt","length","lessThan","lessThanEqual","log","log2","matrixCompMult","max","min","mix","mod","normalize","not","notEqual","pow","radians","reflect","refract","sign","sin","smoothstep","sqrt","step","tan","texture2D","texture2DLod","texture2DProj","texture2DProjLod","textureCube","textureCubeLod","texture2DLodEXT","texture2DProjLodEXT","textureCubeLodEXT","texture2DGradEXT","texture2DProjGradEXT","textureCubeGradEXT"]},7932:function(e,t,r){var o=r(620);e.exports=o.slice().concat(["layout","centroid","smooth","case","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","uvec2","uvec3","uvec4","samplerCubeShadow","sampler2DArray","sampler2DArrayShadow","isampler2D","isampler3D","isamplerCube","isampler2DArray","usampler2D","usampler3D","usamplerCube","usampler2DArray","coherent","restrict","readonly","writeonly","resource","atomic_uint","noperspective","patch","sample","subroutine","common","partition","active","filter","image1D","image2D","image3D","imageCube","iimage1D","iimage2D","iimage3D","iimageCube","uimage1D","uimage2D","uimage3D","uimageCube","image1DArray","image2DArray","iimage1DArray","iimage2DArray","uimage1DArray","uimage2DArray","image1DShadow","image2DShadow","image1DArrayShadow","image2DArrayShadow","imageBuffer","iimageBuffer","uimageBuffer","sampler1DArray","sampler1DArrayShadow","isampler1D","isampler1DArray","usampler1D","usampler1DArray","isampler2DRect","usampler2DRect","samplerBuffer","isamplerBuffer","usamplerBuffer","sampler2DMS","isampler2DMS","usampler2DMS","sampler2DMSArray","isampler2DMSArray","usampler2DMSArray"])},620:function(e){e.exports=["precision","highp","mediump","lowp","attribute","const","uniform","varying","break","continue","do","for","while","if","else","in","out","inout","float","int","uint","void","bool","true","false","discard","return","mat2","mat3","mat4","vec2","vec3","vec4","ivec2","ivec3","ivec4","bvec2","bvec3","bvec4","sampler1D","sampler2D","sampler3D","samplerCube","sampler1DShadow","sampler2DShadow","struct","asm","class","union","enum","typedef","template","this","packed","goto","switch","default","inline","noinline","volatile","public","static","extern","external","interface","long","short","double","half","fixed","unsigned","input","output","hvec2","hvec3","hvec4","dvec2","dvec3","dvec4","fvec2","fvec3","fvec4","sampler2DRect","sampler3DRect","sampler2DRectShadow","sizeof","cast","namespace","using"]},7827:function(e){e.exports=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]},4905:function(e,t,r){var o=r(5874);e.exports=a;function a(i,n){var s=o(n),c=[];return c=c.concat(s(i)),c=c.concat(s(null)),c}},3236:function(e){e.exports=function(t){typeof t=="string"&&(t=[t]);for(var r=[].slice.call(arguments,1),o=[],a=0;a>1,T=-7,l=a?n-1:0,_=a?-1:1,w=r[o+l];for(l+=_,s=w&(1<<-T)-1,w>>=-T,T+=f;T>0;s=s*256+r[o+l],l+=_,T-=8);for(c=s&(1<<-T)-1,s>>=-T,T+=i;T>0;c=c*256+r[o+l],l+=_,T-=8);if(s===0)s=1-v;else{if(s===g)return c?NaN:(w?-1:1)*(1/0);c=c+Math.pow(2,i),s=s-v}return(w?-1:1)*c*Math.pow(2,s-i)},t.write=function(r,o,a,i,n,s){var c,f,g,v=s*8-n-1,T=(1<>1,_=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,w=i?0:s-1,S=i?1:-1,E=o<0||o===0&&1/o<0?1:0;for(o=Math.abs(o),isNaN(o)||o===1/0?(f=isNaN(o)?1:0,c=T):(c=Math.floor(Math.log(o)/Math.LN2),o*(g=Math.pow(2,-c))<1&&(c--,g*=2),c+l>=1?o+=_/g:o+=_*Math.pow(2,1-l),o*g>=2&&(c++,g/=2),c+l>=T?(f=0,c=T):c+l>=1?(f=(o*g-1)*Math.pow(2,n),c=c+l):(f=o*Math.pow(2,l-1)*Math.pow(2,n),c=0));n>=8;r[a+w]=f&255,w+=S,f/=256,n-=8);for(c=c<0;r[a+w]=c&255,w+=S,c/=256,v-=8);r[a+w-S]|=E*128}},8954:function(e,t,r){"use strict";e.exports=l;var o=r(3250),a=r(6803).Fw;function i(_,w,S){this.vertices=_,this.adjacent=w,this.boundary=S,this.lastVisited=-1}i.prototype.flip=function(){var _=this.vertices[0];this.vertices[0]=this.vertices[1],this.vertices[1]=_;var w=this.adjacent[0];this.adjacent[0]=this.adjacent[1],this.adjacent[1]=w};function n(_,w,S){this.vertices=_,this.cell=w,this.index=S}function s(_,w){return a(_.vertices,w.vertices)}function c(_){return function(){var w=this.tuple;return _.apply(this,w)}}function f(_){var w=o[_+1];return w||(w=o),c(w)}var g=[];function v(_,w,S){this.dimension=_,this.vertices=w,this.simplices=S,this.interior=S.filter(function(b){return!b.boundary}),this.tuple=new Array(_+1);for(var E=0;E<=_;++E)this.tuple[E]=this.vertices[E];var y=g[_];y||(y=g[_]=f(_)),this.orient=y}var T=v.prototype;T.handleBoundaryDegeneracy=function(_,w){var S=this.dimension,E=this.vertices.length-1,y=this.tuple,b=this.vertices,p=[_];for(_.lastVisited=-E;p.length>0;){_=p.pop();for(var u=_.adjacent,m=0;m<=S;++m){var h=u[m];if(!(!h.boundary||h.lastVisited<=-E)){for(var P=h.vertices,L=0;L<=S;++L){var z=P[L];z<0?y[L]=w:y[L]=b[z]}var F=this.orient();if(F>0)return h;h.lastVisited=-E,F===0&&p.push(h)}}}return null},T.walk=function(_,w){var S=this.vertices.length-1,E=this.dimension,y=this.vertices,b=this.tuple,p=w?this.interior.length*Math.random()|0:this.interior.length-1,u=this.interior[p];e:for(;!u.boundary;){for(var m=u.vertices,h=u.adjacent,P=0;P<=E;++P)b[P]=y[m[P]];u.lastVisited=S;for(var P=0;P<=E;++P){var L=h[P];if(!(L.lastVisited>=S)){var z=b[P];b[P]=_;var F=this.orient();if(b[P]=z,F<0){u=L;continue e}else L.boundary?L.lastVisited=-S:L.lastVisited=S}}return}return u},T.addPeaks=function(_,w){var S=this.vertices.length-1,E=this.dimension,y=this.vertices,b=this.tuple,p=this.interior,u=this.simplices,m=[w];w.lastVisited=S,w.vertices[w.vertices.indexOf(-1)]=S,w.boundary=!1,p.push(w);for(var h=[];m.length>0;){var w=m.pop(),P=w.vertices,L=w.adjacent,z=P.indexOf(S);if(!(z<0)){for(var F=0;F<=E;++F)if(F!==z){var B=L[F];if(!(!B.boundary||B.lastVisited>=S)){var O=B.vertices;if(B.lastVisited!==-S){for(var I=0,N=0;N<=E;++N)O[N]<0?(I=N,b[N]=_):b[N]=y[O[N]];var U=this.orient();if(U>0){O[I]=S,B.boundary=!1,p.push(B),m.push(B),B.lastVisited=S;continue}else B.lastVisited=-S}var W=B.adjacent,Q=P.slice(),ue=L.slice(),le=new i(Q,ue,!0);u.push(le);var he=W.indexOf(w);if(!(he<0)){W[he]=le,ue[z]=B,Q[F]=-1,ue[F]=w,L[F]=le,le.flip();for(var N=0;N<=E;++N){var G=Q[N];if(!(G<0||G===S)){for(var $=new Array(E-1),J=0,X=0;X<=E;++X){var oe=Q[X];oe<0||X===N||($[J++]=oe)}h.push(new n($,le,N))}}}}}}}h.sort(s);for(var F=0;F+1=0?p[m++]=u[P]:h=P&1;if(h===(_&1)){var L=p[0];p[0]=p[1],p[1]=L}w.push(p)}}return w};function l(_,w){var S=_.length;if(S===0)throw new Error("Must have at least d+1 points");var E=_[0].length;if(S<=E)throw new Error("Must input at least d+1 points");var y=_.slice(0,E+1),b=o.apply(void 0,y);if(b===0)throw new Error("Input not in general position");for(var p=new Array(E+1),u=0;u<=E;++u)p[u]=u;b<0&&(p[0]=1,p[1]=0);for(var m=new i(p,new Array(E+1),!1),h=m.adjacent,P=new Array(E+2),u=0;u<=E;++u){for(var L=p.slice(),z=0;z<=E;++z)z===u&&(L[z]=-1);var F=L[0];L[0]=L[1],L[1]=F;var B=new i(L,new Array(E+1),!0);h[u]=B,P[u]=B}P[E+1]=m;for(var u=0;u<=E;++u)for(var L=h[u].vertices,O=h[u].adjacent,z=0;z<=E;++z){var I=L[z];if(I<0){O[z]=m;continue}for(var N=0;N<=E;++N)h[N].vertices.indexOf(I)<0&&(O[z]=h[N])}for(var U=new v(E,y,P),W=!!w,u=E+1;u3*(P+1)?v(this,h):this.left.insert(h):this.left=b([h]);else if(h[0]>this.mid)this.right?4*(this.right.count+1)>3*(P+1)?v(this,h):this.right.insert(h):this.right=b([h]);else{var L=o.ge(this.leftPoints,h,E),z=o.ge(this.rightPoints,h,y);this.leftPoints.splice(L,0,h),this.rightPoints.splice(z,0,h)}},c.remove=function(h){var P=this.count-this.leftPoints;if(h[1]3*(P-1))return T(this,h);var z=this.left.remove(h);return z===n?(this.left=null,this.count-=1,i):(z===i&&(this.count-=1),z)}else if(h[0]>this.mid){if(!this.right)return a;var F=this.left?this.left.count:0;if(4*F>3*(P-1))return T(this,h);var z=this.right.remove(h);return z===n?(this.right=null,this.count-=1,i):(z===i&&(this.count-=1),z)}else{if(this.count===1)return this.leftPoints[0]===h?n:a;if(this.leftPoints.length===1&&this.leftPoints[0]===h){if(this.left&&this.right){for(var B=this,O=this.left;O.right;)B=O,O=O.right;if(B===this)O.right=this.right;else{var I=this.left,z=this.right;B.count-=O.count,B.right=O.left,O.left=I,O.right=z}f(this,O),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?f(this,this.left):f(this,this.right);return i}for(var I=o.ge(this.leftPoints,h,E);I=0&&h[z][1]>=P;--z){var F=L(h[z]);if(F)return F}}function w(h,P){for(var L=0;Lthis.mid){if(this.right){var L=this.right.queryPoint(h,P);if(L)return L}return _(this.rightPoints,h,P)}else return w(this.leftPoints,P)},c.queryInterval=function(h,P,L){if(hthis.mid&&this.right){var z=this.right.queryInterval(h,P,L);if(z)return z}return Pthis.mid?_(this.rightPoints,h,L):w(this.leftPoints,L)};function S(h,P){return h-P}function E(h,P){var L=h[0]-P[0];return L||h[1]-P[1]}function y(h,P){var L=h[1]-P[1];return L||h[0]-P[0]}function b(h){if(h.length===0)return null;for(var P=[],L=0;L>1],F=[],B=[],O=[],L=0;L13)&&o!==32&&o!==133&&o!==160&&o!==5760&&o!==6158&&(o<8192||o>8205)&&o!==8232&&o!==8233&&o!==8239&&o!==8287&&o!==8288&&o!==12288&&o!==65279)return!1;return!0}},395:function(e){function t(r,o,a){return r*(1-a)+o*a}e.exports=t},2652:function(e,t,r){var o=r(4335),a=r(6864),i=r(1903),n=r(9921),s=r(7608),c=r(5665),f={length:r(1387),normalize:r(3536),dot:r(244),cross:r(5911)},g=a(),v=a(),T=[0,0,0,0],l=[[0,0,0],[0,0,0],[0,0,0]],_=[0,0,0];e.exports=function(b,p,u,m,h,P){if(p||(p=[0,0,0]),u||(u=[0,0,0]),m||(m=[0,0,0]),h||(h=[0,0,0,1]),P||(P=[0,0,0,1]),!o(g,b)||(i(v,g),v[3]=0,v[7]=0,v[11]=0,v[15]=1,Math.abs(n(v)<1e-8)))return!1;var L=g[3],z=g[7],F=g[11],B=g[12],O=g[13],I=g[14],N=g[15];if(L!==0||z!==0||F!==0){T[0]=L,T[1]=z,T[2]=F,T[3]=N;var U=s(v,v);if(!U)return!1;c(v,v),w(h,T,v)}else h[0]=h[1]=h[2]=0,h[3]=1;if(p[0]=B,p[1]=O,p[2]=I,S(l,g),u[0]=f.length(l[0]),f.normalize(l[0],l[0]),m[0]=f.dot(l[0],l[1]),E(l[1],l[1],l[0],1,-m[0]),u[1]=f.length(l[1]),f.normalize(l[1],l[1]),m[0]/=u[1],m[1]=f.dot(l[0],l[2]),E(l[2],l[2],l[0],1,-m[1]),m[2]=f.dot(l[1],l[2]),E(l[2],l[2],l[1],1,-m[2]),u[2]=f.length(l[2]),f.normalize(l[2],l[2]),m[1]/=u[2],m[2]/=u[2],f.cross(_,l[1],l[2]),f.dot(l[0],_)<0)for(var W=0;W<3;W++)u[W]*=-1,l[W][0]*=-1,l[W][1]*=-1,l[W][2]*=-1;return P[0]=.5*Math.sqrt(Math.max(1+l[0][0]-l[1][1]-l[2][2],0)),P[1]=.5*Math.sqrt(Math.max(1-l[0][0]+l[1][1]-l[2][2],0)),P[2]=.5*Math.sqrt(Math.max(1-l[0][0]-l[1][1]+l[2][2],0)),P[3]=.5*Math.sqrt(Math.max(1+l[0][0]+l[1][1]+l[2][2],0)),l[2][1]>l[1][2]&&(P[0]=-P[0]),l[0][2]>l[2][0]&&(P[1]=-P[1]),l[1][0]>l[0][1]&&(P[2]=-P[2]),!0};function w(y,b,p){var u=b[0],m=b[1],h=b[2],P=b[3];return y[0]=p[0]*u+p[4]*m+p[8]*h+p[12]*P,y[1]=p[1]*u+p[5]*m+p[9]*h+p[13]*P,y[2]=p[2]*u+p[6]*m+p[10]*h+p[14]*P,y[3]=p[3]*u+p[7]*m+p[11]*h+p[15]*P,y}function S(y,b){y[0][0]=b[0],y[0][1]=b[1],y[0][2]=b[2],y[1][0]=b[4],y[1][1]=b[5],y[1][2]=b[6],y[2][0]=b[8],y[2][1]=b[9],y[2][2]=b[10]}function E(y,b,p,u,m){y[0]=b[0]*u+p[0]*m,y[1]=b[1]*u+p[1]*m,y[2]=b[2]*u+p[2]*m}},4335:function(e){e.exports=function(r,o){var a=o[15];if(a===0)return!1;for(var i=1/a,n=0;n<16;n++)r[n]=o[n]*i;return!0}},7442:function(e,t,r){var o=r(6658),a=r(7182),i=r(2652),n=r(9921),s=r(8648),c=T(),f=T(),g=T();e.exports=v;function v(w,S,E,y){if(n(S)===0||n(E)===0)return!1;var b=i(S,c.translate,c.scale,c.skew,c.perspective,c.quaternion),p=i(E,f.translate,f.scale,f.skew,f.perspective,f.quaternion);return!b||!p?!1:(o(g.translate,c.translate,f.translate,y),o(g.skew,c.skew,f.skew,y),o(g.scale,c.scale,f.scale,y),o(g.perspective,c.perspective,f.perspective,y),s(g.quaternion,c.quaternion,f.quaternion,y),a(w,g.translate,g.scale,g.skew,g.perspective,g.quaternion),!0)}function T(){return{translate:l(),scale:l(1),skew:l(),perspective:_(),quaternion:_()}}function l(w){return[w||0,w||0,w||0]}function _(){return[0,0,0,1]}},7182:function(e,t,r){var o={identity:r(7894),translate:r(7656),multiply:r(6760),create:r(6864),scale:r(2504),fromRotationTranslation:r(6743)},a=o.create(),i=o.create();e.exports=function(s,c,f,g,v,T){return o.identity(s),o.fromRotationTranslation(s,T,c),s[3]=v[0],s[7]=v[1],s[11]=v[2],s[15]=v[3],o.identity(i),g[2]!==0&&(i[9]=g[2],o.multiply(s,s,i)),g[1]!==0&&(i[9]=0,i[8]=g[1],o.multiply(s,s,i)),g[0]!==0&&(i[8]=0,i[4]=g[0],o.multiply(s,s,i)),o.scale(s,s,f),s}},1811:function(e,t,r){"use strict";var o=r(2478),a=r(7442),i=r(7608),n=r(5567),s=r(2408),c=r(7089),f=r(6582),g=r(7656),v=r(2504),T=r(3536),l=[0,0,0];e.exports=E;function _(y){this._components=y.slice(),this._time=[0],this.prevMatrix=y.slice(),this.nextMatrix=y.slice(),this.computedMatrix=y.slice(),this.computedInverse=y.slice(),this.computedEye=[0,0,0],this.computedUp=[0,0,0],this.computedCenter=[0,0,0],this.computedRadius=[0],this._limits=[-1/0,1/0]}var w=_.prototype;w.recalcMatrix=function(y){var b=this._time,p=o.le(b,y),u=this.computedMatrix;if(!(p<0)){var m=this._components;if(p===b.length-1)for(var h=16*p,P=0;P<16;++P)u[P]=m[h++];else{for(var L=b[p+1]-b[p],h=16*p,z=this.prevMatrix,F=!0,P=0;P<16;++P)z[P]=m[h++];for(var B=this.nextMatrix,P=0;P<16;++P)B[P]=m[h++],F=F&&z[P]===B[P];if(L<1e-6||F)for(var P=0;P<16;++P)u[P]=z[P];else a(u,z,B,(y-b[p])/L)}var O=this.computedUp;O[0]=u[1],O[1]=u[5],O[2]=u[9],T(O,O);var I=this.computedInverse;i(I,u);var N=this.computedEye,U=I[15];N[0]=I[12]/U,N[1]=I[13]/U,N[2]=I[14]/U;for(var W=this.computedCenter,Q=Math.exp(this.computedRadius[0]),P=0;P<3;++P)W[P]=N[P]-u[2+4*P]*Q}},w.idle=function(y){if(!(y1&&o(i[f[l-2]],i[f[l-1]],T)<=0;)l-=1,f.pop();for(f.push(v),l=g.length;l>1&&o(i[g[l-2]],i[g[l-1]],T)>=0;)l-=1,g.pop();g.push(v)}for(var _=new Array(g.length+f.length-2),w=0,s=0,S=f.length;s0;--E)_[w++]=g[E];return _}},351:function(e,t,r){"use strict";e.exports=a;var o=r(4687);function a(i,n){n||(n=i,i=window);var s=0,c=0,f=0,g={shift:!1,alt:!1,control:!1,meta:!1},v=!1;function T(h){var P=!1;return"altKey"in h&&(P=P||h.altKey!==g.alt,g.alt=!!h.altKey),"shiftKey"in h&&(P=P||h.shiftKey!==g.shift,g.shift=!!h.shiftKey),"ctrlKey"in h&&(P=P||h.ctrlKey!==g.control,g.control=!!h.ctrlKey),"metaKey"in h&&(P=P||h.metaKey!==g.meta,g.meta=!!h.metaKey),P}function l(h,P){var L=o.x(P),z=o.y(P);"buttons"in P&&(h=P.buttons|0),(h!==s||L!==c||z!==f||T(P))&&(s=h|0,c=L||0,f=z||0,n&&n(s,c,f,g))}function _(h){l(0,h)}function w(){(s||c||f||g.shift||g.alt||g.meta||g.control)&&(c=f=0,s=0,g.shift=g.alt=g.control=g.meta=!1,n&&n(0,0,0,g))}function S(h){T(h)&&n&&n(s,c,f,g)}function E(h){o.buttons(h)===0?l(0,h):l(s,h)}function y(h){l(s|o.buttons(h),h)}function b(h){l(s&~o.buttons(h),h)}function p(){v||(v=!0,i.addEventListener("mousemove",E),i.addEventListener("mousedown",y),i.addEventListener("mouseup",b),i.addEventListener("mouseleave",_),i.addEventListener("mouseenter",_),i.addEventListener("mouseout",_),i.addEventListener("mouseover",_),i.addEventListener("blur",w),i.addEventListener("keyup",S),i.addEventListener("keydown",S),i.addEventListener("keypress",S),i!==window&&(window.addEventListener("blur",w),window.addEventListener("keyup",S),window.addEventListener("keydown",S),window.addEventListener("keypress",S)))}function u(){v&&(v=!1,i.removeEventListener("mousemove",E),i.removeEventListener("mousedown",y),i.removeEventListener("mouseup",b),i.removeEventListener("mouseleave",_),i.removeEventListener("mouseenter",_),i.removeEventListener("mouseout",_),i.removeEventListener("mouseover",_),i.removeEventListener("blur",w),i.removeEventListener("keyup",S),i.removeEventListener("keydown",S),i.removeEventListener("keypress",S),i!==window&&(window.removeEventListener("blur",w),window.removeEventListener("keyup",S),window.removeEventListener("keydown",S),window.removeEventListener("keypress",S)))}p();var m={element:i};return Object.defineProperties(m,{enabled:{get:function(){return v},set:function(h){h?p():u()},enumerable:!0},buttons:{get:function(){return s},enumerable:!0},x:{get:function(){return c},enumerable:!0},y:{get:function(){return f},enumerable:!0},mods:{get:function(){return g},enumerable:!0}}),m}},24:function(e){var t={left:0,top:0};e.exports=r;function r(a,i,n){i=i||a.currentTarget||a.srcElement,Array.isArray(n)||(n=[0,0]);var s=a.clientX||0,c=a.clientY||0,f=o(i);return n[0]=s-f.left,n[1]=c-f.top,n}function o(a){return a===window||a===document||a===document.body?t:a.getBoundingClientRect()}},4687:function(e,t){"use strict";function r(n){if(typeof n=="object"){if("buttons"in n)return n.buttons;if("which"in n){var s=n.which;if(s===2)return 4;if(s===3)return 2;if(s>0)return 1<=0)return 1<0){if(ue=1,G[J++]=g(p[P],w,S,E),P+=U,y>0)for(Q=1,L=p[P],X=G[J]=g(L,w,S,E),j=G[J+oe],ce=G[J+ee],ze=G[J+be],(X!==j||X!==ce||X!==ze)&&(F=p[P+z],O=p[P+B],N=p[P+I],c(Q,ue,L,F,O,N,X,j,ce,ze,w,S,E),Re=$[J]=le++),J+=1,P+=U,Q=2;Q0)for(Q=1,L=p[P],X=G[J]=g(L,w,S,E),j=G[J+oe],ce=G[J+ee],ze=G[J+be],(X!==j||X!==ce||X!==ze)&&(F=p[P+z],O=p[P+B],N=p[P+I],c(Q,ue,L,F,O,N,X,j,ce,ze,w,S,E),Re=$[J]=le++,ze!==ce&&f($[J+ee],Re,O,N,ce,ze,w,S,E)),J+=1,P+=U,Q=2;Q0){if(Q=1,G[J++]=g(p[P],w,S,E),P+=U,b>0)for(ue=1,L=p[P],X=G[J]=g(L,w,S,E),ce=G[J+ee],j=G[J+oe],ze=G[J+be],(X!==ce||X!==j||X!==ze)&&(F=p[P+z],O=p[P+B],N=p[P+I],c(Q,ue,L,F,O,N,X,ce,j,ze,w,S,E),Re=$[J]=le++),J+=1,P+=U,ue=2;ue0)for(ue=1,L=p[P],X=G[J]=g(L,w,S,E),ce=G[J+ee],j=G[J+oe],ze=G[J+be],(X!==ce||X!==j||X!==ze)&&(F=p[P+z],O=p[P+B],N=p[P+I],c(Q,ue,L,F,O,N,X,ce,j,ze,w,S,E),Re=$[J]=le++,ze!==ce&&f($[J+ee],Re,N,F,ze,ce,w,S,E)),J+=1,P+=U,ue=2;ue 0"),typeof s.vertex!="function"&&c("Must specify vertex creation function"),typeof s.cell!="function"&&c("Must specify cell creation function"),typeof s.phase!="function"&&c("Must specify phase function");for(var T=s.getters||[],l=new Array(g),_=0;_=0?l[_]=!0:l[_]=!1;return i(s.vertex,s.cell,s.phase,v,f,l)}},6199:function(e,t,r){"use strict";var o=r(1338),a={zero:function(E,y,b,p){var u=E[0],m=b[0];p|=0;var h=0,P=m;for(h=0;h2&&h[1]>2&&p(m.pick(-1,-1).lo(1,1).hi(h[0]-2,h[1]-2),u.pick(-1,-1,0).lo(1,1).hi(h[0]-2,h[1]-2),u.pick(-1,-1,1).lo(1,1).hi(h[0]-2,h[1]-2)),h[1]>2&&(b(m.pick(0,-1).lo(1).hi(h[1]-2),u.pick(0,-1,1).lo(1).hi(h[1]-2)),y(u.pick(0,-1,0).lo(1).hi(h[1]-2))),h[1]>2&&(b(m.pick(h[0]-1,-1).lo(1).hi(h[1]-2),u.pick(h[0]-1,-1,1).lo(1).hi(h[1]-2)),y(u.pick(h[0]-1,-1,0).lo(1).hi(h[1]-2))),h[0]>2&&(b(m.pick(-1,0).lo(1).hi(h[0]-2),u.pick(-1,0,0).lo(1).hi(h[0]-2)),y(u.pick(-1,0,1).lo(1).hi(h[0]-2))),h[0]>2&&(b(m.pick(-1,h[1]-1).lo(1).hi(h[0]-2),u.pick(-1,h[1]-1,0).lo(1).hi(h[0]-2)),y(u.pick(-1,h[1]-1,1).lo(1).hi(h[0]-2))),u.set(0,0,0,0),u.set(0,0,1,0),u.set(h[0]-1,0,0,0),u.set(h[0]-1,0,1,0),u.set(0,h[1]-1,0,0),u.set(0,h[1]-1,1,0),u.set(h[0]-1,h[1]-1,0,0),u.set(h[0]-1,h[1]-1,1,0),u}}function S(E){var y=E.join(),h=g[y];if(h)return h;for(var b=E.length,p=[T,l],u=1;u<=b;++u)p.push(_(u));var m=w,h=m.apply(void 0,p);return g[y]=h,h}e.exports=function(y,b,p){if(Array.isArray(p)||(typeof p=="string"?p=o(b.dimension,p):p=o(b.dimension,"clamp")),b.size===0)return y;if(b.dimension===0)return y.set(0),y;var u=S(p);return u(y,b)}},4317:function(e){"use strict";function t(n,s){var c=Math.floor(s),f=s-c,g=0<=c&&c0;){O<64?(y=O,O=0):(y=64,O-=64);for(var I=g[1]|0;I>0;){I<64?(b=I,I=0):(b=64,I-=64),l=F+O*u+I*m,S=B+O*P+I*L;var N=0,U=0,W=0,Q=h,ue=u-p*h,le=m-y*u,he=z,G=P-p*z,$=L-y*P;for(W=0;W0;){L<64?(y=L,L=0):(y=64,L-=64);for(var z=g[0]|0;z>0;){z<64?(E=z,z=0):(E=64,z-=64),l=h+L*p+z*b,S=P+L*m+z*u;var F=0,B=0,O=p,I=b-y*p,N=m,U=u-y*m;for(B=0;B0;){B<64?(b=B,B=0):(b=64,B-=64);for(var O=g[0]|0;O>0;){O<64?(E=O,O=0):(E=64,O-=64);for(var I=g[1]|0;I>0;){I<64?(y=I,I=0):(y=64,I-=64),l=z+B*m+O*p+I*u,S=F+B*L+O*h+I*P;var N=0,U=0,W=0,Q=m,ue=p-b*m,le=u-E*p,he=L,G=h-b*L,$=P-E*h;for(W=0;W_;){N=0,U=F-y;t:for(O=0;OQ)break t;U+=h,N+=P}for(N=F,U=F-y,O=0;O>1,I=O-z,N=O+z,U=F,W=I,Q=O,ue=N,le=B,he=w+1,G=S-1,$=!0,J,X,oe,ie,j,ee,re,ce,be,Ae=0,ze=0,Re=0,Xe,it,ot,tt,lt,Ee,_e,fe,Fe,rt,st,Qe,Lt,kt,Vt,Zt,Sr=m,xr=T(Sr),jr=T(Sr);it=b*U,ot=b*W,Zt=y;e:for(Xe=0;Xe0){X=U,U=W,W=X;break e}if(Re<0)break e;Zt+=P}it=b*ue,ot=b*le,Zt=y;e:for(Xe=0;Xe0){X=ue,ue=le,le=X;break e}if(Re<0)break e;Zt+=P}it=b*U,ot=b*Q,Zt=y;e:for(Xe=0;Xe0){X=U,U=Q,Q=X;break e}if(Re<0)break e;Zt+=P}it=b*W,ot=b*Q,Zt=y;e:for(Xe=0;Xe0){X=W,W=Q,Q=X;break e}if(Re<0)break e;Zt+=P}it=b*U,ot=b*ue,Zt=y;e:for(Xe=0;Xe0){X=U,U=ue,ue=X;break e}if(Re<0)break e;Zt+=P}it=b*Q,ot=b*ue,Zt=y;e:for(Xe=0;Xe0){X=Q,Q=ue,ue=X;break e}if(Re<0)break e;Zt+=P}it=b*W,ot=b*le,Zt=y;e:for(Xe=0;Xe0){X=W,W=le,le=X;break e}if(Re<0)break e;Zt+=P}it=b*W,ot=b*Q,Zt=y;e:for(Xe=0;Xe0){X=W,W=Q,Q=X;break e}if(Re<0)break e;Zt+=P}it=b*ue,ot=b*le,Zt=y;e:for(Xe=0;Xe0){X=ue,ue=le,le=X;break e}if(Re<0)break e;Zt+=P}for(it=b*U,ot=b*W,tt=b*Q,lt=b*ue,Ee=b*le,_e=b*F,fe=b*O,Fe=b*B,Vt=0,Zt=y,Xe=0;Xe0)G--;else if(Re<0){for(it=b*ee,ot=b*he,tt=b*G,Zt=y,Xe=0;Xe0)for(;;){re=y+G*b,Vt=0;e:for(Xe=0;Xe0){if(--GB){e:for(;;){for(re=y+he*b,Vt=0,Zt=y,Xe=0;Xe1&&_?S(l,_[0],_[1]):S(l)}var f={"uint32,1,0":function(v,T){return function(l){var _=l.data,w=l.offset|0,S=l.shape,E=l.stride,y=E[0]|0,b=S[0]|0,p=E[1]|0,u=S[1]|0,m=p,h=p,P=1;b<=32?v(0,b-1,_,w,y,p,b,u,m,h,P):T(0,b-1,_,w,y,p,b,u,m,h,P)}}};function g(v,T){var l=[T,v].join(","),_=f[l],w=n(v,T),S=c(v,T,w);return _(w,S)}e.exports=g},446:function(e,t,r){"use strict";var o=r(7640),a={};function i(n){var s=n.order,c=n.dtype,f=[s,c],g=f.join(":"),v=a[g];return v||(a[g]=v=o(s,c)),v(n),n}e.exports=i},9618:function(e,t,r){var o=r(7163),a=typeof Float64Array<"u";function i(T,l){return T[0]-l[0]}function n(){var T=this.stride,l=new Array(T.length),_;for(_=0;_=0&&(p=y|0,b+=m*p,u-=p),new w(this.data,u,m,b)},S.step=function(y){var b=this.shape[0],p=this.stride[0],u=this.offset,m=0,h=Math.ceil;return typeof y=="number"&&(m=y|0,m<0?(u+=p*(b-1),b=h(-b/m)):b=h(b/m),p*=m),new w(this.data,b,p,u)},S.transpose=function(y){y=y===void 0?0:y|0;var b=this.shape,p=this.stride;return new w(this.data,b[y],p[y],this.offset)},S.pick=function(y){var b=[],p=[],u=this.offset;typeof y=="number"&&y>=0?u=u+this.stride[0]*y|0:(b.push(this.shape[0]),p.push(this.stride[0]));var m=l[b.length+1];return m(this.data,b,p,u)},function(y,b,p,u){return new w(y,b[0],p[0],u)}},2:function(T,l,_){function w(E,y,b,p,u,m){this.data=E,this.shape=[y,b],this.stride=[p,u],this.offset=m|0}var S=w.prototype;return S.dtype=T,S.dimension=2,Object.defineProperty(S,"size",{get:function(){return this.shape[0]*this.shape[1]}}),Object.defineProperty(S,"order",{get:function(){return Math.abs(this.stride[0])>Math.abs(this.stride[1])?[1,0]:[0,1]}}),S.set=function(y,b,p){return T==="generic"?this.data.set(this.offset+this.stride[0]*y+this.stride[1]*b,p):this.data[this.offset+this.stride[0]*y+this.stride[1]*b]=p},S.get=function(y,b){return T==="generic"?this.data.get(this.offset+this.stride[0]*y+this.stride[1]*b):this.data[this.offset+this.stride[0]*y+this.stride[1]*b]},S.index=function(y,b){return this.offset+this.stride[0]*y+this.stride[1]*b},S.hi=function(y,b){return new w(this.data,typeof y!="number"||y<0?this.shape[0]:y|0,typeof b!="number"||b<0?this.shape[1]:b|0,this.stride[0],this.stride[1],this.offset)},S.lo=function(y,b){var p=this.offset,u=0,m=this.shape[0],h=this.shape[1],P=this.stride[0],L=this.stride[1];return typeof y=="number"&&y>=0&&(u=y|0,p+=P*u,m-=u),typeof b=="number"&&b>=0&&(u=b|0,p+=L*u,h-=u),new w(this.data,m,h,P,L,p)},S.step=function(y,b){var p=this.shape[0],u=this.shape[1],m=this.stride[0],h=this.stride[1],P=this.offset,L=0,z=Math.ceil;return typeof y=="number"&&(L=y|0,L<0?(P+=m*(p-1),p=z(-p/L)):p=z(p/L),m*=L),typeof b=="number"&&(L=b|0,L<0?(P+=h*(u-1),u=z(-u/L)):u=z(u/L),h*=L),new w(this.data,p,u,m,h,P)},S.transpose=function(y,b){y=y===void 0?0:y|0,b=b===void 0?1:b|0;var p=this.shape,u=this.stride;return new w(this.data,p[y],p[b],u[y],u[b],this.offset)},S.pick=function(y,b){var p=[],u=[],m=this.offset;typeof y=="number"&&y>=0?m=m+this.stride[0]*y|0:(p.push(this.shape[0]),u.push(this.stride[0])),typeof b=="number"&&b>=0?m=m+this.stride[1]*b|0:(p.push(this.shape[1]),u.push(this.stride[1]));var h=l[p.length+1];return h(this.data,p,u,m)},function(y,b,p,u){return new w(y,b[0],b[1],p[0],p[1],u)}},3:function(T,l,_){function w(E,y,b,p,u,m,h,P){this.data=E,this.shape=[y,b,p],this.stride=[u,m,h],this.offset=P|0}var S=w.prototype;return S.dtype=T,S.dimension=3,Object.defineProperty(S,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]}}),Object.defineProperty(S,"order",{get:function(){var y=Math.abs(this.stride[0]),b=Math.abs(this.stride[1]),p=Math.abs(this.stride[2]);return y>b?b>p?[2,1,0]:y>p?[1,2,0]:[1,0,2]:y>p?[2,0,1]:p>b?[0,1,2]:[0,2,1]}}),S.set=function(y,b,p,u){return T==="generic"?this.data.set(this.offset+this.stride[0]*y+this.stride[1]*b+this.stride[2]*p,u):this.data[this.offset+this.stride[0]*y+this.stride[1]*b+this.stride[2]*p]=u},S.get=function(y,b,p){return T==="generic"?this.data.get(this.offset+this.stride[0]*y+this.stride[1]*b+this.stride[2]*p):this.data[this.offset+this.stride[0]*y+this.stride[1]*b+this.stride[2]*p]},S.index=function(y,b,p){return this.offset+this.stride[0]*y+this.stride[1]*b+this.stride[2]*p},S.hi=function(y,b,p){return new w(this.data,typeof y!="number"||y<0?this.shape[0]:y|0,typeof b!="number"||b<0?this.shape[1]:b|0,typeof p!="number"||p<0?this.shape[2]:p|0,this.stride[0],this.stride[1],this.stride[2],this.offset)},S.lo=function(y,b,p){var u=this.offset,m=0,h=this.shape[0],P=this.shape[1],L=this.shape[2],z=this.stride[0],F=this.stride[1],B=this.stride[2];return typeof y=="number"&&y>=0&&(m=y|0,u+=z*m,h-=m),typeof b=="number"&&b>=0&&(m=b|0,u+=F*m,P-=m),typeof p=="number"&&p>=0&&(m=p|0,u+=B*m,L-=m),new w(this.data,h,P,L,z,F,B,u)},S.step=function(y,b,p){var u=this.shape[0],m=this.shape[1],h=this.shape[2],P=this.stride[0],L=this.stride[1],z=this.stride[2],F=this.offset,B=0,O=Math.ceil;return typeof y=="number"&&(B=y|0,B<0?(F+=P*(u-1),u=O(-u/B)):u=O(u/B),P*=B),typeof b=="number"&&(B=b|0,B<0?(F+=L*(m-1),m=O(-m/B)):m=O(m/B),L*=B),typeof p=="number"&&(B=p|0,B<0?(F+=z*(h-1),h=O(-h/B)):h=O(h/B),z*=B),new w(this.data,u,m,h,P,L,z,F)},S.transpose=function(y,b,p){y=y===void 0?0:y|0,b=b===void 0?1:b|0,p=p===void 0?2:p|0;var u=this.shape,m=this.stride;return new w(this.data,u[y],u[b],u[p],m[y],m[b],m[p],this.offset)},S.pick=function(y,b,p){var u=[],m=[],h=this.offset;typeof y=="number"&&y>=0?h=h+this.stride[0]*y|0:(u.push(this.shape[0]),m.push(this.stride[0])),typeof b=="number"&&b>=0?h=h+this.stride[1]*b|0:(u.push(this.shape[1]),m.push(this.stride[1])),typeof p=="number"&&p>=0?h=h+this.stride[2]*p|0:(u.push(this.shape[2]),m.push(this.stride[2]));var P=l[u.length+1];return P(this.data,u,m,h)},function(y,b,p,u){return new w(y,b[0],b[1],b[2],p[0],p[1],p[2],u)}},4:function(T,l,_){function w(E,y,b,p,u,m,h,P,L,z){this.data=E,this.shape=[y,b,p,u],this.stride=[m,h,P,L],this.offset=z|0}var S=w.prototype;return S.dtype=T,S.dimension=4,Object.defineProperty(S,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]*this.shape[3]}}),Object.defineProperty(S,"order",{get:_}),S.set=function(y,b,p,u,m){return T==="generic"?this.data.set(this.offset+this.stride[0]*y+this.stride[1]*b+this.stride[2]*p+this.stride[3]*u,m):this.data[this.offset+this.stride[0]*y+this.stride[1]*b+this.stride[2]*p+this.stride[3]*u]=m},S.get=function(y,b,p,u){return T==="generic"?this.data.get(this.offset+this.stride[0]*y+this.stride[1]*b+this.stride[2]*p+this.stride[3]*u):this.data[this.offset+this.stride[0]*y+this.stride[1]*b+this.stride[2]*p+this.stride[3]*u]},S.index=function(y,b,p,u){return this.offset+this.stride[0]*y+this.stride[1]*b+this.stride[2]*p+this.stride[3]*u},S.hi=function(y,b,p,u){return new w(this.data,typeof y!="number"||y<0?this.shape[0]:y|0,typeof b!="number"||b<0?this.shape[1]:b|0,typeof p!="number"||p<0?this.shape[2]:p|0,typeof u!="number"||u<0?this.shape[3]:u|0,this.stride[0],this.stride[1],this.stride[2],this.stride[3],this.offset)},S.lo=function(y,b,p,u){var m=this.offset,h=0,P=this.shape[0],L=this.shape[1],z=this.shape[2],F=this.shape[3],B=this.stride[0],O=this.stride[1],I=this.stride[2],N=this.stride[3];return typeof y=="number"&&y>=0&&(h=y|0,m+=B*h,P-=h),typeof b=="number"&&b>=0&&(h=b|0,m+=O*h,L-=h),typeof p=="number"&&p>=0&&(h=p|0,m+=I*h,z-=h),typeof u=="number"&&u>=0&&(h=u|0,m+=N*h,F-=h),new w(this.data,P,L,z,F,B,O,I,N,m)},S.step=function(y,b,p,u){var m=this.shape[0],h=this.shape[1],P=this.shape[2],L=this.shape[3],z=this.stride[0],F=this.stride[1],B=this.stride[2],O=this.stride[3],I=this.offset,N=0,U=Math.ceil;return typeof y=="number"&&(N=y|0,N<0?(I+=z*(m-1),m=U(-m/N)):m=U(m/N),z*=N),typeof b=="number"&&(N=b|0,N<0?(I+=F*(h-1),h=U(-h/N)):h=U(h/N),F*=N),typeof p=="number"&&(N=p|0,N<0?(I+=B*(P-1),P=U(-P/N)):P=U(P/N),B*=N),typeof u=="number"&&(N=u|0,N<0?(I+=O*(L-1),L=U(-L/N)):L=U(L/N),O*=N),new w(this.data,m,h,P,L,z,F,B,O,I)},S.transpose=function(y,b,p,u){y=y===void 0?0:y|0,b=b===void 0?1:b|0,p=p===void 0?2:p|0,u=u===void 0?3:u|0;var m=this.shape,h=this.stride;return new w(this.data,m[y],m[b],m[p],m[u],h[y],h[b],h[p],h[u],this.offset)},S.pick=function(y,b,p,u){var m=[],h=[],P=this.offset;typeof y=="number"&&y>=0?P=P+this.stride[0]*y|0:(m.push(this.shape[0]),h.push(this.stride[0])),typeof b=="number"&&b>=0?P=P+this.stride[1]*b|0:(m.push(this.shape[1]),h.push(this.stride[1])),typeof p=="number"&&p>=0?P=P+this.stride[2]*p|0:(m.push(this.shape[2]),h.push(this.stride[2])),typeof u=="number"&&u>=0?P=P+this.stride[3]*u|0:(m.push(this.shape[3]),h.push(this.stride[3]));var L=l[m.length+1];return L(this.data,m,h,P)},function(y,b,p,u){return new w(y,b[0],b[1],b[2],b[3],p[0],p[1],p[2],p[3],u)}},5:function(l,_,w){function S(y,b,p,u,m,h,P,L,z,F,B,O){this.data=y,this.shape=[b,p,u,m,h],this.stride=[P,L,z,F,B],this.offset=O|0}var E=S.prototype;return E.dtype=l,E.dimension=5,Object.defineProperty(E,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]*this.shape[3]*this.shape[4]}}),Object.defineProperty(E,"order",{get:w}),E.set=function(b,p,u,m,h,P){return l==="generic"?this.data.set(this.offset+this.stride[0]*b+this.stride[1]*p+this.stride[2]*u+this.stride[3]*m+this.stride[4]*h,P):this.data[this.offset+this.stride[0]*b+this.stride[1]*p+this.stride[2]*u+this.stride[3]*m+this.stride[4]*h]=P},E.get=function(b,p,u,m,h){return l==="generic"?this.data.get(this.offset+this.stride[0]*b+this.stride[1]*p+this.stride[2]*u+this.stride[3]*m+this.stride[4]*h):this.data[this.offset+this.stride[0]*b+this.stride[1]*p+this.stride[2]*u+this.stride[3]*m+this.stride[4]*h]},E.index=function(b,p,u,m,h){return this.offset+this.stride[0]*b+this.stride[1]*p+this.stride[2]*u+this.stride[3]*m+this.stride[4]*h},E.hi=function(b,p,u,m,h){return new S(this.data,typeof b!="number"||b<0?this.shape[0]:b|0,typeof p!="number"||p<0?this.shape[1]:p|0,typeof u!="number"||u<0?this.shape[2]:u|0,typeof m!="number"||m<0?this.shape[3]:m|0,typeof h!="number"||h<0?this.shape[4]:h|0,this.stride[0],this.stride[1],this.stride[2],this.stride[3],this.stride[4],this.offset)},E.lo=function(b,p,u,m,h){var P=this.offset,L=0,z=this.shape[0],F=this.shape[1],B=this.shape[2],O=this.shape[3],I=this.shape[4],N=this.stride[0],U=this.stride[1],W=this.stride[2],Q=this.stride[3],ue=this.stride[4];return typeof b=="number"&&b>=0&&(L=b|0,P+=N*L,z-=L),typeof p=="number"&&p>=0&&(L=p|0,P+=U*L,F-=L),typeof u=="number"&&u>=0&&(L=u|0,P+=W*L,B-=L),typeof m=="number"&&m>=0&&(L=m|0,P+=Q*L,O-=L),typeof h=="number"&&h>=0&&(L=h|0,P+=ue*L,I-=L),new S(this.data,z,F,B,O,I,N,U,W,Q,ue,P)},E.step=function(b,p,u,m,h){var P=this.shape[0],L=this.shape[1],z=this.shape[2],F=this.shape[3],B=this.shape[4],O=this.stride[0],I=this.stride[1],N=this.stride[2],U=this.stride[3],W=this.stride[4],Q=this.offset,ue=0,le=Math.ceil;return typeof b=="number"&&(ue=b|0,ue<0?(Q+=O*(P-1),P=le(-P/ue)):P=le(P/ue),O*=ue),typeof p=="number"&&(ue=p|0,ue<0?(Q+=I*(L-1),L=le(-L/ue)):L=le(L/ue),I*=ue),typeof u=="number"&&(ue=u|0,ue<0?(Q+=N*(z-1),z=le(-z/ue)):z=le(z/ue),N*=ue),typeof m=="number"&&(ue=m|0,ue<0?(Q+=U*(F-1),F=le(-F/ue)):F=le(F/ue),U*=ue),typeof h=="number"&&(ue=h|0,ue<0?(Q+=W*(B-1),B=le(-B/ue)):B=le(B/ue),W*=ue),new S(this.data,P,L,z,F,B,O,I,N,U,W,Q)},E.transpose=function(b,p,u,m,h){b=b===void 0?0:b|0,p=p===void 0?1:p|0,u=u===void 0?2:u|0,m=m===void 0?3:m|0,h=h===void 0?4:h|0;var P=this.shape,L=this.stride;return new S(this.data,P[b],P[p],P[u],P[m],P[h],L[b],L[p],L[u],L[m],L[h],this.offset)},E.pick=function(b,p,u,m,h){var P=[],L=[],z=this.offset;typeof b=="number"&&b>=0?z=z+this.stride[0]*b|0:(P.push(this.shape[0]),L.push(this.stride[0])),typeof p=="number"&&p>=0?z=z+this.stride[1]*p|0:(P.push(this.shape[1]),L.push(this.stride[1])),typeof u=="number"&&u>=0?z=z+this.stride[2]*u|0:(P.push(this.shape[2]),L.push(this.stride[2])),typeof m=="number"&&m>=0?z=z+this.stride[3]*m|0:(P.push(this.shape[3]),L.push(this.stride[3])),typeof h=="number"&&h>=0?z=z+this.stride[4]*h|0:(P.push(this.shape[4]),L.push(this.stride[4]));var F=_[P.length+1];return F(this.data,P,L,z)},function(b,p,u,m){return new S(b,p[0],p[1],p[2],p[3],p[4],u[0],u[1],u[2],u[3],u[4],m)}}};function c(T,l){var _=l===-1?"T":String(l),w=s[_];return l===-1?w(T):l===0?w(T,g[T][0]):w(T,g[T],n)}function f(T){if(o(T))return"buffer";if(a)switch(Object.prototype.toString.call(T)){case"[object Float64Array]":return"float64";case"[object Float32Array]":return"float32";case"[object Int8Array]":return"int8";case"[object Int16Array]":return"int16";case"[object Int32Array]":return"int32";case"[object Uint8ClampedArray]":return"uint8_clamped";case"[object Uint8Array]":return"uint8";case"[object Uint16Array]":return"uint16";case"[object Uint32Array]":return"uint32";case"[object BigInt64Array]":return"bigint64";case"[object BigUint64Array]":return"biguint64"}return Array.isArray(T)?"array":"generic"}var g={generic:[],buffer:[],array:[],float32:[],float64:[],int8:[],int16:[],int32:[],uint8_clamped:[],uint8:[],uint16:[],uint32:[],bigint64:[],biguint64:[]};function v(T,l,_,w){if(T===void 0){var u=g.array[0];return u([])}else typeof T=="number"&&(T=[T]);l===void 0&&(l=[T.length]);var S=l.length;if(_===void 0){_=new Array(S);for(var E=S-1,y=1;E>=0;--E)_[E]=y,y*=l[E]}if(w===void 0){w=0;for(var E=0;E>>0;e.exports=n;function n(s,c){if(isNaN(s)||isNaN(c))return NaN;if(s===c)return s;if(s===0)return c<0?-a:a;var f=o.hi(s),g=o.lo(s);return c>s==s>0?g===i?(f+=1,g=0):g+=1:g===0?(g=i,f-=1):g-=1,o.pack(g,f)}},8406:function(e,t){var r=1e-6,o=1e-6;t.vertexNormals=function(a,i,n){for(var s=i.length,c=new Array(s),f=n===void 0?r:n,g=0;gf)for(var P=c[l],L=1/Math.sqrt(p*m),h=0;h<3;++h){var z=(h+1)%3,F=(h+2)%3;P[h]+=L*(u[z]*b[F]-u[F]*b[z])}}for(var g=0;gf)for(var L=1/Math.sqrt(B),h=0;h<3;++h)P[h]*=L;else for(var h=0;h<3;++h)P[h]=0}return c},t.faceNormals=function(a,i,n){for(var s=a.length,c=new Array(s),f=n===void 0?o:n,g=0;gf?E=1/Math.sqrt(E):E=0;for(var l=0;l<3;++l)S[l]*=E;c[g]=S}return c}},4081:function(e){"use strict";e.exports=t;function t(r,o,a,i,n,s,c,f,g,v){var T=o+s+v;if(l>0){var l=Math.sqrt(T+1);r[0]=.5*(c-g)/l,r[1]=.5*(f-i)/l,r[2]=.5*(a-s)/l,r[3]=.5*l}else{var _=Math.max(o,s,v),l=Math.sqrt(2*_-T+1);o>=_?(r[0]=.5*l,r[1]=.5*(n+a)/l,r[2]=.5*(f+i)/l,r[3]=.5*(c-g)/l):s>=_?(r[0]=.5*(a+n)/l,r[1]=.5*l,r[2]=.5*(g+c)/l,r[3]=.5*(f-i)/l):(r[0]=.5*(i+f)/l,r[1]=.5*(c+g)/l,r[2]=.5*l,r[3]=.5*(a-n)/l)}return r}},9977:function(e,t,r){"use strict";e.exports=l;var o=r(9215),a=r(6582),i=r(7399),n=r(7608),s=r(4081);function c(_,w,S){return Math.sqrt(Math.pow(_,2)+Math.pow(w,2)+Math.pow(S,2))}function f(_,w,S,E){return Math.sqrt(Math.pow(_,2)+Math.pow(w,2)+Math.pow(S,2)+Math.pow(E,2))}function g(_,w){var S=w[0],E=w[1],y=w[2],b=w[3],p=f(S,E,y,b);p>1e-6?(_[0]=S/p,_[1]=E/p,_[2]=y/p,_[3]=b/p):(_[0]=_[1]=_[2]=0,_[3]=1)}function v(_,w,S){this.radius=o([S]),this.center=o(w),this.rotation=o(_),this.computedRadius=this.radius.curve(0),this.computedCenter=this.center.curve(0),this.computedRotation=this.rotation.curve(0),this.computedUp=[.1,0,0],this.computedEye=[.1,0,0],this.computedMatrix=[.1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.recalcMatrix(0)}var T=v.prototype;T.lastT=function(){return Math.max(this.radius.lastT(),this.center.lastT(),this.rotation.lastT())},T.recalcMatrix=function(_){this.radius.curve(_),this.center.curve(_),this.rotation.curve(_);var w=this.computedRotation;g(w,w);var S=this.computedMatrix;i(S,w);var E=this.computedCenter,y=this.computedEye,b=this.computedUp,p=Math.exp(this.computedRadius[0]);y[0]=E[0]+p*S[2],y[1]=E[1]+p*S[6],y[2]=E[2]+p*S[10],b[0]=S[1],b[1]=S[5],b[2]=S[9];for(var u=0;u<3;++u){for(var m=0,h=0;h<3;++h)m+=S[u+4*h]*y[h];S[12+u]=-m}},T.getMatrix=function(_,w){this.recalcMatrix(_);var S=this.computedMatrix;if(w){for(var E=0;E<16;++E)w[E]=S[E];return w}return S},T.idle=function(_){this.center.idle(_),this.radius.idle(_),this.rotation.idle(_)},T.flush=function(_){this.center.flush(_),this.radius.flush(_),this.rotation.flush(_)},T.pan=function(_,w,S,E){w=w||0,S=S||0,E=E||0,this.recalcMatrix(_);var y=this.computedMatrix,b=y[1],p=y[5],u=y[9],m=c(b,p,u);b/=m,p/=m,u/=m;var h=y[0],P=y[4],L=y[8],z=h*b+P*p+L*u;h-=b*z,P-=p*z,L-=u*z;var F=c(h,P,L);h/=F,P/=F,L/=F;var B=y[2],O=y[6],I=y[10],N=B*b+O*p+I*u,U=B*h+O*P+I*L;B-=N*b+U*h,O-=N*p+U*P,I-=N*u+U*L;var W=c(B,O,I);B/=W,O/=W,I/=W;var Q=h*w+b*S,ue=P*w+p*S,le=L*w+u*S;this.center.move(_,Q,ue,le);var he=Math.exp(this.computedRadius[0]);he=Math.max(1e-4,he+E),this.radius.set(_,Math.log(he))},T.rotate=function(_,w,S,E){this.recalcMatrix(_),w=w||0,S=S||0;var y=this.computedMatrix,b=y[0],p=y[4],u=y[8],m=y[1],h=y[5],P=y[9],L=y[2],z=y[6],F=y[10],B=w*b+S*m,O=w*p+S*h,I=w*u+S*P,N=-(z*I-F*O),U=-(F*B-L*I),W=-(L*O-z*B),Q=Math.sqrt(Math.max(0,1-Math.pow(N,2)-Math.pow(U,2)-Math.pow(W,2))),ue=f(N,U,W,Q);ue>1e-6?(N/=ue,U/=ue,W/=ue,Q/=ue):(N=U=W=0,Q=1);var le=this.computedRotation,he=le[0],G=le[1],$=le[2],J=le[3],X=he*Q+J*N+G*W-$*U,oe=G*Q+J*U+$*N-he*W,ie=$*Q+J*W+he*U-G*N,j=J*Q-he*N-G*U-$*W;if(E){N=L,U=z,W=F;var ee=Math.sin(E)/c(N,U,W);N*=ee,U*=ee,W*=ee,Q=Math.cos(w),X=X*Q+j*N+oe*W-ie*U,oe=oe*Q+j*U+ie*N-X*W,ie=ie*Q+j*W+X*U-oe*N,j=j*Q-X*N-oe*U-ie*W}var re=f(X,oe,ie,j);re>1e-6?(X/=re,oe/=re,ie/=re,j/=re):(X=oe=ie=0,j=1),this.rotation.set(_,X,oe,ie,j)},T.lookAt=function(_,w,S,E){this.recalcMatrix(_),S=S||this.computedCenter,w=w||this.computedEye,E=E||this.computedUp;var y=this.computedMatrix;a(y,w,S,E);var b=this.computedRotation;s(b,y[0],y[1],y[2],y[4],y[5],y[6],y[8],y[9],y[10]),g(b,b),this.rotation.set(_,b[0],b[1],b[2],b[3]);for(var p=0,u=0;u<3;++u)p+=Math.pow(S[u]-w[u],2);this.radius.set(_,.5*Math.log(Math.max(p,1e-6))),this.center.set(_,S[0],S[1],S[2])},T.translate=function(_,w,S,E){this.center.move(_,w||0,S||0,E||0)},T.setMatrix=function(_,w){var S=this.computedRotation;s(S,w[0],w[1],w[2],w[4],w[5],w[6],w[8],w[9],w[10]),g(S,S),this.rotation.set(_,S[0],S[1],S[2],S[3]);var E=this.computedMatrix;n(E,w);var y=E[15];if(Math.abs(y)>1e-6){var b=E[12]/y,p=E[13]/y,u=E[14]/y;this.recalcMatrix(_);var m=Math.exp(this.computedRadius[0]);this.center.set(_,b-E[2]*m,p-E[6]*m,u-E[10]*m),this.radius.idle(_)}else this.center.idle(_),this.radius.idle(_)},T.setDistance=function(_,w){w>0&&this.radius.set(_,Math.log(w))},T.setDistanceLimits=function(_,w){_>0?_=Math.log(_):_=-1/0,w>0?w=Math.log(w):w=1/0,w=Math.max(w,_),this.radius.bounds[0][0]=_,this.radius.bounds[1][0]=w},T.getDistanceLimits=function(_){var w=this.radius.bounds;return _?(_[0]=Math.exp(w[0][0]),_[1]=Math.exp(w[1][0]),_):[Math.exp(w[0][0]),Math.exp(w[1][0])]},T.toJSON=function(){return this.recalcMatrix(this.lastT()),{center:this.computedCenter.slice(),rotation:this.computedRotation.slice(),distance:Math.log(this.computedRadius[0]),zoomMin:this.radius.bounds[0][0],zoomMax:this.radius.bounds[1][0]}},T.fromJSON=function(_){var w=this.lastT(),S=_.center;S&&this.center.set(w,S[0],S[1],S[2]);var E=_.rotation;E&&this.rotation.set(w,E[0],E[1],E[2],E[3]);var y=_.distance;y&&y>0&&this.radius.set(w,Math.log(y)),this.setDistanceLimits(_.zoomMin,_.zoomMax)};function l(_){_=_||{};var w=_.center||[0,0,0],S=_.rotation||[0,0,0,1],E=_.radius||1;w=[].slice.call(w,0,3),S=[].slice.call(S,0,4),g(S,S);var y=new v(S,w,Math.log(E));return y.setDistanceLimits(_.zoomMin,_.zoomMax),("eye"in _||"up"in _)&&y.lookAt(0,_.eye,_.center,_.up),y}},1371:function(e,t,r){"use strict";var o=r(3233);e.exports=function(i,n,s){return s=typeof s<"u"?s+"":" ",o(s,n)+i}},3202:function(e){e.exports=function(r,o){o||(o=[0,""]),r=String(r);var a=parseFloat(r,10);return o[0]=a,o[1]=r.match(/[\d.\-\+]*\s*(.*)/)[1]||"",o}},3088:function(e,t,r){"use strict";e.exports=a;var o=r(3140);function a(i,n){for(var s=n.length|0,c=i.length,f=[new Array(s),new Array(s)],g=0;g0){P=f[F][m][0],z=F;break}L=P[z^1];for(var B=0;B<2;++B)for(var O=f[B][m],I=0;I0&&(P=N,L=U,z=B)}return h||P&&l(P,z),L}function w(u,m){var h=f[m][u][0],P=[u];l(h,m);for(var L=h[m^1],z=m;;){for(;L!==u;)P.push(L),L=_(P[P.length-2],L,!1);if(f[0][u].length+f[1][u].length===0)break;var F=P[P.length-1],B=u,O=P[1],I=_(F,B,!0);if(o(n[F],n[B],n[O],n[I])<0)break;P.push(u),L=_(F,B)}return P}function S(u,m){return m[1]===m[m.length-1]}for(var g=0;g0;){var b=f[0][g].length,p=w(g,E);S(y,p)?y.push.apply(y,p):(y.length>0&&T.push(y),y=p)}y.length>0&&T.push(y)}return T}},5609:function(e,t,r){"use strict";e.exports=a;var o=r(3134);function a(i,n){for(var s=o(i,n.length),c=new Array(n.length),f=new Array(n.length),g=[],v=0;v0;){var l=g.pop();c[l]=!1;for(var _=s[l],v=0;v<_.length;++v){var w=_[v];--f[w]===0&&g.push(w)}}for(var S=new Array(n.length),E=[],v=0;v0}b=b.filter(p);for(var u=b.length,m=new Array(u),h=new Array(u),y=0;y0;){var re=ie.pop(),ce=ue[re];c(ce,function(Xe,it){return Xe-it});var be=ce.length,Ae=j[re],ze;if(Ae===0){var O=b[re];ze=[O]}for(var y=0;y=0)&&(j[Re]=Ae^1,ie.push(Re),Ae===0)){var O=b[Re];oe(O)||(O.reverse(),ze.push(O))}}Ae===0&&ee.push(ze)}return ee}},5085:function(e,t,r){e.exports=_;var o=r(3250)[3],a=r(4209),i=r(3352),n=r(2478);function s(){return!0}function c(w){return function(S,E){var y=w[S];return y?!!y.queryPoint(E,s):!1}}function f(w){for(var S={},E=0;E0&&S[y]===E[0])b=w[y-1];else return 1;for(var p=1;b;){var u=b.key,m=o(E,u[0],u[1]);if(u[0][0]0)p=-1,b=b.right;else return 0;else if(m>0)b=b.left;else if(m<0)p=1,b=b.right;else return 0}return p}}function v(w){return 1}function T(w){return function(E){return w(E[0],E[1])?0:1}}function l(w,S){return function(y){return w(y[0],y[1])?0:S(y)}}function _(w){for(var S=w.length,E=[],y=[],b=0,p=0;p=v?(u=1,h=v+2*_+S):(u=-_/v,h=_*u+S)):(u=0,w>=0?(m=0,h=S):-w>=l?(m=1,h=l+2*w+S):(m=-w/l,h=w*m+S));else if(m<0)m=0,_>=0?(u=0,h=S):-_>=v?(u=1,h=v+2*_+S):(u=-_/v,h=_*u+S);else{var P=1/p;u*=P,m*=P,h=u*(v*u+T*m+2*_)+m*(T*u+l*m+2*w)+S}else{var L,z,F,B;u<0?(L=T+_,z=l+w,z>L?(F=z-L,B=v-2*T+l,F>=B?(u=1,m=0,h=v+2*_+S):(u=F/B,m=1-u,h=u*(v*u+T*m+2*_)+m*(T*u+l*m+2*w)+S)):(u=0,z<=0?(m=1,h=l+2*w+S):w>=0?(m=0,h=S):(m=-w/l,h=w*m+S))):m<0?(L=T+w,z=v+_,z>L?(F=z-L,B=v-2*T+l,F>=B?(m=1,u=0,h=l+2*w+S):(m=F/B,u=1-m,h=u*(v*u+T*m+2*_)+m*(T*u+l*m+2*w)+S)):(m=0,z<=0?(u=1,h=v+2*_+S):_>=0?(u=0,h=S):(u=-_/v,h=_*u+S))):(F=l+w-T-_,F<=0?(u=0,m=1,h=l+2*w+S):(B=v-2*T+l,F>=B?(u=1,m=0,h=v+2*_+S):(u=F/B,m=1-u,h=u*(v*u+T*m+2*_)+m*(T*u+l*m+2*w)+S)))}for(var O=1-u-m,g=0;g0){var l=s[f-1];if(o(v,l)===0&&i(l)!==T){f-=1;continue}}s[f++]=v}}return s.length=f,s}},3233:function(e){"use strict";var t="",r;e.exports=o;function o(a,i){if(typeof a!="string")throw new TypeError("expected a string");if(i===1)return a;if(i===2)return a+a;var n=a.length*i;if(r!==a||typeof r>"u")r=a,t="";else if(t.length>=n)return t.substr(0,n);for(;n>t.length&&i>1;)i&1&&(t+=a),i>>=1,a+=a;return t+=a,t=t.substr(0,n),t}},3025:function(e,t,r){e.exports=r.g.performance&&r.g.performance.now?function(){return performance.now()}:Date.now||function(){return+new Date}},7004:function(e){"use strict";e.exports=t;function t(r){for(var o=r.length,a=r[r.length-1],i=o,n=o-2;n>=0;--n){var s=a,c=r[n];a=s+c;var f=a-s,g=c-f;g&&(r[--i]=a,a=g)}for(var v=0,n=i;n0){if(z<=0)return F;B=L+z}else if(L<0){if(z>=0)return F;B=-(L+z)}else return F;var O=f*B;return F>=O||F<=-O?F:w(m,h,P)},function(m,h,P,L){var z=m[0]-L[0],F=h[0]-L[0],B=P[0]-L[0],O=m[1]-L[1],I=h[1]-L[1],N=P[1]-L[1],U=m[2]-L[2],W=h[2]-L[2],Q=P[2]-L[2],ue=F*N,le=B*I,he=B*O,G=z*N,$=z*I,J=F*O,X=U*(ue-le)+W*(he-G)+Q*($-J),oe=(Math.abs(ue)+Math.abs(le))*Math.abs(U)+(Math.abs(he)+Math.abs(G))*Math.abs(W)+(Math.abs($)+Math.abs(J))*Math.abs(Q),ie=g*oe;return X>ie||-X>ie?X:S(m,h,P,L)}];function y(u){var m=E[u.length];return m||(m=E[u.length]=_(u.length)),m.apply(void 0,u)}function b(u,m,h,P,L,z,F){return function(O,I,N,U,W){switch(arguments.length){case 0:case 1:return 0;case 2:return P(O,I);case 3:return L(O,I,N);case 4:return z(O,I,N,U);case 5:return F(O,I,N,U,W)}for(var Q=new Array(arguments.length),ue=0;ue0&&v>0||g<0&&v<0)return!1;var T=o(c,n,s),l=o(f,n,s);return T>0&&l>0||T<0&&l<0?!1:g===0&&v===0&&T===0&&l===0?a(n,s,c,f):!0}},8545:function(e){"use strict";e.exports=r;function t(o,a){var i=o+a,n=i-o,s=i-n,c=a-n,f=o-s,g=f+c;return g?[g,i]:[i]}function r(o,a){var i=o.length|0,n=a.length|0;if(i===1&&n===1)return t(o[0],-a[0]);var s=i+n,c=new Array(s),f=0,g=0,v=0,T=Math.abs,l=o[g],_=T(l),w=-a[v],S=T(w),E,y;_=n?(E=l,g+=1,g=n?(E=l,g+=1,g"u"&&(E=s(_));var y=_.length;if(y===0||E<1)return{cells:[],vertexIds:[],vertexWeights:[]};var b=c(w,+S),p=f(_,E),u=g(p,w,b,+S),m=v(p,w.length|0),h=n(E)(_,p.data,m,b),P=T(p),L=[].slice.call(u.data,0,u.shape[0]);return a.free(b),a.free(p.data),a.free(u.data),a.free(m),{cells:h,vertexIds:P,vertexWeights:L}}},1570:function(e){"use strict";e.exports=r;var t=[function(){function a(n,s,c,f){for(var g=Math.min(c,f)|0,v=Math.max(c,f)|0,T=n[2*g],l=n[2*g+1];T>1,w=s[2*_+1];if(w===v)return _;v>1,w=s[2*_+1];if(w===v)return _;v>1,w=s[2*_+1];if(w===v)return _;v>1,w=s[2*_+1];if(w===v)return _;v>1,B=f(m[F],h);B<=0?(B===0&&(z=F),P=F+1):B>0&&(L=F-1)}return z}o=l;function _(m,h){for(var P=new Array(m.length),L=0,z=P.length;L=m.length||f(m[ue],F)!==0););}return P}o=_;function w(m,h){if(!h)return _(T(E(m,0)),m,0);for(var P=new Array(h),L=0;L>>N&1&&I.push(z[N]);h.push(I)}return v(h)}o=S;function E(m,h){if(h<0)return[];for(var P=[],L=(1<0)-(i<0)},t.abs=function(i){var n=i>>r-1;return(i^n)-n},t.min=function(i,n){return n^(i^n)&-(i65535)<<4,i>>>=n,s=(i>255)<<3,i>>>=s,n|=s,s=(i>15)<<2,i>>>=s,n|=s,s=(i>3)<<1,i>>>=s,n|=s,n|i>>1},t.log10=function(i){return i>=1e9?9:i>=1e8?8:i>=1e7?7:i>=1e6?6:i>=1e5?5:i>=1e4?4:i>=1e3?3:i>=100?2:i>=10?1:0},t.popCount=function(i){return i=i-(i>>>1&1431655765),i=(i&858993459)+(i>>>2&858993459),(i+(i>>>4)&252645135)*16843009>>>24};function o(i){var n=32;return i&=-i,i&&n--,i&65535&&(n-=16),i&16711935&&(n-=8),i&252645135&&(n-=4),i&858993459&&(n-=2),i&1431655765&&(n-=1),n}t.countTrailingZeros=o,t.nextPow2=function(i){return i+=i===0,--i,i|=i>>>1,i|=i>>>2,i|=i>>>4,i|=i>>>8,i|=i>>>16,i+1},t.prevPow2=function(i){return i|=i>>>1,i|=i>>>2,i|=i>>>4,i|=i>>>8,i|=i>>>16,i-(i>>>1)},t.parity=function(i){return i^=i>>>16,i^=i>>>8,i^=i>>>4,i&=15,27030>>>i&1};var a=new Array(256);(function(i){for(var n=0;n<256;++n){var s=n,c=n,f=7;for(s>>>=1;s;s>>>=1)c<<=1,c|=s&1,--f;i[n]=c<>>8&255]<<16|a[i>>>16&255]<<8|a[i>>>24&255]},t.interleave2=function(i,n){return i&=65535,i=(i|i<<8)&16711935,i=(i|i<<4)&252645135,i=(i|i<<2)&858993459,i=(i|i<<1)&1431655765,n&=65535,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,i|n<<1},t.deinterleave2=function(i,n){return i=i>>>n&1431655765,i=(i|i>>>1)&858993459,i=(i|i>>>2)&252645135,i=(i|i>>>4)&16711935,i=(i|i>>>16)&65535,i<<16>>16},t.interleave3=function(i,n,s){return i&=1023,i=(i|i<<16)&4278190335,i=(i|i<<8)&251719695,i=(i|i<<4)&3272356035,i=(i|i<<2)&1227133513,n&=1023,n=(n|n<<16)&4278190335,n=(n|n<<8)&251719695,n=(n|n<<4)&3272356035,n=(n|n<<2)&1227133513,i|=n<<1,s&=1023,s=(s|s<<16)&4278190335,s=(s|s<<8)&251719695,s=(s|s<<4)&3272356035,s=(s|s<<2)&1227133513,i|s<<2},t.deinterleave3=function(i,n){return i=i>>>n&1227133513,i=(i|i>>>2)&3272356035,i=(i|i>>>4)&251719695,i=(i|i>>>8)&4278190335,i=(i|i>>>16)&1023,i<<22>>22},t.nextCombination=function(i){var n=i|i-1;return n+1|(~n&-~n)-1>>>o(i)+1}},2014:function(e,t,r){"use strict";"use restrict";var o=r(3105),a=r(4623);function i(u){for(var m=0,h=Math.max,P=0,L=u.length;P>1,F=c(u[z],m);F<=0?(F===0&&(L=z),h=z+1):F>0&&(P=z-1)}return L}t.findCell=T;function l(u,m){for(var h=new Array(u.length),P=0,L=h.length;P=u.length||c(u[Q],z)!==0););}return h}t.incidence=l;function _(u,m){if(!m)return l(v(S(u,0)),u,0);for(var h=new Array(m),P=0;P>>I&1&&O.push(L[I]);m.push(O)}return g(m)}t.explode=w;function S(u,m){if(m<0)return[];for(var h=[],P=(1<>1:(G>>1)-1}function P(G){for(var $=m(G);;){var J=$,X=2*G+1,oe=2*(G+1),ie=G;if(X0;){var J=h(G);if(J>=0){var X=m(J);if($0){var G=O[0];return u(0,U-1),U-=1,P(0),G}return-1}function F(G,$){var J=O[G];return _[J]===$?G:(_[J]=-1/0,L(G),z(),_[J]=$,U+=1,L(U-1))}function B(G){if(!w[G]){w[G]=!0;var $=T[G],J=l[G];T[J]>=0&&(T[J]=$),l[$]>=0&&(l[$]=J),I[$]>=0&&F(I[$],p($)),I[J]>=0&&F(I[J],p(J))}}for(var O=[],I=new Array(g),S=0;S>1;S>=0;--S)P(S);for(;;){var W=z();if(W<0||_[W]>f)break;B(W)}for(var Q=[],S=0;S=0&&J>=0&&$!==J){var X=I[$],oe=I[J];X!==oe&&he.push([X,oe])}}),a.unique(a.normalize(he)),{positions:Q,edges:he}}},1303:function(e,t,r){"use strict";e.exports=i;var o=r(3250);function a(n,s){var c,f;if(s[0][0]s[1][0])c=s[1],f=s[0];else{var g=Math.min(n[0][1],n[1][1]),v=Math.max(n[0][1],n[1][1]),T=Math.min(s[0][1],s[1][1]),l=Math.max(s[0][1],s[1][1]);return vl?g-l:v-l}var _,w;n[0][1]s[1][0])c=s[1],f=s[0];else return a(s,n);var g,v;if(n[0][0]n[1][0])g=n[1],v=n[0];else return-a(n,s);var T=o(c,f,v),l=o(c,f,g);if(T<0){if(l<=0)return T}else if(T>0){if(l>=0)return T}else if(l)return l;if(T=o(v,g,f),l=o(v,g,c),T<0){if(l<=0)return T}else if(T>0){if(l>=0)return T}else if(l)return l;return f[0]-v[0]}},4209:function(e,t,r){"use strict";e.exports=l;var o=r(2478),a=r(3840),i=r(3250),n=r(1303);function s(_,w,S){this.slabs=_,this.coordinates=w,this.horizontal=S}var c=s.prototype;function f(_,w){return _.y-w}function g(_,w){for(var S=null;_;){var E=_.key,y,b;E[0][0]0)if(w[0]!==E[1][0])S=_,_=_.right;else{var u=g(_.right,w);if(u)return u;_=_.left}else{if(w[0]!==E[1][0])return _;var u=g(_.right,w);if(u)return u;_=_.left}}return S}c.castUp=function(_){var w=o.le(this.coordinates,_[0]);if(w<0)return-1;var S=this.slabs[w],E=g(this.slabs[w],_),y=-1;if(E&&(y=E.value),this.coordinates[w]===_[0]){var b=null;if(E&&(b=E.key),w>0){var p=g(this.slabs[w-1],_);p&&(b?n(p.key,b)>0&&(b=p.key,y=p.value):(y=p.value,b=p.key))}var u=this.horizontal[w];if(u.length>0){var m=o.ge(u,_[1],f);if(m=u.length)return y;h=u[m]}}if(h.start)if(b){var P=i(b[0],b[1],[_[0],h.y]);b[0][0]>b[1][0]&&(P=-P),P>0&&(y=h.index)}else y=h.index;else h.y!==_[1]&&(y=h.index)}}}return y};function v(_,w,S,E){this.y=_,this.index=w,this.start=S,this.closed=E}function T(_,w,S,E){this.x=_,this.segment=w,this.create=S,this.index=E}function l(_){for(var w=_.length,S=2*w,E=new Array(S),y=0;y1&&(w=1);for(var S=1-w,E=g.length,y=new Array(E),b=0;b0||_>0&&y<0){var b=n(w,y,S,_);T.push(b),l.push(b.slice())}y<0?l.push(S.slice()):y>0?T.push(S.slice()):(T.push(S.slice()),l.push(S.slice())),_=y}return{positive:T,negative:l}}function c(g,v){for(var T=[],l=i(g[g.length-1],v),_=g[g.length-1],w=g[0],S=0;S0||l>0&&E<0)&&T.push(n(_,E,w,l)),E>=0&&T.push(w.slice()),l=E}return T}function f(g,v){for(var T=[],l=i(g[g.length-1],v),_=g[g.length-1],w=g[0],S=0;S0||l>0&&E<0)&&T.push(n(_,E,w,l)),E<=0&&T.push(w.slice()),l=E}return T}},3387:function(e,t,r){var o;(function(){"use strict";var a={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function i(g){return s(f(g),arguments)}function n(g,v){return i.apply(null,[g].concat(v||[]))}function s(g,v){var T=1,l=g.length,_,w="",S,E,y,b,p,u,m,h;for(S=0;S=0),y.type){case"b":_=parseInt(_,10).toString(2);break;case"c":_=String.fromCharCode(parseInt(_,10));break;case"d":case"i":_=parseInt(_,10);break;case"j":_=JSON.stringify(_,null,y.width?parseInt(y.width):0);break;case"e":_=y.precision?parseFloat(_).toExponential(y.precision):parseFloat(_).toExponential();break;case"f":_=y.precision?parseFloat(_).toFixed(y.precision):parseFloat(_);break;case"g":_=y.precision?String(Number(_.toPrecision(y.precision))):parseFloat(_);break;case"o":_=(parseInt(_,10)>>>0).toString(8);break;case"s":_=String(_),_=y.precision?_.substring(0,y.precision):_;break;case"t":_=String(!!_),_=y.precision?_.substring(0,y.precision):_;break;case"T":_=Object.prototype.toString.call(_).slice(8,-1).toLowerCase(),_=y.precision?_.substring(0,y.precision):_;break;case"u":_=parseInt(_,10)>>>0;break;case"v":_=_.valueOf(),_=y.precision?_.substring(0,y.precision):_;break;case"x":_=(parseInt(_,10)>>>0).toString(16);break;case"X":_=(parseInt(_,10)>>>0).toString(16).toUpperCase();break}a.json.test(y.type)?w+=_:(a.number.test(y.type)&&(!m||y.sign)?(h=m?"+":"-",_=_.toString().replace(a.sign,"")):h="",p=y.pad_char?y.pad_char==="0"?"0":y.pad_char.charAt(1):" ",u=y.width-(h+_).length,b=y.width&&u>0?p.repeat(u):"",w+=y.align?h+_+b:p==="0"?h+b+_:b+h+_)}return w}var c=Object.create(null);function f(g){if(c[g])return c[g];for(var v=g,T,l=[],_=0;v;){if((T=a.text.exec(v))!==null)l.push(T[0]);else if((T=a.modulo.exec(v))!==null)l.push("%");else if((T=a.placeholder.exec(v))!==null){if(T[2]){_|=1;var w=[],S=T[2],E=[];if((E=a.key.exec(S))!==null)for(w.push(E[1]);(S=S.substring(E[0].length))!=="";)if((E=a.key_access.exec(S))!==null)w.push(E[1]);else if((E=a.index_access.exec(S))!==null)w.push(E[1]);else throw new SyntaxError("[sprintf] failed to parse named argument key");else throw new SyntaxError("[sprintf] failed to parse named argument key");T[2]=w}else _|=2;if(_===3)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");l.push({placeholder:T[0],param_no:T[1],keys:T[2],sign:T[3],pad_char:T[4],align:T[5],width:T[6],precision:T[7],type:T[8]})}else throw new SyntaxError("[sprintf] unexpected placeholder");v=v.substring(T[0].length)}return c[g]=l}t.sprintf=i,t.vsprintf=n,typeof window<"u"&&(window.sprintf=i,window.vsprintf=n,o=function(){return{sprintf:i,vsprintf:n}}.call(t,r,t,e),o!==void 0&&(e.exports=o))})()},3711:function(e,t,r){"use strict";e.exports=f;var o=r(2640),a=r(781),i={"2d":function(g,v,T){var l=g({order:v,scalarArguments:3,getters:T==="generic"?[0]:void 0,phase:function(w,S,E,y){return w>y|0},vertex:function(w,S,E,y,b,p,u,m,h,P,L,z,F){var B=(u<<0)+(m<<1)+(h<<2)+(P<<3)|0;if(!(B===0||B===15))switch(B){case 0:L.push([w-.5,S-.5]);break;case 1:L.push([w-.25-.25*(y+E-2*F)/(E-y),S-.25-.25*(b+E-2*F)/(E-b)]);break;case 2:L.push([w-.75-.25*(-y-E+2*F)/(y-E),S-.25-.25*(p+y-2*F)/(y-p)]);break;case 3:L.push([w-.5,S-.5-.5*(b+E+p+y-4*F)/(E-b+y-p)]);break;case 4:L.push([w-.25-.25*(p+b-2*F)/(b-p),S-.75-.25*(-b-E+2*F)/(b-E)]);break;case 5:L.push([w-.5-.5*(y+E+p+b-4*F)/(E-y+b-p),S-.5]);break;case 6:L.push([w-.5-.25*(-y-E+p+b)/(y-E+b-p),S-.5-.25*(-b-E+p+y)/(b-E+y-p)]);break;case 7:L.push([w-.75-.25*(p+b-2*F)/(b-p),S-.75-.25*(p+y-2*F)/(y-p)]);break;case 8:L.push([w-.75-.25*(-p-b+2*F)/(p-b),S-.75-.25*(-p-y+2*F)/(p-y)]);break;case 9:L.push([w-.5-.25*(y+E+-p-b)/(E-y+p-b),S-.5-.25*(b+E+-p-y)/(E-b+p-y)]);break;case 10:L.push([w-.5-.5*(-y-E+-p-b+4*F)/(y-E+p-b),S-.5]);break;case 11:L.push([w-.25-.25*(-p-b+2*F)/(p-b),S-.75-.25*(b+E-2*F)/(E-b)]);break;case 12:L.push([w-.5,S-.5-.5*(-b-E+-p-y+4*F)/(b-E+p-y)]);break;case 13:L.push([w-.75-.25*(y+E-2*F)/(E-y),S-.25-.25*(-p-y+2*F)/(p-y)]);break;case 14:L.push([w-.25-.25*(-y-E+2*F)/(y-E),S-.25-.25*(-b-E+2*F)/(b-E)]);break;case 15:L.push([w-.5,S-.5]);break}},cell:function(w,S,E,y,b,p,u,m,h){b?m.push([w,S]):m.push([S,w])}});return function(_,w){var S=[],E=[];return l(_,S,E,w),{positions:S,cells:E}}}};function n(g,v){var T=g.length+"d",l=i[T];if(l)return l(o,g,v)}function s(g,v){for(var T=a(g,v),l=T.length,_=new Array(l),w=new Array(l),S=0;SMath.max(y,b)?p[2]=1:y>Math.max(E,b)?p[0]=1:p[1]=1;for(var u=0,m=0,h=0;h<3;++h)u+=S[h]*S[h],m+=p[h]*S[h];for(var h=0;h<3;++h)p[h]-=m/u*S[h];return s(p,p),p}function T(S,E,y,b,p,u,m,h){this.center=o(y),this.up=o(b),this.right=o(p),this.radius=o([u]),this.angle=o([m,h]),this.angle.bounds=[[-1/0,-Math.PI/2],[1/0,Math.PI/2]],this.setDistanceLimits(S,E),this.computedCenter=this.center.curve(0),this.computedUp=this.up.curve(0),this.computedRight=this.right.curve(0),this.computedRadius=this.radius.curve(0),this.computedAngle=this.angle.curve(0),this.computedToward=[0,0,0],this.computedEye=[0,0,0],this.computedMatrix=new Array(16);for(var P=0;P<16;++P)this.computedMatrix[P]=.5;this.recalcMatrix(0)}var l=T.prototype;l.setDistanceLimits=function(S,E){S>0?S=Math.log(S):S=-1/0,E>0?E=Math.log(E):E=1/0,E=Math.max(E,S),this.radius.bounds[0][0]=S,this.radius.bounds[1][0]=E},l.getDistanceLimits=function(S){var E=this.radius.bounds[0];return S?(S[0]=Math.exp(E[0][0]),S[1]=Math.exp(E[1][0]),S):[Math.exp(E[0][0]),Math.exp(E[1][0])]},l.recalcMatrix=function(S){this.center.curve(S),this.up.curve(S),this.right.curve(S),this.radius.curve(S),this.angle.curve(S);for(var E=this.computedUp,y=this.computedRight,b=0,p=0,u=0;u<3;++u)p+=E[u]*y[u],b+=E[u]*E[u];for(var m=Math.sqrt(b),h=0,u=0;u<3;++u)y[u]-=E[u]*p/b,h+=y[u]*y[u],E[u]/=m;for(var P=Math.sqrt(h),u=0;u<3;++u)y[u]/=P;var L=this.computedToward;n(L,E,y),s(L,L);for(var z=Math.exp(this.computedRadius[0]),F=this.computedAngle[0],B=this.computedAngle[1],O=Math.cos(F),I=Math.sin(F),N=Math.cos(B),U=Math.sin(B),W=this.computedCenter,Q=O*N,ue=I*N,le=U,he=-O*U,G=-I*U,$=N,J=this.computedEye,X=this.computedMatrix,u=0;u<3;++u){var oe=Q*y[u]+ue*L[u]+le*E[u];X[4*u+1]=he*y[u]+G*L[u]+$*E[u],X[4*u+2]=oe,X[4*u+3]=0}var ie=X[1],j=X[5],ee=X[9],re=X[2],ce=X[6],be=X[10],Ae=j*be-ee*ce,ze=ee*re-ie*be,Re=ie*ce-j*re,Xe=f(Ae,ze,Re);Ae/=Xe,ze/=Xe,Re/=Xe,X[0]=Ae,X[4]=ze,X[8]=Re;for(var u=0;u<3;++u)J[u]=W[u]+X[2+4*u]*z;for(var u=0;u<3;++u){for(var h=0,it=0;it<3;++it)h+=X[u+4*it]*J[it];X[12+u]=-h}X[15]=1},l.getMatrix=function(S,E){this.recalcMatrix(S);var y=this.computedMatrix;if(E){for(var b=0;b<16;++b)E[b]=y[b];return E}return y};var _=[0,0,0];l.rotate=function(S,E,y,b){if(this.angle.move(S,E,y),b){this.recalcMatrix(S);var p=this.computedMatrix;_[0]=p[2],_[1]=p[6],_[2]=p[10];for(var u=this.computedUp,m=this.computedRight,h=this.computedToward,P=0;P<3;++P)p[4*P]=u[P],p[4*P+1]=m[P],p[4*P+2]=h[P];i(p,p,b,_);for(var P=0;P<3;++P)u[P]=p[4*P],m[P]=p[4*P+1];this.up.set(S,u[0],u[1],u[2]),this.right.set(S,m[0],m[1],m[2])}},l.pan=function(S,E,y,b){E=E||0,y=y||0,b=b||0,this.recalcMatrix(S);var p=this.computedMatrix,u=Math.exp(this.computedRadius[0]),m=p[1],h=p[5],P=p[9],L=f(m,h,P);m/=L,h/=L,P/=L;var z=p[0],F=p[4],B=p[8],O=z*m+F*h+B*P;z-=m*O,F-=h*O,B-=P*O;var I=f(z,F,B);z/=I,F/=I,B/=I;var N=z*E+m*y,U=F*E+h*y,W=B*E+P*y;this.center.move(S,N,U,W);var Q=Math.exp(this.computedRadius[0]);Q=Math.max(1e-4,Q+b),this.radius.set(S,Math.log(Q))},l.translate=function(S,E,y,b){this.center.move(S,E||0,y||0,b||0)},l.setMatrix=function(S,E,y,b){var p=1;typeof y=="number"&&(p=y|0),(p<0||p>3)&&(p=1);var u=(p+2)%3,m=(p+1)%3;E||(this.recalcMatrix(S),E=this.computedMatrix);var h=E[p],P=E[p+4],L=E[p+8];if(b){var F=Math.abs(h),B=Math.abs(P),O=Math.abs(L),I=Math.max(F,B,O);F===I?(h=h<0?-1:1,P=L=0):O===I?(L=L<0?-1:1,h=P=0):(P=P<0?-1:1,h=L=0)}else{var z=f(h,P,L);h/=z,P/=z,L/=z}var N=E[u],U=E[u+4],W=E[u+8],Q=N*h+U*P+W*L;N-=h*Q,U-=P*Q,W-=L*Q;var ue=f(N,U,W);N/=ue,U/=ue,W/=ue;var le=P*W-L*U,he=L*N-h*W,G=h*U-P*N,$=f(le,he,G);le/=$,he/=$,G/=$,this.center.jump(S,_e,fe,Fe),this.radius.idle(S),this.up.jump(S,h,P,L),this.right.jump(S,N,U,W);var J,X;if(p===2){var oe=E[1],ie=E[5],j=E[9],ee=oe*N+ie*U+j*W,re=oe*le+ie*he+j*G;ze<0?J=-Math.PI/2:J=Math.PI/2,X=Math.atan2(re,ee)}else{var ce=E[2],be=E[6],Ae=E[10],ze=ce*h+be*P+Ae*L,Re=ce*N+be*U+Ae*W,Xe=ce*le+be*he+Ae*G;J=Math.asin(g(ze)),X=Math.atan2(Xe,Re)}this.angle.jump(S,X,J),this.recalcMatrix(S);var it=E[2],ot=E[6],tt=E[10],lt=this.computedMatrix;a(lt,E);var Ee=lt[15],_e=lt[12]/Ee,fe=lt[13]/Ee,Fe=lt[14]/Ee,rt=Math.exp(this.computedRadius[0]);this.center.jump(S,_e-it*rt,fe-ot*rt,Fe-tt*rt)},l.lastT=function(){return Math.max(this.center.lastT(),this.up.lastT(),this.right.lastT(),this.radius.lastT(),this.angle.lastT())},l.idle=function(S){this.center.idle(S),this.up.idle(S),this.right.idle(S),this.radius.idle(S),this.angle.idle(S)},l.flush=function(S){this.center.flush(S),this.up.flush(S),this.right.flush(S),this.radius.flush(S),this.angle.flush(S)},l.setDistance=function(S,E){E>0&&this.radius.set(S,Math.log(E))},l.lookAt=function(S,E,y,b){this.recalcMatrix(S),E=E||this.computedEye,y=y||this.computedCenter,b=b||this.computedUp;var p=b[0],u=b[1],m=b[2],h=f(p,u,m);if(!(h<1e-6)){p/=h,u/=h,m/=h;var P=E[0]-y[0],L=E[1]-y[1],z=E[2]-y[2],F=f(P,L,z);if(!(F<1e-6)){P/=F,L/=F,z/=F;var B=this.computedRight,O=B[0],I=B[1],N=B[2],U=p*O+u*I+m*N;O-=U*p,I-=U*u,N-=U*m;var W=f(O,I,N);if(!(W<.01&&(O=u*z-m*L,I=m*P-p*z,N=p*L-u*P,W=f(O,I,N),W<1e-6))){O/=W,I/=W,N/=W,this.up.set(S,p,u,m),this.right.set(S,O,I,N),this.center.set(S,y[0],y[1],y[2]),this.radius.set(S,Math.log(F));var Q=u*N-m*I,ue=m*O-p*N,le=p*I-u*O,he=f(Q,ue,le);Q/=he,ue/=he,le/=he;var G=p*P+u*L+m*z,$=O*P+I*L+N*z,J=Q*P+ue*L+le*z,X=Math.asin(g(G)),oe=Math.atan2(J,$),ie=this.angle._state,j=ie[ie.length-1],ee=ie[ie.length-2];j=j%(2*Math.PI);var re=Math.abs(j+2*Math.PI-oe),ce=Math.abs(j-oe),be=Math.abs(j-2*Math.PI-oe);re0?N.pop():new ArrayBuffer(O)}t.mallocArrayBuffer=_;function w(B){return new Uint8Array(_(B),0,B)}t.mallocUint8=w;function S(B){return new Uint16Array(_(2*B),0,B)}t.mallocUint16=S;function E(B){return new Uint32Array(_(4*B),0,B)}t.mallocUint32=E;function y(B){return new Int8Array(_(B),0,B)}t.mallocInt8=y;function b(B){return new Int16Array(_(2*B),0,B)}t.mallocInt16=b;function p(B){return new Int32Array(_(4*B),0,B)}t.mallocInt32=p;function u(B){return new Float32Array(_(4*B),0,B)}t.mallocFloat32=t.mallocFloat=u;function m(B){return new Float64Array(_(8*B),0,B)}t.mallocFloat64=t.mallocDouble=m;function h(B){return n?new Uint8ClampedArray(_(B),0,B):w(B)}t.mallocUint8Clamped=h;function P(B){return s?new BigUint64Array(_(8*B),0,B):null}t.mallocBigUint64=P;function L(B){return c?new BigInt64Array(_(8*B),0,B):null}t.mallocBigInt64=L;function z(B){return new DataView(_(B),0,B)}t.mallocDataView=z;function F(B){B=o.nextPow2(B);var O=o.log2(B),I=v[O];return I.length>0?I.pop():new i(B)}t.mallocBuffer=F,t.clearCache=function(){for(var O=0;O<32;++O)f.UINT8[O].length=0,f.UINT16[O].length=0,f.UINT32[O].length=0,f.INT8[O].length=0,f.INT16[O].length=0,f.INT32[O].length=0,f.FLOAT[O].length=0,f.DOUBLE[O].length=0,f.BIGUINT64[O].length=0,f.BIGINT64[O].length=0,f.UINT8C[O].length=0,g[O].length=0,v[O].length=0}},1755:function(e){"use strict";"use restrict";e.exports=t;function t(o){this.roots=new Array(o),this.ranks=new Array(o);for(var a=0;a",N="",U=I.length,W=N.length,Q=F[0]===_||F[0]===E,ue=0,le=-W;ue>-1&&(ue=B.indexOf(I,ue),!(ue===-1||(le=B.indexOf(N,ue+U),le===-1)||le<=ue));){for(var he=ue;he=le)O[he]=null,B=B.substr(0,he)+" "+B.substr(he+1);else if(O[he]!==null){var G=O[he].indexOf(F[0]);G===-1?O[he]+=F:Q&&(O[he]=O[he].substr(0,G+1)+(1+parseInt(O[he][G+1]))+O[he].substr(G+2))}var $=ue+U,J=B.substr($,le-$),X=J.indexOf(I);X!==-1?ue=X:ue=le+W}return O}function p(z,F,B){for(var O=F.textAlign||"start",I=F.textBaseline||"alphabetic",N=[1<<30,1<<30],U=[0,0],W=z.length,Q=0;Q/g,` `):B=B.replace(/\/g," ");var U="",W=[];for(j=0;j-1?parseInt(fe[1+st]):0,kt=Qe>-1?parseInt(Fe[1+Qe]):0;Lt!==kt&&(rt=rt.replace(Re(),"?px "),ce*=Math.pow(.75,kt-Lt),rt=rt.replace("?px ",Re())),re+=.25*G*(kt-Lt)}if(N.superscripts===!0){var Vt=fe.indexOf(_),Zt=Fe.indexOf(_),Sr=Vt>-1?parseInt(fe[1+Vt]):0,xr=Zt>-1?parseInt(Fe[1+Zt]):0;Sr!==xr&&(rt=rt.replace(Re(),"?px "),ce*=Math.pow(.75,xr-Sr),rt=rt.replace("?px ",Re())),re-=.25*G*(xr-Sr)}if(N.bolds===!0){var jr=fe.indexOf(g)>-1,wr=Fe.indexOf(g)>-1;!jr&&wr&&(Ir?rt=rt.replace("italic ","italic bold "):rt="bold "+rt),jr&&!wr&&(rt=rt.replace("bold ",""))}if(N.italics===!0){var Ir=fe.indexOf(T)>-1,bt=Fe.indexOf(T)>-1;!Ir&&bt&&(rt="italic "+rt),Ir&&!bt&&(rt=rt.replace("italic ",""))}F.font=rt}for(ie=0;ie0&&(I=O.size),O.lineSpacing&&O.lineSpacing>0&&(N=O.lineSpacing),O.styletags&&O.styletags.breaklines&&(U.breaklines=!!O.styletags.breaklines),O.styletags&&O.styletags.bolds&&(U.bolds=!!O.styletags.bolds),O.styletags&&O.styletags.italics&&(U.italics=!!O.styletags.italics),O.styletags&&O.styletags.subscripts&&(U.subscripts=!!O.styletags.subscripts),O.styletags&&O.styletags.superscripts&&(U.superscripts=!!O.styletags.superscripts)),B.font=[O.fontStyle,O.fontVariant,O.fontWeight,I+"px",O.font].filter(function(Q){return Q}).join(" "),B.textAlign="start",B.textBaseline="alphabetic",B.direction="ltr";var W=u(F,B,z,I,N,U);return P(W,O,I)}},1538:function(e){(function(){"use strict";if(typeof ses<"u"&&ses.ok&&!ses.ok())return;function r(h){h.permitHostObjects___&&h.permitHostObjects___(r)}typeof ses<"u"&&(ses.weakMapPermitHostObjects=r);var o=!1;if(typeof WeakMap=="function"){var a=WeakMap;if(!(typeof navigator<"u"&&/Firefox/.test(navigator.userAgent))){var i=new a,n=Object.freeze({});if(i.set(n,1),i.get(n)!==1)o=!0;else{e.exports=WeakMap;return}}}var s=Object.prototype.hasOwnProperty,c=Object.getOwnPropertyNames,f=Object.defineProperty,g=Object.isExtensible,v="weakmap:",T=v+"ident:"+Math.random()+"___";if(typeof crypto<"u"&&typeof crypto.getRandomValues=="function"&&typeof ArrayBuffer=="function"&&typeof Uint8Array=="function"){var l=new ArrayBuffer(25),_=new Uint8Array(l);crypto.getRandomValues(_),T=v+"rand:"+Array.prototype.map.call(_,function(h){return(h%36).toString(36)}).join("")+"___"}function w(h){return!(h.substr(0,v.length)==v&&h.substr(h.length-3)==="___")}if(f(Object,"getOwnPropertyNames",{value:function(P){return c(P).filter(w)}}),"getPropertyNames"in Object){var S=Object.getPropertyNames;f(Object,"getPropertyNames",{value:function(P){return S(P).filter(w)}})}function E(h){if(h!==Object(h))throw new TypeError("Not an object: "+h);var P=h[T];if(P&&P.key===h)return P;if(g(h)){P={key:h};try{return f(h,T,{value:P,writable:!1,enumerable:!1,configurable:!1}),P}catch{return}}}(function(){var h=Object.freeze;f(Object,"freeze",{value:function(F){return E(F),h(F)}});var P=Object.seal;f(Object,"seal",{value:function(F){return E(F),P(F)}});var L=Object.preventExtensions;f(Object,"preventExtensions",{value:function(F){return E(F),L(F)}})})();function y(h){return h.prototype=null,Object.freeze(h)}var b=!1;function p(){!b&&typeof console<"u"&&(b=!0,console.warn("WeakMap should be invoked as new WeakMap(), not WeakMap(). This will be an error in the future."))}var u=0,m=function(){this instanceof m||p();var h=[],P=[],L=u++;function z(I,N){var U,W=E(I);return W?L in W?W[L]:N:(U=h.indexOf(I),U>=0?P[U]:N)}function F(I){var N=E(I);return N?L in N:h.indexOf(I)>=0}function B(I,N){var U,W=E(I);return W?W[L]=N:(U=h.indexOf(I),U>=0?P[U]=N:(U=h.length,P[U]=N,h[U]=I)),this}function O(I){var N=E(I),U,W;return N?L in N&&delete N[L]:(U=h.indexOf(I),U<0?!1:(W=h.length-1,h[U]=void 0,P[U]=P[W],h[U]=h[W],h.length=W,P.length=W,!0))}return Object.create(m.prototype,{get___:{value:y(z)},has___:{value:y(F)},set___:{value:y(B)},delete___:{value:y(O)}})};m.prototype=Object.create(Object.prototype,{get:{value:function(P,L){return this.get___(P,L)},writable:!0,configurable:!0},has:{value:function(P){return this.has___(P)},writable:!0,configurable:!0},set:{value:function(P,L){return this.set___(P,L)},writable:!0,configurable:!0},delete:{value:function(P){return this.delete___(P)},writable:!0,configurable:!0}}),typeof a=="function"?function(){o&&typeof Proxy<"u"&&(Proxy=void 0);function h(){this instanceof m||p();var P=new a,L=void 0,z=!1;function F(N,U){return L?P.has(N)?P.get(N):L.get___(N,U):P.get(N,U)}function B(N){return P.has(N)||(L?L.has___(N):!1)}var O;o?O=function(N,U){return P.set(N,U),P.has(N)||(L||(L=new m),L.set(N,U)),this}:O=function(N,U){if(z)try{P.set(N,U)}catch{L||(L=new m),L.set___(N,U)}else P.set(N,U);return this};function I(N){var U=!!P.delete(N);return L&&L.delete___(N)||U}return Object.create(m.prototype,{get___:{value:y(F)},has___:{value:y(B)},set___:{value:y(O)},delete___:{value:y(I)},permitHostObjects___:{value:y(function(N){if(N===r)z=!0;else throw new Error("bogus call to permitHostObjects___")})}})}h.prototype=m.prototype,e.exports=h,Object.defineProperty(WeakMap.prototype,"constructor",{value:WeakMap,enumerable:!1,configurable:!0,writable:!0})}():(typeof Proxy<"u"&&(Proxy=void 0),e.exports=m)})()},236:function(e,t,r){var o=r(8284);e.exports=a;function a(){var i={};return function(n){if((typeof n!="object"||n===null)&&typeof n!="function")throw new Error("Weakmap-shim: Key must be object");var s=n.valueOf(i);return s&&s.identity===i?s:o(n,i)}}},8284:function(e){e.exports=t;function t(r,o){var a={identity:o},i=r.valueOf;return Object.defineProperty(r,"valueOf",{value:function(n){return n!==o?i.apply(this,arguments):a},writable:!0}),a}},606:function(e,t,r){var o=r(236);e.exports=a;function a(){var i=o();return{get:function(n,s){var c=i(n);return c.hasOwnProperty("value")?c.value:s},set:function(n,s){return i(n).value=s,this},has:function(n){return"value"in i(n)},delete:function(n){return delete i(n).value}}}},3349:function(e){"use strict";function t(){return function(s,c,f,g,v,T){var l=s[0],_=f[0],w=[0],S=_;g|=0;var E=0,y=_;for(E=0;E=0!=p>=0&&v.push(w[0]+.5+.5*(b+p)/(b-p))}g+=y,++w[0]}}}function r(){return t()}var o=r;function a(s){var c={};return function(g,v,T){var l=g.dtype,_=g.order,w=[l,_.join()].join(),S=c[w];return S||(c[w]=S=s([l,_])),S(g.shape.slice(0),g.data,g.stride,g.offset|0,v,T)}}function i(s){return a(o.bind(void 0,s))}function n(s){return i({funcName:s.funcName})}e.exports=n({funcName:"zeroCrossings"})},781:function(e,t,r){"use strict";e.exports=a;var o=r(3349);function a(i,n){var s=[];return n=+n||0,o(i.hi(i.shape[0]-1),s,n),s}},7790:function(){}},x={};function A(e){var t=x[e];if(t!==void 0)return t.exports;var r=x[e]={id:e,loaded:!1,exports:{}};return d[e].call(r.exports,r,r.exports,A),r.loaded=!0,r.exports}(function(){A.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}()})(),function(){A.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e}}();var M=A(1964);q.exports=M})()}}),_E=Ze({"node_modules/color-name/index.js"(Z,q){"use strict";q.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}}}),VN=Ze({"node_modules/color-normalize/node_modules/color-parse/index.js"(Z,q){"use strict";var d=_E();q.exports=A;var x={red:0,orange:60,yellow:120,green:180,blue:240,purple:300};function A(M){var e,t=[],r=1,o;if(typeof M=="string")if(M=M.toLowerCase(),d[M])t=d[M].slice(),o="rgb";else if(M==="transparent")r=0,o="rgb",t=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(M)){var a=M.slice(1),i=a.length,n=i<=4;r=1,n?(t=[parseInt(a[0]+a[0],16),parseInt(a[1]+a[1],16),parseInt(a[2]+a[2],16)],i===4&&(r=parseInt(a[3]+a[3],16)/255)):(t=[parseInt(a[0]+a[1],16),parseInt(a[2]+a[3],16),parseInt(a[4]+a[5],16)],i===8&&(r=parseInt(a[6]+a[7],16)/255)),t[0]||(t[0]=0),t[1]||(t[1]=0),t[2]||(t[2]=0),o="rgb"}else if(e=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(M)){var s=e[1],c=s==="rgb",a=s.replace(/a$/,"");o=a;var i=a==="cmyk"?4:a==="gray"?1:3;t=e[2].trim().split(/\s*[,\/]\s*|\s+/).map(function(v,T){if(/%$/.test(v))return T===i?parseFloat(v)/100:a==="rgb"?parseFloat(v)*255/100:parseFloat(v);if(a[T]==="h"){if(/deg$/.test(v))return parseFloat(v);if(x[v]!==void 0)return x[v]}return parseFloat(v)}),s===a&&t.push(1),r=c||t[i]===void 0?1:t[i],t=t.slice(0,i)}else M.length>10&&/[0-9](?:\s|\/)/.test(M)&&(t=M.match(/([0-9]+)/g).map(function(f){return parseFloat(f)}),o=M.match(/([a-z])/ig).join("").toLowerCase());else isNaN(M)?Array.isArray(M)||M.length?(t=[M[0],M[1],M[2]],o="rgb",r=M.length===4?M[3]:1):M instanceof Object&&(M.r!=null||M.red!=null||M.R!=null?(o="rgb",t=[M.r||M.red||M.R||0,M.g||M.green||M.G||0,M.b||M.blue||M.B||0]):(o="hsl",t=[M.h||M.hue||M.H||0,M.s||M.saturation||M.S||0,M.l||M.lightness||M.L||M.b||M.brightness]),r=M.a||M.alpha||M.opacity||1,M.opacity!=null&&(r/=100)):(o="rgb",t=[M>>>16,(M&65280)>>>8,M&255]);return{space:o,values:t,alpha:r}}}}),GN=Ze({"node_modules/color-normalize/node_modules/color-rgba/index.js"(Z,q){"use strict";var d=VN();q.exports=function(M){Array.isArray(M)&&M.raw&&(M=String.raw.apply(null,arguments));var e,t,r,o=d(M);if(!o.space)return[];var a=[0,0,0],i=o.space[0]==="h"?[360,100,100]:[255,255,255];return e=Array(3),e[0]=Math.min(Math.max(o.values[0],a[0]),i[0]),e[1]=Math.min(Math.max(o.values[1],a[1]),i[1]),e[2]=Math.min(Math.max(o.values[2],a[2]),i[2]),o.space[0]==="h"&&(e=x(e)),e.push(Math.min(Math.max(o.alpha,0),1)),e};function x(A){var M=A[0]/360,e=A[1]/100,t=A[2]/100,r,o,a,i,n,s=0;if(e===0)return n=t*255,[n,n,n];for(o=t<.5?t*(1+e):t+e-t*e,r=2*t-o,i=[0,0,0];s<3;)a=M+1/3*-(s-1),a<0?a++:a>1&&a--,n=6*a<1?r+(o-r)*6*a:2*a<1?o:3*a<2?r+(o-r)*(2/3-a)*6:r,i[s++]=n*255;return i}}}),vx=Ze({"node_modules/clamp/index.js"(Z,q){q.exports=d;function d(x,A,M){return AM?M:x:xA?A:x}}}),Q3=Ze({"node_modules/dtype/index.js"(Z,q){q.exports=function(d){switch(d){case"int8":return Int8Array;case"int16":return Int16Array;case"int32":return Int32Array;case"uint8":return Uint8Array;case"uint16":return Uint16Array;case"uint32":return Uint32Array;case"float32":return Float32Array;case"float64":return Float64Array;case"array":return Array;case"uint8_clamped":return Uint8ClampedArray}}}}),h0=Ze({"node_modules/color-normalize/index.js"(Z,q){"use strict";var d=GN(),x=vx(),A=Q3();q.exports=function(t,r){(r==="float"||!r)&&(r="array"),r==="uint"&&(r="uint8"),r==="uint_clamped"&&(r="uint8_clamped");var o=A(r),a=new o(4),i=r!=="uint8"&&r!=="uint8_clamped";return(!t.length||typeof t=="string")&&(t=d(t),t[0]/=255,t[1]/=255,t[2]/=255),M(t)?(a[0]=t[0],a[1]=t[1],a[2]=t[2],a[3]=t[3]!=null?t[3]:255,i&&(a[0]/=255,a[1]/=255,a[2]/=255,a[3]/=255),a):(i?(a[0]=t[0],a[1]=t[1],a[2]=t[2],a[3]=t[3]!=null?t[3]:1):(a[0]=x(Math.floor(t[0]*255),0,255),a[1]=x(Math.floor(t[1]*255),0,255),a[2]=x(Math.floor(t[2]*255),0,255),a[3]=t[3]==null?255:x(Math.floor(t[3]*255),0,255)),a)};function M(e){return!!(e instanceof Uint8Array||e instanceof Uint8ClampedArray||Array.isArray(e)&&(e[0]>1||e[0]===0)&&(e[1]>1||e[1]===0)&&(e[2]>1||e[2]===0)&&(!e[3]||e[3]>1))}}}),Qv=Ze({"src/lib/str2rgbarray.js"(Z,q){"use strict";var d=h0();function x(A){return A?d(A):[0,0,0,1]}q.exports=x}}),em=Ze({"src/lib/gl_format_color.js"(Z,q){"use strict";var d=ns(),x=Ch(),A=h0(),M=rc(),e=oh().defaultLine,t=xp().isArrayOrTypedArray,r=A(e),o=1;function a(f,g){var v=f;return v[3]*=g,v}function i(f){if(d(f))return r;var g=A(f);return g.length?g:r}function n(f){return d(f)?f:o}function s(f,g,v){var T=f.color;T&&T._inputArray&&(T=T._inputArray);var l=t(T),_=t(g),w=M.extractOpts(f),S=[],E,y,b,p,u;if(w.colorscale!==void 0?E=M.makeColorScaleFuncFromTrace(f):E=i,l?y=function(h,P){return h[P]===void 0?r:A(E(h[P]))}:y=i,_?b=function(h,P){return h[P]===void 0?o:n(h[P])}:b=n,l||_)for(var m=0;m0){var v=o.c2l(f);o._lowerLogErrorBound||(o._lowerLogErrorBound=v),o._lowerErrorBound=Math.min(o._lowerLogErrorBound,v)}}else i[n]=[-s[0]*r,s[1]*r]}return i}function A(e){for(var t=0;t-1?-1:P.indexOf("right")>-1?1:0}function w(P){return P==null?0:P.indexOf("top")>-1?-1:P.indexOf("bottom")>-1?1:0}function S(P){var L=0,z=0,F=[L,z];if(Array.isArray(P))for(var B=0;B=0){var W=T(N.position,N.delaunayColor,N.delaunayAxis);W.opacity=P.opacity,this.delaunayMesh?this.delaunayMesh.update(W):(W.gl=L,this.delaunayMesh=M(W),this.delaunayMesh._trace=this,this.scene.glplot.add(this.delaunayMesh))}else this.delaunayMesh&&(this.scene.glplot.remove(this.delaunayMesh),this.delaunayMesh.dispose(),this.delaunayMesh=null)},v.dispose=function(){this.linePlot&&(this.scene.glplot.remove(this.linePlot),this.linePlot.dispose()),this.scatterPlot&&(this.scene.glplot.remove(this.scatterPlot),this.scatterPlot.dispose()),this.errorBars&&(this.scene.glplot.remove(this.errorBars),this.errorBars.dispose()),this.textMarkers&&(this.scene.glplot.remove(this.textMarkers),this.textMarkers.dispose()),this.delaunayMesh&&(this.scene.glplot.remove(this.delaunayMesh),this.delaunayMesh.dispose())};function h(P,L){var z=new g(P,L.uid);return z.update(L),z}q.exports=h}}),bE=Ze({"src/traces/scatter3d/attributes.js"(Z,q){"use strict";var d=tf(),x=tc(),A=Mu(),M=Qc().axisHoverFormat,e=Cs().hovertemplateAttrs,t=Cs().texttemplateAttrs,r=eu(),o=xE(),a=eT(),i=rs().extendFlat,n=pc().overrideAll,s=Km(),c=d.line,f=d.marker,g=f.line,v=i({width:c.width,dash:{valType:"enumerated",values:s(o),dflt:"solid"}},A("line"));function T(_){return{show:{valType:"boolean",dflt:!1},opacity:{valType:"number",min:0,max:1,dflt:1},scale:{valType:"number",min:0,max:10,dflt:2/3}}}var l=q.exports=n({x:d.x,y:d.y,z:{valType:"data_array"},text:i({},d.text,{}),texttemplate:t({},{}),hovertext:i({},d.hovertext,{}),hovertemplate:e(),xhoverformat:M("x"),yhoverformat:M("y"),zhoverformat:M("z"),mode:i({},d.mode,{dflt:"lines+markers"}),surfaceaxis:{valType:"enumerated",values:[-1,0,1,2],dflt:-1},surfacecolor:{valType:"color"},projection:{x:T("x"),y:T("y"),z:T("z")},connectgaps:d.connectgaps,line:v,marker:i({symbol:{valType:"enumerated",values:s(a),dflt:"circle",arrayOk:!0},size:i({},f.size,{dflt:8}),sizeref:f.sizeref,sizemin:f.sizemin,sizemode:f.sizemode,opacity:i({},f.opacity,{arrayOk:!1}),colorbar:f.colorbar,line:i({width:i({},g.width,{arrayOk:!1})},A("marker.line"))},A("marker")),textposition:i({},d.textposition,{dflt:"top center"}),textfont:x({noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,editType:"calc",colorEditType:"style",arrayOk:!0,variantValues:["normal","small-caps"]}),opacity:r.opacity,hoverinfo:i({},r.hoverinfo)},"calc","nested");l.x.editType=l.y.editType=l.z.editType="calc+clearAxisTypes"}}),XN=Ze({"src/traces/scatter3d/defaults.js"(Z,q){"use strict";var d=oo(),x=ca(),A=Fu(),M=md(),e=Dd(),t=zd(),r=bE();q.exports=function(i,n,s,c){function f(E,y){return x.coerce(i,n,r,E,y)}var g=o(i,n,f,c);if(!g){n.visible=!1;return}f("text"),f("hovertext"),f("hovertemplate"),f("xhoverformat"),f("yhoverformat"),f("zhoverformat"),f("mode"),A.hasMarkers(n)&&M(i,n,s,c,f,{noSelect:!0,noAngle:!0}),A.hasLines(n)&&(f("connectgaps"),e(i,n,s,c,f)),A.hasText(n)&&(f("texttemplate"),t(i,n,c,f,{noSelect:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0}));var v=(n.line||{}).color,T=(n.marker||{}).color;f("surfaceaxis")>=0&&f("surfacecolor",v||T);for(var l=["x","y","z"],_=0;_<3;++_){var w="projection."+l[_];f(w+".show")&&(f(w+".opacity"),f(w+".scale"))}var S=d.getComponentMethod("errorbars","supplyDefaults");S(i,n,v||T||s,{axis:"z"}),S(i,n,v||T||s,{axis:"y",inherit:"z"}),S(i,n,v||T||s,{axis:"x",inherit:"z"})};function o(a,i,n,s){var c=0,f=n("x"),g=n("y"),v=n("z"),T=d.getComponentMethod("calendars","handleTraceDefaults");return T(a,i,["x","y","z"],s),f&&g&&v&&(c=Math.min(f.length,g.length,v.length),i._length=i._xlength=i._ylength=i._zlength=c),c}}}),ZN=Ze({"src/traces/scatter3d/calc.js"(Z,q){"use strict";var d=Av(),x=Fd();q.exports=function(M,e){var t=[{x:!1,y:!1,trace:e,t:{}}];return d(t,e),x(M,e),t}}}),YN=Ze({"node_modules/get-canvas-context/index.js"(Z,q){q.exports=d;function d(x,A){if(typeof x!="string")throw new TypeError("must specify type string");if(A=A||{},typeof document>"u"&&!A.canvas)return null;var M=A.canvas||document.createElement("canvas");typeof A.width=="number"&&(M.width=A.width),typeof A.height=="number"&&(M.height=A.height);var e=A,t;try{var r=[x];x.indexOf("webgl")===0&&r.push("experimental-"+x);for(var o=0;o/g," "));n[s]=v,c.tickmode=f}}o.ticks=n;for(var s=0;s<3;++s){M[s]=.5*(r.glplot.bounds[0][s]+r.glplot.bounds[1][s]);for(var T=0;T<2;++T)o.bounds[T][s]=r.glplot.bounds[T][s]}r.contourLevels=e(n)}}}),eU=Ze({"src/plots/gl3d/scene.js"(Z,q){"use strict";var d=Yh().gl_plot3d,x=d.createCamera,A=d.createScene,M=KN(),e=x2(),t=oo(),r=ca(),o=r.preserveDrawingBuffer(),a=Wo(),i=ef(),n=Qv(),s=wE(),c=N5(),f=JN(),g=$N(),v=QN(),T=Yd().applyAutorangeOptions,l,_,w=!1;function S(z,F){var B=document.createElement("div"),O=z.container;this.graphDiv=z.graphDiv;var I=document.createElementNS("http://www.w3.org/2000/svg","svg");I.style.position="absolute",I.style.top=I.style.left="0px",I.style.width=I.style.height="100%",I.style["z-index"]=20,I.style["pointer-events"]="none",B.appendChild(I),this.svgContainer=I,B.id=z.id,B.style.position="absolute",B.style.top=B.style.left="0px",B.style.width=B.style.height="100%",O.appendChild(B),this.fullLayout=F,this.id=z.id||"scene",this.fullSceneLayout=F[this.id],this.plotArgs=[[],{},{}],this.axesOptions=f(F,F[this.id]),this.spikeOptions=g(F[this.id]),this.container=B,this.staticMode=!!z.staticPlot,this.pixelRatio=this.pixelRatio||z.plotGlPixelRatio||2,this.dataScale=[1,1,1],this.contourLevels=[[],[],[]],this.convertAnnotations=t.getComponentMethod("annotations3d","convert"),this.drawAnnotations=t.getComponentMethod("annotations3d","draw"),this.initializeGLPlot()}var E=S.prototype;E.prepareOptions=function(){var z=this,F={canvas:z.canvas,gl:z.gl,glOptions:{preserveDrawingBuffer:o,premultipliedAlpha:!0,antialias:!0},container:z.container,axes:z.axesOptions,spikes:z.spikeOptions,pickRadius:10,snapToData:!0,autoScale:!0,autoBounds:!1,cameraObject:z.camera,pixelRatio:z.pixelRatio};if(z.staticMode){if(!_&&(l=document.createElement("canvas"),_=M({canvas:l,preserveDrawingBuffer:!0,premultipliedAlpha:!0,antialias:!0}),!_))throw new Error("error creating static canvas/context for image server");F.gl=_,F.canvas=l}return F};var y=!0;E.tryCreatePlot=function(){var z=this,F=z.prepareOptions(),B=!0;try{z.glplot=A(F)}catch{if(z.staticMode||!y||o)B=!1;else{r.warn(["webgl setup failed possibly due to","false preserveDrawingBuffer config.","The mobile/tablet device may not be detected by is-mobile module.","Enabling preserveDrawingBuffer in second attempt to create webgl scene..."].join(" "));try{o=F.glOptions.preserveDrawingBuffer=!0,z.glplot=A(F)}catch{o=F.glOptions.preserveDrawingBuffer=!1,B=!1}}}return y=!1,B},E.initializeGLCamera=function(){var z=this,F=z.fullSceneLayout.camera,B=F.projection.type==="orthographic";z.camera=x(z.container,{center:[F.center.x,F.center.y,F.center.z],eye:[F.eye.x,F.eye.y,F.eye.z],up:[F.up.x,F.up.y,F.up.z],_ortho:B,zoomMin:.01,zoomMax:100,mode:"orbit"})},E.initializeGLPlot=function(){var z=this;z.initializeGLCamera();var F=z.tryCreatePlot();if(!F)return s(z);z.traces={},z.make4thDimension();var B=z.graphDiv,O=B.layout,I=function(){var U={};return z.isCameraChanged(O)&&(U[z.id+".camera"]=z.getCamera()),z.isAspectChanged(O)&&(U[z.id+".aspectratio"]=z.glplot.getAspectratio(),O[z.id].aspectmode!=="manual"&&(z.fullSceneLayout.aspectmode=O[z.id].aspectmode=U[z.id+".aspectmode"]="manual")),U},N=function(U){if(U.fullSceneLayout.dragmode!==!1){var W=I();U.saveLayout(O),U.graphDiv.emit("plotly_relayout",W)}};return z.glplot.canvas&&(z.glplot.canvas.addEventListener("mouseup",function(){N(z)}),z.glplot.canvas.addEventListener("touchstart",function(){w=!0}),z.glplot.canvas.addEventListener("wheel",function(U){if(B._context._scrollZoom.gl3d){if(z.camera._ortho){var W=U.deltaX>U.deltaY?1.1:.9090909090909091,Q=z.glplot.getAspectratio();z.glplot.setAspectratio({x:W*Q.x,y:W*Q.y,z:W*Q.z})}N(z)}},e?{passive:!1}:!1),z.glplot.canvas.addEventListener("mousemove",function(){if(z.fullSceneLayout.dragmode!==!1&&z.camera.mouseListener.buttons!==0){var U=I();z.graphDiv.emit("plotly_relayouting",U)}}),z.staticMode||z.glplot.canvas.addEventListener("webglcontextlost",function(U){B&&B.emit&&B.emit("plotly_webglcontextlost",{event:U,layer:z.id})},!1)),z.glplot.oncontextloss=function(){z.recoverContext()},z.glplot.onrender=function(){z.render()},!0},E.render=function(){var z=this,F=z.graphDiv,B,O=z.svgContainer,I=z.container.getBoundingClientRect();F._fullLayout._calcInverseTransform(F);var N=F._fullLayout._invScaleX,U=F._fullLayout._invScaleY,W=I.width*N,Q=I.height*U;O.setAttributeNS(null,"viewBox","0 0 "+W+" "+Q),O.setAttributeNS(null,"width",W),O.setAttributeNS(null,"height",Q),v(z),z.glplot.axes.update(z.axesOptions);for(var ue=Object.keys(z.traces),le=null,he=z.glplot.selection,G=0;G")):B.type==="isosurface"||B.type==="volume"?(ie.valueLabel=a.hoverLabelText(z._mockAxis,z._mockAxis.d2l(he.traceCoordinate[3]),B.valuehoverformat),be.push("value: "+ie.valueLabel),he.textLabel&&be.push(he.textLabel),ce=be.join("
")):ce=he.textLabel;var Ae={x:he.traceCoordinate[0],y:he.traceCoordinate[1],z:he.traceCoordinate[2],data:X._input,fullData:X,curveNumber:X.index,pointNumber:oe};i.appendArrayPointValue(Ae,X,oe),B._module.eventData&&(Ae=X._module.eventData(Ae,he,X,{},oe));var ze={points:[Ae]};if(z.fullSceneLayout.hovermode){var Re=[];i.loneHover({trace:X,x:(.5+.5*J[0]/J[3])*W,y:(.5-.5*J[1]/J[3])*Q,xLabel:ie.xLabel,yLabel:ie.yLabel,zLabel:ie.zLabel,text:ce,name:le.name,color:i.castHoverOption(X,oe,"bgcolor")||le.color,borderColor:i.castHoverOption(X,oe,"bordercolor"),fontFamily:i.castHoverOption(X,oe,"font.family"),fontSize:i.castHoverOption(X,oe,"font.size"),fontColor:i.castHoverOption(X,oe,"font.color"),nameLength:i.castHoverOption(X,oe,"namelength"),textAlign:i.castHoverOption(X,oe,"align"),hovertemplate:r.castOption(X,oe,"hovertemplate"),hovertemplateLabels:r.extendFlat({},Ae,ie),eventData:[Ae]},{container:O,gd:F,inOut_bbox:Re}),Ae.bbox=Re[0]}he.distance<5&&(he.buttons||w)?F.emit("plotly_click",ze):F.emit("plotly_hover",ze),this.oldEventData=ze}else i.loneUnhover(O),this.oldEventData&&F.emit("plotly_unhover",this.oldEventData),this.oldEventData=void 0;z.drawAnnotations(z)},E.recoverContext=function(){var z=this;z.glplot.dispose();var F=function(){if(z.glplot.gl.isContextLost()){requestAnimationFrame(F);return}if(!z.initializeGLPlot()){r.error("Catastrophic and unrecoverable WebGL error. Context lost.");return}z.plot.apply(z,z.plotArgs)};requestAnimationFrame(F)};var b=["xaxis","yaxis","zaxis"];function p(z,F,B){for(var O=z.fullSceneLayout,I=0;I<3;I++){var N=b[I],U=N.charAt(0),W=O[N],Q=F[U],ue=F[U+"calendar"],le=F["_"+U+"length"];if(!r.isArrayOrTypedArray(Q))B[0][I]=Math.min(B[0][I],0),B[1][I]=Math.max(B[1][I],le-1);else for(var he,G=0;G<(le||Q.length);G++)if(r.isArrayOrTypedArray(Q[G]))for(var $=0;$X[1][U])X[0][U]=-1,X[1][U]=1;else{var it=X[1][U]-X[0][U];X[0][U]-=it/32,X[1][U]+=it/32}if(j=[X[0][U],X[1][U]],j=T(j,Q),X[0][U]=j[0],X[1][U]=j[1],Q.isReversed()){var ot=X[0][U];X[0][U]=X[1][U],X[1][U]=ot}}else j=Q.range,X[0][U]=Q.r2l(j[0]),X[1][U]=Q.r2l(j[1]);X[0][U]===X[1][U]&&(X[0][U]-=1,X[1][U]+=1),oe[U]=X[1][U]-X[0][U],Q.range=[X[0][U],X[1][U]],Q.limitRange(),O.glplot.setBounds(U,{min:Q.range[0]*$[U],max:Q.range[1]*$[U]})}var tt,lt=le.aspectmode;if(lt==="cube")tt=[1,1,1];else if(lt==="manual"){var Ee=le.aspectratio;tt=[Ee.x,Ee.y,Ee.z]}else if(lt==="auto"||lt==="data"){var _e=[1,1,1];for(U=0;U<3;++U){Q=le[b[U]],ue=Q.type;var fe=ie[ue];_e[U]=Math.pow(fe.acc,1/fe.count)/$[U]}lt==="data"||Math.max.apply(null,_e)/Math.min.apply(null,_e)<=4?tt=_e:tt=[1,1,1]}else throw new Error("scene.js aspectRatio was not one of the enumerated types");le.aspectratio.x=he.aspectratio.x=tt[0],le.aspectratio.y=he.aspectratio.y=tt[1],le.aspectratio.z=he.aspectratio.z=tt[2],O.glplot.setAspectratio(le.aspectratio),O.viewInitial.aspectratio||(O.viewInitial.aspectratio={x:le.aspectratio.x,y:le.aspectratio.y,z:le.aspectratio.z}),O.viewInitial.aspectmode||(O.viewInitial.aspectmode=le.aspectmode);var Fe=le.domain||null,rt=F._size||null;if(Fe&&rt){var st=O.container.style;st.position="absolute",st.left=rt.l+Fe.x[0]*rt.w+"px",st.top=rt.t+(1-Fe.y[1])*rt.h+"px",st.width=rt.w*(Fe.x[1]-Fe.x[0])+"px",st.height=rt.h*(Fe.y[1]-Fe.y[0])+"px"}O.glplot.redraw()}},E.destroy=function(){var z=this;z.glplot&&(z.camera.mouseListener.enabled=!1,z.container.removeEventListener("wheel",z.camera.wheelListener),z.camera=null,z.glplot.dispose(),z.container.parentNode.removeChild(z.container),z.glplot=null)};function m(z){return[[z.eye.x,z.eye.y,z.eye.z],[z.center.x,z.center.y,z.center.z],[z.up.x,z.up.y,z.up.z]]}function h(z){return{up:{x:z.up[0],y:z.up[1],z:z.up[2]},center:{x:z.center[0],y:z.center[1],z:z.center[2]},eye:{x:z.eye[0],y:z.eye[1],z:z.eye[2]},projection:{type:z._ortho===!0?"orthographic":"perspective"}}}E.getCamera=function(){var z=this;return z.camera.view.recalcMatrix(z.camera.view.lastT()),h(z.camera)},E.setViewport=function(z){var F=this,B=z.camera;F.camera.lookAt.apply(this,m(B)),F.glplot.setAspectratio(z.aspectratio);var O=B.projection.type==="orthographic",I=F.camera._ortho;O!==I&&(F.glplot.redraw(),F.glplot.clearRGBA(),F.glplot.dispose(),F.initializeGLPlot())},E.isCameraChanged=function(z){var F=this,B=F.getCamera(),O=r.nestedProperty(z,F.id+".camera"),I=O.get();function N(ue,le,he,G){var $=["up","center","eye"],J=["x","y","z"];return le[$[he]]&&ue[$[he]][J[G]]===le[$[he]][J[G]]}var U=!1;if(I===void 0)U=!0;else{for(var W=0;W<3;W++)for(var Q=0;Q<3;Q++)if(!N(B,I,W,Q)){U=!0;break}(!I.projection||B.projection&&B.projection.type!==I.projection.type)&&(U=!0)}return U},E.isAspectChanged=function(z){var F=this,B=F.glplot.getAspectratio(),O=r.nestedProperty(z,F.id+".aspectratio"),I=O.get();return I===void 0||I.x!==B.x||I.y!==B.y||I.z!==B.z},E.saveLayout=function(z){var F=this,B=F.fullLayout,O,I,N,U,W,Q,ue=F.isCameraChanged(z),le=F.isAspectChanged(z),he=ue||le;if(he){var G={};if(ue&&(O=F.getCamera(),I=r.nestedProperty(z,F.id+".camera"),N=I.get(),G[F.id+".camera"]=N),le&&(U=F.glplot.getAspectratio(),W=r.nestedProperty(z,F.id+".aspectratio"),Q=W.get(),G[F.id+".aspectratio"]=Q),t.call("_storeDirectGUIEdit",z,B._preGUI,G),ue){I.set(O);var $=r.nestedProperty(B,F.id+".camera");$.set(O)}if(le){W.set(U);var J=r.nestedProperty(B,F.id+".aspectratio");J.set(U),F.glplot.redraw()}}return he},E.updateFx=function(z,F){var B=this,O=B.camera;if(O)if(z==="orbit")O.mode="orbit",O.keyBindingMode="rotate";else if(z==="turntable"){O.up=[0,0,1],O.mode="turntable",O.keyBindingMode="rotate";var I=B.graphDiv,N=I._fullLayout,U=B.fullSceneLayout.camera,W=U.up.x,Q=U.up.y,ue=U.up.z;if(ue/Math.sqrt(W*W+Q*Q+ue*ue)<.999){var le=B.id+".camera.up",he={x:0,y:0,z:1},G={};G[le]=he;var $=I.layout;t.call("_storeDirectGUIEdit",$,N._preGUI,G),U.up=he,r.nestedProperty($,le).set(he)}}else O.keyBindingMode=z;B.fullSceneLayout.hovermode=F};function P(z,F,B){for(var O=0,I=B-1;O0)for(var W=255/U,Q=0;Q<3;++Q)z[N+Q]=Math.min(W*z[N+Q],255)}}E.toImage=function(z){var F=this;z||(z="png"),F.staticMode&&F.container.appendChild(l),F.glplot.redraw();var B=F.glplot.gl,O=B.drawingBufferWidth,I=B.drawingBufferHeight;B.bindFramebuffer(B.FRAMEBUFFER,null);var N=new Uint8Array(O*I*4);B.readPixels(0,0,O,I,B.RGBA,B.UNSIGNED_BYTE,N),P(N,O,I),L(N,O,I);var U=document.createElement("canvas");U.width=O,U.height=I;var W=U.getContext("2d",{willReadFrequently:!0}),Q=W.createImageData(O,I);Q.data.set(N),W.putImageData(Q,0,0);var ue;switch(z){case"jpeg":ue=U.toDataURL("image/jpeg");break;case"webp":ue=U.toDataURL("image/webp");break;default:ue=U.toDataURL("image/png")}return F.staticMode&&F.container.removeChild(l),ue},E.setConvert=function(){for(var z=this,F=0;F<3;F++){var B=z.fullSceneLayout[b[F]];a.setConvert(B,z.fullLayout),B.setScale=r.noop}},E.make4thDimension=function(){var z=this,F=z.graphDiv,B=F._fullLayout;z._mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},a.setConvert(z._mockAxis,B)},q.exports=S}}),tU=Ze({"src/plots/gl3d/layout/attributes.js"(Z,q){"use strict";q.exports={scene:{valType:"subplotid",dflt:"scene",editType:"calc+clearAxisTypes"}}}}),TE=Ze({"src/plots/gl3d/layout/axis_attributes.js"(Z,q){"use strict";var d=Yn(),x=Wh(),A=rs().extendFlat,M=pc().overrideAll;q.exports=M({visible:x.visible,showspikes:{valType:"boolean",dflt:!0},spikesides:{valType:"boolean",dflt:!0},spikethickness:{valType:"number",min:0,dflt:2},spikecolor:{valType:"color",dflt:d.defaultLine},showbackground:{valType:"boolean",dflt:!1},backgroundcolor:{valType:"color",dflt:"rgba(204, 204, 204, 0.5)"},showaxeslabels:{valType:"boolean",dflt:!0},color:x.color,categoryorder:x.categoryorder,categoryarray:x.categoryarray,title:{text:x.title.text,font:x.title.font},type:A({},x.type,{values:["-","linear","log","date","category"]}),autotypenumbers:x.autotypenumbers,autorange:x.autorange,autorangeoptions:{minallowed:x.autorangeoptions.minallowed,maxallowed:x.autorangeoptions.maxallowed,clipmin:x.autorangeoptions.clipmin,clipmax:x.autorangeoptions.clipmax,include:x.autorangeoptions.include,editType:"plot"},rangemode:x.rangemode,minallowed:x.minallowed,maxallowed:x.maxallowed,range:A({},x.range,{items:[{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}}],anim:!1}),tickmode:x.minor.tickmode,nticks:x.nticks,tick0:x.tick0,dtick:x.dtick,tickvals:x.tickvals,ticktext:x.ticktext,ticks:x.ticks,mirror:x.mirror,ticklen:x.ticklen,tickwidth:x.tickwidth,tickcolor:x.tickcolor,showticklabels:x.showticklabels,labelalias:x.labelalias,tickfont:x.tickfont,tickangle:x.tickangle,tickprefix:x.tickprefix,showtickprefix:x.showtickprefix,ticksuffix:x.ticksuffix,showticksuffix:x.showticksuffix,showexponent:x.showexponent,exponentformat:x.exponentformat,minexponent:x.minexponent,separatethousands:x.separatethousands,tickformat:x.tickformat,tickformatstops:x.tickformatstops,hoverformat:x.hoverformat,showline:x.showline,linecolor:x.linecolor,linewidth:x.linewidth,showgrid:x.showgrid,gridcolor:A({},x.gridcolor,{dflt:"rgb(204, 204, 204)"}),gridwidth:x.gridwidth,zeroline:x.zeroline,zerolinecolor:x.zerolinecolor,zerolinewidth:x.zerolinewidth},"plot","from-root")}}),AE=Ze({"src/plots/gl3d/layout/layout_attributes.js"(Z,q){"use strict";var d=TE(),x=bc().attributes,A=rs().extendFlat,M=ca().counterRegex;function e(t,r,o){return{x:{valType:"number",dflt:t,editType:"camera"},y:{valType:"number",dflt:r,editType:"camera"},z:{valType:"number",dflt:o,editType:"camera"},editType:"camera"}}q.exports={_arrayAttrRegexps:[M("scene",".annotations",!0)],bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"plot"},camera:{up:A(e(0,0,1),{}),center:A(e(0,0,0),{}),eye:A(e(1.25,1.25,1.25),{}),projection:{type:{valType:"enumerated",values:["perspective","orthographic"],dflt:"perspective",editType:"calc"},editType:"calc"},editType:"camera"},domain:x({name:"scene",editType:"plot"}),aspectmode:{valType:"enumerated",values:["auto","cube","data","manual"],dflt:"auto",editType:"plot",impliedEdits:{"aspectratio.x":void 0,"aspectratio.y":void 0,"aspectratio.z":void 0}},aspectratio:{x:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},y:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},z:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},editType:"plot",impliedEdits:{aspectmode:"manual"}},xaxis:d,yaxis:d,zaxis:d,dragmode:{valType:"enumerated",values:["orbit","turntable","zoom","pan",!1],editType:"plot"},hovermode:{valType:"enumerated",values:["closest",!1],dflt:"closest",editType:"modebar"},uirevision:{valType:"any",editType:"none"},editType:"plot"}}}),rU=Ze({"src/plots/gl3d/layout/axis_defaults.js"(Z,q){"use strict";var d=Ch().mix,x=ca(),A=Dl(),M=TE(),e=O5(),t=z_(),r=["xaxis","yaxis","zaxis"],o=100*136/187;q.exports=function(i,n,s){var c,f;function g(l,_){return x.coerce(c,f,M,l,_)}for(var v=0;v1;function g(v){if(!f){var T=d.validate(n[v],t[v]);if(T)return n[v]}}M(n,s,c,{type:o,attributes:t,handleDefaults:a,fullLayout:s,font:s.font,fullData:c,getDfltFromLayout:g,autotypenumbersDflt:s.autotypenumbers,paper_bgcolor:s.paper_bgcolor,calendar:s.calendar})};function a(i,n,s,c){for(var f=s("bgcolor"),g=x.combine(f,c.paper_bgcolor),v=["up","center","eye"],T=0;T.999)&&(E="turntable")}else E="turntable";s("dragmode",E),s("hovermode",c.getDfltFromLayout("hovermode"))}}}),p0=Ze({"src/plots/gl3d/index.js"(Z){"use strict";var q=pc().overrideAll,d=Xm(),x=eU(),A=Hh().getSubplotData,M=ca(),e=vd(),t="gl3d",r="scene";Z.name=t,Z.attr=r,Z.idRoot=r,Z.idRegex=Z.attrRegex=M.counterRegex("scene"),Z.attributes=tU(),Z.layoutAttributes=AE(),Z.baseLayoutAttrOverrides=q({hoverlabel:d.hoverlabel},"plot","nested"),Z.supplyLayoutDefaults=aU(),Z.plot=function(a){for(var i=a._fullLayout,n=a._fullData,s=i._subplots[t],c=0;c0){P=c[L];break}return P}function T(m,h){if(!(m<1||h<1)){for(var P=g(m),L=g(h),z=1,F=0;FS;)L--,L/=v(L),L++,L1?z:1};function E(m,h,P){var L=P[8]+P[2]*h[0]+P[5]*h[1];return m[0]=(P[6]+P[0]*h[0]+P[3]*h[1])/L,m[1]=(P[7]+P[1]*h[0]+P[4]*h[1])/L,m}function y(m,h,P){return b(m,h,E,P),m}function b(m,h,P,L){for(var z=[0,0],F=m.shape[0],B=m.shape[1],O=0;O0&&this.contourStart[L]!==null&&this.contourEnd[L]!==null&&this.contourEnd[L]>this.contourStart[L]))for(h[L]=!0,z=this.contourStart[L];zQ&&(this.minValues[N]=Q),this.maxValues[N]c&&(o.isomin=null,o.isomax=null);var f=n("x"),g=n("y"),v=n("z"),T=n("value");if(!f||!f.length||!g||!g.length||!v||!v.length||!T||!T.length){o.visible=!1;return}var l=x.getComponentMethod("calendars","handleTraceDefaults");l(r,o,["x","y","z"],i),n("valuehoverformat"),["x","y","z"].forEach(function(E){n(E+"hoverformat");var y="caps."+E,b=n(y+".show");b&&n(y+".fill");var p="slices."+E,u=n(p+".show");u&&(n(p+".fill"),n(p+".locations"))});var _=n("spaceframe.show");_&&n("spaceframe.fill");var w=n("surface.show");w&&(n("surface.count"),n("surface.fill"),n("surface.pattern"));var S=n("contour.show");S&&(n("contour.color"),n("contour.width")),["text","hovertext","hovertemplate","lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","lighting.vertexnormalsepsilon","lighting.facenormalsepsilon","lightposition.x","lightposition.y","lightposition.z","flatshading","opacity"].forEach(function(E){n(E)}),M(r,o,i,n,{prefix:"",cLetter:"c"}),o._length=null}q.exports={supplyDefaults:e,supplyIsoDefaults:t}}}),rT=Ze({"src/traces/streamtube/calc.js"(Z,q){"use strict";var d=ca(),x=wp();function A(r,o){o._len=Math.min(o.u.length,o.v.length,o.w.length,o.x.length,o.y.length,o.z.length),o._u=t(o.u,o._len),o._v=t(o.v,o._len),o._w=t(o.w,o._len),o._x=t(o.x,o._len),o._y=t(o.y,o._len),o._z=t(o.z,o._len);var a=M(o);o._gridFill=a.fill,o._Xs=a.Xs,o._Ys=a.Ys,o._Zs=a.Zs,o._len=a.len;var i=0,n,s,c;o.starts&&(n=t(o.starts.x||[]),s=t(o.starts.y||[]),c=t(o.starts.z||[]),i=Math.min(n.length,s.length,c.length)),o._startsX=n||[],o._startsY=s||[],o._startsZ=c||[];var f=0,g=1/0,v;for(v=0;v1&&(u=o[n-1],h=a[n-1],L=i[n-1]),s=0;su?"-":"+")+"x"),S=S.replace("y",(m>h?"-":"+")+"y"),S=S.replace("z",(P>L?"-":"+")+"z");var O=function(){n=0,z=[],F=[],B=[]};(!n||n0;g--){var v=Math.min(f[g],f[g-1]),T=Math.max(f[g],f[g-1]);if(T>v&&v-1}function ee(bt,Be){return bt===null?Be:bt}function re(bt,Be,Ke){ue();var Ue=[Be],Me=[Ke];if(X>=1)Ue=[Be],Me=[Ke];else if(X>0){var qe=ie(Be,Ke);Ue=qe.xyzv,Me=qe.abc}for(var Ce=0;Ce-1?Ke[Pe]:Q(at,yt,Tt);Gt>-1?Te[Pe]=Gt:Te[Pe]=he(at,yt,Tt,ee(bt,Ot))}G(Te[0],Te[1],Te[2])}}function ce(bt,Be,Ke){var Ue=function(Me,qe,Ce){re(bt,[Be[Me],Be[qe],Be[Ce]],[Ke[Me],Ke[qe],Ke[Ce]])};Ue(0,1,2),Ue(2,3,0)}function be(bt,Be,Ke){var Ue=function(Me,qe,Ce){re(bt,[Be[Me],Be[qe],Be[Ce]],[Ke[Me],Ke[qe],Ke[Ce]])};Ue(0,1,2),Ue(3,0,1),Ue(2,3,0),Ue(1,2,3)}function Ae(bt,Be,Ke,Ue){var Me=bt[3];MeUe&&(Me=Ue);for(var qe=(bt[3]-Me)/(bt[3]-Be[3]+1e-9),Ce=[],Te=0;Te<4;Te++)Ce[Te]=(1-qe)*bt[Te]+qe*Be[Te];return Ce}function ze(bt,Be,Ke){return bt>=Be&&bt<=Ke}function Re(bt){var Be=.001*(O-B);return bt>=B-Be&&bt<=O+Be}function Xe(bt){for(var Be=[],Ke=0;Ke<4;Ke++){var Ue=bt[Ke];Be.push([c._x[Ue],c._y[Ue],c._z[Ue],c._value[Ue]])}return Be}var it=3;function ot(bt,Be,Ke,Ue,Me,qe){qe||(qe=1),Ke=[-1,-1,-1];var Ce=!1,Te=[ze(Be[0][3],Ue,Me),ze(Be[1][3],Ue,Me),ze(Be[2][3],Ue,Me)];if(!Te[0]&&!Te[1]&&!Te[2])return!1;var Pe=function(yt,Tt,Ot){return Re(Tt[0][3])&&Re(Tt[1][3])&&Re(Tt[2][3])?(re(yt,Tt,Ot),!0):qeTe?[z,qe]:[qe,F];Vt(Be,Pe[0],Pe[1])}}var at=[[Math.min(B,F),Math.max(B,F)],[Math.min(z,O),Math.max(z,O)]];["x","y","z"].forEach(function(yt){for(var Tt=[],Ot=0;Ot0&&(Ua.push(ei.id),yt==="x"?Ba.push([ei.distRatio,0,0]):yt==="y"?Ba.push([0,ei.distRatio,0]):Ba.push([0,0,ei.distRatio]))}else yt==="x"?la=jr(1,u-1):yt==="y"?la=jr(1,m-1):la=jr(1,h-1);Ua.length>0&&(yt==="x"?Tt[Gt]=Zt(bt,Ua,rr,Qt,Ba,Tt[Gt]):yt==="y"?Tt[Gt]=Sr(bt,Ua,rr,Qt,Ba,Tt[Gt]):Tt[Gt]=xr(bt,Ua,rr,Qt,Ba,Tt[Gt]),Gt++),la.length>0&&(yt==="x"?Tt[Gt]=rt(bt,la,rr,Qt,Tt[Gt]):yt==="y"?Tt[Gt]=st(bt,la,rr,Qt,Tt[Gt]):Tt[Gt]=Qe(bt,la,rr,Qt,Tt[Gt]),Gt++)}var za=c.caps[yt];za.show&&za.fill&&(oe(za.fill),yt==="x"?Tt[Gt]=rt(bt,[0,u-1],rr,Qt,Tt[Gt]):yt==="y"?Tt[Gt]=st(bt,[0,m-1],rr,Qt,Tt[Gt]):Tt[Gt]=Qe(bt,[0,h-1],rr,Qt,Tt[Gt]),Gt++)}}),w===0&&le(),c._meshX=I,c._meshY=N,c._meshZ=U,c._meshIntensity=W,c._Xs=y,c._Ys=b,c._Zs=p}return Ir(),c}function s(c,f){var g=c.glplot.gl,v=d({gl:g}),T=new o(c,v,f.uid);return v._trace=T,T.update(f),c.glplot.add(v),T}q.exports={findNearestOnAxis:r,generateIsoMeshes:n,createIsosurfaceTrace:s}}}),cU=Ze({"src/traces/isosurface/index.js"(Z,q){"use strict";q.exports={attributes:tT(),supplyDefaults:ME().supplyDefaults,calc:EE(),colorbar:{min:"cmin",max:"cmax"},plot:aT().createIsosurfaceTrace,moduleType:"trace",name:"isosurface",basePlotModule:p0(),categories:["gl3d","showLegend"],meta:{}}}}),fU=Ze({"lib/isosurface.js"(Z,q){"use strict";q.exports=cU()}}),CE=Ze({"src/traces/volume/attributes.js"(Z,q){"use strict";var d=Mu(),x=tT(),A=mx(),M=eu(),e=rs().extendFlat,t=pc().overrideAll,r=q.exports=t(e({x:x.x,y:x.y,z:x.z,value:x.value,isomin:x.isomin,isomax:x.isomax,surface:x.surface,spaceframe:{show:{valType:"boolean",dflt:!1},fill:{valType:"number",min:0,max:1,dflt:1}},slices:x.slices,caps:x.caps,text:x.text,hovertext:x.hovertext,xhoverformat:x.xhoverformat,yhoverformat:x.yhoverformat,zhoverformat:x.zhoverformat,valuehoverformat:x.valuehoverformat,hovertemplate:x.hovertemplate},d("",{colorAttr:"`value`",showScaleDflt:!0,editTypeOverride:"calc"}),{colorbar:x.colorbar,opacity:x.opacity,opacityscale:A.opacityscale,lightposition:x.lightposition,lighting:x.lighting,flatshading:x.flatshading,contour:x.contour,hoverinfo:e({},M.hoverinfo),showlegend:e({},M.showlegend,{dflt:!1})}),"calc","nested");r.x.editType=r.y.editType=r.z.editType=r.value.editType="calc+clearAxisTypes"}}),hU=Ze({"src/traces/volume/defaults.js"(Z,q){"use strict";var d=ca(),x=CE(),A=ME().supplyIsoDefaults,M=SE().opacityscaleDefaults;q.exports=function(t,r,o,a){function i(n,s){return d.coerce(t,r,x,n,s)}A(t,r,o,a,i),M(t,r,a,i)}}}),pU=Ze({"src/traces/volume/convert.js"(Z,q){"use strict";var d=Yh().gl_mesh3d,x=em().parseColorScale,A=ca().isArrayOrTypedArray,M=Qv(),e=rc().extractOpts,t=E1(),r=aT().findNearestOnAxis,o=aT().generateIsoMeshes;function a(s,c,f){this.scene=s,this.uid=f,this.mesh=c,this.name="",this.data=null,this.showContour=!1}var i=a.prototype;i.handlePick=function(s){if(s.object===this.mesh){var c=s.data.index,f=this.data._meshX[c],g=this.data._meshY[c],v=this.data._meshZ[c],T=this.data._Ys.length,l=this.data._Zs.length,_=r(f,this.data._Xs).id,w=r(g,this.data._Ys).id,S=r(v,this.data._Zs).id,E=s.index=S+l*w+l*T*_;s.traceCoordinate=[this.data._meshX[E],this.data._meshY[E],this.data._meshZ[E],this.data._value[E]];var y=this.data.hovertext||this.data.text;return A(y)&&y[E]!==void 0?s.textLabel=y[E]:y&&(s.textLabel=y),!0}},i.update=function(s){var c=this.scene,f=c.fullSceneLayout;this.data=o(s);function g(w,S,E,y){return S.map(function(b){return w.d2l(b,0,y)*E})}var v=t(g(f.xaxis,s._meshX,c.dataScale[0],s.xcalendar),g(f.yaxis,s._meshY,c.dataScale[1],s.ycalendar),g(f.zaxis,s._meshZ,c.dataScale[2],s.zcalendar)),T=t(s._meshI,s._meshJ,s._meshK),l={positions:v,cells:T,lightPosition:[s.lightposition.x,s.lightposition.y,s.lightposition.z],ambient:s.lighting.ambient,diffuse:s.lighting.diffuse,specular:s.lighting.specular,roughness:s.lighting.roughness,fresnel:s.lighting.fresnel,vertexNormalsEpsilon:s.lighting.vertexnormalsepsilon,faceNormalsEpsilon:s.lighting.facenormalsepsilon,opacity:s.opacity,opacityscale:s.opacityscale,contourEnable:s.contour.show,contourColor:M(s.contour.color).slice(0,3),contourWidth:s.contour.width,useFacetNormals:s.flatshading},_=e(s);l.vertexIntensity=s._meshIntensity,l.vertexIntensityBounds=[_.min,_.max],l.colormap=x(s),this.mesh.update(l)},i.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()};function n(s,c){var f=s.glplot.gl,g=d({gl:f}),v=new a(s,g,c.uid);return g._trace=v,v.update(c),s.glplot.add(g),v}q.exports=n}}),dU=Ze({"src/traces/volume/index.js"(Z,q){"use strict";q.exports={attributes:CE(),supplyDefaults:hU(),calc:EE(),colorbar:{min:"cmin",max:"cmax"},plot:pU(),moduleType:"trace",name:"volume",basePlotModule:p0(),categories:["gl3d","showLegend"],meta:{}}}}),vU=Ze({"lib/volume.js"(Z,q){"use strict";q.exports=dU()}}),mU=Ze({"src/traces/mesh3d/defaults.js"(Z,q){"use strict";var d=oo(),x=ca(),A=gh(),M=M1();q.exports=function(t,r,o,a){function i(g,v){return x.coerce(t,r,M,g,v)}function n(g){var v=g.map(function(T){var l=i(T);return l&&x.isArrayOrTypedArray(l)?l:null});return v.every(function(T){return T&&T.length===v[0].length})&&v}var s=n(["x","y","z"]);if(!s){r.visible=!1;return}if(n(["i","j","k"]),r.i&&(!r.j||!r.k)||r.j&&(!r.k||!r.i)||r.k&&(!r.i||!r.j)){r.visible=!1;return}var c=d.getComponentMethod("calendars","handleTraceDefaults");c(t,r,["x","y","z"],a),["lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","lighting.vertexnormalsepsilon","lighting.facenormalsepsilon","lightposition.x","lightposition.y","lightposition.z","flatshading","alphahull","delaunayaxis","opacity"].forEach(function(g){i(g)});var f=i("contour.show");f&&(i("contour.color"),i("contour.width")),"intensity"in t?(i("intensity"),i("intensitymode"),A(t,r,a,i,{prefix:"",cLetter:"c"})):(r.showscale=!1,"facecolor"in t?i("facecolor"):"vertexcolor"in t?i("vertexcolor"):i("color",o)),i("text"),i("hovertext"),i("hovertemplate"),i("xhoverformat"),i("yhoverformat"),i("zhoverformat"),r._length=null}}}),gU=Ze({"src/traces/mesh3d/calc.js"(Z,q){"use strict";var d=wp();q.exports=function(A,M){M.intensity&&d(A,M,{vals:M.intensity,containerStr:"",cLetter:"c"})}}}),yU=Ze({"src/traces/mesh3d/convert.js"(Z,q){"use strict";var d=Yh().gl_mesh3d,x=Yh().delaunay_triangulate,A=Yh().alpha_shape,M=Yh().convex_hull,e=em().parseColorScale,t=ca().isArrayOrTypedArray,r=Qv(),o=rc().extractOpts,a=E1();function i(l,_,w){this.scene=l,this.uid=w,this.mesh=_,this.name="",this.color="#fff",this.data=null,this.showContour=!1}var n=i.prototype;n.handlePick=function(l){if(l.object===this.mesh){var _=l.index=l.data.index;l.data._cellCenter?l.traceCoordinate=l.data.dataCoordinate:l.traceCoordinate=[this.data.x[_],this.data.y[_],this.data.z[_]];var w=this.data.hovertext||this.data.text;return t(w)&&w[_]!==void 0?l.textLabel=w[_]:w&&(l.textLabel=w),!0}};function s(l){for(var _=[],w=l.length,S=0;S=_-.5)return!1;return!0}n.update=function(l){var _=this.scene,w=_.fullSceneLayout;this.data=l;var S=l.x.length,E=a(c(w.xaxis,l.x,_.dataScale[0],l.xcalendar),c(w.yaxis,l.y,_.dataScale[1],l.ycalendar),c(w.zaxis,l.z,_.dataScale[2],l.zcalendar)),y;if(l.i&&l.j&&l.k){if(l.i.length!==l.j.length||l.j.length!==l.k.length||!v(l.i,S)||!v(l.j,S)||!v(l.k,S))return;y=a(f(l.i),f(l.j),f(l.k))}else l.alphahull===0?y=M(E):l.alphahull>0?y=A(l.alphahull,E):y=g(l.delaunayaxis,E);var b={positions:E,cells:y,lightPosition:[l.lightposition.x,l.lightposition.y,l.lightposition.z],ambient:l.lighting.ambient,diffuse:l.lighting.diffuse,specular:l.lighting.specular,roughness:l.lighting.roughness,fresnel:l.lighting.fresnel,vertexNormalsEpsilon:l.lighting.vertexnormalsepsilon,faceNormalsEpsilon:l.lighting.facenormalsepsilon,opacity:l.opacity,contourEnable:l.contour.show,contourColor:r(l.contour.color).slice(0,3),contourWidth:l.contour.width,useFacetNormals:l.flatshading};if(l.intensity){var p=o(l);this.color="#fff";var u=l.intensitymode;b[u+"Intensity"]=l.intensity,b[u+"IntensityBounds"]=[p.min,p.max],b.colormap=e(l)}else l.vertexcolor?(this.color=l.vertexcolor[0],b.vertexColors=s(l.vertexcolor)):l.facecolor?(this.color=l.facecolor[0],b.cellColors=s(l.facecolor)):(this.color=l.color,b.meshColor=r(l.color));this.mesh.update(b)},n.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()};function T(l,_){var w=l.glplot.gl,S=d({gl:w}),E=new i(l,S,_.uid);return S._trace=E,E.update(_),l.glplot.add(S),E}q.exports=T}}),_U=Ze({"src/traces/mesh3d/index.js"(Z,q){"use strict";q.exports={attributes:M1(),supplyDefaults:mU(),calc:gU(),colorbar:{min:"cmin",max:"cmax"},plot:yU(),moduleType:"trace",name:"mesh3d",basePlotModule:p0(),categories:["gl3d","showLegend"],meta:{}}}}),xU=Ze({"lib/mesh3d.js"(Z,q){"use strict";q.exports=_U()}}),kE=Ze({"src/traces/cone/attributes.js"(Z,q){"use strict";var d=Mu(),x=Qc().axisHoverFormat,A=Cs().hovertemplateAttrs,M=M1(),e=eu(),t=rs().extendFlat,r={x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},u:{valType:"data_array",editType:"calc"},v:{valType:"data_array",editType:"calc"},w:{valType:"data_array",editType:"calc"},sizemode:{valType:"enumerated",values:["scaled","absolute","raw"],editType:"calc",dflt:"scaled"},sizeref:{valType:"number",editType:"calc",min:0},anchor:{valType:"enumerated",editType:"calc",values:["tip","tail","cm","center"],dflt:"cm"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertemplate:A({editType:"calc"},{keys:["norm"]}),uhoverformat:x("u",1),vhoverformat:x("v",1),whoverformat:x("w",1),xhoverformat:x("x"),yhoverformat:x("y"),zhoverformat:x("z"),showlegend:t({},e.showlegend,{dflt:!1})};t(r,d("",{colorAttr:"u/v/w norm",showScaleDflt:!0,editTypeOverride:"calc"}));var o=["opacity","lightposition","lighting"];o.forEach(function(a){r[a]=M[a]}),r.hoverinfo=t({},e.hoverinfo,{editType:"calc",flags:["x","y","z","u","v","w","norm","text","name"],dflt:"x+y+z+norm+text+name"}),q.exports=r}}),bU=Ze({"src/traces/cone/defaults.js"(Z,q){"use strict";var d=ca(),x=gh(),A=kE();q.exports=function(e,t,r,o){function a(T,l){return d.coerce(e,t,A,T,l)}var i=a("u"),n=a("v"),s=a("w"),c=a("x"),f=a("y"),g=a("z");if(!i||!i.length||!n||!n.length||!s||!s.length||!c||!c.length||!f||!f.length||!g||!g.length){t.visible=!1;return}var v=a("sizemode");a("sizeref",v==="raw"?1:.5),a("anchor"),a("lighting.ambient"),a("lighting.diffuse"),a("lighting.specular"),a("lighting.roughness"),a("lighting.fresnel"),a("lightposition.x"),a("lightposition.y"),a("lightposition.z"),x(e,t,o,a,{prefix:"",cLetter:"c"}),a("text"),a("hovertext"),a("hovertemplate"),a("uhoverformat"),a("vhoverformat"),a("whoverformat"),a("xhoverformat"),a("yhoverformat"),a("zhoverformat"),t._length=null}}}),wU=Ze({"src/traces/cone/calc.js"(Z,q){"use strict";var d=wp();q.exports=function(A,M){for(var e=M.u,t=M.v,r=M.w,o=Math.min(M.x.length,M.y.length,M.z.length,e.length,t.length,r.length),a=-1/0,i=1/0,n=0;n2?v=f.slice(1,g-1):g===2?v=[(f[0]+f[1])/2]:v=f,v}function n(f){var g=f.length;return g===1?[.5,.5]:[f[1]-f[0],f[g-1]-f[g-2]]}function s(f,g){var v=f.fullSceneLayout,T=f.dataScale,l=g._len,_={};function w(he,G){var $=v[G],J=T[r[G]];return A.simpleMap(he,function(X){return $.d2l(X)*J})}if(_.vectors=t(w(g._u,"xaxis"),w(g._v,"yaxis"),w(g._w,"zaxis"),l),!l)return{positions:[],cells:[]};var S=w(g._Xs,"xaxis"),E=w(g._Ys,"yaxis"),y=w(g._Zs,"zaxis");_.meshgrid=[S,E,y],_.gridFill=g._gridFill;var b=g._slen;if(b)_.startingPositions=t(w(g._startsX,"xaxis"),w(g._startsY,"yaxis"),w(g._startsZ,"zaxis"));else{for(var p=E[0],u=i(S),m=i(y),h=new Array(u.length*m.length),P=0,L=0;Lp&&(p=P[0]),P[1]u&&(u=P[1])}function h(P){switch(P.type){case"GeometryCollection":P.geometries.forEach(h);break;case"Point":m(P.coordinates);break;case"MultiPoint":P.coordinates.forEach(m);break}}w.arcs.forEach(function(P){for(var L=-1,z=P.length,F;++Lp&&(p=F[0]),F[1]u&&(u=F[1])});for(E in w.objects)h(w.objects[E]);return[y,b,p,u]}function e(w,S){for(var E,y=w.length,b=y-S;b<--y;)E=w[b],w[b++]=w[y],w[y]=E}function t(w,S){return typeof S=="string"&&(S=w.objects[S]),S.type==="GeometryCollection"?{type:"FeatureCollection",features:S.geometries.map(function(E){return r(w,E)})}:r(w,S)}function r(w,S){var E=S.id,y=S.bbox,b=S.properties==null?{}:S.properties,p=o(w,S);return E==null&&y==null?{type:"Feature",properties:b,geometry:p}:y==null?{type:"Feature",id:E,properties:b,geometry:p}:{type:"Feature",id:E,bbox:y,properties:b,geometry:p}}function o(w,S){var E=A(w.transform),y=w.arcs;function b(L,z){z.length&&z.pop();for(var F=y[L<0?~L:L],B=0,O=F.length;B1)y=s(w,S,E);else for(b=0,y=new Array(p=w.arcs.length);b1)for(var z=1,F=m(P[0]),B,O;zF&&(O=P[0],P[0]=P[z],P[z]=O,F=B);return P}).filter(function(h){return h.length>0})}}function v(w,S){for(var E=0,y=w.length;E>>1;w[b]=2))throw new Error("n must be \u22652");h=w.bbox||M(w);var E=h[0],y=h[1],b=h[2],p=h[3],u;S={scale:[b-E?(b-E)/(u-1):1,p-y?(p-y)/(u-1):1],translate:[E,y]}}else h=w.bbox;var m=l(S),h,P,L=w.objects,z={};function F(I){return m(I)}function B(I){var N;switch(I.type){case"GeometryCollection":N={type:"GeometryCollection",geometries:I.geometries.map(B)};break;case"Point":N={type:"Point",coordinates:F(I.coordinates)};break;case"MultiPoint":N={type:"MultiPoint",coordinates:I.coordinates.map(F)};break;default:return I}return I.id!=null&&(N.id=I.id),I.bbox!=null&&(N.bbox=I.bbox),I.properties!=null&&(N.properties=I.properties),N}function O(I){var N=0,U=1,W=I.length,Q,ue=new Array(W);for(ue[0]=m(I[0],0);++N0&&(M.push(e),e=[])}return e.length>0&&M.push(e),M},Z.makeLine=function(d){return d.length===1?{type:"LineString",coordinates:d[0]}:{type:"MultiLineString",coordinates:d}},Z.makePolygon=function(d){if(d.length===1)return{type:"Polygon",coordinates:d};for(var x=new Array(d.length),A=0;Ae(B,z)),F)}function r(L,z,F={}){for(let O of L){if(O.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(O[O.length-1].length!==O[0].length)throw new Error("First and last Position are not equivalent.");for(let I=0;Ir(B,z)),F)}function a(L,z,F={}){if(L.length<2)throw new Error("coordinates must be an array of two or more positions");return A({type:"LineString",coordinates:L},z,F)}function i(L,z,F={}){return n(L.map(B=>a(B,z)),F)}function n(L,z={}){let F={type:"FeatureCollection"};return z.id&&(F.id=z.id),z.bbox&&(F.bbox=z.bbox),F.features=L,F}function s(L,z,F={}){return A({type:"MultiLineString",coordinates:L},z,F)}function c(L,z,F={}){return A({type:"MultiPoint",coordinates:L},z,F)}function f(L,z,F={}){return A({type:"MultiPolygon",coordinates:L},z,F)}function g(L,z,F={}){return A({type:"GeometryCollection",geometries:L},z,F)}function v(L,z=0){if(z&&!(z>=0))throw new Error("precision must be a positive number");let F=Math.pow(10,z||0);return Math.round(L*F)/F}function T(L,z="kilometers"){let F=d[z];if(!F)throw new Error(z+" units is invalid");return L*F}function l(L,z="kilometers"){let F=d[z];if(!F)throw new Error(z+" units is invalid");return L/F}function _(L,z){return E(l(L,z))}function w(L){let z=L%360;return z<0&&(z+=360),z}function S(L){return L=L%360,L>180?L-360:L<-180?L+360:L}function E(L){return L%(2*Math.PI)*180/Math.PI}function y(L){return L%360*Math.PI/180}function b(L,z="kilometers",F="kilometers"){if(!(L>=0))throw new Error("length must be a positive number");return T(l(L,z),F)}function p(L,z="meters",F="kilometers"){if(!(L>=0))throw new Error("area must be a positive number");let B=x[z];if(!B)throw new Error("invalid original units");let O=x[F];if(!O)throw new Error("invalid final units");return L/B*O}function u(L){return!isNaN(L)&&L!==null&&!Array.isArray(L)}function m(L){return L!==null&&typeof L=="object"&&!Array.isArray(L)}function h(L){if(!L)throw new Error("bbox is required");if(!Array.isArray(L))throw new Error("bbox must be an Array");if(L.length!==4&&L.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");L.forEach(z=>{if(!u(z))throw new Error("bbox must only contain numbers")})}function P(L){if(!L)throw new Error("id is required");if(["string","number"].indexOf(typeof L)===-1)throw new Error("id must be a number or a string")}Z.areaFactors=x,Z.azimuthToBearing=S,Z.bearingToAzimuth=w,Z.convertArea=p,Z.convertLength=b,Z.degreesToRadians=y,Z.earthRadius=q,Z.factors=d,Z.feature=A,Z.featureCollection=n,Z.geometry=M,Z.geometryCollection=g,Z.isNumber=u,Z.isObject=m,Z.lengthToDegrees=_,Z.lengthToRadians=l,Z.lineString=a,Z.lineStrings=i,Z.multiLineString=s,Z.multiPoint=c,Z.multiPolygon=f,Z.point=e,Z.points=t,Z.polygon=r,Z.polygons=o,Z.radiansToDegrees=E,Z.radiansToLength=T,Z.round=v,Z.validateBBox=h,Z.validateId=P}}),sT=Ze({"node_modules/@turf/meta/dist/cjs/index.cjs"(Z){"use strict";Object.defineProperty(Z,"__esModule",{value:!0});var q=oT();function d(l,_,w){if(l!==null)for(var S,E,y,b,p,u,m,h=0,P=0,L,z=l.type,F=z==="FeatureCollection",B=z==="Feature",O=F?l.features.length:1,I=0;Iu||F>m||B>h){p=P,u=S,m=F,h=B,y=0;return}var O=q.lineString.call(void 0,[p,P],w.properties);if(_(O,S,E,B,y)===!1)return!1;y++,p=P})===!1)return!1}}})}function c(l,_,w){var S=w,E=!1;return s(l,function(y,b,p,u,m){E===!1&&w===void 0?S=y:S=_(S,y,b,p,u,m),E=!0}),S}function f(l,_){if(!l)throw new Error("geojson is required");i(l,function(w,S,E){if(w.geometry!==null){var y=w.geometry.type,b=w.geometry.coordinates;switch(y){case"LineString":if(_(w,S,E,0,0)===!1)return!1;break;case"Polygon":for(var p=0;pi+A(n),0)}function A(a){let i=0,n;switch(a.type){case"Polygon":return M(a.coordinates);case"MultiPolygon":for(n=0;n0){i+=Math.abs(r(a[0]));for(let n=1;n=i?(s+2)%i:s+2],v=c[0]*t,T=f[1]*t,l=g[0]*t;n+=(l-v)*Math.sin(T),s++}return n*e}var o=x;Z.area=x,Z.default=o}}),DU=Ze({"node_modules/@turf/centroid/dist/cjs/index.cjs"(Z){"use strict";Object.defineProperty(Z,"__esModule",{value:!0});var q=oT(),d=sT();function x(M,e={}){let t=0,r=0,o=0;return d.coordEach.call(void 0,M,function(a){t+=a[0],r+=a[1],o++},!0),q.point.call(void 0,[t/o,r/o],e.properties)}var A=x;Z.centroid=x,Z.default=A}}),zU=Ze({"node_modules/@turf/bbox/dist/cjs/index.cjs"(Z){"use strict";Object.defineProperty(Z,"__esModule",{value:!0});var q=sT();function d(A,M={}){if(A.bbox!=null&&M.recompute!==!0)return A.bbox;let e=[1/0,1/0,-1/0,-1/0];return q.coordEach.call(void 0,A,t=>{e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]0&&z[F+1][0]<0)return F;return null}switch(b==="RUS"||b==="FJI"?u=function(z){var F;if(L(z)===null)F=z;else for(F=new Array(z.length),P=0;PF?B[O++]=[z[P][0]+360,z[P][1]]:P===F?(B[O++]=z[P],B[O++]=[z[P][0],-90]):B[O++]=z[P];var I=i.tester(B);I.pts.pop(),p.push(I)}:u=function(z){p.push(i.tester(z))},E.type){case"MultiPolygon":for(m=0;m0?I.properties.ct=l(I):I.properties.ct=[NaN,NaN],B.fIn=z,B.fOut=I,p.push(I)}else r.log(["Location",B.loc,"does not have a valid GeoJSON geometry.","Traces with locationmode *geojson-id* only support","*Polygon* and *MultiPolygon* geometries."].join(" "))}delete b[F]}switch(y.type){case"FeatureCollection":var P=y.features;for(u=0;up&&(p=h,y=m)}else y=E;return M(y).geometry.coordinates}function _(S){var E=window.PlotlyGeoAssets||{},y=[];function b(P){return new Promise(function(L,z){d.json(P,function(F,B){if(F){delete E[P];var O=F.status===404?'GeoJSON at URL "'+P+'" does not exist.':"Unexpected error while fetching from "+P;return z(new Error(O))}return E[P]=B,L(B)})})}function p(P){return new Promise(function(L,z){var F=0,B=setInterval(function(){if(E[P]&&E[P]!=="pending")return clearInterval(B),L(E[P]);if(F>100)return clearInterval(B),z("Unexpected error while fetching from "+P);F++},50)})}for(var u=0;u")}}}),OU=Ze({"src/traces/scattergeo/event_data.js"(Z,q){"use strict";q.exports=function(x,A,M,e,t){x.lon=A.lon,x.lat=A.lat,x.location=A.loc?A.loc:null;var r=e[t];return r.fIn&&r.fIn.properties&&(x.properties=r.fIn.properties),x}}}),BU=Ze({"src/traces/scattergeo/select.js"(Z,q){"use strict";var d=Fu(),x=qs().BADNUM;q.exports=function(M,e){var t=M.cd,r=M.xaxis,o=M.yaxis,a=[],i=t[0].trace,n,s,c,f,g,v=!d.hasMarkers(i)&&!d.hasText(i);if(v)return[];if(e===!1)for(g=0;gX?1:J>=X?0:NaN}function A(J){return J.length===1&&(J=M(J)),{left:function(X,oe,ie,j){for(ie==null&&(ie=0),j==null&&(j=X.length);ie>>1;J(X[ee],oe)<0?ie=ee+1:j=ee}return ie},right:function(X,oe,ie,j){for(ie==null&&(ie=0),j==null&&(j=X.length);ie>>1;J(X[ee],oe)>0?j=ee:ie=ee+1}return ie}}}function M(J){return function(X,oe){return x(J(X),oe)}}var e=A(x),t=e.right,r=e.left;function o(J,X){X==null&&(X=a);for(var oe=0,ie=J.length-1,j=J[0],ee=new Array(ie<0?0:ie);oeJ?1:X>=J?0:NaN}function s(J){return J===null?NaN:+J}function c(J,X){var oe=J.length,ie=0,j=-1,ee=0,re,ce,be=0;if(X==null)for(;++j1)return be/(ie-1)}function f(J,X){var oe=c(J,X);return oe&&Math.sqrt(oe)}function g(J,X){var oe=J.length,ie=-1,j,ee,re;if(X==null){for(;++ie=j)for(ee=re=j;++iej&&(ee=j),re=j)for(ee=re=j;++iej&&(ee=j),re0)return[J];if((ie=X0)for(J=Math.ceil(J/ce),X=Math.floor(X/ce),re=new Array(ee=Math.ceil(X-J+1));++j=0?(ee>=E?10:ee>=y?5:ee>=b?2:1)*Math.pow(10,j):-Math.pow(10,-j)/(ee>=E?10:ee>=y?5:ee>=b?2:1)}function m(J,X,oe){var ie=Math.abs(X-J)/Math.max(0,oe),j=Math.pow(10,Math.floor(Math.log(ie)/Math.LN10)),ee=ie/j;return ee>=E?j*=10:ee>=y?j*=5:ee>=b&&(j*=2),XRe;)Xe.pop(),--it;var ot=new Array(it+1),tt;for(ee=0;ee<=it;++ee)tt=ot[ee]=[],tt.x0=ee>0?Xe[ee-1]:ze,tt.x1=ee=1)return+oe(J[ie-1],ie-1,J);var ie,j=(ie-1)*X,ee=Math.floor(j),re=+oe(J[ee],ee,J),ce=+oe(J[ee+1],ee+1,J);return re+(ce-re)*(j-ee)}}function z(J,X,oe){return J=l.call(J,s).sort(x),Math.ceil((oe-X)/(2*(L(J,.75)-L(J,.25))*Math.pow(J.length,-1/3)))}function F(J,X,oe){return Math.ceil((oe-X)/(3.5*f(J)*Math.pow(J.length,-1/3)))}function B(J,X){var oe=J.length,ie=-1,j,ee;if(X==null){for(;++ie=j)for(ee=j;++ieee&&(ee=j)}else for(;++ie=j)for(ee=j;++ieee&&(ee=j);return ee}function O(J,X){var oe=J.length,ie=oe,j=-1,ee,re=0;if(X==null)for(;++j=0;)for(re=J[X],oe=re.length;--oe>=0;)ee[--j]=re[oe];return ee}function U(J,X){var oe=J.length,ie=-1,j,ee;if(X==null){for(;++ie=j)for(ee=j;++iej&&(ee=j)}else for(;++ie=j)for(ee=j;++iej&&(ee=j);return ee}function W(J,X){for(var oe=X.length,ie=new Array(oe);oe--;)ie[oe]=J[X[oe]];return ie}function Q(J,X){if(oe=J.length){var oe,ie=0,j=0,ee,re=J[j];for(X==null&&(X=x);++ie0?1:er<0?-1:0},p=Math.sqrt,u=Math.tan;function m(er){return er>1?0:er<-1?a:Math.acos(er)}function h(er){return er>1?i:er<-1?-i:Math.asin(er)}function P(er){return(er=y(er/2))*er}function L(){}function z(er,yr){er&&B.hasOwnProperty(er.type)&&B[er.type](er,yr)}var F={Feature:function(er,yr){z(er.geometry,yr)},FeatureCollection:function(er,yr){for(var na=er.features,$r=-1,La=na.length;++$r=0?1:-1,La=$r*na,hi=l(yr),Pi=y(yr),Zi=G*Pi,tn=he*hi+Zi*l(La),dn=Zi*$r*y(La);U.add(T(dn,tn)),le=er,he=hi,G=Pi}function j(er){return W.reset(),N(er,$),W*2}function ee(er){return[T(er[1],er[0]),h(er[2])]}function re(er){var yr=er[0],na=er[1],$r=l(na);return[$r*l(yr),$r*y(yr),y(na)]}function ce(er,yr){return er[0]*yr[0]+er[1]*yr[1]+er[2]*yr[2]}function be(er,yr){return[er[1]*yr[2]-er[2]*yr[1],er[2]*yr[0]-er[0]*yr[2],er[0]*yr[1]-er[1]*yr[0]]}function Ae(er,yr){er[0]+=yr[0],er[1]+=yr[1],er[2]+=yr[2]}function ze(er,yr){return[er[0]*yr,er[1]*yr,er[2]*yr]}function Re(er){var yr=p(er[0]*er[0]+er[1]*er[1]+er[2]*er[2]);er[0]/=yr,er[1]/=yr,er[2]/=yr}var Xe,it,ot,tt,lt,Ee,_e,fe,Fe=A(),rt,st,Qe={point:Lt,lineStart:Vt,lineEnd:Zt,polygonStart:function(){Qe.point=Sr,Qe.lineStart=xr,Qe.lineEnd=jr,Fe.reset(),$.polygonStart()},polygonEnd:function(){$.polygonEnd(),Qe.point=Lt,Qe.lineStart=Vt,Qe.lineEnd=Zt,U<0?(Xe=-(ot=180),it=-(tt=90)):Fe>r?tt=90:Fe<-r&&(it=-90),st[0]=Xe,st[1]=ot},sphere:function(){Xe=-(ot=180),it=-(tt=90)}};function Lt(er,yr){rt.push(st=[Xe=er,ot=er]),yrtt&&(tt=yr)}function kt(er,yr){var na=re([er*f,yr*f]);if(fe){var $r=be(fe,na),La=[$r[1],-$r[0],0],hi=be(La,$r);Re(hi),hi=ee(hi);var Pi=er-lt,Zi=Pi>0?1:-1,tn=hi[0]*c*Zi,dn,Ri=g(Pi)>180;Ri^(Zi*lttt&&(tt=dn)):(tn=(tn+360)%360-180,Ri^(Zi*lttt&&(tt=yr))),Ri?erwr(Xe,ot)&&(ot=er):wr(er,ot)>wr(Xe,ot)&&(Xe=er):ot>=Xe?(erot&&(ot=er)):er>lt?wr(Xe,er)>wr(Xe,ot)&&(ot=er):wr(er,ot)>wr(Xe,ot)&&(Xe=er)}else rt.push(st=[Xe=er,ot=er]);yrtt&&(tt=yr),fe=na,lt=er}function Vt(){Qe.point=kt}function Zt(){st[0]=Xe,st[1]=ot,Qe.point=Lt,fe=null}function Sr(er,yr){if(fe){var na=er-lt;Fe.add(g(na)>180?na+(na>0?360:-360):na)}else Ee=er,_e=yr;$.point(er,yr),kt(er,yr)}function xr(){$.lineStart()}function jr(){Sr(Ee,_e),$.lineEnd(),g(Fe)>r&&(Xe=-(ot=180)),st[0]=Xe,st[1]=ot,fe=null}function wr(er,yr){return(yr-=er)<0?yr+360:yr}function Ir(er,yr){return er[0]-yr[0]}function bt(er,yr){return er[0]<=er[1]?er[0]<=yr&&yr<=er[1]:yrwr($r[0],$r[1])&&($r[1]=La[1]),wr(La[0],$r[1])>wr($r[0],$r[1])&&($r[0]=La[0])):hi.push($r=La);for(Pi=-1/0,na=hi.length-1,yr=0,$r=hi[na];yr<=na;$r=La,++yr)La=hi[yr],(Zi=wr($r[1],La[0]))>Pi&&(Pi=Zi,Xe=La[0],ot=$r[1])}return rt=st=null,Xe===1/0||it===1/0?[[NaN,NaN],[NaN,NaN]]:[[Xe,it],[ot,tt]]}var Ke,Ue,Me,qe,Ce,Te,Pe,at,yt,Tt,Ot,Gt,rr,Qt,Tr,la,Ua={sphere:L,point:Ba,lineStart:ei,lineEnd:Ci,polygonStart:function(){Ua.lineStart=Jt,Ua.lineEnd=Nt},polygonEnd:function(){Ua.lineStart=ei,Ua.lineEnd=Ci}};function Ba(er,yr){er*=f,yr*=f;var na=l(yr);Ra(na*l(er),na*y(er),y(yr))}function Ra(er,yr,na){++Ke,Me+=(er-Me)/Ke,qe+=(yr-qe)/Ke,Ce+=(na-Ce)/Ke}function ei(){Ua.point=za}function za(er,yr){er*=f,yr*=f;var na=l(yr);Qt=na*l(er),Tr=na*y(er),la=y(yr),Ua.point=ti,Ra(Qt,Tr,la)}function ti(er,yr){er*=f,yr*=f;var na=l(yr),$r=na*l(er),La=na*y(er),hi=y(yr),Pi=T(p((Pi=Tr*hi-la*La)*Pi+(Pi=la*$r-Qt*hi)*Pi+(Pi=Qt*La-Tr*$r)*Pi),Qt*$r+Tr*La+la*hi);Ue+=Pi,Te+=Pi*(Qt+(Qt=$r)),Pe+=Pi*(Tr+(Tr=La)),at+=Pi*(la+(la=hi)),Ra(Qt,Tr,la)}function Ci(){Ua.point=Ba}function Jt(){Ua.point=Kt}function Nt(){Wt(Gt,rr),Ua.point=Ba}function Kt(er,yr){Gt=er,rr=yr,er*=f,yr*=f,Ua.point=Wt;var na=l(yr);Qt=na*l(er),Tr=na*y(er),la=y(yr),Ra(Qt,Tr,la)}function Wt(er,yr){er*=f,yr*=f;var na=l(yr),$r=na*l(er),La=na*y(er),hi=y(yr),Pi=Tr*hi-la*La,Zi=la*$r-Qt*hi,tn=Qt*La-Tr*$r,dn=p(Pi*Pi+Zi*Zi+tn*tn),Ri=h(dn),Fi=dn&&-Ri/dn;yt+=Fi*Pi,Tt+=Fi*Zi,Ot+=Fi*tn,Ue+=Ri,Te+=Ri*(Qt+(Qt=$r)),Pe+=Ri*(Tr+(Tr=La)),at+=Ri*(la+(la=hi)),Ra(Qt,Tr,la)}function Pr(er){Ke=Ue=Me=qe=Ce=Te=Pe=at=yt=Tt=Ot=0,N(er,Ua);var yr=yt,na=Tt,$r=Ot,La=yr*yr+na*na+$r*$r;return Laa?er+Math.round(-er/s)*s:er,yr]}ra.invert=ra;function Ia(er,yr,na){return(er%=s)?yr||na?ma($a(er),ai(yr,na)):$a(er):yr||na?ai(yr,na):ra}function Ha(er){return function(yr,na){return yr+=er,[yr>a?yr-s:yr<-a?yr+s:yr,na]}}function $a(er){var yr=Ha(er);return yr.invert=Ha(-er),yr}function ai(er,yr){var na=l(er),$r=y(er),La=l(yr),hi=y(yr);function Pi(Zi,tn){var dn=l(tn),Ri=l(Zi)*dn,Fi=y(Zi)*dn,qi=y(tn),_i=qi*na+Ri*$r;return[T(Fi*La-_i*hi,Ri*na-qi*$r),h(_i*La+Fi*hi)]}return Pi.invert=function(Zi,tn){var dn=l(tn),Ri=l(Zi)*dn,Fi=y(Zi)*dn,qi=y(tn),_i=qi*La-Fi*hi;return[T(Fi*La+qi*hi,Ri*na+_i*$r),h(_i*na-Ri*$r)]},Pi}function mi(er){er=Ia(er[0]*f,er[1]*f,er.length>2?er[2]*f:0);function yr(na){return na=er(na[0]*f,na[1]*f),na[0]*=c,na[1]*=c,na}return yr.invert=function(na){return na=er.invert(na[0]*f,na[1]*f),na[0]*=c,na[1]*=c,na},yr}function xt(er,yr,na,$r,La,hi){if(na){var Pi=l(yr),Zi=y(yr),tn=$r*na;La==null?(La=yr+$r*s,hi=yr-tn/2):(La=ct(Pi,La),hi=ct(Pi,hi),($r>0?Lahi)&&(La+=$r*s));for(var dn,Ri=La;$r>0?Ri>hi:Ri1&&er.push(er.pop().concat(er.shift()))},result:function(){var na=er;return er=[],yr=null,na}}}function Rr(er,yr){return g(er[0]-yr[0])=0;--Zi)La.point((Fi=Ri[Zi])[0],Fi[1]);else $r(qi.x,qi.p.x,-1,La);qi=qi.p}qi=qi.o,Ri=qi.z,_i=!_i}while(!qi.v);La.lineEnd()}}}function Kr(er){if(yr=er.length){for(var yr,na=0,$r=er[0],La;++na=0?1:-1,Rs=Qs*xs,Ks=Rs>a,ys=Kn*_o;if(Ur.add(T(ys*Qs*y(Rs),ao*Qo+ys*l(Rs))),Pi+=Ks?xs+Qs*s:xs,Ks^_i>=na^wn>=na){var Fl=be(re(qi),re(co));Re(Fl);var yl=be(hi,Fl);Re(yl);var sl=(Ks^xs>=0?-1:1)*h(yl[2]);($r>sl||$r===sl&&(Fl[0]||Fl[1]))&&(Zi+=Ks^xs>=0?1:-1)}}return(Pi<-r||Pi0){for(tn||(La.polygonStart(),tn=!0),La.lineStart(),Qo=0;Qo1&&un&2&&_o.push(_o.pop().concat(_o.shift())),Ri.push(_o.filter(It))}}return qi}}function It(er){return er.length>1}function dr(er,yr){return((er=er.x)[0]<0?er[1]-i-r:i-er[1])-((yr=yr.x)[0]<0?yr[1]-i-r:i-yr[1])}var kr=fa(function(){return!0},ia,Fa,[-a,-i]);function ia(er){var yr=NaN,na=NaN,$r=NaN,La;return{lineStart:function(){er.lineStart(),La=1},point:function(hi,Pi){var Zi=hi>0?a:-a,tn=g(hi-yr);g(tn-a)0?i:-i),er.point($r,na),er.lineEnd(),er.lineStart(),er.point(Zi,na),er.point(hi,na),La=0):$r!==Zi&&tn>=a&&(g(yr-$r)r?v((y(yr)*(hi=l($r))*y(na)-y($r)*(La=l(yr))*y(er))/(La*hi*Pi)):(yr+$r)/2}function Fa(er,yr,na,$r){var La;if(er==null)La=na*i,$r.point(-a,La),$r.point(0,La),$r.point(a,La),$r.point(a,0),$r.point(a,-La),$r.point(0,-La),$r.point(-a,-La),$r.point(-a,0),$r.point(-a,La);else if(g(er[0]-yr[0])>r){var hi=er[0]0,La=g(yr)>r;function hi(Ri,Fi,qi,_i){xt(_i,er,na,qi,Ri,Fi)}function Pi(Ri,Fi){return l(Ri)*l(Fi)>yr}function Zi(Ri){var Fi,qi,_i,Mn,Kn;return{lineStart:function(){Mn=_i=!1,Kn=1},point:function(ao,Jn){var co=[ao,Jn],wn,un=Pi(ao,Jn),_o=$r?un?0:dn(ao,Jn):un?dn(ao+(ao<0?a:-a),Jn):0;if(!Fi&&(Mn=_i=un)&&Ri.lineStart(),un!==_i&&(wn=tn(Fi,co),(!wn||Rr(Fi,wn)||Rr(co,wn))&&(co[2]=1)),un!==_i)Kn=0,un?(Ri.lineStart(),wn=tn(co,Fi),Ri.point(wn[0],wn[1])):(wn=tn(Fi,co),Ri.point(wn[0],wn[1],2),Ri.lineEnd()),Fi=wn;else if(La&&Fi&&$r^un){var Qo;!(_o&qi)&&(Qo=tn(co,Fi,!0))&&(Kn=0,$r?(Ri.lineStart(),Ri.point(Qo[0][0],Qo[0][1]),Ri.point(Qo[1][0],Qo[1][1]),Ri.lineEnd()):(Ri.point(Qo[1][0],Qo[1][1]),Ri.lineEnd(),Ri.lineStart(),Ri.point(Qo[0][0],Qo[0][1],3)))}un&&(!Fi||!Rr(Fi,co))&&Ri.point(co[0],co[1]),Fi=co,_i=un,qi=_o},lineEnd:function(){_i&&Ri.lineEnd(),Fi=null},clean:function(){return Kn|(Mn&&_i)<<1}}}function tn(Ri,Fi,qi){var _i=re(Ri),Mn=re(Fi),Kn=[1,0,0],ao=be(_i,Mn),Jn=ce(ao,ao),co=ao[0],wn=Jn-co*co;if(!wn)return!qi&&Ri;var un=yr*Jn/wn,_o=-yr*co/wn,Qo=be(Kn,ao),xs=ze(Kn,un),Qs=ze(ao,_o);Ae(xs,Qs);var Rs=Qo,Ks=ce(xs,Rs),ys=ce(Rs,Rs),Fl=Ks*Ks-ys*(ce(xs,xs)-1);if(!(Fl<0)){var yl=p(Fl),sl=ze(Rs,(-Ks-yl)/ys);if(Ae(sl,xs),sl=ee(sl),!qi)return sl;var Un=Ri[0],Io=Fi[0],Xs=Ri[1],Ls=Fi[1],ou;Io0^sl[1]<(g(sl[0]-Un)a^(Un<=sl[0]&&sl[0]<=Io)){var yu=ze(Rs,(-Ks+yl)/ys);return Ae(yu,xs),[sl,ee(yu)]}}}function dn(Ri,Fi){var qi=$r?er:a-er,_i=0;return Ri<-qi?_i|=1:Ri>qi&&(_i|=2),Fi<-qi?_i|=4:Fi>qi&&(_i|=8),_i}return fa(Pi,Zi,hi,$r?[0,-er]:[-a,er-a])}function ha(er,yr,na,$r,La,hi){var Pi=er[0],Zi=er[1],tn=yr[0],dn=yr[1],Ri=0,Fi=1,qi=tn-Pi,_i=dn-Zi,Mn;if(Mn=na-Pi,!(!qi&&Mn>0)){if(Mn/=qi,qi<0){if(Mn0){if(Mn>Fi)return;Mn>Ri&&(Ri=Mn)}if(Mn=La-Pi,!(!qi&&Mn<0)){if(Mn/=qi,qi<0){if(Mn>Fi)return;Mn>Ri&&(Ri=Mn)}else if(qi>0){if(Mn0)){if(Mn/=_i,_i<0){if(Mn0){if(Mn>Fi)return;Mn>Ri&&(Ri=Mn)}if(Mn=hi-Zi,!(!_i&&Mn<0)){if(Mn/=_i,_i<0){if(Mn>Fi)return;Mn>Ri&&(Ri=Mn)}else if(_i>0){if(Mn0&&(er[0]=Pi+Ri*qi,er[1]=Zi+Ri*_i),Fi<1&&(yr[0]=Pi+Fi*qi,yr[1]=Zi+Fi*_i),!0}}}}}var Da=1e9,Xi=-Da;function Li(er,yr,na,$r){function La(dn,Ri){return er<=dn&&dn<=na&&yr<=Ri&&Ri<=$r}function hi(dn,Ri,Fi,qi){var _i=0,Mn=0;if(dn==null||(_i=Pi(dn,Fi))!==(Mn=Pi(Ri,Fi))||tn(dn,Ri)<0^Fi>0)do qi.point(_i===0||_i===3?er:na,_i>1?$r:yr);while((_i=(_i+Fi+4)%4)!==Mn);else qi.point(Ri[0],Ri[1])}function Pi(dn,Ri){return g(dn[0]-er)0?0:3:g(dn[0]-na)0?2:1:g(dn[1]-yr)0?1:0:Ri>0?3:2}function Zi(dn,Ri){return tn(dn.x,Ri.x)}function tn(dn,Ri){var Fi=Pi(dn,1),qi=Pi(Ri,1);return Fi!==qi?Fi-qi:Fi===0?Ri[1]-dn[1]:Fi===1?dn[0]-Ri[0]:Fi===2?dn[1]-Ri[1]:Ri[0]-dn[0]}return function(dn){var Ri=dn,Fi=Or(),qi,_i,Mn,Kn,ao,Jn,co,wn,un,_o,Qo,xs={point:Qs,lineStart:Fl,lineEnd:yl,polygonStart:Ks,polygonEnd:ys};function Qs(Un,Io){La(Un,Io)&&Ri.point(Un,Io)}function Rs(){for(var Un=0,Io=0,Xs=_i.length;Io$r&&(Pc-Lc)*($r-yu)>(wu-yu)*(er-Lc)&&++Un:wu<=$r&&(Pc-Lc)*($r-yu)<(wu-yu)*(er-Lc)&&--Un;return Un}function Ks(){Ri=Fi,qi=[],_i=[],Qo=!0}function ys(){var Un=Rs(),Io=Qo&&Un,Xs=(qi=x.merge(qi)).length;(Io||Xs)&&(dn.polygonStart(),Io&&(dn.lineStart(),hi(null,null,1,dn),dn.lineEnd()),Xs&&Gr(qi,Zi,Un,hi,dn),dn.polygonEnd()),Ri=dn,qi=_i=Mn=null}function Fl(){xs.point=sl,_i&&_i.push(Mn=[]),_o=!0,un=!1,co=wn=NaN}function yl(){qi&&(sl(Kn,ao),Jn&&un&&Fi.rejoin(),qi.push(Fi.result())),xs.point=Qs,un&&Ri.lineEnd()}function sl(Un,Io){var Xs=La(Un,Io);if(_i&&Mn.push([Un,Io]),_o)Kn=Un,ao=Io,Jn=Xs,_o=!1,Xs&&(Ri.lineStart(),Ri.point(Un,Io));else if(Xs&&un)Ri.point(Un,Io);else{var Ls=[co=Math.max(Xi,Math.min(Da,co)),wn=Math.max(Xi,Math.min(Da,wn))],ou=[Un=Math.max(Xi,Math.min(Da,Un)),Io=Math.max(Xi,Math.min(Da,Io))];ha(Ls,ou,er,yr,na,$r)?(un||(Ri.lineStart(),Ri.point(Ls[0],Ls[1])),Ri.point(ou[0],ou[1]),Xs||Ri.lineEnd(),Qo=!1):Xs&&(Ri.lineStart(),Ri.point(Un,Io),Qo=!1)}co=Un,wn=Io,un=Xs}return xs}}function fn(){var er=0,yr=0,na=960,$r=500,La,hi,Pi;return Pi={stream:function(Zi){return La&&hi===Zi?La:La=Li(er,yr,na,$r)(hi=Zi)},extent:function(Zi){return arguments.length?(er=+Zi[0][0],yr=+Zi[0][1],na=+Zi[1][0],$r=+Zi[1][1],La=hi=null,Pi):[[er,yr],[na,$r]]}}}var An=A(),kn,zn,Xn,to={sphere:L,point:L,lineStart:mo,lineEnd:L,polygonStart:L,polygonEnd:L};function mo(){to.point=Jo,to.lineEnd=pn}function pn(){to.point=to.lineEnd=L}function Jo(er,yr){er*=f,yr*=f,kn=er,zn=y(yr),Xn=l(yr),to.point=Xo}function Xo(er,yr){er*=f,yr*=f;var na=y(yr),$r=l(yr),La=g(er-kn),hi=l(La),Pi=y(La),Zi=$r*Pi,tn=Xn*na-zn*$r*hi,dn=zn*na+Xn*$r*hi;An.add(T(p(Zi*Zi+tn*tn),dn)),kn=er,zn=na,Xn=$r}function Ts(er){return An.reset(),N(er,to),+An}var Po=[null,null],so={type:"LineString",coordinates:Po};function Vn(er,yr){return Po[0]=er,Po[1]=yr,Ts(so)}var To={Feature:function(er,yr){return Oo(er.geometry,yr)},FeatureCollection:function(er,yr){for(var na=er.features,$r=-1,La=na.length;++$r0&&(La=Vn(er[hi],er[hi-1]),La>0&&na<=La&&$r<=La&&(na+$r-La)*(1-Math.pow((na-$r)/La,2))r}).map(qi)).concat(x.range(_(hi/dn)*dn,La,dn).filter(function(wn){return g(wn%Fi)>r}).map(_i))}return Jn.lines=function(){return co().map(function(wn){return{type:"LineString",coordinates:wn}})},Jn.outline=function(){return{type:"Polygon",coordinates:[Mn($r).concat(Kn(Pi).slice(1),Mn(na).reverse().slice(1),Kn(Zi).reverse().slice(1))]}},Jn.extent=function(wn){return arguments.length?Jn.extentMajor(wn).extentMinor(wn):Jn.extentMinor()},Jn.extentMajor=function(wn){return arguments.length?($r=+wn[0][0],na=+wn[1][0],Zi=+wn[0][1],Pi=+wn[1][1],$r>na&&(wn=$r,$r=na,na=wn),Zi>Pi&&(wn=Zi,Zi=Pi,Pi=wn),Jn.precision(ao)):[[$r,Zi],[na,Pi]]},Jn.extentMinor=function(wn){return arguments.length?(yr=+wn[0][0],er=+wn[1][0],hi=+wn[0][1],La=+wn[1][1],yr>er&&(wn=yr,yr=er,er=wn),hi>La&&(wn=hi,hi=La,La=wn),Jn.precision(ao)):[[yr,hi],[er,La]]},Jn.step=function(wn){return arguments.length?Jn.stepMajor(wn).stepMinor(wn):Jn.stepMinor()},Jn.stepMajor=function(wn){return arguments.length?(Ri=+wn[0],Fi=+wn[1],Jn):[Ri,Fi]},Jn.stepMinor=function(wn){return arguments.length?(tn=+wn[0],dn=+wn[1],Jn):[tn,dn]},Jn.precision=function(wn){return arguments.length?(ao=+wn,qi=Ui(hi,La,90),_i=Cn(yr,er,ao),Mn=Ui(Zi,Pi,90),Kn=Cn($r,na,ao),Jn):ao},Jn.extentMajor([[-180,-90+r],[180,90-r]]).extentMinor([[-180,-80-r],[180,80+r]])}function Bs(){return tl()()}function uo(er,yr){var na=er[0]*f,$r=er[1]*f,La=yr[0]*f,hi=yr[1]*f,Pi=l($r),Zi=y($r),tn=l(hi),dn=y(hi),Ri=Pi*l(na),Fi=Pi*y(na),qi=tn*l(La),_i=tn*y(La),Mn=2*h(p(P(hi-$r)+Pi*tn*P(La-na))),Kn=y(Mn),ao=Mn?function(Jn){var co=y(Jn*=Mn)/Kn,wn=y(Mn-Jn)/Kn,un=wn*Ri+co*qi,_o=wn*Fi+co*_i,Qo=wn*Zi+co*dn;return[T(_o,un)*c,T(Qo,p(un*un+_o*_o))*c]}:function(){return[na*c,$r*c]};return ao.distance=Mn,ao}function $s(er){return er}var ms=A(),Is=A(),rl,Sn,po,ro,As={point:L,lineStart:L,lineEnd:L,polygonStart:function(){As.lineStart=al,As.lineEnd=au},polygonEnd:function(){As.lineStart=As.lineEnd=As.point=L,ms.add(g(Is)),Is.reset()},result:function(){var er=ms/2;return ms.reset(),er}};function al(){As.point=$n}function $n(er,yr){As.point=zs,rl=po=er,Sn=ro=yr}function zs(er,yr){Is.add(ro*er-po*yr),po=er,ro=yr}function au(){zs(rl,Sn)}var fl=1/0,xu=fl,zl=-fl,Ns=zl,iu={point:Eu,lineStart:L,lineEnd:L,polygonStart:L,polygonEnd:L,result:function(){var er=[[fl,xu],[zl,Ns]];return zl=Ns=-(xu=fl=1/0),er}};function Eu(er,yr){erzl&&(zl=er),yrNs&&(Ns=yr)}var Bc=0,Cu=0,Af=0,pf=0,Us=0,Vc=0,Sf=0,nu=0,Ll=0,ic,Ou,il,vl,gs={point:Vs,lineStart:nc,lineEnd:cl,polygonStart:function(){gs.lineStart=yh,gs.lineEnd=ls},polygonEnd:function(){gs.point=Vs,gs.lineStart=nc,gs.lineEnd=cl},result:function(){var er=Ll?[Sf/Ll,nu/Ll]:Vc?[pf/Vc,Us/Vc]:Af?[Bc/Af,Cu/Af]:[NaN,NaN];return Bc=Cu=Af=pf=Us=Vc=Sf=nu=Ll=0,er}};function Vs(er,yr){Bc+=er,Cu+=yr,++Af}function nc(){gs.point=Nl}function Nl(er,yr){gs.point=qu,Vs(il=er,vl=yr)}function qu(er,yr){var na=er-il,$r=yr-vl,La=p(na*na+$r*$r);pf+=La*(il+er)/2,Us+=La*(vl+yr)/2,Vc+=La,Vs(il=er,vl=yr)}function cl(){gs.point=Vs}function yh(){gs.point=_h}function ls(){Ss(ic,Ou)}function _h(er,yr){gs.point=Ss,Vs(ic=il=er,Ou=vl=yr)}function Ss(er,yr){var na=er-il,$r=yr-vl,La=p(na*na+$r*$r);pf+=La*(il+er)/2,Us+=La*(vl+yr)/2,Vc+=La,La=vl*er-il*yr,Sf+=La*(il+er),nu+=La*(vl+yr),Ll+=La*3,Vs(il=er,vl=yr)}function Qn(er){this._context=er}Qn.prototype={_radius:4.5,pointRadius:function(er){return this._radius=er,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(er,yr){switch(this._point){case 0:{this._context.moveTo(er,yr),this._point=1;break}case 1:{this._context.lineTo(er,yr);break}default:{this._context.moveTo(er+this._radius,yr),this._context.arc(er,yr,this._radius,0,s);break}}},result:L};var Gc=A(),Vu,Ul,Mf,wc,rf,Kl={point:L,lineStart:function(){Kl.point=Yf},lineEnd:function(){Vu&&zf(Ul,Mf),Kl.point=L},polygonStart:function(){Vu=!0},polygonEnd:function(){Vu=null},result:function(){var er=+Gc;return Gc.reset(),er}};function Yf(er,yr){Kl.point=zf,Ul=wc=er,Mf=rf=yr}function zf(er,yr){wc-=er,rf-=yr,Gc.add(p(wc*wc+rf*rf)),wc=er,rf=yr}function af(){this._string=[]}af.prototype={_radius:4.5,_circle:Nc(4.5),pointRadius:function(er){return(er=+er)!==this._radius&&(this._radius=er,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._string.push("Z"),this._point=NaN},point:function(er,yr){switch(this._point){case 0:{this._string.push("M",er,",",yr),this._point=1;break}case 1:{this._string.push("L",er,",",yr);break}default:{this._circle==null&&(this._circle=Nc(this._radius)),this._string.push("M",er,",",yr,this._circle);break}}},result:function(){if(this._string.length){var er=this._string.join("");return this._string=[],er}else return null}};function Nc(er){return"m0,"+er+"a"+er+","+er+" 0 1,1 0,"+-2*er+"a"+er+","+er+" 0 1,1 0,"+2*er+"z"}function Ff(er,yr){var na=4.5,$r,La;function hi(Pi){return Pi&&(typeof na=="function"&&La.pointRadius(+na.apply(this,arguments)),N(Pi,$r(La))),La.result()}return hi.area=function(Pi){return N(Pi,$r(As)),As.result()},hi.measure=function(Pi){return N(Pi,$r(Kl)),Kl.result()},hi.bounds=function(Pi){return N(Pi,$r(iu)),iu.result()},hi.centroid=function(Pi){return N(Pi,$r(gs)),gs.result()},hi.projection=function(Pi){return arguments.length?($r=Pi==null?(er=null,$s):(er=Pi).stream,hi):er},hi.context=function(Pi){return arguments.length?(La=Pi==null?(yr=null,new af):new Qn(yr=Pi),typeof na!="function"&&La.pointRadius(na),hi):yr},hi.pointRadius=function(Pi){return arguments.length?(na=typeof Pi=="function"?Pi:(La.pointRadius(+Pi),+Pi),hi):na},hi.projection(er).context(yr)}function Of(er){return{stream:Gu(er)}}function Gu(er){return function(yr){var na=new Ef;for(var $r in er)na[$r]=er[$r];return na.stream=yr,na}}function Ef(){}Ef.prototype={constructor:Ef,point:function(er,yr){this.stream.point(er,yr)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function oc(er,yr,na){var $r=er.clipExtent&&er.clipExtent();return er.scale(150).translate([0,0]),$r!=null&&er.clipExtent(null),N(na,er.stream(iu)),yr(iu.result()),$r!=null&&er.clipExtent($r),er}function Hc(er,yr,na){return oc(er,function($r){var La=yr[1][0]-yr[0][0],hi=yr[1][1]-yr[0][1],Pi=Math.min(La/($r[1][0]-$r[0][0]),hi/($r[1][1]-$r[0][1])),Zi=+yr[0][0]+(La-Pi*($r[1][0]+$r[0][0]))/2,tn=+yr[0][1]+(hi-Pi*($r[1][1]+$r[0][1]))/2;er.scale(150*Pi).translate([Zi,tn])},na)}function Jl(er,yr,na){return Hc(er,[[0,0],yr],na)}function Uc(er,yr,na){return oc(er,function($r){var La=+yr,hi=La/($r[1][0]-$r[0][0]),Pi=(La-hi*($r[1][0]+$r[0][0]))/2,Zi=-hi*$r[0][1];er.scale(150*hi).translate([Pi,Zi])},na)}function Tc(er,yr,na){return oc(er,function($r){var La=+yr,hi=La/($r[1][1]-$r[0][1]),Pi=-hi*$r[0][0],Zi=(La-hi*($r[1][1]+$r[0][1]))/2;er.scale(150*hi).translate([Pi,Zi])},na)}var Gs=16,Cf=l(30*f);function lh(er,yr){return+yr?Wc(er,yr):Bf(er)}function Bf(er){return Gu({point:function(yr,na){yr=er(yr,na),this.stream.point(yr[0],yr[1])}})}function Wc(er,yr){function na($r,La,hi,Pi,Zi,tn,dn,Ri,Fi,qi,_i,Mn,Kn,ao){var Jn=dn-$r,co=Ri-La,wn=Jn*Jn+co*co;if(wn>4*yr&&Kn--){var un=Pi+qi,_o=Zi+_i,Qo=tn+Mn,xs=p(un*un+_o*_o+Qo*Qo),Qs=h(Qo/=xs),Rs=g(g(Qo)-1)yr||g((Jn*yl+co*sl)/wn-.5)>.3||Pi*qi+Zi*_i+tn*Mn2?Un[2]%360*f:0,yl()):[Zi*c,tn*c,dn*c]},ys.angle=function(Un){return arguments.length?(Fi=Un%360*f,yl()):Fi*c},ys.reflectX=function(Un){return arguments.length?(qi=Un?-1:1,yl()):qi<0},ys.reflectY=function(Un){return arguments.length?(_i=Un?-1:1,yl()):_i<0},ys.precision=function(Un){return arguments.length?(Qo=lh(xs,_o=Un*Un),sl()):p(_o)},ys.fitExtent=function(Un,Io){return Hc(ys,Un,Io)},ys.fitSize=function(Un,Io){return Jl(ys,Un,Io)},ys.fitWidth=function(Un,Io){return Uc(ys,Un,Io)},ys.fitHeight=function(Un,Io){return Tc(ys,Un,Io)};function yl(){var Un=ml(na,0,0,qi,_i,Fi).apply(null,yr(hi,Pi)),Io=(Fi?ml:Nf)(na,$r-Un[0],La-Un[1],qi,_i,Fi);return Ri=Ia(Zi,tn,dn),xs=ma(yr,Io),Qs=ma(Ri,xs),Qo=lh(xs,_o),sl()}function sl(){return Rs=Ks=null,ys}return function(){return yr=er.apply(this,arguments),ys.invert=yr.invert&&Fl,yl()}}function nl(er){var yr=0,na=a/3,$r=Ac(er),La=$r(yr,na);return La.parallels=function(hi){return arguments.length?$r(yr=hi[0]*f,na=hi[1]*f):[yr*c,na*c]},La}function dc(er){var yr=l(er);function na($r,La){return[$r*yr,y(La)/yr]}return na.invert=function($r,La){return[$r/yr,h(La*yr)]},na}function vu(er,yr){var na=y(er),$r=(na+y(yr))/2;if(g($r)=.12&&ao<.234&&Kn>=-.425&&Kn<-.214?La:ao>=.166&&ao<.234&&Kn>=-.214&&Kn<-.115?Pi:na).invert(qi)},Ri.stream=function(qi){return er&&yr===qi?er:er=Uf([na.stream(yr=qi),La.stream(qi),Pi.stream(qi)])},Ri.precision=function(qi){return arguments.length?(na.precision(qi),La.precision(qi),Pi.precision(qi),Fi()):na.precision()},Ri.scale=function(qi){return arguments.length?(na.scale(qi),La.scale(qi*.35),Pi.scale(qi),Ri.translate(na.translate())):na.scale()},Ri.translate=function(qi){if(!arguments.length)return na.translate();var _i=na.scale(),Mn=+qi[0],Kn=+qi[1];return $r=na.translate(qi).clipExtent([[Mn-.455*_i,Kn-.238*_i],[Mn+.455*_i,Kn+.238*_i]]).stream(dn),hi=La.translate([Mn-.307*_i,Kn+.201*_i]).clipExtent([[Mn-.425*_i+r,Kn+.12*_i+r],[Mn-.214*_i-r,Kn+.234*_i-r]]).stream(dn),Zi=Pi.translate([Mn-.205*_i,Kn+.212*_i]).clipExtent([[Mn-.214*_i+r,Kn+.166*_i+r],[Mn-.115*_i-r,Kn+.234*_i-r]]).stream(dn),Fi()},Ri.fitExtent=function(qi,_i){return Hc(Ri,qi,_i)},Ri.fitSize=function(qi,_i){return Jl(Ri,qi,_i)},Ri.fitWidth=function(qi,_i){return Uc(Ri,qi,_i)},Ri.fitHeight=function(qi,_i){return Tc(Ri,qi,_i)};function Fi(){return er=yr=null,Ri}return Ri.scale(1070)}function Bu(er){return function(yr,na){var $r=l(yr),La=l(na),hi=er($r*La);return[hi*La*y(yr),hi*y(na)]}}function Sc(er){return function(yr,na){var $r=p(yr*yr+na*na),La=er($r),hi=y(La),Pi=l(La);return[T(yr*hi,$r*Pi),h($r&&na*hi/$r)]}}var vc=Bu(function(er){return p(2/(1+er))});vc.invert=Sc(function(er){return 2*h(er/2)});function Lh(){return Lu(vc).scale(124.75).clipAngle(180-.001)}var nf=Bu(function(er){return(er=m(er))&&er/y(er)});nf.invert=Sc(function(er){return er});function df(){return Lu(nf).scale(79.4188).clipAngle(180-.001)}function Nu(er,yr){return[er,S(u((i+yr)/2))]}Nu.invert=function(er,yr){return[er,2*v(w(yr))-i]};function of(){return tu(Nu).scale(961/s)}function tu(er){var yr=Lu(er),na=yr.center,$r=yr.scale,La=yr.translate,hi=yr.clipExtent,Pi=null,Zi,tn,dn;yr.scale=function(Fi){return arguments.length?($r(Fi),Ri()):$r()},yr.translate=function(Fi){return arguments.length?(La(Fi),Ri()):La()},yr.center=function(Fi){return arguments.length?(na(Fi),Ri()):na()},yr.clipExtent=function(Fi){return arguments.length?(Fi==null?Pi=Zi=tn=dn=null:(Pi=+Fi[0][0],Zi=+Fi[0][1],tn=+Fi[1][0],dn=+Fi[1][1]),Ri()):Pi==null?null:[[Pi,Zi],[tn,dn]]};function Ri(){var Fi=a*$r(),qi=yr(mi(yr.rotate()).invert([0,0]));return hi(Pi==null?[[qi[0]-Fi,qi[1]-Fi],[qi[0]+Fi,qi[1]+Fi]]:er===Nu?[[Math.max(qi[0]-Fi,Pi),Zi],[Math.min(qi[0]+Fi,tn),dn]]:[[Pi,Math.max(qi[1]-Fi,Zi)],[tn,Math.min(qi[1]+Fi,dn)]])}return Ri()}function Xc(er){return u((i+er)/2)}function uh(er,yr){var na=l(er),$r=er===yr?y(er):S(na/l(yr))/S(Xc(yr)/Xc(er)),La=na*E(Xc(er),$r)/$r;if(!$r)return Nu;function hi(Pi,Zi){La>0?Zi<-i+r&&(Zi=-i+r):Zi>i-r&&(Zi=i-r);var tn=La/E(Xc(Zi),$r);return[tn*y($r*Pi),La-tn*l($r*Pi)]}return hi.invert=function(Pi,Zi){var tn=La-Zi,dn=b($r)*p(Pi*Pi+tn*tn),Ri=T(Pi,g(tn))*b(tn);return tn*$r<0&&(Ri-=a*b(Pi)*b(tn)),[Ri/$r,2*v(E(La/dn,1/$r))-i]},hi}function vf(){return nl(uh).scale(109.5).parallels([30,30])}function ol(er,yr){return[er,yr]}ol.invert=ol;function mu(){return Lu(ol).scale(152.63)}function Pu(er,yr){var na=l(er),$r=er===yr?y(er):(na-l(yr))/(yr-er),La=na/$r+er;if(g($r)r&&--$r>0);return[er/(.8707+(hi=na*na)*(-.131979+hi*(-.013791+hi*hi*hi*(.003971-.001529*hi)))),na]};function mc(){return Lu(Ec).scale(175.295)}function jl(er,yr){return[l(yr)*y(er),y(yr)]}jl.invert=Sc(h);function gu(){return Lu(jl).scale(249.5).clipAngle(90+r)}function Cc(er,yr){var na=l(yr),$r=1+l(er)*na;return[na*y(er)/$r,y(yr)/$r]}Cc.invert=Sc(function(er){return 2*v(er)});function Yc(){return Lu(Cc).scale(250).clipAngle(142)}function sc(er,yr){return[S(u((i+yr)/2)),-er]}sc.invert=function(er,yr){return[-yr,2*v(w(er))-i]};function kc(){var er=tu(sc),yr=er.center,na=er.rotate;return er.center=function($r){return arguments.length?yr([-$r[1],$r[0]]):($r=yr(),[$r[1],-$r[0]])},er.rotate=function($r){return arguments.length?na([$r[0],$r[1],$r.length>2?$r[2]+90:90]):($r=na(),[$r[0],$r[1],$r[2]-90])},na([0,0,90]).scale(159.155)}d.geoAlbers=Ml,d.geoAlbersUsa=Jf,d.geoArea=j,d.geoAzimuthalEqualArea=Lh,d.geoAzimuthalEqualAreaRaw=vc,d.geoAzimuthalEquidistant=df,d.geoAzimuthalEquidistantRaw=nf,d.geoBounds=Be,d.geoCentroid=Pr,d.geoCircle=Nr,d.geoClipAntimeridian=kr,d.geoClipCircle=Ya,d.geoClipExtent=fn,d.geoClipRectangle=Li,d.geoConicConformal=vf,d.geoConicConformalRaw=uh,d.geoConicEqualArea=bu,d.geoConicEqualAreaRaw=vu,d.geoConicEquidistant=kf,d.geoConicEquidistantRaw=Pu,d.geoContains=Yo,d.geoDistance=Vn,d.geoEqualEarth=Lf,d.geoEqualEarthRaw=Zc,d.geoEquirectangular=mu,d.geoEquirectangularRaw=ol,d.geoGnomonic=jf,d.geoGnomonicRaw=ru,d.geoGraticule=tl,d.geoGraticule10=Bs,d.geoIdentity=Xu,d.geoInterpolate=uo,d.geoLength=Ts,d.geoMercator=of,d.geoMercatorRaw=Nu,d.geoNaturalEarth1=mc,d.geoNaturalEarth1Raw=Ec,d.geoOrthographic=gu,d.geoOrthographicRaw=jl,d.geoPath=Ff,d.geoProjection=Lu,d.geoProjectionMutator=Ac,d.geoRotation=mi,d.geoStereographic=Yc,d.geoStereographicRaw=Cc,d.geoStream=N,d.geoTransform=Of,d.geoTransverseMercator=kc,d.geoTransverseMercatorRaw=sc,Object.defineProperty(d,"__esModule",{value:!0})})}}),NU=Ze({"node_modules/d3-geo-projection/dist/d3-geo-projection.js"(Z,q){(function(d,x){typeof Z=="object"&&typeof q<"u"?x(Z,DE(),yx()):x(d.d3=d.d3||{},d.d3,d.d3)})(Z,function(d,x,A){"use strict";var M=Math.abs,e=Math.atan,t=Math.atan2,r=Math.cos,o=Math.exp,a=Math.floor,i=Math.log,n=Math.max,s=Math.min,c=Math.pow,f=Math.round,g=Math.sign||function(He){return He>0?1:He<0?-1:0},v=Math.sin,T=Math.tan,l=1e-6,_=1e-12,w=Math.PI,S=w/2,E=w/4,y=Math.SQRT1_2,b=F(2),p=F(w),u=w*2,m=180/w,h=w/180;function P(He){return He?He/Math.sin(He):1}function L(He){return He>1?S:He<-1?-S:Math.asin(He)}function z(He){return He>1?0:He<-1?w:Math.acos(He)}function F(He){return He>0?Math.sqrt(He):0}function B(He){return He=o(2*He),(He-1)/(He+1)}function O(He){return(o(He)-o(-He))/2}function I(He){return(o(He)+o(-He))/2}function N(He){return i(He+F(He*He+1))}function U(He){return i(He+F(He*He-1))}function W(He){var Je=T(He/2),ut=2*i(r(He/2))/(Je*Je);function dt(Ct,wt){var Dt=r(Ct),ur=r(wt),mr=v(wt),Er=ur*Dt,Br=-((1-Er?i((1+Er)/2)/(1-Er):-.5)+ut/(1+Er));return[Br*ur*v(Ct),Br*mr]}return dt.invert=function(Ct,wt){var Dt=F(Ct*Ct+wt*wt),ur=-He/2,mr=50,Er;if(!Dt)return[0,0];do{var Br=ur/2,Qr=r(Br),ga=v(Br),Sa=ga/Qr,Oa=-i(M(Qr));ur-=Er=(2/Sa*Oa-ut*Sa-Dt)/(-Oa/(ga*ga)+1-ut/(2*Qr*Qr))*(Qr<0?.7:1)}while(M(Er)>l&&--mr>0);var di=v(ur);return[t(Ct*di,Dt*r(ur)),L(wt*di/Dt)]},dt}function Q(){var He=S,Je=x.geoProjectionMutator(W),ut=Je(He);return ut.radius=function(dt){return arguments.length?Je(He=dt*h):He*m},ut.scale(179.976).clipAngle(147)}function ue(He,Je){var ut=r(Je),dt=P(z(ut*r(He/=2)));return[2*ut*v(He)*dt,v(Je)*dt]}ue.invert=function(He,Je){if(!(He*He+4*Je*Je>w*w+l)){var ut=He,dt=Je,Ct=25;do{var wt=v(ut),Dt=v(ut/2),ur=r(ut/2),mr=v(dt),Er=r(dt),Br=v(2*dt),Qr=mr*mr,ga=Er*Er,Sa=Dt*Dt,Oa=1-ga*ur*ur,di=Oa?z(Er*ur)*F(Wi=1/Oa):Wi=0,Wi,Gi=2*di*Er*Dt-He,on=di*mr-Je,Tn=Wi*(ga*Sa+di*Er*ur*Qr),Wn=Wi*(.5*wt*Br-di*2*mr*Dt),Bn=Wi*.25*(Br*Dt-di*mr*ga*wt),Ao=Wi*(Qr*ur+di*Sa*Er),ss=Wn*Bn-Ao*Tn;if(!ss)break;var So=(on*Wn-Gi*Ao)/ss,Ko=(Gi*Bn-on*Tn)/ss;ut-=So,dt-=Ko}while((M(So)>l||M(Ko)>l)&&--Ct>0);return[ut,dt]}};function le(){return x.geoProjection(ue).scale(152.63)}function he(He){var Je=v(He),ut=r(He),dt=He>=0?1:-1,Ct=T(dt*He),wt=(1+Je-ut)/2;function Dt(ur,mr){var Er=r(mr),Br=r(ur/=2);return[(1+Er)*v(ur),(dt*mr>-t(Br,Ct)-.001?0:-dt*10)+wt+v(mr)*ut-(1+Er)*Je*Br]}return Dt.invert=function(ur,mr){var Er=0,Br=0,Qr=50;do{var ga=r(Er),Sa=v(Er),Oa=r(Br),di=v(Br),Wi=1+Oa,Gi=Wi*Sa-ur,on=wt+di*ut-Wi*Je*ga-mr,Tn=Wi*ga/2,Wn=-Sa*di,Bn=Je*Wi*Sa/2,Ao=ut*Oa+Je*ga*di,ss=Wn*Bn-Ao*Tn,So=(on*Wn-Gi*Ao)/ss/2,Ko=(Gi*Bn-on*Tn)/ss;M(Ko)>2&&(Ko/=2),Er-=So,Br-=Ko}while((M(So)>l||M(Ko)>l)&&--Qr>0);return dt*Br>-t(r(Er),Ct)-.001?[Er*2,Br]:null},Dt}function G(){var He=20*h,Je=He>=0?1:-1,ut=T(Je*He),dt=x.geoProjectionMutator(he),Ct=dt(He),wt=Ct.stream;return Ct.parallel=function(Dt){return arguments.length?(ut=T((Je=(He=Dt*h)>=0?1:-1)*He),dt(He)):He*m},Ct.stream=function(Dt){var ur=Ct.rotate(),mr=wt(Dt),Er=(Ct.rotate([0,0]),wt(Dt)),Br=Ct.precision();return Ct.rotate(ur),mr.sphere=function(){Er.polygonStart(),Er.lineStart();for(var Qr=Je*-180;Je*Qr<180;Qr+=Je*90)Er.point(Qr,Je*90);if(He)for(;Je*(Qr-=3*Je*Br)>=-180;)Er.point(Qr,Je*-t(r(Qr*h/2),ut)*m);Er.lineEnd(),Er.polygonEnd()},mr},Ct.scale(218.695).center([0,28.0974])}function $(He,Je){var ut=T(Je/2),dt=F(1-ut*ut),Ct=1+dt*r(He/=2),wt=v(He)*dt/Ct,Dt=ut/Ct,ur=wt*wt,mr=Dt*Dt;return[4/3*wt*(3+ur-3*mr),4/3*Dt*(3+3*ur-mr)]}$.invert=function(He,Je){if(He*=3/8,Je*=3/8,!He&&M(Je)>1)return null;var ut=He*He,dt=Je*Je,Ct=1+ut+dt,wt=F((Ct-F(Ct*Ct-4*Je*Je))/2),Dt=L(wt)/3,ur=wt?U(M(Je/wt))/3:N(M(He))/3,mr=r(Dt),Er=I(ur),Br=Er*Er-mr*mr;return[g(He)*2*t(O(ur)*mr,.25-Br),g(Je)*2*t(Er*v(Dt),.25+Br)]};function J(){return x.geoProjection($).scale(66.1603)}var X=F(8),oe=i(1+b);function ie(He,Je){var ut=M(Je);return ut_&&--dt>0);return[He/(r(ut)*(X-1/v(ut))),g(Je)*ut]};function j(){return x.geoProjection(ie).scale(112.314)}function ee(He){var Je=2*w/He;function ut(dt,Ct){var wt=x.geoAzimuthalEquidistantRaw(dt,Ct);if(M(dt)>S){var Dt=t(wt[1],wt[0]),ur=F(wt[0]*wt[0]+wt[1]*wt[1]),mr=Je*f((Dt-S)/Je)+S,Er=t(v(Dt-=mr),2-r(Dt));Dt=mr+L(w/ur*v(Er))-Er,wt[0]=ur*r(Dt),wt[1]=ur*v(Dt)}return wt}return ut.invert=function(dt,Ct){var wt=F(dt*dt+Ct*Ct);if(wt>S){var Dt=t(Ct,dt),ur=Je*f((Dt-S)/Je)+S,mr=Dt>ur?-1:1,Er=wt*r(ur-Dt),Br=1/T(mr*z((Er-w)/F(w*(w-2*Er)+wt*wt)));Dt=ur+2*e((Br+mr*F(Br*Br-3))/3),dt=wt*r(Dt),Ct=wt*v(Dt)}return x.geoAzimuthalEquidistantRaw.invert(dt,Ct)},ut}function re(){var He=5,Je=x.geoProjectionMutator(ee),ut=Je(He),dt=ut.stream,Ct=.01,wt=-r(Ct*h),Dt=v(Ct*h);return ut.lobes=function(ur){return arguments.length?Je(He=+ur):He},ut.stream=function(ur){var mr=ut.rotate(),Er=dt(ur),Br=(ut.rotate([0,0]),dt(ur));return ut.rotate(mr),Er.sphere=function(){Br.polygonStart(),Br.lineStart();for(var Qr=0,ga=360/He,Sa=2*w/He,Oa=90-180/He,di=S;Qr0&&M(Ct)>l);return dt<0?NaN:ut}function Re(He,Je,ut){return Je===void 0&&(Je=40),ut===void 0&&(ut=_),function(dt,Ct,wt,Dt){var ur,mr,Er;wt=wt===void 0?0:+wt,Dt=Dt===void 0?0:+Dt;for(var Br=0;Brur){wt-=mr/=2,Dt-=Er/=2;continue}ur=Oa;var di=(wt>0?-1:1)*ut,Wi=(Dt>0?-1:1)*ut,Gi=He(wt+di,Dt),on=He(wt,Dt+Wi),Tn=(Gi[0]-Qr[0])/di,Wn=(Gi[1]-Qr[1])/di,Bn=(on[0]-Qr[0])/Wi,Ao=(on[1]-Qr[1])/Wi,ss=Ao*Tn-Wn*Bn,So=(M(ss)<.5?.5:1)/ss;if(mr=(Sa*Bn-ga*Ao)*So,Er=(ga*Wn-Sa*Tn)*So,wt+=mr,Dt+=Er,M(mr)0&&(ur[1]*=1+mr/1.5*ur[0]*ur[0]),ur}return dt.invert=Re(dt),dt}function it(){return x.geoProjection(Xe()).rotate([-16.5,-42]).scale(176.57).center([7.93,.09])}function ot(He,Je){var ut=He*v(Je),dt=30,Ct;do Je-=Ct=(Je+v(Je)-ut)/(1+r(Je));while(M(Ct)>l&&--dt>0);return Je/2}function tt(He,Je,ut){function dt(Ct,wt){return[He*Ct*r(wt=ot(ut,wt)),Je*v(wt)]}return dt.invert=function(Ct,wt){return wt=L(wt/Je),[Ct/(He*r(wt)),L((2*wt+v(2*wt))/ut)]},dt}var lt=tt(b/S,b,w);function Ee(){return x.geoProjection(lt).scale(169.529)}var _e=2.00276,fe=1.11072;function Fe(He,Je){var ut=ot(w,Je);return[_e*He/(1/r(Je)+fe/r(ut)),(Je+b*v(ut))/_e]}Fe.invert=function(He,Je){var ut=_e*Je,dt=Je<0?-E:E,Ct=25,wt,Dt;do Dt=ut-b*v(dt),dt-=wt=(v(2*dt)+2*dt-w*v(Dt))/(2*r(2*dt)+2+w*r(Dt)*b*r(dt));while(M(wt)>l&&--Ct>0);return Dt=ut-b*v(dt),[He*(1/r(Dt)+fe/r(dt))/_e,Dt]};function rt(){return x.geoProjection(Fe).scale(160.857)}function st(He){var Je=0,ut=x.geoProjectionMutator(He),dt=ut(Je);return dt.parallel=function(Ct){return arguments.length?ut(Je=Ct*h):Je*m},dt}function Qe(He,Je){return[He*r(Je),Je]}Qe.invert=function(He,Je){return[He/r(Je),Je]};function Lt(){return x.geoProjection(Qe).scale(152.63)}function kt(He){if(!He)return Qe;var Je=1/T(He);function ut(dt,Ct){var wt=Je+He-Ct,Dt=wt&&dt*r(Ct)/wt;return[wt*v(Dt),Je-wt*r(Dt)]}return ut.invert=function(dt,Ct){var wt=F(dt*dt+(Ct=Je-Ct)*Ct),Dt=Je+He-wt;return[wt/r(Dt)*t(dt,Ct),Dt]},ut}function Vt(){return st(kt).scale(123.082).center([0,26.1441]).parallel(45)}function Zt(He){function Je(ut,dt){var Ct=S-dt,wt=Ct&&ut*He*v(Ct)/Ct;return[Ct*v(wt)/He,S-Ct*r(wt)]}return Je.invert=function(ut,dt){var Ct=ut*He,wt=S-dt,Dt=F(Ct*Ct+wt*wt),ur=t(Ct,wt);return[(Dt?Dt/v(Dt):1)*ur/He,S-Dt]},Je}function Sr(){var He=.5,Je=x.geoProjectionMutator(Zt),ut=Je(He);return ut.fraction=function(dt){return arguments.length?Je(He=+dt):He},ut.scale(158.837)}var xr=tt(1,4/w,w);function jr(){return x.geoProjection(xr).scale(152.63)}function wr(He,Je,ut,dt,Ct,wt){var Dt=r(wt),ur;if(M(He)>1||M(wt)>1)ur=z(ut*Ct+Je*dt*Dt);else{var mr=v(He/2),Er=v(wt/2);ur=2*L(F(mr*mr+Je*dt*Er*Er))}return M(ur)>l?[ur,t(dt*v(wt),Je*Ct-ut*dt*Dt)]:[0,0]}function Ir(He,Je,ut){return z((He*He+Je*Je-ut*ut)/(2*He*Je))}function bt(He){return He-2*w*a((He+w)/(2*w))}function Be(He,Je,ut){for(var dt=[[He[0],He[1],v(He[1]),r(He[1])],[Je[0],Je[1],v(Je[1]),r(Je[1])],[ut[0],ut[1],v(ut[1]),r(ut[1])]],Ct=dt[2],wt,Dt=0;Dt<3;++Dt,Ct=wt)wt=dt[Dt],Ct.v=wr(wt[1]-Ct[1],Ct[3],Ct[2],wt[3],wt[2],wt[0]-Ct[0]),Ct.point=[0,0];var ur=Ir(dt[0].v[0],dt[2].v[0],dt[1].v[0]),mr=Ir(dt[0].v[0],dt[1].v[0],dt[2].v[0]),Er=w-ur;dt[2].point[1]=0,dt[0].point[0]=-(dt[1].point[0]=dt[0].v[0]/2);var Br=[dt[2].point[0]=dt[0].point[0]+dt[2].v[0]*r(ur),2*(dt[0].point[1]=dt[1].point[1]=dt[2].v[0]*v(ur))];function Qr(ga,Sa){var Oa=v(Sa),di=r(Sa),Wi=new Array(3),Gi;for(Gi=0;Gi<3;++Gi){var on=dt[Gi];if(Wi[Gi]=wr(Sa-on[1],on[3],on[2],di,Oa,ga-on[0]),!Wi[Gi][0])return on.point;Wi[Gi][1]=bt(Wi[Gi][1]-on.v[1])}var Tn=Br.slice();for(Gi=0;Gi<3;++Gi){var Wn=Gi==2?0:Gi+1,Bn=Ir(dt[Gi].v[0],Wi[Gi][0],Wi[Wn][0]);Wi[Gi][1]<0&&(Bn=-Bn),Gi?Gi==1?(Bn=mr-Bn,Tn[0]-=Wi[Gi][0]*r(Bn),Tn[1]-=Wi[Gi][0]*v(Bn)):(Bn=Er-Bn,Tn[0]+=Wi[Gi][0]*r(Bn),Tn[1]+=Wi[Gi][0]*v(Bn)):(Tn[0]+=Wi[Gi][0]*r(Bn),Tn[1]-=Wi[Gi][0]*v(Bn))}return Tn[0]/=3,Tn[1]/=3,Tn}return Qr}function Ke(He){return He[0]*=h,He[1]*=h,He}function Ue(){return Me([0,22],[45,22],[22.5,-22]).scale(380).center([22.5,2])}function Me(He,Je,ut){var dt=x.geoCentroid({type:"MultiPoint",coordinates:[He,Je,ut]}),Ct=[-dt[0],-dt[1]],wt=x.geoRotation(Ct),Dt=Be(Ke(wt(He)),Ke(wt(Je)),Ke(wt(ut)));Dt.invert=Re(Dt);var ur=x.geoProjection(Dt).rotate(Ct),mr=ur.center;return delete ur.rotate,ur.center=function(Er){return arguments.length?mr(wt(Er)):wt.invert(mr())},ur.clipAngle(90)}function qe(He,Je){var ut=F(1-v(Je));return[2/p*He*ut,p*(1-ut)]}qe.invert=function(He,Je){var ut=(ut=Je/p-1)*ut;return[ut>0?He*F(w/ut)/2:0,L(1-ut)]};function Ce(){return x.geoProjection(qe).scale(95.6464).center([0,30])}function Te(He){var Je=T(He);function ut(dt,Ct){return[dt,(dt?dt/v(dt):1)*(v(Ct)*r(dt)-Je*r(Ct))]}return ut.invert=Je?function(dt,Ct){dt&&(Ct*=v(dt)/dt);var wt=r(dt);return[dt,2*t(F(wt*wt+Je*Je-Ct*Ct)-wt,Je-Ct)]}:function(dt,Ct){return[dt,L(dt?Ct*T(dt)/dt:Ct)]},ut}function Pe(){return st(Te).scale(249.828).clipAngle(90)}var at=F(3);function yt(He,Je){return[at*He*(2*r(2*Je/3)-1)/p,at*p*v(Je/3)]}yt.invert=function(He,Je){var ut=3*L(Je/(at*p));return[p*He/(at*(2*r(2*ut/3)-1)),ut]};function Tt(){return x.geoProjection(yt).scale(156.19)}function Ot(He){var Je=r(He);function ut(dt,Ct){return[dt*Je,v(Ct)/Je]}return ut.invert=function(dt,Ct){return[dt/Je,L(Ct*Je)]},ut}function Gt(){return st(Ot).parallel(38.58).scale(195.044)}function rr(He){var Je=r(He);function ut(dt,Ct){return[dt*Je,(1+Je)*T(Ct/2)]}return ut.invert=function(dt,Ct){return[dt/Je,e(Ct/(1+Je))*2]},ut}function Qt(){return st(rr).scale(124.75)}function Tr(He,Je){var ut=F(8/(3*w));return[ut*He*(1-M(Je)/w),ut*Je]}Tr.invert=function(He,Je){var ut=F(8/(3*w)),dt=Je/ut;return[He/(ut*(1-M(dt)/w)),dt]};function la(){return x.geoProjection(Tr).scale(165.664)}function Ua(He,Je){var ut=F(4-3*v(M(Je)));return[2/F(6*w)*He*ut,g(Je)*F(2*w/3)*(2-ut)]}Ua.invert=function(He,Je){var ut=2-M(Je)/F(2*w/3);return[He*F(6*w)/(2*ut),g(Je)*L((4-ut*ut)/3)]};function Ba(){return x.geoProjection(Ua).scale(165.664)}function Ra(He,Je){var ut=F(w*(4+w));return[2/ut*He*(1+F(1-4*Je*Je/(w*w))),4/ut*Je]}Ra.invert=function(He,Je){var ut=F(w*(4+w))/2;return[He*ut/(1+F(1-Je*Je*(4+w)/(4*w))),Je*ut/2]};function ei(){return x.geoProjection(Ra).scale(180.739)}function za(He,Je){var ut=(2+S)*v(Je);Je/=2;for(var dt=0,Ct=1/0;dt<10&&M(Ct)>l;dt++){var wt=r(Je);Je-=Ct=(Je+v(Je)*(wt+2)-ut)/(2*wt*(1+wt))}return[2/F(w*(4+w))*He*(1+r(Je)),2*F(w/(4+w))*v(Je)]}za.invert=function(He,Je){var ut=Je*F((4+w)/w)/2,dt=L(ut),Ct=r(dt);return[He/(2/F(w*(4+w))*(1+Ct)),L((dt+ut*(Ct+2))/(2+S))]};function ti(){return x.geoProjection(za).scale(180.739)}function Ci(He,Je){return[He*(1+r(Je))/F(2+w),2*Je/F(2+w)]}Ci.invert=function(He,Je){var ut=F(2+w),dt=Je*ut/2;return[ut*He/(1+r(dt)),dt]};function Jt(){return x.geoProjection(Ci).scale(173.044)}function Nt(He,Je){for(var ut=(1+S)*v(Je),dt=0,Ct=1/0;dt<10&&M(Ct)>l;dt++)Je-=Ct=(Je+v(Je)-ut)/(1+r(Je));return ut=F(2+w),[He*(1+r(Je))/ut,2*Je/ut]}Nt.invert=function(He,Je){var ut=1+S,dt=F(ut/2);return[He*2*dt/(1+r(Je*=dt)),L((Je+v(Je))/ut)]};function Kt(){return x.geoProjection(Nt).scale(173.044)}var Wt=3+2*b;function Pr(He,Je){var ut=v(He/=2),dt=r(He),Ct=F(r(Je)),wt=r(Je/=2),Dt=v(Je)/(wt+b*dt*Ct),ur=F(2/(1+Dt*Dt)),mr=F((b*wt+(dt+ut)*Ct)/(b*wt+(dt-ut)*Ct));return[Wt*(ur*(mr-1/mr)-2*i(mr)),Wt*(ur*Dt*(mr+1/mr)-2*e(Dt))]}Pr.invert=function(He,Je){if(!(wt=$.invert(He/1.2,Je*1.065)))return null;var ut=wt[0],dt=wt[1],Ct=20,wt;He/=Wt,Je/=Wt;do{var Dt=ut/2,ur=dt/2,mr=v(Dt),Er=r(Dt),Br=v(ur),Qr=r(ur),ga=r(dt),Sa=F(ga),Oa=Br/(Qr+b*Er*Sa),di=Oa*Oa,Wi=F(2/(1+di)),Gi=b*Qr+(Er+mr)*Sa,on=b*Qr+(Er-mr)*Sa,Tn=Gi/on,Wn=F(Tn),Bn=Wn-1/Wn,Ao=Wn+1/Wn,ss=Wi*Bn-2*i(Wn)-He,So=Wi*Oa*Ao-2*e(Oa)-Je,Ko=Br&&y*Sa*mr*di/Br,hs=(b*Er*Qr+Sa)/(2*(Qr+b*Er*Sa)*(Qr+b*Er*Sa)*Sa),ll=-.5*Oa*Wi*Wi*Wi,Js=ll*Ko,es=ll*hs,ts=(ts=2*Qr+b*Sa*(Er-mr))*ts*Wn,Pl=(b*Er*Qr*Sa+ga)/ts,$l=-(b*mr*Br)/(Sa*ts),Ru=Bn*Js-2*Pl/Wn+Wi*(Pl+Pl/Tn),hu=Bn*es-2*$l/Wn+Wi*($l+$l/Tn),wl=Oa*Ao*Js-2*Ko/(1+di)+Wi*Ao*Ko+Wi*Oa*(Pl-Pl/Tn),su=Oa*Ao*es-2*hs/(1+di)+Wi*Ao*hs+Wi*Oa*($l-$l/Tn),uc=hu*wl-su*Ru;if(!uc)break;var ql=(So*hu-ss*su)/uc,Vl=(ss*wl-So*Ru)/uc;ut-=ql,dt=n(-S,s(S,dt-Vl))}while((M(ql)>l||M(Vl)>l)&&--Ct>0);return M(M(dt)-S)dt){var Qr=F(Br),ga=t(Er,mr),Sa=ut*f(ga/ut),Oa=ga-Sa,di=He*r(Oa),Wi=(He*v(Oa)-Oa*v(di))/(S-di),Gi=Rr(Oa,Wi),on=(w-He)/Lr(Gi,di,w);mr=Qr;var Tn=50,Wn;do mr-=Wn=(He+Lr(Gi,di,mr)*on-Qr)/(Gi(mr)*on);while(M(Wn)>l&&--Tn>0);Er=Oa*v(mr),mrdt){var mr=F(ur),Er=t(Dt,wt),Br=ut*f(Er/ut),Qr=Er-Br;wt=mr*r(Qr),Dt=mr*v(Qr);for(var ga=wt-S,Sa=v(wt),Oa=Dt/Sa,di=wtl||M(Oa)>l)&&--di>0);return[Qr,ga]},mr}var Ur=Kr(2.8284,-1.6988,.75432,-.18071,1.76003,-.38914,.042555);function aa(){return x.geoProjection(Ur).scale(149.995)}var da=Kr(2.583819,-.835827,.170354,-.038094,1.543313,-.411435,.082742);function fa(){return x.geoProjection(da).scale(153.93)}var It=Kr(5/6*w,-.62636,-.0344,0,1.3493,-.05524,0,.045);function dr(){return x.geoProjection(It).scale(130.945)}function kr(He,Je){var ut=He*He,dt=Je*Je;return[He*(1-.162388*dt)*(.87-952426e-9*ut*ut),Je*(1+dt/12)]}kr.invert=function(He,Je){var ut=He,dt=Je,Ct=50,wt;do{var Dt=dt*dt;dt-=wt=(dt*(1+Dt/12)-Je)/(1+Dt/4)}while(M(wt)>l&&--Ct>0);Ct=50,He/=1-.162388*Dt;do{var ur=(ur=ut*ut)*ur;ut-=wt=(ut*(.87-952426e-9*ur)-He)/(.87-.00476213*ur)}while(M(wt)>l&&--Ct>0);return[ut,dt]};function ia(){return x.geoProjection(kr).scale(131.747)}var Ca=Kr(2.6516,-.76534,.19123,-.047094,1.36289,-.13965,.031762);function Fa(){return x.geoProjection(Ca).scale(131.087)}function Ya(He){var Je=He(S,0)[0]-He(-S,0)[0];function ut(dt,Ct){var wt=dt>0?-.5:.5,Dt=He(dt+wt*w,Ct);return Dt[0]-=wt*Je,Dt}return He.invert&&(ut.invert=function(dt,Ct){var wt=dt>0?-.5:.5,Dt=He.invert(dt+wt*Je,Ct),ur=Dt[0]-wt*w;return ur<-w?ur+=2*w:ur>w&&(ur-=2*w),Dt[0]=ur,Dt}),ut}function ha(He,Je){var ut=g(He),dt=g(Je),Ct=r(Je),wt=r(He)*Ct,Dt=v(He)*Ct,ur=v(dt*Je);He=M(t(Dt,ur)),Je=L(wt),M(He-S)>l&&(He%=S);var mr=Da(He>w/4?S-He:He,Je);return He>w/4&&(ur=mr[0],mr[0]=-mr[1],mr[1]=-ur),mr[0]*=ut,mr[1]*=-dt,mr}ha.invert=function(He,Je){M(He)>1&&(He=g(He)*2-He),M(Je)>1&&(Je=g(Je)*2-Je);var ut=g(He),dt=g(Je),Ct=-ut*He,wt=-dt*Je,Dt=wt/Ct<1,ur=Xi(Dt?wt:Ct,Dt?Ct:wt),mr=ur[0],Er=ur[1],Br=r(Er);return Dt&&(mr=-S-mr),[ut*(t(v(mr)*Br,-v(Er))+w),dt*L(r(mr)*Br)]};function Da(He,Je){if(Je===S)return[0,0];var ut=v(Je),dt=ut*ut,Ct=dt*dt,wt=1+Ct,Dt=1+3*Ct,ur=1-Ct,mr=L(1/F(wt)),Er=ur+dt*wt*mr,Br=(1-ut)/Er,Qr=F(Br),ga=Br*wt,Sa=F(ga),Oa=Qr*ur,di,Wi;if(He===0)return[0,-(Oa+dt*Sa)];var Gi=r(Je),on=1/Gi,Tn=2*ut*Gi,Wn=(-3*dt+mr*Dt)*Tn,Bn=(-Er*Gi-(1-ut)*Wn)/(Er*Er),Ao=.5*Bn/Qr,ss=ur*Ao-2*dt*Qr*Tn,So=dt*wt*Bn+Br*Dt*Tn,Ko=-on*Tn,hs=-on*So,ll=-2*on*ss,Js=4*He/w,es;if(He>.222*w||Je.175*w){if(di=(Oa+dt*F(ga*(1+Ct)-Oa*Oa))/(1+Ct),He>w/4)return[di,di];var ts=di,Pl=.5*di;di=.5*(Pl+ts),Wi=50;do{var $l=F(ga-di*di),Ru=di*(ll+Ko*$l)+hs*L(di/Sa)-Js;if(!Ru)break;Ru<0?Pl=di:ts=di,di=.5*(Pl+ts)}while(M(ts-Pl)>l&&--Wi>0)}else{di=l,Wi=25;do{var hu=di*di,wl=F(ga-hu),su=ll+Ko*wl,uc=di*su+hs*L(di/Sa)-Js,ql=su+(hs-Ko*hu)/wl;di-=es=wl?uc/ql:0}while(M(es)>l&&--Wi>0)}return[di,-Oa-dt*F(ga-di*di)]}function Xi(He,Je){for(var ut=0,dt=1,Ct=.5,wt=50;;){var Dt=Ct*Ct,ur=F(Ct),mr=L(1/F(1+Dt)),Er=1-Dt+Ct*(1+Dt)*mr,Br=(1-ur)/Er,Qr=F(Br),ga=Br*(1+Dt),Sa=Qr*(1-Dt),Oa=ga-He*He,di=F(Oa),Wi=Je+Sa+Ct*di;if(M(dt-ut)<_||--wt===0||Wi===0)break;Wi>0?ut=Ct:dt=Ct,Ct=.5*(ut+dt)}if(!wt)return null;var Gi=L(ur),on=r(Gi),Tn=1/on,Wn=2*ur*on,Bn=(-3*Ct+mr*(1+3*Dt))*Wn,Ao=(-Er*on-(1-ur)*Bn)/(Er*Er),ss=.5*Ao/Qr,So=(1-Dt)*ss-2*Ct*Qr*Wn,Ko=-2*Tn*So,hs=-Tn*Wn,ll=-Tn*(Ct*(1+Dt)*Ao+Br*(1+3*Dt)*Wn);return[w/4*(He*(Ko+hs*di)+ll*L(He/F(ga))),Gi]}function Li(){return x.geoProjection(Ya(ha)).scale(239.75)}function fn(He,Je,ut){var dt,Ct,wt;return He?(dt=An(He,ut),Je?(Ct=An(Je,1-ut),wt=Ct[1]*Ct[1]+ut*dt[0]*dt[0]*Ct[0]*Ct[0],[[dt[0]*Ct[2]/wt,dt[1]*dt[2]*Ct[0]*Ct[1]/wt],[dt[1]*Ct[1]/wt,-dt[0]*dt[2]*Ct[0]*Ct[2]/wt],[dt[2]*Ct[1]*Ct[2]/wt,-ut*dt[0]*dt[1]*Ct[0]/wt]]):[[dt[0],0],[dt[1],0],[dt[2],0]]):(Ct=An(Je,1-ut),[[0,Ct[0]/Ct[1]],[1/Ct[1],0],[Ct[2]/Ct[1],0]])}function An(He,Je){var ut,dt,Ct,wt,Dt;if(Je=1-l)return ut=(1-Je)/4,dt=I(He),wt=B(He),Ct=1/dt,Dt=dt*O(He),[wt+ut*(Dt-He)/(dt*dt),Ct-ut*wt*Ct*(Dt-He),Ct+ut*wt*Ct*(Dt+He),2*e(o(He))-S+ut*(Dt-He)/dt];var ur=[1,0,0,0,0,0,0,0,0],mr=[F(Je),0,0,0,0,0,0,0,0],Er=0;for(dt=F(1-Je),Dt=1;M(mr[Er]/ur[Er])>l&&Er<8;)ut=ur[Er++],mr[Er]=(ut-dt)/2,ur[Er]=(ut+dt)/2,dt=F(ut*dt),Dt*=2;Ct=Dt*ur[Er]*He;do wt=mr[Er]*v(dt=Ct)/ur[Er],Ct=(L(wt)+Ct)/2;while(--Er);return[v(Ct),wt=r(Ct),wt/r(Ct-dt),Ct]}function kn(He,Je,ut){var dt=M(He),Ct=M(Je),wt=O(Ct);if(dt){var Dt=1/v(dt),ur=1/(T(dt)*T(dt)),mr=-(ur+ut*(wt*wt*Dt*Dt)-1+ut),Er=(ut-1)*ur,Br=(-mr+F(mr*mr-4*Er))/2;return[zn(e(1/F(Br)),ut)*g(He),zn(e(F((Br/ur-1)/ut)),1-ut)*g(Je)]}return[0,zn(e(wt),1-ut)*g(Je)]}function zn(He,Je){if(!Je)return He;if(Je===1)return i(T(He/2+E));for(var ut=1,dt=F(1-Je),Ct=F(Je),wt=0;M(Ct)>l;wt++){if(He%w){var Dt=e(dt*T(He)/ut);Dt<0&&(Dt+=w),He+=Dt+~~(He/w)*w}else He+=He;Ct=(ut+dt)/2,dt=F(ut*dt),Ct=((ut=Ct)-dt)/2}return He/(c(2,wt)*ut)}function Xn(He,Je){var ut=(b-1)/(b+1),dt=F(1-ut*ut),Ct=zn(S,dt*dt),wt=-1,Dt=i(T(w/4+M(Je)/2)),ur=o(wt*Dt)/F(ut),mr=to(ur*r(wt*He),ur*v(wt*He)),Er=kn(mr[0],mr[1],dt*dt);return[-Er[1],(Je>=0?1:-1)*(.5*Ct-Er[0])]}function to(He,Je){var ut=He*He,dt=Je+1,Ct=1-ut-Je*Je;return[.5*((He>=0?S:-S)-t(Ct,2*He)),-.25*i(Ct*Ct+4*ut)+.5*i(dt*dt+ut)]}function mo(He,Je){var ut=Je[0]*Je[0]+Je[1]*Je[1];return[(He[0]*Je[0]+He[1]*Je[1])/ut,(He[1]*Je[0]-He[0]*Je[1])/ut]}Xn.invert=function(He,Je){var ut=(b-1)/(b+1),dt=F(1-ut*ut),Ct=zn(S,dt*dt),wt=-1,Dt=fn(.5*Ct-Je,-He,dt*dt),ur=mo(Dt[0],Dt[1]),mr=t(ur[1],ur[0])/wt;return[mr,2*e(o(.5/wt*i(ut*ur[0]*ur[0]+ut*ur[1]*ur[1])))-S]};function pn(){return x.geoProjection(Ya(Xn)).scale(151.496)}function Jo(He){var Je=v(He),ut=r(He),dt=Xo(He);dt.invert=Xo(-He);function Ct(wt,Dt){var ur=dt(wt,Dt);wt=ur[0],Dt=ur[1];var mr=v(Dt),Er=r(Dt),Br=r(wt),Qr=z(Je*mr+ut*Er*Br),ga=v(Qr),Sa=M(ga)>l?Qr/ga:1;return[Sa*ut*v(wt),(M(wt)>S?Sa:-Sa)*(Je*Er-ut*mr*Br)]}return Ct.invert=function(wt,Dt){var ur=F(wt*wt+Dt*Dt),mr=-v(ur),Er=r(ur),Br=ur*Er,Qr=-Dt*mr,ga=ur*Je,Sa=F(Br*Br+Qr*Qr-ga*ga),Oa=t(Br*ga+Qr*Sa,Qr*ga-Br*Sa),di=(ur>S?-1:1)*t(wt*mr,ur*r(Oa)*Er+Dt*v(Oa)*mr);return dt.invert(di,Oa)},Ct}function Xo(He){var Je=v(He),ut=r(He);return function(dt,Ct){var wt=r(Ct),Dt=r(dt)*wt,ur=v(dt)*wt,mr=v(Ct);return[t(ur,Dt*ut-mr*Je),L(mr*ut+Dt*Je)]}}function Ts(){var He=0,Je=x.geoProjectionMutator(Jo),ut=Je(He),dt=ut.rotate,Ct=ut.stream,wt=x.geoCircle();return ut.parallel=function(Dt){if(!arguments.length)return He*m;var ur=ut.rotate();return Je(He=Dt*h).rotate(ur)},ut.rotate=function(Dt){return arguments.length?(dt.call(ut,[Dt[0],Dt[1]-He*m]),wt.center([-Dt[0],-Dt[1]]),ut):(Dt=dt.call(ut),Dt[1]+=He*m,Dt)},ut.stream=function(Dt){return Dt=Ct(Dt),Dt.sphere=function(){Dt.polygonStart();var ur=.01,mr=wt.radius(90-ur)().coordinates[0],Er=mr.length-1,Br=-1,Qr;for(Dt.lineStart();++Br=0;)Dt.point((Qr=mr[Br])[0],Qr[1]);Dt.lineEnd(),Dt.polygonEnd()},Dt},ut.scale(79.4187).parallel(45).clipAngle(180-.001)}var Po=3,so=L(1-1/Po)*m,Vn=Ot(0);function To(He){var Je=so*h,ut=qe(w,Je)[0]-qe(-w,Je)[0],dt=Vn(0,Je)[1],Ct=qe(0,Je)[1],wt=p-Ct,Dt=u/He,ur=4/u,mr=dt+wt*wt*4/u;function Er(Br,Qr){var ga,Sa=M(Qr);if(Sa>Je){var Oa=s(He-1,n(0,a((Br+w)/Dt)));Br+=w*(He-1)/He-Oa*Dt,ga=qe(Br,Sa),ga[0]=ga[0]*u/ut-u*(He-1)/(2*He)+Oa*u/He,ga[1]=dt+(ga[1]-Ct)*4*wt/u,Qr<0&&(ga[1]=-ga[1])}else ga=Vn(Br,Qr);return ga[0]*=ur,ga[1]/=mr,ga}return Er.invert=function(Br,Qr){Br/=ur,Qr*=mr;var ga=M(Qr);if(ga>dt){var Sa=s(He-1,n(0,a((Br+w)/Dt)));Br=(Br+w*(He-1)/He-Sa*Dt)*ut/u;var Oa=qe.invert(Br,.25*(ga-dt)*u/wt+Ct);return Oa[0]-=w*(He-1)/He-Sa*Dt,Qr<0&&(Oa[1]=-Oa[1]),Oa}return Vn.invert(Br,Qr)},Er}function qo(He,Je){return[He,Je&1?90-l:so]}function Oo(He,Je){return[He,Je&1?-90+l:-so]}function lo(He){return[He[0]*(1-l),He[1]]}function Co(He){var Je=[].concat(A.range(-180,180+He/2,He).map(qo),A.range(180,-180-He/2,-He).map(Oo));return{type:"Polygon",coordinates:[He===180?Je.map(lo):Je]}}function os(){var He=4,Je=x.geoProjectionMutator(To),ut=Je(He),dt=ut.stream;return ut.lobes=function(Ct){return arguments.length?Je(He=+Ct):He},ut.stream=function(Ct){var wt=ut.rotate(),Dt=dt(Ct),ur=(ut.rotate([0,0]),dt(Ct));return ut.rotate(wt),Dt.sphere=function(){x.geoStream(Co(180/He),ur)},Dt},ut.scale(239.75)}function Ys(He){var Je=1+He,ut=v(1/Je),dt=L(ut),Ct=2*F(w/(wt=w+4*dt*Je)),wt,Dt=.5*Ct*(Je+F(He*(2+He))),ur=He*He,mr=Je*Je;function Er(Br,Qr){var ga=1-v(Qr),Sa,Oa;if(ga&&ga<2){var di=S-Qr,Wi=25,Gi;do{var on=v(di),Tn=r(di),Wn=dt+t(on,Je-Tn),Bn=1+mr-2*Je*Tn;di-=Gi=(di-ur*dt-Je*on+Bn*Wn-.5*ga*wt)/(2*Je*on*Wn)}while(M(Gi)>_&&--Wi>0);Sa=Ct*F(Bn),Oa=Br*Wn/w}else Sa=Ct*(He+ga),Oa=Br*dt/w;return[Sa*v(Oa),Dt-Sa*r(Oa)]}return Er.invert=function(Br,Qr){var ga=Br*Br+(Qr-=Dt)*Qr,Sa=(1+mr-ga/(Ct*Ct))/(2*Je),Oa=z(Sa),di=v(Oa),Wi=dt+t(di,Je-Sa);return[L(Br/F(ga))*w/Wi,L(1-2*(Oa-ur*dt-Je*di+(1+mr-2*Je*Sa)*Wi)/wt)]},Er}function Os(){var He=1,Je=x.geoProjectionMutator(Ys),ut=Je(He);return ut.ratio=function(dt){return arguments.length?Je(He=+dt):He},ut.scale(167.774).center([0,18.67])}var Yo=.7109889596207567,Ui=.0528035274542;function Cn(He,Je){return Je>-Yo?(He=lt(He,Je),He[1]+=Ui,He):Qe(He,Je)}Cn.invert=function(He,Je){return Je>-Yo?lt.invert(He,Je-Ui):Qe.invert(He,Je)};function tl(){return x.geoProjection(Cn).rotate([-20,-55]).scale(164.263).center([0,-5.4036])}function Bs(He,Je){return M(Je)>Yo?(He=lt(He,Je),He[1]-=Je>0?Ui:-Ui,He):Qe(He,Je)}Bs.invert=function(He,Je){return M(Je)>Yo?lt.invert(He,Je+(Je>0?Ui:-Ui)):Qe.invert(He,Je)};function uo(){return x.geoProjection(Bs).scale(152.63)}function $s(He,Je,ut,dt){var Ct=F(4*w/(2*ut+(1+He-Je/2)*v(2*ut)+(He+Je)/2*v(4*ut)+Je/2*v(6*ut))),wt=F(dt*v(ut)*F((1+He*r(2*ut)+Je*r(4*ut))/(1+He+Je))),Dt=ut*mr(1);function ur(Qr){return F(1+He*r(2*Qr)+Je*r(4*Qr))}function mr(Qr){var ga=Qr*ut;return(2*ga+(1+He-Je/2)*v(2*ga)+(He+Je)/2*v(4*ga)+Je/2*v(6*ga))/ut}function Er(Qr){return ur(Qr)*v(Qr)}var Br=function(Qr,ga){var Sa=ut*ze(mr,Dt*v(ga)/ut,ga/w);isNaN(Sa)&&(Sa=ut*g(ga));var Oa=Ct*ur(Sa);return[Oa*wt*Qr/w*r(Sa),Oa/wt*v(Sa)]};return Br.invert=function(Qr,ga){var Sa=ze(Er,ga*wt/Ct);return[Qr*w/(r(Sa)*Ct*wt*ur(Sa)),L(ut*mr(Sa/ut)/Dt)]},ut===0&&(Ct=F(dt/w),Br=function(Qr,ga){return[Qr*Ct,v(ga)/Ct]},Br.invert=function(Qr,ga){return[Qr/Ct,L(ga*Ct)]}),Br}function ms(){var He=1,Je=0,ut=45*h,dt=2,Ct=x.geoProjectionMutator($s),wt=Ct(He,Je,ut,dt);return wt.a=function(Dt){return arguments.length?Ct(He=+Dt,Je,ut,dt):He},wt.b=function(Dt){return arguments.length?Ct(He,Je=+Dt,ut,dt):Je},wt.psiMax=function(Dt){return arguments.length?Ct(He,Je,ut=+Dt*h,dt):ut*m},wt.ratio=function(Dt){return arguments.length?Ct(He,Je,ut,dt=+Dt):dt},wt.scale(180.739)}function Is(He,Je,ut,dt,Ct,wt,Dt,ur,mr,Er,Br){if(Br.nanEncountered)return NaN;var Qr,ga,Sa,Oa,di,Wi,Gi,on,Tn,Wn;if(Qr=ut-Je,ga=He(Je+Qr*.25),Sa=He(ut-Qr*.25),isNaN(ga)){Br.nanEncountered=!0;return}if(isNaN(Sa)){Br.nanEncountered=!0;return}return Oa=Qr*(dt+4*ga+Ct)/12,di=Qr*(Ct+4*Sa+wt)/12,Wi=Oa+di,Wn=(Wi-Dt)/15,Er>mr?(Br.maxDepthCount++,Wi+Wn):Math.abs(Wn)>1;do mr[Wi]>Sa?di=Wi:Oa=Wi,Wi=Oa+di>>1;while(Wi>Oa);var Gi=mr[Wi+1]-mr[Wi];return Gi&&(Gi=(Sa-mr[Wi+1])/Gi),(Wi+1+Gi)/Dt}var Qr=2*Br(1)/w*wt/ut,ga=function(Sa,Oa){var di=Br(M(v(Oa))),Wi=dt(di)*Sa;return di/=Qr,[Wi,Oa>=0?di:-di]};return ga.invert=function(Sa,Oa){var di;return Oa*=Qr,M(Oa)<1&&(di=g(Oa)*L(Ct(M(Oa))*wt)),[Sa/dt(M(Oa)),di]},ga}function po(){var He=0,Je=2.5,ut=1.183136,dt=x.geoProjectionMutator(Sn),Ct=dt(He,Je,ut);return Ct.alpha=function(wt){return arguments.length?dt(He=+wt,Je,ut):He},Ct.k=function(wt){return arguments.length?dt(He,Je=+wt,ut):Je},Ct.gamma=function(wt){return arguments.length?dt(He,Je,ut=+wt):ut},Ct.scale(152.63)}function ro(He,Je){return M(He[0]-Je[0])=0;--mr)ut=He[1][mr],dt=ut[0][0],Ct=ut[0][1],wt=ut[1][1],Dt=ut[2][0],ur=ut[2][1],Je.push(As([[Dt-l,ur-l],[Dt-l,wt+l],[dt+l,wt+l],[dt+l,Ct-l]],30));return{type:"Polygon",coordinates:[A.merge(Je)]}}function $n(He,Je,ut){var dt,Ct;function wt(mr,Er){for(var Br=Er<0?-1:1,Qr=Je[+(Er<0)],ga=0,Sa=Qr.length-1;gaQr[ga][2][0];++ga);var Oa=He(mr-Qr[ga][1][0],Er);return Oa[0]+=He(Qr[ga][1][0],Br*Er>Br*Qr[ga][0][1]?Qr[ga][0][1]:Er)[0],Oa}ut?wt.invert=ut(wt):He.invert&&(wt.invert=function(mr,Er){for(var Br=Ct[+(Er<0)],Qr=Je[+(Er<0)],ga=0,Sa=Br.length;gaOa&&(di=Sa,Sa=Oa,Oa=di),[[Qr,Sa],[ga,Oa]]})}),Dt):Je.map(function(Er){return Er.map(function(Br){return[[Br[0][0]*m,Br[0][1]*m],[Br[1][0]*m,Br[1][1]*m],[Br[2][0]*m,Br[2][1]*m]]})})},Je!=null&&Dt.lobes(Je),Dt}var zs=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]];function au(){return $n(Fe,zs).scale(160.857)}var fl=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]];function xu(){return $n(Bs,fl).scale(152.63)}var zl=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]];function Ns(){return $n(lt,zl).scale(169.529)}var iu=[[[[-180,0],[-90,90],[0,0]],[[0,0],[90,90],[180,0]]],[[[-180,0],[-90,-90],[0,0]],[[0,0],[90,-90],[180,0]]]];function Eu(){return $n(lt,iu).scale(169.529).rotate([20,0])}var Bc=[[[[-180,35],[-30,90],[0,35]],[[0,35],[30,90],[180,35]]],[[[-180,-10],[-102,-90],[-65,-10]],[[-65,-10],[5,-90],[77,-10]],[[77,-10],[103,-90],[180,-10]]]];function Cu(){return $n(Cn,Bc,Re).rotate([-20,-55]).scale(164.263).center([0,-5.4036])}var Af=[[[[-180,0],[-110,90],[-40,0]],[[-40,0],[0,90],[40,0]],[[40,0],[110,90],[180,0]]],[[[-180,0],[-110,-90],[-40,0]],[[-40,0],[0,-90],[40,0]],[[40,0],[110,-90],[180,0]]]];function pf(){return $n(Qe,Af).scale(152.63).rotate([-20,0])}function Us(He,Je){return[3/u*He*F(w*w/3-Je*Je),Je]}Us.invert=function(He,Je){return[u/3*He/F(w*w/3-Je*Je),Je]};function Vc(){return x.geoProjection(Us).scale(158.837)}function Sf(He){function Je(ut,dt){if(M(M(dt)-S)2)return null;ut/=2,dt/=2;var wt=ut*ut,Dt=dt*dt,ur=2*dt/(1+wt+Dt);return ur=c((1+ur)/(1-ur),1/He),[t(2*ut,1-wt-Dt)/He,L((ur-1)/(ur+1))]},Je}function nu(){var He=.5,Je=x.geoProjectionMutator(Sf),ut=Je(He);return ut.spacing=function(dt){return arguments.length?Je(He=+dt):He},ut.scale(124.75)}var Ll=w/b;function ic(He,Je){return[He*(1+F(r(Je)))/2,Je/(r(Je/2)*r(He/6))]}ic.invert=function(He,Je){var ut=M(He),dt=M(Je),Ct=l,wt=S;dtl||M(Wi)>l)&&--Ct>0);return Ct&&[ut,dt]};function vl(){return x.geoProjection(il).scale(139.98)}function gs(He,Je){return[v(He)/r(Je),T(Je)*r(He)]}gs.invert=function(He,Je){var ut=He*He,dt=Je*Je,Ct=dt+1,wt=ut+Ct,Dt=He?y*F((wt-F(wt*wt-4*ut))/ut):1/F(Ct);return[L(He*Dt),g(Je)*z(Dt)]};function Vs(){return x.geoProjection(gs).scale(144.049).clipAngle(90-.001)}function nc(He){var Je=r(He),ut=T(E+He/2);function dt(Ct,wt){var Dt=wt-He,ur=M(Dt)=0;)Br=He[Er],Qr=Br[0]+ur*(Sa=Qr)-mr*ga,ga=Br[1]+ur*ga+mr*Sa;return Qr=ur*(Sa=Qr)-mr*ga,ga=ur*ga+mr*Sa,[Qr,ga]}return ut.invert=function(dt,Ct){var wt=20,Dt=dt,ur=Ct;do{for(var mr=Je,Er=He[mr],Br=Er[0],Qr=Er[1],ga=0,Sa=0,Oa;--mr>=0;)Er=He[mr],ga=Br+Dt*(Oa=ga)-ur*Sa,Sa=Qr+Dt*Sa+ur*Oa,Br=Er[0]+Dt*(Oa=Br)-ur*Qr,Qr=Er[1]+Dt*Qr+ur*Oa;ga=Br+Dt*(Oa=ga)-ur*Sa,Sa=Qr+Dt*Sa+ur*Oa,Br=Dt*(Oa=Br)-ur*Qr-dt,Qr=Dt*Qr+ur*Oa-Ct;var di=ga*ga+Sa*Sa,Wi,Gi;Dt-=Wi=(Br*ga+Qr*Sa)/di,ur-=Gi=(Qr*ga-Br*Sa)/di}while(M(Wi)+M(Gi)>l*l&&--wt>0);if(wt){var on=F(Dt*Dt+ur*ur),Tn=2*e(on*.5),Wn=v(Tn);return[t(Dt*Wn,on*r(Tn)),on?L(ur*Wn/on):0]}},ut}var ls=[[.9972523,0],[.0052513,-.0041175],[.0074606,.0048125],[-.0153783,-.1968253],[.0636871,-.1408027],[.3660976,-.2937382]],_h=[[.98879,0],[0,0],[-.050909,0],[0,0],[.075528,0]],Ss=[[.984299,0],[.0211642,.0037608],[-.1036018,-.0575102],[-.0329095,-.0320119],[.0499471,.1223335],[.026046,.0899805],[7388e-7,-.1435792],[.0075848,-.1334108],[-.0216473,.0776645],[-.0225161,.0853673]],Qn=[[.9245,0],[0,0],[.01943,0]],Gc=[[.721316,0],[0,0],[-.00881625,-.00617325]];function Vu(){return Kl(ls,[152,-64]).scale(1400).center([-160.908,62.4864]).clipAngle(30).angle(7.8)}function Ul(){return Kl(_h,[95,-38]).scale(1e3).clipAngle(55).center([-96.5563,38.8675])}function Mf(){return Kl(Ss,[120,-45]).scale(359.513).clipAngle(55).center([-117.474,53.0628])}function wc(){return Kl(Qn,[-20,-18]).scale(209.091).center([20,16.7214]).clipAngle(82)}function rf(){return Kl(Gc,[165,10]).scale(250).clipAngle(130).center([-165,-10])}function Kl(He,Je){var ut=x.geoProjection(yh(He)).rotate(Je).clipAngle(90),dt=x.geoRotation(Je),Ct=ut.center;return delete ut.rotate,ut.center=function(wt){return arguments.length?Ct(dt(wt)):dt.invert(Ct())},ut}var Yf=F(6),zf=F(7);function af(He,Je){var ut=L(7*v(Je)/(3*Yf));return[Yf*He*(2*r(2*ut/3)-1)/zf,9*v(ut/3)/zf]}af.invert=function(He,Je){var ut=3*L(Je*zf/9);return[He*zf/(Yf*(2*r(2*ut/3)-1)),L(v(ut)*3*Yf/7)]};function Nc(){return x.geoProjection(af).scale(164.859)}function Ff(He,Je){for(var ut=(1+y)*v(Je),dt=Je,Ct=0,wt;Ct<25&&(dt-=wt=(v(dt/2)+v(dt)-ut)/(.5*r(dt/2)+r(dt)),!(M(wt)_&&--dt>0);return wt=ut*ut,Dt=wt*wt,ur=wt*Dt,[He/(.84719-.13063*wt+ur*ur*(-.04515+.05494*wt-.02326*Dt+.00331*ur)),ut]};function Hc(){return x.geoProjection(oc).scale(175.295)}function Jl(He,Je){return[He*(1+r(Je))/2,2*(Je-T(Je/2))]}Jl.invert=function(He,Je){for(var ut=Je/2,dt=0,Ct=1/0;dt<10&&M(Ct)>l;++dt){var wt=r(Je/2);Je-=Ct=(Je-T(Je/2)-ut)/(1-.5/(wt*wt))}return[2*He/(1+r(Je)),Je]};function Uc(){return x.geoProjection(Jl).scale(152.63)}var Tc=[[[[-180,0],[-90,90],[0,0]],[[0,0],[90,90],[180,0]]],[[[-180,0],[-90,-90],[0,0]],[[0,0],[90,-90],[180,0]]]];function Gs(){return $n(ce(1/0),Tc).rotate([20,0]).scale(152.63)}function Cf(He,Je){var ut=v(Je),dt=r(Je),Ct=g(He);if(He===0||M(Je)===S)return[0,Je];if(Je===0)return[He,0];if(M(He)===S)return[He*dt,S*ut];var wt=w/(2*He)-2*He/w,Dt=2*Je/w,ur=(1-Dt*Dt)/(ut-Dt),mr=wt*wt,Er=ur*ur,Br=1+mr/Er,Qr=1+Er/mr,ga=(wt*ut/ur-wt/2)/Br,Sa=(Er*ut/mr+ur/2)/Qr,Oa=ga*ga+dt*dt/Br,di=Sa*Sa-(Er*ut*ut/mr+ur*ut-1)/Qr;return[S*(ga+F(Oa)*Ct),S*(Sa+F(di<0?0:di)*g(-Je*wt)*Ct)]}Cf.invert=function(He,Je){He/=S,Je/=S;var ut=He*He,dt=Je*Je,Ct=ut+dt,wt=w*w;return[He?(Ct-1+F((1-Ct)*(1-Ct)+4*ut))/(2*He)*S:0,ze(function(Dt){return Ct*(w*v(Dt)-2*Dt)*w+4*Dt*Dt*(Je-v(Dt))+2*w*Dt-wt*Je},0)]};function lh(){return x.geoProjection(Cf).scale(127.267)}var Bf=1.0148,Wc=.23185,Kf=-.14499,ku=.02406,Nf=Bf,ml=5*Wc,Lu=7*Kf,Ac=9*ku,nl=1.790857183;function dc(He,Je){var ut=Je*Je;return[He,Je*(Bf+ut*ut*(Wc+ut*(Kf+ku*ut)))]}dc.invert=function(He,Je){Je>nl?Je=nl:Je<-nl&&(Je=-nl);var ut=Je,dt;do{var Ct=ut*ut;ut-=dt=(ut*(Bf+Ct*Ct*(Wc+Ct*(Kf+ku*Ct)))-Je)/(Nf+Ct*Ct*(ml+Ct*(Lu+Ac*Ct)))}while(M(dt)>l);return[He,ut]};function vu(){return x.geoProjection(dc).scale(139.319)}function bu(He,Je){if(M(Je)l&&--Ct>0);return Dt=T(dt),[(M(Je)=0;)if(dt=Je[ur],ut[0]===dt[0]&&ut[1]===dt[1]){if(wt)return[wt,ut];wt=ut}}}function tu(He){for(var Je=He.length,ut=[],dt=He[Je-1],Ct=0;Ct0?[-dt[0],0]:[180-dt[0],180])};var Je=vf.map(function(ut){return{face:ut,project:He(ut)}});return[-1,0,0,1,0,1,4,5].forEach(function(ut,dt){var Ct=Je[ut];Ct&&(Ct.children||(Ct.children=[])).push(Je[dt])}),nf(Je[0],function(ut,dt){return Je[ut<-w/2?dt<0?6:4:ut<0?dt<0?2:0:utdt^Sa>dt&&ut<(ga-Er)*(dt-Br)/(Sa-Br)+Er&&(Ct=!Ct)}return Ct}function ru(He,Je){var ut=Je.stream,dt;if(!ut)throw new Error("invalid projection");switch(He&&He.type){case"Feature":dt=Xu;break;case"FeatureCollection":dt=jf;break;default:dt=mc;break}return dt(He,ut)}function jf(He,Je){return{type:"FeatureCollection",features:He.features.map(function(ut){return Xu(ut,Je)})}}function Xu(He,Je){return{type:"Feature",id:He.id,properties:He.properties,geometry:mc(He.geometry,Je)}}function Ec(He,Je){return{type:"GeometryCollection",geometries:He.geometries.map(function(ut){return mc(ut,Je)})}}function mc(He,Je){if(!He)return null;if(He.type==="GeometryCollection")return Ec(He,Je);var ut;switch(He.type){case"Point":ut=Cc;break;case"MultiPoint":ut=Cc;break;case"LineString":ut=Yc;break;case"MultiLineString":ut=Yc;break;case"Polygon":ut=sc;break;case"MultiPolygon":ut=sc;break;case"Sphere":ut=sc;break;default:return null}return x.geoStream(He,Je(ut)),ut.result()}var jl=[],gu=[],Cc={point:function(He,Je){jl.push([He,Je])},result:function(){var He=jl.length?jl.length<2?{type:"Point",coordinates:jl[0]}:{type:"MultiPoint",coordinates:jl}:null;return jl=[],He}},Yc={lineStart:Wu,point:function(He,Je){jl.push([He,Je])},lineEnd:function(){jl.length&&(gu.push(jl),jl=[])},result:function(){var He=gu.length?gu.length<2?{type:"LineString",coordinates:gu[0]}:{type:"MultiLineString",coordinates:gu}:null;return gu=[],He}},sc={polygonStart:Wu,lineStart:Wu,point:function(He,Je){jl.push([He,Je])},lineEnd:function(){var He=jl.length;if(He){do jl.push(jl[0].slice());while(++He<4);gu.push(jl),jl=[]}},polygonEnd:Wu,result:function(){if(!gu.length)return null;var He=[],Je=[];return gu.forEach(function(ut){Zc(ut)?He.push([ut]):Je.push(ut)}),Je.forEach(function(ut){var dt=ut[0];He.some(function(Ct){if(Lf(Ct[0],dt))return Ct.push(ut),!0})||He.push([ut])}),gu=[],He.length?He.length>1?{type:"MultiPolygon",coordinates:He}:{type:"Polygon",coordinates:He[0]}:null}};function kc(He){var Je=He(S,0)[0]-He(-S,0)[0];function ut(dt,Ct){var wt=M(dt)0?dt-w:dt+w,Ct),ur=(Dt[0]-Dt[1])*y,mr=(Dt[0]+Dt[1])*y;if(wt)return[ur,mr];var Er=Je*y,Br=ur>0^mr>0?-1:1;return[Br*ur-g(mr)*Er,Br*mr-g(ur)*Er]}return He.invert&&(ut.invert=function(dt,Ct){var wt=(dt+Ct)*y,Dt=(Ct-dt)*y,ur=M(wt)<.5*Je&&M(Dt)<.5*Je;if(!ur){var mr=Je*y,Er=wt>0^Dt>0?-1:1,Br=-Er*dt+(Dt>0?1:-1)*mr,Qr=-Er*Ct+(wt>0?1:-1)*mr;wt=(-Br-Qr)*y,Dt=(Br-Qr)*y}var ga=He.invert(wt,Dt);return ur||(ga[0]+=wt>0?w:-w),ga}),x.geoProjection(ut).rotate([-90,-90,45]).clipAngle(180-.001)}function er(){return kc(ha).scale(176.423)}function yr(){return kc(Xn).scale(111.48)}function na(He,Je){if(!(0<=(Je=+Je)&&Je<=20))throw new Error("invalid digits");function ut(Er){var Br=Er.length,Qr=2,ga=new Array(Br);for(ga[0]=+Er[0].toFixed(Je),ga[1]=+Er[1].toFixed(Je);Qr2||Sa[0]!=Br[0]||Sa[1]!=Br[1])&&(Qr.push(Sa),Br=Sa)}return Qr.length===1&&Er.length>1&&Qr.push(ut(Er[Er.length-1])),Qr}function wt(Er){return Er.map(Ct)}function Dt(Er){if(Er==null)return Er;var Br;switch(Er.type){case"GeometryCollection":Br={type:"GeometryCollection",geometries:Er.geometries.map(Dt)};break;case"Point":Br={type:"Point",coordinates:ut(Er.coordinates)};break;case"MultiPoint":Br={type:Er.type,coordinates:dt(Er.coordinates)};break;case"LineString":Br={type:Er.type,coordinates:Ct(Er.coordinates)};break;case"MultiLineString":case"Polygon":Br={type:Er.type,coordinates:wt(Er.coordinates)};break;case"MultiPolygon":Br={type:"MultiPolygon",coordinates:Er.coordinates.map(wt)};break;default:return Er}return Er.bbox!=null&&(Br.bbox=Er.bbox),Br}function ur(Er){var Br={type:"Feature",properties:Er.properties,geometry:Dt(Er.geometry)};return Er.id!=null&&(Br.id=Er.id),Er.bbox!=null&&(Br.bbox=Er.bbox),Br}if(He!=null)switch(He.type){case"Feature":return ur(He);case"FeatureCollection":{var mr={type:"FeatureCollection",features:He.features.map(ur)};return He.bbox!=null&&(mr.bbox=He.bbox),mr}default:return Dt(He)}return He}function $r(He){var Je=v(He);function ut(dt,Ct){var wt=Je?T(dt*Je/2)/Je:dt/2;if(!Ct)return[2*wt,-He];var Dt=2*e(wt*v(Ct)),ur=1/T(Ct);return[v(Dt)*ur,Ct+(1-r(Dt))*ur-He]}return ut.invert=function(dt,Ct){if(M(Ct+=He)l&&--ur>0);var ga=dt*(Er=T(Dt)),Sa=T(M(Ct)0?S:-S)*(mr+Ct*(Br-Dt)/2+Ct*Ct*(Br-2*mr+Dt)/2)]}Pi.invert=function(He,Je){var ut=Je/S,dt=ut*90,Ct=s(18,M(dt/5)),wt=n(0,a(Ct));do{var Dt=hi[wt][1],ur=hi[wt+1][1],mr=hi[s(19,wt+2)][1],Er=mr-Dt,Br=mr-2*ur+Dt,Qr=2*(M(ut)-ur)/Er,ga=Br/Er,Sa=Qr*(1-ga*Qr*(1-2*ga*Qr));if(Sa>=0||wt===1){dt=(Je>=0?5:-5)*(Sa+Ct);var Oa=50,di;do Ct=s(18,M(dt)/5),wt=a(Ct),Sa=Ct-wt,Dt=hi[wt][1],ur=hi[wt+1][1],mr=hi[s(19,wt+2)][1],dt-=(di=(Je>=0?S:-S)*(ur+Sa*(mr-Dt)/2+Sa*Sa*(mr-2*ur+Dt)/2)-Je)*m;while(M(di)>_&&--Oa>0);break}}while(--wt>=0);var Wi=hi[wt][0],Gi=hi[wt+1][0],on=hi[s(19,wt+2)][0];return[He/(Gi+Sa*(on-Wi)/2+Sa*Sa*(on-2*Gi+Wi)/2),dt*h]};function Zi(){return x.geoProjection(Pi).scale(152.63)}function tn(He){function Je(ut,dt){var Ct=r(dt),wt=(He-1)/(He-Ct*r(ut));return[wt*Ct*v(ut),wt*v(dt)]}return Je.invert=function(ut,dt){var Ct=ut*ut+dt*dt,wt=F(Ct),Dt=(He-F(1-Ct*(He+1)/(He-1)))/((He-1)/wt+wt/(He-1));return[t(ut*Dt,wt*F(1-Dt*Dt)),wt?L(dt*Dt/wt):0]},Je}function dn(He,Je){var ut=tn(He);if(!Je)return ut;var dt=r(Je),Ct=v(Je);function wt(Dt,ur){var mr=ut(Dt,ur),Er=mr[1],Br=Er*Ct/(He-1)+dt;return[mr[0]*dt/Br,Er/Br]}return wt.invert=function(Dt,ur){var mr=(He-1)/(He-1-ur*Ct);return ut.invert(mr*Dt,mr*ur*dt)},wt}function Ri(){var He=2,Je=0,ut=x.geoProjectionMutator(dn),dt=ut(He,Je);return dt.distance=function(Ct){return arguments.length?ut(He=+Ct,Je):He},dt.tilt=function(Ct){return arguments.length?ut(He,Je=Ct*h):Je*m},dt.scale(432.147).clipAngle(z(1/He)*m-1e-6)}var Fi=1e-4,qi=1e4,_i=-180,Mn=_i+Fi,Kn=180,ao=Kn-Fi,Jn=-90,co=Jn+Fi,wn=90,un=wn-Fi;function _o(He){return He.length>0}function Qo(He){return Math.floor(He*qi)/qi}function xs(He){return He===Jn||He===wn?[0,He]:[_i,Qo(He)]}function Qs(He){var Je=He[0],ut=He[1],dt=!1;return Je<=Mn?(Je=_i,dt=!0):Je>=ao&&(Je=Kn,dt=!0),ut<=co?(ut=Jn,dt=!0):ut>=un&&(ut=wn,dt=!0),dt?[Je,ut]:He}function Rs(He){return He.map(Qs)}function Ks(He,Je,ut){for(var dt=0,Ct=He.length;dt=ao||Br<=co||Br>=un){wt[Dt]=Qs(mr);for(var Qr=Dt+1;QrMn&&Saco&&Oa=ur)break;ut.push({index:-1,polygon:Je,ring:wt=wt.slice(Qr-1)}),wt[0]=xs(wt[0][1]),Dt=-1,ur=wt.length}}}}function ys(He){var Je,ut=He.length,dt={},Ct={},wt,Dt,ur,mr,Er;for(Je=0;Je0?w-ur:ur)*m],Er=x.geoProjection(He(Dt)).rotate(mr),Br=x.geoRotation(mr),Qr=Er.center;return delete Er.rotate,Er.center=function(ga){return arguments.length?Qr(Br(ga)):Br.invert(Qr())},Er.clipAngle(90)}function Ls(He){var Je=r(He);function ut(dt,Ct){var wt=x.geoGnomonicRaw(dt,Ct);return wt[0]*=Je,wt}return ut.invert=function(dt,Ct){return x.geoGnomonicRaw.invert(dt/Je,Ct)},ut}function ou(){return Iu([-158,21.5],[-77,39]).clipAngle(60).scale(400)}function Iu(He,Je){return Xs(Ls,He,Je)}function Zu(He){if(!(He*=2))return x.geoAzimuthalEquidistantRaw;var Je=-He/2,ut=-Je,dt=He*He,Ct=T(ut),wt=.5/v(ut);function Dt(ur,mr){var Er=z(r(mr)*r(ur-Je)),Br=z(r(mr)*r(ur-ut)),Qr=mr<0?-1:1;return Er*=Er,Br*=Br,[(Er-Br)/(2*He),Qr*F(4*dt*Br-(dt-Er+Br)*(dt-Er+Br))/(2*He)]}return Dt.invert=function(ur,mr){var Er=mr*mr,Br=r(F(Er+(ga=ur+Je)*ga)),Qr=r(F(Er+(ga=ur+ut)*ga)),ga,Sa;return[t(Sa=Br-Qr,ga=(Br+Qr)*Ct),(mr<0?-1:1)*z(F(ga*ga+Sa*Sa)*wt)]},Dt}function Lc(){return yu([-158,21.5],[-77,39]).clipAngle(130).scale(122.571)}function yu(He,Je){return Xs(Zu,He,Je)}function Pc(He,Je){if(M(Je)l&&--ur>0);return[g(He)*(F(Ct*Ct+4)+Ct)*w/4,S*Dt]};function Yu(){return x.geoProjection(lc).scale(127.16)}function Ne(He,Je,ut,dt,Ct){function wt(Dt,ur){var mr=ut*v(dt*ur),Er=F(1-mr*mr),Br=F(2/(1+Er*r(Dt*=Ct)));return[He*Er*Br*v(Dt),Je*mr*Br]}return wt.invert=function(Dt,ur){var mr=Dt/He,Er=ur/Je,Br=F(mr*mr+Er*Er),Qr=2*L(Br/2);return[t(Dt*T(Qr),He*Br)/Ct,Br&&L(ur*v(Qr)/(Je*ut*Br))/dt]},wt}function R(He,Je,ut,dt){var Ct=w/3;He=n(He,l),Je=n(Je,l),He=s(He,S),Je=s(Je,w-l),ut=n(ut,0),ut=s(ut,100-l),dt=n(dt,l);var wt=ut/100+1,Dt=dt/100,ur=z(wt*r(Ct))/Ct,mr=v(He)/v(ur*S),Er=Je/w,Br=F(Dt*v(He/2)/v(Je/2)),Qr=Br/F(Er*mr*ur),ga=1/(Br*F(Er*mr*ur));return Ne(Qr,ga,mr,ur,Er)}function ae(){var He=65*h,Je=60*h,ut=20,dt=200,Ct=x.geoProjectionMutator(R),wt=Ct(He,Je,ut,dt);return wt.poleline=function(Dt){return arguments.length?Ct(He=+Dt*h,Je,ut,dt):He*m},wt.parallels=function(Dt){return arguments.length?Ct(He,Je=+Dt*h,ut,dt):Je*m},wt.inflation=function(Dt){return arguments.length?Ct(He,Je,ut=+Dt,dt):ut},wt.ratio=function(Dt){return arguments.length?Ct(He,Je,ut,dt=+Dt):dt},wt.scale(163.775)}function we(){return ae().poleline(65).parallels(60).inflation(0).ratio(200).scale(172.633)}var Se=4*w+3*F(3),Oe=2*F(2*w*F(3)/Se),pt=tt(Oe*F(3)/w,Oe,Se/6);function At(){return x.geoProjection(pt).scale(176.84)}function Bt(He,Je){return[He*F(1-3*Je*Je/(w*w)),Je]}Bt.invert=function(He,Je){return[He/F(1-3*Je*Je/(w*w)),Je]};function $t(){return x.geoProjection(Bt).scale(152.63)}function br(He,Je){var ut=r(Je),dt=r(He)*ut,Ct=1-dt,wt=r(He=t(v(He)*ut,-v(Je))),Dt=v(He);return ut=F(1-dt*dt),[Dt*ut-wt*Ct,-wt*ut-Dt*Ct]}br.invert=function(He,Je){var ut=(He*He+Je*Je)/-2,dt=F(-ut*(2+ut)),Ct=Je*ut+He*dt,wt=He*ut-Je*dt,Dt=F(wt*wt+Ct*Ct);return[t(dt*Ct,Dt*(1+ut)),Dt?-L(dt*wt/Dt):0]};function Ar(){return x.geoProjection(br).rotate([0,-90,45]).scale(124.75).clipAngle(180-.001)}function Yr(He,Je){var ut=ue(He,Je);return[(ut[0]+He/S)/2,(ut[1]+Je)/2]}Yr.invert=function(He,Je){var ut=He,dt=Je,Ct=25;do{var wt=r(dt),Dt=v(dt),ur=v(2*dt),mr=Dt*Dt,Er=wt*wt,Br=v(ut),Qr=r(ut/2),ga=v(ut/2),Sa=ga*ga,Oa=1-Er*Qr*Qr,di=Oa?z(wt*Qr)*F(Wi=1/Oa):Wi=0,Wi,Gi=.5*(2*di*wt*ga+ut/S)-He,on=.5*(di*Dt+dt)-Je,Tn=.5*Wi*(Er*Sa+di*wt*Qr*mr)+.5/S,Wn=Wi*(Br*ur/4-di*Dt*ga),Bn=.125*Wi*(ur*ga-di*Dt*Er*Br),Ao=.5*Wi*(mr*Qr+di*Sa*wt)+.5,ss=Wn*Bn-Ao*Tn,So=(on*Wn-Gi*Ao)/ss,Ko=(Gi*Bn-on*Tn)/ss;ut-=So,dt-=Ko}while((M(So)>l||M(Ko)>l)&&--Ct>0);return[ut,dt]};function sa(){return x.geoProjection(Yr).scale(158.837)}d.geoNaturalEarth=x.geoNaturalEarth1,d.geoNaturalEarthRaw=x.geoNaturalEarth1Raw,d.geoAiry=Q,d.geoAiryRaw=W,d.geoAitoff=le,d.geoAitoffRaw=ue,d.geoArmadillo=G,d.geoArmadilloRaw=he,d.geoAugust=J,d.geoAugustRaw=$,d.geoBaker=j,d.geoBakerRaw=ie,d.geoBerghaus=re,d.geoBerghausRaw=ee,d.geoBertin1953=it,d.geoBertin1953Raw=Xe,d.geoBoggs=rt,d.geoBoggsRaw=Fe,d.geoBonne=Vt,d.geoBonneRaw=kt,d.geoBottomley=Sr,d.geoBottomleyRaw=Zt,d.geoBromley=jr,d.geoBromleyRaw=xr,d.geoChamberlin=Me,d.geoChamberlinRaw=Be,d.geoChamberlinAfrica=Ue,d.geoCollignon=Ce,d.geoCollignonRaw=qe,d.geoCraig=Pe,d.geoCraigRaw=Te,d.geoCraster=Tt,d.geoCrasterRaw=yt,d.geoCylindricalEqualArea=Gt,d.geoCylindricalEqualAreaRaw=Ot,d.geoCylindricalStereographic=Qt,d.geoCylindricalStereographicRaw=rr,d.geoEckert1=la,d.geoEckert1Raw=Tr,d.geoEckert2=Ba,d.geoEckert2Raw=Ua,d.geoEckert3=ei,d.geoEckert3Raw=Ra,d.geoEckert4=ti,d.geoEckert4Raw=za,d.geoEckert5=Jt,d.geoEckert5Raw=Ci,d.geoEckert6=Kt,d.geoEckert6Raw=Nt,d.geoEisenlohr=ta,d.geoEisenlohrRaw=Pr,d.geoFahey=Ia,d.geoFaheyRaw=ra,d.geoFoucaut=$a,d.geoFoucautRaw=Ha,d.geoFoucautSinusoidal=mi,d.geoFoucautSinusoidalRaw=ai,d.geoGilbert=Nr,d.geoGingery=Gr,d.geoGingeryRaw=Or,d.geoGinzburg4=aa,d.geoGinzburg4Raw=Ur,d.geoGinzburg5=fa,d.geoGinzburg5Raw=da,d.geoGinzburg6=dr,d.geoGinzburg6Raw=It,d.geoGinzburg8=ia,d.geoGinzburg8Raw=kr,d.geoGinzburg9=Fa,d.geoGinzburg9Raw=Ca,d.geoGringorten=Li,d.geoGringortenRaw=ha,d.geoGuyou=pn,d.geoGuyouRaw=Xn,d.geoHammer=Ae,d.geoHammerRaw=ce,d.geoHammerRetroazimuthal=Ts,d.geoHammerRetroazimuthalRaw=Jo,d.geoHealpix=os,d.geoHealpixRaw=To,d.geoHill=Os,d.geoHillRaw=Ys,d.geoHomolosine=uo,d.geoHomolosineRaw=Bs,d.geoHufnagel=ms,d.geoHufnagelRaw=$s,d.geoHyperelliptical=po,d.geoHyperellipticalRaw=Sn,d.geoInterrupt=$n,d.geoInterruptedBoggs=au,d.geoInterruptedHomolosine=xu,d.geoInterruptedMollweide=Ns,d.geoInterruptedMollweideHemispheres=Eu,d.geoInterruptedSinuMollweide=Cu,d.geoInterruptedSinusoidal=pf,d.geoKavrayskiy7=Vc,d.geoKavrayskiy7Raw=Us,d.geoLagrange=nu,d.geoLagrangeRaw=Sf,d.geoLarrivee=Ou,d.geoLarriveeRaw=ic,d.geoLaskowski=vl,d.geoLaskowskiRaw=il,d.geoLittrow=Vs,d.geoLittrowRaw=gs,d.geoLoximuthal=Nl,d.geoLoximuthalRaw=nc,d.geoMiller=cl,d.geoMillerRaw=qu,d.geoModifiedStereographic=Kl,d.geoModifiedStereographicRaw=yh,d.geoModifiedStereographicAlaska=Vu,d.geoModifiedStereographicGs48=Ul,d.geoModifiedStereographicGs50=Mf,d.geoModifiedStereographicMiller=wc,d.geoModifiedStereographicLee=rf,d.geoMollweide=Ee,d.geoMollweideRaw=lt,d.geoMtFlatPolarParabolic=Nc,d.geoMtFlatPolarParabolicRaw=af,d.geoMtFlatPolarQuartic=Of,d.geoMtFlatPolarQuarticRaw=Ff,d.geoMtFlatPolarSinusoidal=Ef,d.geoMtFlatPolarSinusoidalRaw=Gu,d.geoNaturalEarth2=Hc,d.geoNaturalEarth2Raw=oc,d.geoNellHammer=Uc,d.geoNellHammerRaw=Jl,d.geoInterruptedQuarticAuthalic=Gs,d.geoNicolosi=lh,d.geoNicolosiRaw=Cf,d.geoPatterson=vu,d.geoPattersonRaw=dc,d.geoPolyconic=Ml,d.geoPolyconicRaw=bu,d.geoPolyhedral=nf,d.geoPolyhedralButterfly=ol,d.geoPolyhedralCollignon=kf,d.geoPolyhedralWaterman=hl,d.geoProject=ru,d.geoGringortenQuincuncial=er,d.geoPeirceQuincuncial=yr,d.geoPierceQuincuncial=yr,d.geoQuantize=na,d.geoQuincuncial=kc,d.geoRectangularPolyconic=La,d.geoRectangularPolyconicRaw=$r,d.geoRobinson=Zi,d.geoRobinsonRaw=Pi,d.geoSatellite=Ri,d.geoSatelliteRaw=dn,d.geoSinuMollweide=tl,d.geoSinuMollweideRaw=Cn,d.geoSinusoidal=Lt,d.geoSinusoidalRaw=Qe,d.geoStitch=sl,d.geoTimes=Io,d.geoTimesRaw=Un,d.geoTwoPointAzimuthal=Iu,d.geoTwoPointAzimuthalRaw=Ls,d.geoTwoPointAzimuthalUsa=ou,d.geoTwoPointEquidistant=yu,d.geoTwoPointEquidistantRaw=Zu,d.geoTwoPointEquidistantUsa=Lc,d.geoVanDerGrinten=wu,d.geoVanDerGrintenRaw=Pc,d.geoVanDerGrinten2=fo,d.geoVanDerGrinten2Raw=gc,d.geoVanDerGrinten3=Ic,d.geoVanDerGrinten3Raw=zo,d.geoVanDerGrinten4=Yu,d.geoVanDerGrinten4Raw=lc,d.geoWagner=ae,d.geoWagner7=we,d.geoWagnerRaw=R,d.geoWagner4=At,d.geoWagner4Raw=pt,d.geoWagner6=$t,d.geoWagner6Raw=Bt,d.geoWiechel=Ar,d.geoWiechelRaw=br,d.geoWinkel3=sa,d.geoWinkel3Raw=Yr,Object.defineProperty(d,"__esModule",{value:!0})})}}),UU=Ze({"src/plots/geo/zoom.js"(Z,q){"use strict";var d=On(),x=ca(),A=oo(),M=Math.PI/180,e=180/Math.PI,t={cursor:"pointer"},r={cursor:"auto"};function o(m,h){var P=m.projection,L;return h._isScoped?L=n:h._isClipped?L=c:L=s,L(m,P)}q.exports=o;function a(m,h){return d.behavior.zoom().translate(h.translate()).scale(h.scale())}function i(m,h,P){var L=m.id,z=m.graphDiv,F=z.layout,B=F[L],O=z._fullLayout,I=O[L],N={},U={};function W(Q,ue){N[L+"."+Q]=x.nestedProperty(B,Q).get(),A.call("_storeDirectGUIEdit",F,O._preGUI,N);var le=x.nestedProperty(I,Q);le.get()!==ue&&(le.set(ue),x.nestedProperty(B,Q).set(ue),U[L+"."+Q]=ue)}P(W),W("projection.scale",h.scale()/m.fitScale),W("fitbounds",!1),z.emit("plotly_relayout",U)}function n(m,h){var P=a(m,h);function L(){d.select(this).style(t)}function z(){h.scale(d.event.scale).translate(d.event.translate),m.render(!0);var O=h.invert(m.midPt);m.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":h.scale()/m.fitScale,"geo.center.lon":O[0],"geo.center.lat":O[1]})}function F(O){var I=h.invert(m.midPt);O("center.lon",I[0]),O("center.lat",I[1])}function B(){d.select(this).style(r),i(m,h,F)}return P.on("zoomstart",L).on("zoom",z).on("zoomend",B),P}function s(m,h){var P=a(m,h),L=2,z,F,B,O,I,N,U,W,Q;function ue(X){return h.invert(X)}function le(X){var oe=ue(X);if(!oe)return!0;var ie=h(oe);return Math.abs(ie[0]-X[0])>L||Math.abs(ie[1]-X[1])>L}function he(){d.select(this).style(t),z=d.mouse(this),F=h.rotate(),B=h.translate(),O=F,I=ue(z)}function G(){if(N=d.mouse(this),le(z)){P.scale(h.scale()),P.translate(h.translate());return}h.scale(d.event.scale),h.translate([B[0],d.event.translate[1]]),I?ue(N)&&(W=ue(N),U=[O[0]+(W[0]-I[0]),F[1],F[2]],h.rotate(U),O=U):(z=N,I=ue(z)),Q=!0,m.render(!0);var X=h.rotate(),oe=h.invert(m.midPt);m.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":h.scale()/m.fitScale,"geo.center.lon":oe[0],"geo.center.lat":oe[1],"geo.projection.rotation.lon":-X[0]})}function $(){d.select(this).style(r),Q&&i(m,h,J)}function J(X){var oe=h.rotate(),ie=h.invert(m.midPt);X("projection.rotation.lon",-oe[0]),X("center.lon",ie[0]),X("center.lat",ie[1])}return P.on("zoomstart",he).on("zoom",G).on("zoomend",$),P}function c(m,h){var P={r:h.rotate(),k:h.scale()},L=a(m,h),z=u(L,"zoomstart","zoom","zoomend"),F=0,B=L.on,O;L.on("zoomstart",function(){d.select(this).style(t);var Q=d.mouse(this),ue=h.rotate(),le=ue,he=h.translate(),G=g(ue);O=f(h,Q),B.call(L,"zoom",function(){var $=d.mouse(this);if(h.scale(P.k=d.event.scale),!O)Q=$,O=f(h,Q);else if(f(h,$)){h.rotate(ue).translate(he);var J=f(h,$),X=T(O,J),oe=E(v(G,X)),ie=P.r=l(oe,O,le);(!isFinite(ie[0])||!isFinite(ie[1])||!isFinite(ie[2]))&&(ie=le),h.rotate(ie),le=ie}N(z.of(this,arguments))}),I(z.of(this,arguments))}).on("zoomend",function(){d.select(this).style(r),B.call(L,"zoom",null),U(z.of(this,arguments)),i(m,h,W)}).on("zoom.redraw",function(){m.render(!0);var Q=h.rotate();m.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":h.scale()/m.fitScale,"geo.projection.rotation.lon":-Q[0],"geo.projection.rotation.lat":-Q[1]})});function I(Q){F++||Q({type:"zoomstart"})}function N(Q){Q({type:"zoom"})}function U(Q){--F||Q({type:"zoomend"})}function W(Q){var ue=h.rotate();Q("projection.rotation.lon",-ue[0]),Q("projection.rotation.lat",-ue[1])}return d.rebind(L,z,"on")}function f(m,h){var P=m.invert(h);return P&&isFinite(P[0])&&isFinite(P[1])&&y(P)}function g(m){var h=.5*m[0]*M,P=.5*m[1]*M,L=.5*m[2]*M,z=Math.sin(h),F=Math.cos(h),B=Math.sin(P),O=Math.cos(P),I=Math.sin(L),N=Math.cos(L);return[F*O*N+z*B*I,z*O*N-F*B*I,F*B*N+z*O*I,F*O*I-z*B*N]}function v(m,h){var P=m[0],L=m[1],z=m[2],F=m[3],B=h[0],O=h[1],I=h[2],N=h[3];return[P*B-L*O-z*I-F*N,P*O+L*B+z*N-F*I,P*I-L*N+z*B+F*O,P*N+L*I-z*O+F*B]}function T(m,h){if(!(!m||!h)){var P=p(m,h),L=Math.sqrt(b(P,P)),z=.5*Math.acos(Math.max(-1,Math.min(1,b(m,h)))),F=Math.sin(z)/L;return L&&[Math.cos(z),P[2]*F,-P[1]*F,P[0]*F]}}function l(m,h,P){var L=S(h,2,m[0]);L=S(L,1,m[1]),L=S(L,0,m[2]-P[2]);var z=h[0],F=h[1],B=h[2],O=L[0],I=L[1],N=L[2],U=Math.atan2(F,z)*e,W=Math.sqrt(z*z+F*F),Q,ue;Math.abs(I)>W?(ue=(I>0?90:-90)-U,Q=0):(ue=Math.asin(I/W)*e-U,Q=Math.sqrt(W*W-I*I));var le=180-ue-2*U,he=(Math.atan2(N,O)-Math.atan2(B,Q))*e,G=(Math.atan2(N,O)-Math.atan2(B,-Q))*e,$=_(P[0],P[1],ue,he),J=_(P[0],P[1],le,G);return $<=J?[ue,he,P[2]]:[le,G,P[2]]}function _(m,h,P,L){var z=w(P-m),F=w(L-h);return Math.sqrt(z*z+F*F)}function w(m){return(m%360+540)%360-180}function S(m,h,P){var L=P*M,z=m.slice(),F=h===0?1:0,B=h===2?1:2,O=Math.cos(L),I=Math.sin(L);return z[F]=m[F]*O-m[B]*I,z[B]=m[B]*O+m[F]*I,z}function E(m){return[Math.atan2(2*(m[0]*m[1]+m[2]*m[3]),1-2*(m[1]*m[1]+m[2]*m[2]))*e,Math.asin(Math.max(-1,Math.min(1,2*(m[0]*m[2]-m[3]*m[1]))))*e,Math.atan2(2*(m[0]*m[3]+m[1]*m[2]),1-2*(m[2]*m[2]+m[3]*m[3]))*e]}function y(m){var h=m[0]*M,P=m[1]*M,L=Math.cos(P);return[L*Math.cos(h),L*Math.sin(h),Math.sin(P)]}function b(m,h){for(var P=0,L=0,z=m.length;L0&&I._module.calcGeoJSON(O,L)}if(!z){var N=this.updateProjection(P,L);if(N)return;(!this.viewInitial||this.scope!==F.scope)&&this.saveViewInitial(F)}this.scope=F.scope,this.updateBaseLayers(L,F),this.updateDims(L,F),this.updateFx(L,F),s.generalUpdatePerTraceModule(this.graphDiv,this,P,F);var U=this.layers.frontplot.select(".scatterlayer");this.dataPoints.point=U.selectAll(".point"),this.dataPoints.text=U.selectAll("text"),this.dataPaths.line=U.selectAll(".js-line");var W=this.layers.backplot.select(".choroplethlayer");this.dataPaths.choropleth=W.selectAll("path"),this._render()},p.updateProjection=function(P,L){var z=this.graphDiv,F=L[this.id],B=L._size,O=F.domain,I=F.projection,N=F.lonaxis,U=F.lataxis,W=N._ax,Q=U._ax,ue=this.projection=u(F),le=[[B.l+B.w*O.x[0],B.t+B.h*(1-O.y[1])],[B.l+B.w*O.x[1],B.t+B.h*(1-O.y[0])]],he=F.center||{},G=I.rotation||{},$=N.range||[],J=U.range||[];if(F.fitbounds){W._length=le[1][0]-le[0][0],Q._length=le[1][1]-le[0][1],W.range=f(z,W),Q.range=f(z,Q);var X=(W.range[0]+W.range[1])/2,oe=(Q.range[0]+Q.range[1])/2;if(F._isScoped)he={lon:X,lat:oe};else if(F._isClipped){he={lon:X,lat:oe},G={lon:X,lat:oe,roll:G.roll};var ie=I.type,j=w.lonaxisSpan[ie]/2||180,ee=w.lataxisSpan[ie]/2||90;$=[X-j,X+j],J=[oe-ee,oe+ee]}else he={lon:X,lat:oe},G={lon:X,lat:G.lat,roll:G.roll}}ue.center([he.lon-G.lon,he.lat-G.lat]).rotate([-G.lon,-G.lat,G.roll]).parallels(I.parallels);var re=h($,J);ue.fitExtent(le,re);var ce=this.bounds=ue.getBounds(re),be=this.fitScale=ue.scale(),Ae=ue.translate();if(F.fitbounds){var ze=ue.getBounds(h(W.range,Q.range)),Re=Math.min((ce[1][0]-ce[0][0])/(ze[1][0]-ze[0][0]),(ce[1][1]-ce[0][1])/(ze[1][1]-ze[0][1]));isFinite(Re)?ue.scale(Re*be):r.warn("Something went wrong during"+this.id+"fitbounds computations.")}else ue.scale(I.scale*be);var Xe=this.midPt=[(ce[0][0]+ce[1][0])/2,(ce[0][1]+ce[1][1])/2];if(ue.translate([Ae[0]+(Xe[0]-Ae[0]),Ae[1]+(Xe[1]-Ae[1])]).clipExtent(ce),F._isAlbersUsa){var it=ue([he.lon,he.lat]),ot=ue.translate();ue.translate([ot[0]-(it[0]-ot[0]),ot[1]-(it[1]-ot[1])])}},p.updateBaseLayers=function(P,L){var z=this,F=z.topojson,B=z.layers,O=z.basePaths;function I(le){return le==="lonaxis"||le==="lataxis"}function N(le){return!!w.lineLayers[le]}function U(le){return!!w.fillLayers[le]}var W=this.hasChoropleth?w.layersForChoropleth:w.layers,Q=W.filter(function(le){return N(le)||U(le)?L["show"+le]:I(le)?L[le].showgrid:!0}),ue=z.framework.selectAll(".layer").data(Q,String);ue.exit().each(function(le){delete B[le],delete O[le],d.select(this).remove()}),ue.enter().append("g").attr("class",function(le){return"layer "+le}).each(function(le){var he=B[le]=d.select(this);le==="bg"?z.bgRect=he.append("rect").style("pointer-events","all"):I(le)?O[le]=he.append("path").style("fill","none"):le==="backplot"?he.append("g").classed("choroplethlayer",!0):le==="frontplot"?he.append("g").classed("scatterlayer",!0):N(le)?O[le]=he.append("path").style("fill","none").style("stroke-miterlimit",2):U(le)&&(O[le]=he.append("path").style("stroke","none"))}),ue.order(),ue.each(function(le){var he=O[le],G=w.layerNameToAdjective[le];le==="frame"?he.datum(w.sphereSVG):N(le)||U(le)?he.datum(y(F,F.objects[le])):I(le)&&he.datum(m(le,L,P)).call(a.stroke,L[le].gridcolor).call(i.dashLine,L[le].griddash,L[le].gridwidth),N(le)?he.call(a.stroke,L[G+"color"]).call(i.dashLine,"",L[G+"width"]):U(le)&&he.call(a.fill,L[G+"color"])})},p.updateDims=function(P,L){var z=this.bounds,F=(L.framewidth||0)/2,B=z[0][0]-F,O=z[0][1]-F,I=z[1][0]-B+F,N=z[1][1]-O+F;i.setRect(this.clipRect,B,O,I,N),this.bgRect.call(i.setRect,B,O,I,N).call(a.fill,L.bgcolor),this.xaxis._offset=B,this.xaxis._length=I,this.yaxis._offset=O,this.yaxis._length=N},p.updateFx=function(P,L){var z=this,F=z.graphDiv,B=z.bgRect,O=P.dragmode,I=P.clickmode;if(z.isStatic)return;function N(){var ue=z.viewInitial,le={};for(var he in ue)le[z.id+"."+he]=ue[he];t.call("_guiRelayout",F,le),F.emit("plotly_doubleclick",null)}function U(ue){return z.projection.invert([ue[0]+z.xaxis._offset,ue[1]+z.yaxis._offset])}var W=function(ue,le){if(le.isRect){var he=ue.range={};he[z.id]=[U([le.xmin,le.ymin]),U([le.xmax,le.ymax])]}else{var G=ue.lassoPoints={};G[z.id]=le.map(U)}},Q={element:z.bgRect.node(),gd:F,plotinfo:{id:z.id,xaxis:z.xaxis,yaxis:z.yaxis,fillRangeItems:W},xaxes:[z.xaxis],yaxes:[z.yaxis],subplot:z.id,clickFn:function(ue){ue===2&&T(F)}};O==="pan"?(B.node().onmousedown=null,B.call(_(z,L)),B.on("dblclick.zoom",N),F._context._scrollZoom.geo||B.on("wheel.zoom",null)):(O==="select"||O==="lasso")&&(B.on(".zoom",null),Q.prepFn=function(ue,le,he){v(ue,le,he,Q,O)},g.init(Q)),B.on("mousemove",function(){var ue=z.projection.invert(r.getPositionFromD3Event());if(!ue)return g.unhover(F,d.event);z.xaxis.p2c=function(){return ue[0]},z.yaxis.p2c=function(){return ue[1]},n.hover(F,d.event,z.id)}),B.on("mouseout",function(){F._dragging||g.unhover(F,d.event)}),B.on("click",function(){O!=="select"&&O!=="lasso"&&(I.indexOf("select")>-1&&l(d.event,F,[z.xaxis],[z.yaxis],z.id,Q),I.indexOf("event")>-1&&n.click(F,d.event))})},p.makeFramework=function(){var P=this,L=P.graphDiv,z=L._fullLayout,F="clip"+z._uid+P.id;P.clipDef=z._clips.append("clipPath").attr("id",F),P.clipRect=P.clipDef.append("rect"),P.framework=d.select(P.container).append("g").attr("class","geo "+P.id).call(i.setClipUrl,F,L),P.project=function(B){var O=P.projection(B);return O?[O[0]-P.xaxis._offset,O[1]-P.yaxis._offset]:[null,null]},P.xaxis={_id:"x",c2p:function(B){return P.project(B)[0]}},P.yaxis={_id:"y",c2p:function(B){return P.project(B)[1]}},P.mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},c.setConvert(P.mockAxis,z)},p.saveViewInitial=function(P){var L=P.center||{},z=P.projection,F=z.rotation||{};this.viewInitial={fitbounds:P.fitbounds,"projection.scale":z.scale};var B;P._isScoped?B={"center.lon":L.lon,"center.lat":L.lat}:P._isClipped?B={"projection.rotation.lon":F.lon,"projection.rotation.lat":F.lat}:B={"center.lon":L.lon,"center.lat":L.lat,"projection.rotation.lon":F.lon},r.extendFlat(this.viewInitial,B)},p.render=function(P){this._hasMarkerAngles&&P?this.plot(this._geoCalcData,this._fullLayout,[],!0):this._render()},p._render=function(){var P=this.projection,L=P.getPath(),z;function F(O){var I=P(O.lonlat);return I?o(I[0],I[1]):null}function B(O){return P.isLonLatOverEdges(O.lonlat)?"none":null}for(z in this.basePaths)this.basePaths[z].attr("d",L);for(z in this.dataPaths)this.dataPaths[z].attr("d",function(O){return L(O.geojson)});for(z in this.dataPoints)this.dataPoints[z].attr("display",B).attr("transform",F)};function u(P){var L=P.projection,z=L.type,F=w.projNames[z];F="geo"+r.titleCase(F);for(var B=x[F]||e[F],O=B(),I=P._isSatellite?Math.acos(1/L.distance)*180/Math.PI:P._isClipped?w.lonaxisSpan[z]/2:null,N=["center","rotate","parallels","clipExtent"],U=function(ue){return ue?O:[]},W=0;WG}else return!1},O.getPath=function(){return A().projection(O)},O.getBounds=function(ue){return O.getPath().bounds(ue)},O.precision(w.precision),P._isSatellite&&O.tilt(L.tilt).distance(L.distance),I&&O.clipAngle(I-w.clipPad),O}function m(P,L,z){var F=1e-6,B=2.5,O=L[P],I=w.scopeDefaults[L.scope],N,U,W;P==="lonaxis"?(N=I.lonaxisRange,U=I.lataxisRange,W=function(oe,ie){return[oe,ie]}):P==="lataxis"&&(N=I.lataxisRange,U=I.lonaxisRange,W=function(oe,ie){return[ie,oe]});var Q={type:"linear",range:[N[0],N[1]-F],tick0:O.tick0,dtick:O.dtick};c.setConvert(Q,z);var ue=c.calcTicks(Q);!L.isScoped&&P==="lonaxis"&&ue.pop();for(var le=ue.length,he=new Array(le),G=0;G0&&B<0&&(B+=360);var N=(B-F)/4;return{type:"Polygon",coordinates:[[[F,O],[F,I],[F+N,I],[F+2*N,I],[F+3*N,I],[B,I],[B,O],[B-N,O],[B-2*N,O],[B-3*N,O],[F,O]]]}}}}),zE=Ze({"src/plots/geo/layout_attributes.js"(Z,q){"use strict";var d=oh(),x=bc().attributes,A=Gh().dash,M=gx(),e=pc().overrideAll,t=Km(),r={range:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},showgrid:{valType:"boolean",dflt:!1},tick0:{valType:"number",dflt:0},dtick:{valType:"number"},gridcolor:{valType:"color",dflt:d.lightLine},gridwidth:{valType:"number",min:0,dflt:1},griddash:A},o=q.exports=e({domain:x({name:"geo"},{}),fitbounds:{valType:"enumerated",values:[!1,"locations","geojson"],dflt:!1,editType:"plot"},resolution:{valType:"enumerated",values:[110,50],dflt:110,coerceNumber:!0},scope:{valType:"enumerated",values:t(M.scopeDefaults),dflt:"world"},projection:{type:{valType:"enumerated",values:t(M.projNames)},rotation:{lon:{valType:"number"},lat:{valType:"number"},roll:{valType:"number"}},tilt:{valType:"number",dflt:0},distance:{valType:"number",min:1.001,dflt:2},parallels:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},scale:{valType:"number",min:0,dflt:1}},center:{lon:{valType:"number"},lat:{valType:"number"}},visible:{valType:"boolean",dflt:!0},showcoastlines:{valType:"boolean"},coastlinecolor:{valType:"color",dflt:d.defaultLine},coastlinewidth:{valType:"number",min:0,dflt:1},showland:{valType:"boolean",dflt:!1},landcolor:{valType:"color",dflt:M.landColor},showocean:{valType:"boolean",dflt:!1},oceancolor:{valType:"color",dflt:M.waterColor},showlakes:{valType:"boolean",dflt:!1},lakecolor:{valType:"color",dflt:M.waterColor},showrivers:{valType:"boolean",dflt:!1},rivercolor:{valType:"color",dflt:M.waterColor},riverwidth:{valType:"number",min:0,dflt:1},showcountries:{valType:"boolean"},countrycolor:{valType:"color",dflt:d.defaultLine},countrywidth:{valType:"number",min:0,dflt:1},showsubunits:{valType:"boolean"},subunitcolor:{valType:"color",dflt:d.defaultLine},subunitwidth:{valType:"number",min:0,dflt:1},showframe:{valType:"boolean"},framecolor:{valType:"color",dflt:d.defaultLine},framewidth:{valType:"number",min:0,dflt:1},bgcolor:{valType:"color",dflt:d.background},lonaxis:r,lataxis:r},"plot","from-root");o.uirevision={valType:"any",editType:"none"}}}),qU=Ze({"src/plots/geo/layout_defaults.js"(Z,q){"use strict";var d=ca(),x=i0(),A=Hh().getSubplotData,M=gx(),e=zE(),t=M.axesNames;q.exports=function(a,i,n){x(a,i,n,{type:"geo",attributes:e,handleDefaults:r,fullData:n,partition:"y"})};function r(o,a,i,n){var s=A(n.fullData,"geo",n.id),c=s.map(function(J){return J.index}),f=i("resolution"),g=i("scope"),v=M.scopeDefaults[g],T=i("projection.type",v.projType),l=a._isAlbersUsa=T==="albers usa";l&&(g=a.scope="usa");var _=a._isScoped=g!=="world",w=a._isSatellite=T==="satellite",S=a._isConic=T.indexOf("conic")!==-1||T==="albers",E=a._isClipped=!!M.lonaxisSpan[T];if(o.visible===!1){var y=d.extendDeep({},a._template);y.showcoastlines=!1,y.showcountries=!1,y.showframe=!1,y.showlakes=!1,y.showland=!1,y.showocean=!1,y.showrivers=!1,y.showsubunits=!1,y.lonaxis&&(y.lonaxis.showgrid=!1),y.lataxis&&(y.lataxis.showgrid=!1),a._template=y}for(var b=i("visible"),p,u=0;u0&&U<0&&(U+=360);var W=(N+U)/2,Q;if(!l){var ue=_?v.projRotate:[W,0,0];Q=i("projection.rotation.lon",ue[0]),i("projection.rotation.lat",ue[1]),i("projection.rotation.roll",ue[2]),p=i("showcoastlines",!_&&b),p&&(i("coastlinecolor"),i("coastlinewidth")),p=i("showocean",b?void 0:!1),p&&i("oceancolor")}var le,he;if(l?(le=-96.6,he=38.7):(le=_?W:Q,he=(I[0]+I[1])/2),i("center.lon",le),i("center.lat",he),w&&(i("projection.tilt"),i("projection.distance")),S){var G=v.projParallels||[0,60];i("projection.parallels",G)}i("projection.scale"),p=i("showland",b?void 0:!1),p&&i("landcolor"),p=i("showlakes",b?void 0:!1),p&&i("lakecolor"),p=i("showrivers",b?void 0:!1),p&&(i("rivercolor"),i("riverwidth")),p=i("showcountries",_&&g!=="usa"&&b),p&&(i("countrycolor"),i("countrywidth")),(g==="usa"||g==="north america"&&f===50)&&(i("showsubunits",b),i("subunitcolor"),i("subunitwidth")),_||(p=i("showframe",b),p&&(i("framecolor"),i("framewidth"))),i("bgcolor");var $=i("fitbounds");$&&(delete a.projection.scale,_?(delete a.center.lon,delete a.center.lat):E?(delete a.center.lon,delete a.center.lat,delete a.projection.rotation.lon,delete a.projection.rotation.lat,delete a.lonaxis.range,delete a.lataxis.range):(delete a.center.lon,delete a.center.lat,delete a.projection.rotation.lon))}}}),FE=Ze({"src/plots/geo/index.js"(Z,q){"use strict";var d=Hh().getSubplotCalcData,x=ca().counterRegex,A=jU(),M="geo",e=x(M),t={};t[M]={valType:"subplotid",dflt:M,editType:"calc"};function r(i){for(var n=i._fullLayout,s=i.calcdata,c=n._subplots[M],f=0;f")}}}}),fT=Ze({"src/traces/choropleth/event_data.js"(Z,q){"use strict";q.exports=function(x,A,M,e,t){x.location=A.location,x.z=A.z;var r=e[t];return r.fIn&&r.fIn.properties&&(x.properties=r.fIn.properties),x.ct=r.ct,x}}}),hT=Ze({"src/traces/choropleth/select.js"(Z,q){"use strict";q.exports=function(x,A){var M=x.cd,e=x.xaxis,t=x.yaxis,r=[],o,a,i,n,s;if(A===!1)for(o=0;o=Math.min(U,W)&&T<=Math.max(U,W)?0:1/0}if(L=Math.min(Q,ue)&&l<=Math.max(Q,ue)?0:1/0}B=Math.sqrt(L*L+z*z),u=w[P]}}}else for(P=w.length-1;P>-1;P--)p=w[P],m=g[p],h=v[p],L=c.c2p(m)-T,z=f.c2p(h)-l,F=Math.sqrt(L*L+z*z),F100},Z.isDotSymbol=function(d){return typeof d=="string"?q.DOT_RE.test(d):d>200}}}),ZU=Ze({"src/traces/scattergl/defaults.js"(Z,q){"use strict";var d=ca(),x=oo(),A=dT(),M=_x(),e=Tv(),t=Fu(),r=n1(),o=Qd(),a=md(),i=Dd(),n=ev(),s=zd();q.exports=function(f,g,v,T){function l(u,m){return d.coerce(f,g,M,u,m)}var _=f.marker?A.isOpenSymbol(f.marker.symbol):!1,w=t.isBubble(f),S=r(f,g,T,l);if(!S){g.visible=!1;return}o(f,g,T,l),l("xhoverformat"),l("yhoverformat");var E=S>>1,f=r[c],g=a!==void 0?a(f,o):f-o;g>=0?(s=c,n=c-1):i=c+1}return s}function x(r,o,a,i,n){for(var s=n+1;i<=n;){var c=i+n>>>1,f=r[c],g=a!==void 0?a(f,o):f-o;g>0?(s=c,n=c-1):i=c+1}return s}function A(r,o,a,i,n){for(var s=i-1;i<=n;){var c=i+n>>>1,f=r[c],g=a!==void 0?a(f,o):f-o;g<0?(s=c,i=c+1):n=c-1}return s}function M(r,o,a,i,n){for(var s=i-1;i<=n;){var c=i+n>>>1,f=r[c],g=a!==void 0?a(f,o):f-o;g<=0?(s=c,i=c+1):n=c-1}return s}function e(r,o,a,i,n){for(;i<=n;){var s=i+n>>>1,c=r[s],f=a!==void 0?a(c,o):c-o;if(f===0)return s;f<=0?i=s+1:n=s-1}return-1}function t(r,o,a,i,n,s){return typeof a=="function"?s(r,o,a,i===void 0?0:i|0,n===void 0?r.length-1:n|0):s(r,o,void 0,a===void 0?0:a|0,i===void 0?r.length-1:i|0)}q.exports={ge:function(r,o,a,i,n){return t(r,o,a,i,n,d)},gt:function(r,o,a,i,n){return t(r,o,a,i,n,x)},lt:function(r,o,a,i,n){return t(r,o,a,i,n,A)},le:function(r,o,a,i,n){return t(r,o,a,i,n,M)},eq:function(r,o,a,i,n){return t(r,o,a,i,n,e)}}}}),Ev=Ze({"node_modules/pick-by-alias/index.js"(Z,q){"use strict";q.exports=function(M,e,t){var r={},o,a;if(typeof e=="string"&&(e=x(e)),Array.isArray(e)){var i={};for(a=0;a1&&(A=arguments),typeof A=="string"?A=A.split(/\s/).map(parseFloat):typeof A=="number"&&(A=[A]),A.length&&typeof A[0]=="number"?A.length===1?M={width:A[0],height:A[0],x:0,y:0}:A.length===2?M={width:A[0],height:A[1],x:0,y:0}:M={x:A[0],y:A[1],width:A[2]-A[0]||0,height:A[3]-A[1]||0}:A&&(A=d(A,{left:"x l left Left",top:"y t top Top",width:"w width W Width",height:"h height W Width",bottom:"b bottom Bottom",right:"r right Right"}),M={x:A.left||0,y:A.top||0},A.width==null?A.right?M.width=A.right-M.x:M.width=0:M.width=A.width,A.height==null?A.bottom?M.height=A.bottom-M.y:M.height=0:M.height=A.height),M}}}),vg=Ze({"node_modules/array-bounds/index.js"(Z,q){"use strict";q.exports=d;function d(x,A){if(!x||x.length==null)throw Error("Argument should be an array");A==null?A=1:A=Math.floor(A);for(var M=Array(A*2),e=0;et&&(t=x[o]),x[o]>>1,w;g.dtype||(g.dtype="array"),typeof g.dtype=="string"?w=new(a(g.dtype))(_):g.dtype&&(w=g.dtype,Array.isArray(w)&&(w.length=_));for(let L=0;L<_;++L)w[L]=L;let S=[],E=[],y=[],b=[];u(0,0,1,w,0,1);let p=0;for(let L=0;Lv||I>n){for(let oe=0;oere||W>ce||Q=le||j===ee)return;let be=S[ie];ee===void 0&&(ee=be.length);for(let Ee=j;Ee=B&&fe<=I&&Fe>=O&&Fe<=N&&he.push(_e)}let Ae=E[ie],ze=Ae[j*4+0],Re=Ae[j*4+1],Xe=Ae[j*4+2],it=Ae[j*4+3],ot=$(Ae,j+1),tt=oe*.5,lt=ie+1;G(J,X,tt,lt,ze,Re||Xe||it||ot),G(J,X+tt,tt,lt,Re,Xe||it||ot),G(J+tt,X,tt,lt,Xe,it||ot),G(J+tt,X+tt,tt,lt,it,ot)}function $(J,X){let oe=null,ie=0;for(;oe===null;)if(oe=J[X*4+ie],ie++,ie>J.length)return null;return oe}return he}function h(L,z,F,B,O){let I=[];for(let N=0;N1&&(f=1),f<-1&&(f=-1),c*Math.acos(f)},t=function(a,i,n,s,c,f,g,v,T,l,_,w){var S=Math.pow(c,2),E=Math.pow(f,2),y=Math.pow(_,2),b=Math.pow(w,2),p=S*E-S*b-E*y;p<0&&(p=0),p/=S*b+E*y,p=Math.sqrt(p)*(g===v?-1:1);var u=p*c/f*w,m=p*-f/c*_,h=l*u-T*m+(a+n)/2,P=T*u+l*m+(i+s)/2,L=(_-u)/c,z=(w-m)/f,F=(-_-u)/c,B=(-w-m)/f,O=e(1,0,L,z),I=e(L,z,F,B);return v===0&&I>0&&(I-=x),v===1&&I<0&&(I+=x),[h,P,O,I]},r=function(a){var i=a.px,n=a.py,s=a.cx,c=a.cy,f=a.rx,g=a.ry,v=a.xAxisRotation,T=v===void 0?0:v,l=a.largeArcFlag,_=l===void 0?0:l,w=a.sweepFlag,S=w===void 0?0:w,E=[];if(f===0||g===0)return[];var y=Math.sin(T*x/360),b=Math.cos(T*x/360),p=b*(i-s)/2+y*(n-c)/2,u=-y*(i-s)/2+b*(n-c)/2;if(p===0&&u===0)return[];f=Math.abs(f),g=Math.abs(g);var m=Math.pow(p,2)/Math.pow(f,2)+Math.pow(u,2)/Math.pow(g,2);m>1&&(f*=Math.sqrt(m),g*=Math.sqrt(m));var h=t(i,n,s,c,f,g,_,S,y,b,p,u),P=d(h,4),L=P[0],z=P[1],F=P[2],B=P[3],O=Math.abs(B)/(x/4);Math.abs(1-O)<1e-7&&(O=1);var I=Math.max(Math.ceil(O),1);B/=I;for(var N=0;N4?(o=l[l.length-4],a=l[l.length-3]):(o=f,a=g),r.push(l)}return r}function A(e,t,r,o){return["C",e,t,r,o,r,o]}function M(e,t,r,o,a,i){return["C",e/3+2/3*r,t/3+2/3*o,a/3+2/3*r,i/3+2/3*o,a,i]}}}),NE=Ze({"node_modules/is-svg-path/index.js"(Z,q){"use strict";q.exports=function(x){return typeof x!="string"?!1:(x=x.trim(),!!(/^[mzlhvcsqta]\s*[-+.0-9][^mlhvzcsqta]+/i.test(x)&&/[\dz]$/i.test(x)&&x.length>4))}}}),aj=Ze({"node_modules/svg-path-bounds/index.js"(Z,q){"use strict";var d=M_(),x=BE(),A=rj(),M=NE(),e=Y_();q.exports=t;function t(r){if(Array.isArray(r)&&r.length===1&&typeof r[0]=="string"&&(r=r[0]),typeof r=="string"&&(e(M(r),"String is not an SVG path."),r=d(r)),e(Array.isArray(r),"Argument should be a string or an array of path segments."),r=x(r),r=A(r),!r.length)return[0,0,0,0];for(var o=[1/0,1/0,-1/0,-1/0],a=0,i=r.length;ao[2]&&(o[2]=n[s+0]),n[s+1]>o[3]&&(o[3]=n[s+1]);return o}}}),ij=Ze({"node_modules/normalize-svg-path/index.js"(Z,q){var d=Math.PI,x=o(120);q.exports=A;function A(a){for(var i,n=[],s=0,c=0,f=0,g=0,v=null,T=null,l=0,_=0,w=0,S=a.length;w7&&(n.push(E.splice(0,7)),E.unshift("C"));break;case"S":var b=l,p=_;(i=="C"||i=="S")&&(b+=b-s,p+=p-c),E=["C",b,p,E[1],E[2],E[3],E[4]];break;case"T":i=="Q"||i=="T"?(v=l*2-v,T=_*2-T):(v=l,T=_),E=e(l,_,v,T,E[1],E[2]);break;case"Q":v=E[1],T=E[2],E=e(l,_,E[1],E[2],E[3],E[4]);break;case"L":E=M(l,_,E[1],E[2]);break;case"H":E=M(l,_,E[1],_);break;case"V":E=M(l,_,l,E[1]);break;case"Z":E=M(l,_,f,g);break}i=y,l=E[E.length-2],_=E[E.length-1],E.length>4?(s=E[E.length-4],c=E[E.length-3]):(s=l,c=_),n.push(E)}return n}function M(a,i,n,s){return["C",a,i,n,s,n,s]}function e(a,i,n,s,c,f){return["C",a/3+2/3*n,i/3+2/3*s,c/3+2/3*n,f/3+2/3*s,c,f]}function t(a,i,n,s,c,f,g,v,T,l){if(l)h=l[0],P=l[1],u=l[2],m=l[3];else{var _=r(a,i,-c);a=_.x,i=_.y,_=r(v,T,-c),v=_.x,T=_.y;var w=(a-v)/2,S=(i-T)/2,E=w*w/(n*n)+S*S/(s*s);E>1&&(E=Math.sqrt(E),n=E*n,s=E*s);var y=n*n,b=s*s,p=(f==g?-1:1)*Math.sqrt(Math.abs((y*b-y*S*S-b*w*w)/(y*S*S+b*w*w)));p==1/0&&(p=1);var u=p*n*S/s+(a+v)/2,m=p*-s*w/n+(i+T)/2,h=Math.asin(((i-m)/s).toFixed(9)),P=Math.asin(((T-m)/s).toFixed(9));h=aP&&(h=h-d*2),!g&&P>h&&(P=P-d*2)}if(Math.abs(P-h)>x){var L=P,z=v,F=T;P=h+x*(g&&P>h?1:-1),v=u+n*Math.cos(P),T=m+s*Math.sin(P);var B=t(v,T,n,s,c,0,g,z,F,[P,L,u,m])}var O=Math.tan((P-h)/4),I=4/3*n*O,N=4/3*s*O,U=[2*a-(a+I*Math.sin(h)),2*i-(i-N*Math.cos(h)),v+I*Math.sin(P),T-N*Math.cos(P),v,T];if(l)return U;B&&(U=U.concat(B));for(var W=0;W0?r.strokeStyle="white":r.strokeStyle="black",r.lineWidth=Math.abs(v)),r.translate(c*.5,f*.5),r.scale(_,_),i()){var w=new Path2D(n);r.fill(w),v&&r.stroke(w)}else{var S=x(n);A(r,S),r.fill(),v&&r.stroke()}r.setTransform(1,0,0,1,0,0);var E=e(r,{cutoff:s.cutoff!=null?s.cutoff:.5,radius:s.radius!=null?s.radius:g*.5});return E}var a;function i(){if(a!=null)return a;var n=document.createElement("canvas").getContext("2d");if(n.canvas.width=n.canvas.height=1,!window.Path2D)return a=!1;var s=new Path2D("M0,0h1v1h-1v-1Z");n.fillStyle="black",n.fill(s);var c=n.getImageData(0,0,1,1);return a=c&&c.data&&c.data[3]===255}}}),gg=Ze({"src/traces/scattergl/convert.js"(Z,q){"use strict";var d=ns(),x=sj(),A=h0(),M=oo(),e=ca(),t=e.isArrayOrTypedArray,r=as(),o=$c(),a=em().formatColor,i=Fu(),n=r1(),s=dT(),c=m0(),f=Zm().DESELECTDIM,g={start:1,left:1,end:-1,right:-1,middle:0,center:0,bottom:1,top:-1},v=Qp().appendArrayPointValue;function T(B,O){var I,N={marker:void 0,markerSel:void 0,markerUnsel:void 0,line:void 0,fill:void 0,errorX:void 0,errorY:void 0,text:void 0,textSel:void 0,textUnsel:void 0},U=B._context.plotGlPixelRatio;if(O.visible!==!0)return N;if(i.hasText(O)&&(N.text=l(B,O),N.textSel=E(B,O,O.selected),N.textUnsel=E(B,O,O.unselected)),i.hasMarkers(O)&&(N.marker=w(B,O),N.markerSel=S(B,O,O.selected),N.markerUnsel=S(B,O,O.unselected),!O.unselected&&t(O.marker.opacity))){var W=O.marker.opacity;for(N.markerUnsel.opacity=new Array(W.length),I=0;I500?"bold":"normal":B}function w(B,O){var I=O._length,N=O.marker,U={},W,Q=t(N.symbol),ue=t(N.angle),le=t(N.color),he=t(N.line.color),G=t(N.opacity),$=t(N.size),J=t(N.line.width),X;if(Q||(X=s.isOpenSymbol(N.symbol)),Q||le||he||G||ue){U.symbols=new Array(I),U.angles=new Array(I),U.colors=new Array(I),U.borderColors=new Array(I);var oe=N.symbol,ie=N.angle,j=a(N,N.opacity,I),ee=a(N.line,N.opacity,I);if(!t(ee[0])){var re=ee;for(ee=Array(I),W=0;Wc.TOO_MANY_POINTS||i.hasMarkers(O)?"rect":"round";if(he&&O.connectgaps){var $=W[0],J=W[1];for(Q=0;Q1?le[Q]:le[0]:le,X=t(he)?he.length>1?he[Q]:he[0]:he,oe=g[J],ie=g[X],j=G?G/.8+1:0,ee=-ie*j-ie*.5;W.offset[Q]=[oe*j/$,ee/$]}}return W}q.exports={style:T,markerStyle:w,markerSelection:S,linePositions:L,errorBarPositions:z,textPosition:F}}}),UE=Ze({"src/traces/scattergl/scene_update.js"(Z,q){"use strict";var d=ca();q.exports=function(A,M){var e=M._scene,t={count:0,dirty:!0,lineOptions:[],fillOptions:[],markerOptions:[],markerSelectedOptions:[],markerUnselectedOptions:[],errorXOptions:[],errorYOptions:[],textOptions:[],textSelectedOptions:[],textUnselectedOptions:[],selectBatch:[],unselectBatch:[]},r={fill2d:!1,scatter2d:!1,error2d:!1,line2d:!1,glText:!1,select2d:!1};return M._scene||(e=M._scene={},e.init=function(){d.extendFlat(e,r,t)},e.init(),e.update=function(a){var i=d.repeat(a,e.count);if(e.fill2d&&e.fill2d.update(i),e.scatter2d&&e.scatter2d.update(i),e.line2d&&e.line2d.update(i),e.error2d&&e.error2d.update(i.concat(i)),e.select2d&&e.select2d.update(i),e.glText)for(var n=0;n=f,u=b*2,m={},h,P=S.makeCalcdata(_,"x"),L=E.makeCalcdata(_,"y"),z=e(_,S,"x",P),F=e(_,E,"y",L),B=z.vals,O=F.vals;_._x=B,_._y=O,_.xperiodalignment&&(_._origX=P,_._xStarts=z.starts,_._xEnds=z.ends),_.yperiodalignment&&(_._origY=L,_._yStarts=F.starts,_._yEnds=F.ends);var I=new Array(u),N=new Array(b);for(h=0;h1&&x.extendFlat(y.line,n.linePositions(T,_,w)),y.errorX||y.errorY){var b=n.errorBarPositions(T,_,w,S,E);y.errorX&&x.extendFlat(y.errorX,b.x),y.errorY&&x.extendFlat(y.errorY,b.y)}return y.text&&(x.extendFlat(y.text,{positions:w},n.textPosition(T,_,y.text,y.marker)),x.extendFlat(y.textSel,{positions:w},n.textPosition(T,_,y.text,y.markerSel)),x.extendFlat(y.textUnsel,{positions:w},n.textPosition(T,_,y.text,y.markerUnsel))),y}}}),jE=Ze({"src/traces/scattergl/edit_style.js"(Z,q){"use strict";var d=ca(),x=Yn(),A=Zm().DESELECTDIM;function M(e){var t=e[0],r=t.trace,o=t.t,a=o._scene,i=o.index,n=a.selectBatch[i],s=a.unselectBatch[i],c=a.textOptions[i],f=a.textSelectedOptions[i]||{},g=a.textUnselectedOptions[i]||{},v=d.extendFlat({},c),T,l;if(n.length||s.length){var _=f.color,w=g.color,S=c.color,E=d.isArrayOrTypedArray(S);for(v.color=new Array(r._length),T=0;T>>24,r=(M&16711680)>>>16,o=(M&65280)>>>8,a=M&255;return e===!1?[t,r,o,a]:[t/255,r/255,o/255,a/255]}}}),sh=Ze({"node_modules/object-assign/index.js"(Z,q){"use strict";var d=Object.getOwnPropertySymbols,x=Object.prototype.hasOwnProperty,A=Object.prototype.propertyIsEnumerable;function M(t){if(t==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}function e(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de",Object.getOwnPropertyNames(t)[0]==="5")return!1;for(var r={},o=0;o<10;o++)r["_"+String.fromCharCode(o)]=o;var a=Object.getOwnPropertyNames(r).map(function(n){return r[n]});if(a.join("")!=="0123456789")return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach(function(n){i[n]=n}),Object.keys(Object.assign({},i)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}q.exports=e()?Object.assign:function(t,r){for(var o,a=M(t),i,n=1;nm.length)&&(h=m.length);for(var P=0,L=new Array(h);P 1.0 + delta) { discard; } alpha -= smoothstep(1.0 - delta, 1.0 + delta, radius); float borderRadius = fragBorderRadius; float ratio = smoothstep(borderRadius - delta, borderRadius + delta, radius); vec4 color = mix(fragColor, fragBorderColor, ratio); color.a *= alpha * opacity; gl_FragColor = color; } `]),le.vert=v([`precision highp float; #define GLSLIFY 1 attribute float x, y, xFract, yFract; attribute float size, borderSize; attribute vec4 colorId, borderColorId; attribute float isActive; // \`invariant\` effectively turns off optimizations for the position. // We need this because -fast-math on M1 Macs is re-ordering // floating point operations in a way that causes floating point // precision limits to put points in the wrong locations. invariant gl_Position; uniform bool constPointSize; uniform float pixelRatio; uniform vec2 paletteSize, scale, scaleFract, translate, translateFract; uniform sampler2D paletteTexture; const float maxSize = 100.; varying vec4 fragColor, fragBorderColor; varying float fragBorderRadius, fragWidth; float pointSizeScale = (constPointSize) ? 2. : pixelRatio; bool isDirect = (paletteSize.x < 1.); vec4 getColor(vec4 id) { return isDirect ? id / 255. : texture2D(paletteTexture, vec2( (id.x + .5) / paletteSize.x, (id.y + .5) / paletteSize.y ) ); } void main() { // ignore inactive points if (isActive == 0.) return; vec2 position = vec2(x, y); vec2 positionFract = vec2(xFract, yFract); vec4 color = getColor(colorId); vec4 borderColor = getColor(borderColorId); float size = size * maxSize / 255.; float borderSize = borderSize * maxSize / 255.; gl_PointSize = (size + borderSize) * pointSizeScale; vec2 pos = (position + translate) * scale + (positionFract + translateFract) * scale + (position + translate) * scaleFract + (positionFract + translateFract) * scaleFract; gl_Position = vec4(pos * 2. - 1., 0., 1.); fragBorderRadius = 1. - 2. * borderSize / (size + borderSize); fragColor = color; fragBorderColor = borderColor.a == 0. || borderSize == 0. ? vec4(color.rgb, 0.) : borderColor; fragWidth = 1. / gl_PointSize; } `]),w&&(le.frag=le.frag.replace("smoothstep","smoothStep"),ue.frag=ue.frag.replace("smoothstep","smoothStep")),this.drawCircle=m(le)}b.defaults={color:"black",borderColor:"transparent",borderSize:0,size:12,opacity:1,marker:void 0,viewport:null,range:null,pixelSize:null,count:0,offset:0,bounds:null,positions:[],snap:1e4},b.prototype.render=function(){return arguments.length&&this.update.apply(this,arguments),this.draw(),this},b.prototype.draw=function(){for(var m=this,h=arguments.length,P=new Array(h),L=0;L_e)?lt.tree=f(tt,{bounds:Qe}):_e&&_e.length&&(lt.tree=_e),lt.tree){var Lt={primitive:"points",usage:"static",data:lt.tree,type:"uint32"};lt.elements?lt.elements(Lt):lt.elements=B.elements(Lt)}var kt=S.float32(tt);fe({data:kt,usage:"dynamic"});var Vt=S.fract32(tt,kt);return Fe({data:Vt,usage:"dynamic"}),rt({data:new Uint8Array(st),type:"uint8",usage:"stream"}),tt}},{marker:function(tt,lt,Ee){var _e=lt.activation;if(_e.forEach(function(Vt){return Vt&&Vt.destroy&&Vt.destroy()}),_e.length=0,!tt||typeof tt[0]=="number"){var fe=m.addMarker(tt);_e[fe]=!0}else{for(var Fe=[],rt=0,st=Math.min(tt.length,lt.count);rt=0)return z;var F;if(m instanceof Uint8Array||m instanceof Uint8ClampedArray)F=m;else{F=new Uint8Array(m.length);for(var B=0,O=m.length;BL*4&&(this.tooManyColors=!0),this.updatePalette(P),z.length===1?z[0]:z},b.prototype.updatePalette=function(m){if(!this.tooManyColors){var h=this.maxColors,P=this.paletteTexture,L=Math.ceil(m.length*.25/h);if(L>1){m=m.slice();for(var z=m.length*.25%h;z80*I){ue=he=B[0],le=G=B[1];for(var oe=I;oehe&&(he=$),J>G&&(G=J);X=Math.max(he-ue,G-le),X=X!==0?32767/X:0}return M(W,Q,I,ue,le,X,0),Q}function x(B,O,I,N,U){var W,Q;if(U===F(B,O,I,N)>0)for(W=O;W=O;W-=N)Q=P(W,B[W],B[W+1],Q);return Q&&S(Q,Q.next)&&(L(Q),Q=Q.next),Q}function A(B,O){if(!B)return B;O||(O=B);var I=B,N;do if(N=!1,!I.steiner&&(S(I,I.next)||w(I.prev,I,I.next)===0)){if(L(I),I=O=I.prev,I===I.next)break;N=!0}else I=I.next;while(N||I!==O);return O}function M(B,O,I,N,U,W,Q){if(B){!Q&&W&&f(B,N,U,W);for(var ue=B,le,he;B.prev!==B.next;){if(le=B.prev,he=B.next,W?t(B,N,U,W):e(B)){O.push(le.i/I|0),O.push(B.i/I|0),O.push(he.i/I|0),L(B),B=he.next,ue=he.next;continue}if(B=he,B===ue){Q?Q===1?(B=r(A(B),O,I),M(B,O,I,N,U,W,2)):Q===2&&o(B,O,I,N,U,W):M(A(B),O,I,N,U,W,1);break}}}}function e(B){var O=B.prev,I=B,N=B.next;if(w(O,I,N)>=0)return!1;for(var U=O.x,W=I.x,Q=N.x,ue=O.y,le=I.y,he=N.y,G=UW?U>Q?U:Q:W>Q?W:Q,X=ue>le?ue>he?ue:he:le>he?le:he,oe=N.next;oe!==O;){if(oe.x>=G&&oe.x<=J&&oe.y>=$&&oe.y<=X&&l(U,ue,W,le,Q,he,oe.x,oe.y)&&w(oe.prev,oe,oe.next)>=0)return!1;oe=oe.next}return!0}function t(B,O,I,N){var U=B.prev,W=B,Q=B.next;if(w(U,W,Q)>=0)return!1;for(var ue=U.x,le=W.x,he=Q.x,G=U.y,$=W.y,J=Q.y,X=uele?ue>he?ue:he:le>he?le:he,j=G>$?G>J?G:J:$>J?$:J,ee=v(X,oe,O,I,N),re=v(ie,j,O,I,N),ce=B.prevZ,be=B.nextZ;ce&&ce.z>=ee&&be&&be.z<=re;){if(ce.x>=X&&ce.x<=ie&&ce.y>=oe&&ce.y<=j&&ce!==U&&ce!==Q&&l(ue,G,le,$,he,J,ce.x,ce.y)&&w(ce.prev,ce,ce.next)>=0||(ce=ce.prevZ,be.x>=X&&be.x<=ie&&be.y>=oe&&be.y<=j&&be!==U&&be!==Q&&l(ue,G,le,$,he,J,be.x,be.y)&&w(be.prev,be,be.next)>=0))return!1;be=be.nextZ}for(;ce&&ce.z>=ee;){if(ce.x>=X&&ce.x<=ie&&ce.y>=oe&&ce.y<=j&&ce!==U&&ce!==Q&&l(ue,G,le,$,he,J,ce.x,ce.y)&&w(ce.prev,ce,ce.next)>=0)return!1;ce=ce.prevZ}for(;be&&be.z<=re;){if(be.x>=X&&be.x<=ie&&be.y>=oe&&be.y<=j&&be!==U&&be!==Q&&l(ue,G,le,$,he,J,be.x,be.y)&&w(be.prev,be,be.next)>=0)return!1;be=be.nextZ}return!0}function r(B,O,I){var N=B;do{var U=N.prev,W=N.next.next;!S(U,W)&&E(U,N,N.next,W)&&u(U,W)&&u(W,U)&&(O.push(U.i/I|0),O.push(N.i/I|0),O.push(W.i/I|0),L(N),L(N.next),N=B=W),N=N.next}while(N!==B);return A(N)}function o(B,O,I,N,U,W){var Q=B;do{for(var ue=Q.next.next;ue!==Q.prev;){if(Q.i!==ue.i&&_(Q,ue)){var le=h(Q,ue);Q=A(Q,Q.next),le=A(le,le.next),M(Q,O,I,N,U,W,0),M(le,O,I,N,U,W,0);return}ue=ue.next}Q=Q.next}while(Q!==B)}function a(B,O,I,N){var U=[],W,Q,ue,le,he;for(W=0,Q=O.length;W=I.next.y&&I.next.y!==I.y){var ue=I.x+(U-I.y)*(I.next.x-I.x)/(I.next.y-I.y);if(ue<=N&&ue>W&&(W=ue,Q=I.x=I.x&&I.x>=he&&N!==I.x&&l(UQ.x||I.x===Q.x&&c(Q,I)))&&(Q=I,$=J)),I=I.next;while(I!==le);return Q}function c(B,O){return w(B.prev,B,O.prev)<0&&w(O.next,B,B.next)<0}function f(B,O,I,N){var U=B;do U.z===0&&(U.z=v(U.x,U.y,O,I,N)),U.prevZ=U.prev,U.nextZ=U.next,U=U.next;while(U!==B);U.prevZ.nextZ=null,U.prevZ=null,g(U)}function g(B){var O,I,N,U,W,Q,ue,le,he=1;do{for(I=B,B=null,W=null,Q=0;I;){for(Q++,N=I,ue=0,O=0;O0||le>0&&N;)ue!==0&&(le===0||!N||I.z<=N.z)?(U=I,I=I.nextZ,ue--):(U=N,N=N.nextZ,le--),W?W.nextZ=U:B=U,U.prevZ=W,W=U;I=N}W.nextZ=null,he*=2}while(Q>1);return B}function v(B,O,I,N,U){return B=(B-I)*U|0,O=(O-N)*U|0,B=(B|B<<8)&16711935,B=(B|B<<4)&252645135,B=(B|B<<2)&858993459,B=(B|B<<1)&1431655765,O=(O|O<<8)&16711935,O=(O|O<<4)&252645135,O=(O|O<<2)&858993459,O=(O|O<<1)&1431655765,B|O<<1}function T(B){var O=B,I=B;do(O.x=(B-Q)*(W-ue)&&(B-Q)*(N-ue)>=(I-Q)*(O-ue)&&(I-Q)*(W-ue)>=(U-Q)*(N-ue)}function _(B,O){return B.next.i!==O.i&&B.prev.i!==O.i&&!p(B,O)&&(u(B,O)&&u(O,B)&&m(B,O)&&(w(B.prev,B,O.prev)||w(B,O.prev,O))||S(B,O)&&w(B.prev,B,B.next)>0&&w(O.prev,O,O.next)>0)}function w(B,O,I){return(O.y-B.y)*(I.x-O.x)-(O.x-B.x)*(I.y-O.y)}function S(B,O){return B.x===O.x&&B.y===O.y}function E(B,O,I,N){var U=b(w(B,O,I)),W=b(w(B,O,N)),Q=b(w(I,N,B)),ue=b(w(I,N,O));return!!(U!==W&&Q!==ue||U===0&&y(B,I,O)||W===0&&y(B,N,O)||Q===0&&y(I,B,N)||ue===0&&y(I,O,N))}function y(B,O,I){return O.x<=Math.max(B.x,I.x)&&O.x>=Math.min(B.x,I.x)&&O.y<=Math.max(B.y,I.y)&&O.y>=Math.min(B.y,I.y)}function b(B){return B>0?1:B<0?-1:0}function p(B,O){var I=B;do{if(I.i!==B.i&&I.next.i!==B.i&&I.i!==O.i&&I.next.i!==O.i&&E(I,I.next,B,O))return!0;I=I.next}while(I!==B);return!1}function u(B,O){return w(B.prev,B,B.next)<0?w(B,O,B.next)>=0&&w(B,B.prev,O)>=0:w(B,O,B.prev)<0||w(B,B.next,O)<0}function m(B,O){var I=B,N=!1,U=(B.x+O.x)/2,W=(B.y+O.y)/2;do I.y>W!=I.next.y>W&&I.next.y!==I.y&&U<(I.next.x-I.x)*(W-I.y)/(I.next.y-I.y)+I.x&&(N=!N),I=I.next;while(I!==B);return N}function h(B,O){var I=new z(B.i,B.x,B.y),N=new z(O.i,O.x,O.y),U=B.next,W=O.prev;return B.next=O,O.prev=B,I.next=U,U.prev=I,N.next=I,I.prev=N,W.next=N,N.prev=W,N}function P(B,O,I,N){var U=new z(B,O,I);return N?(U.next=N.next,U.prev=N,N.next.prev=U,N.next=U):(U.prev=U,U.next=U),U}function L(B){B.next.prev=B.prev,B.prev.next=B.next,B.prevZ&&(B.prevZ.nextZ=B.nextZ),B.nextZ&&(B.nextZ.prevZ=B.prevZ)}function z(B,O,I){this.i=B,this.x=O,this.y=I,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}d.deviation=function(B,O,I,N){var U=O&&O.length,W=U?O[0]*I:B.length,Q=Math.abs(F(B,0,W,I));if(U)for(var ue=0,le=O.length;ue0&&(N+=B[U-1].length,I.holes.push(N))}return I}}}),dj=Ze({"node_modules/array-normalize/index.js"(Z,q){"use strict";var d=vg();q.exports=x;function x(A,M,e){if(!A||A.length==null)throw Error("Argument should be an array");M==null&&(M=1),e==null&&(e=d(A,M));for(var t=0;t-1}}}),KE=Ze({"node_modules/es5-ext/string/#/contains/index.js"(Z,q){"use strict";q.exports=Ej()()?String.prototype.contains:Cj()}}),rm=Ze({"node_modules/d/index.js"(Z,q){"use strict";var d=yg(),x=ZE(),A=_T(),M=YE(),e=KE(),t=q.exports=function(r,o){var a,i,n,s,c;return arguments.length<2||typeof r!="string"?(s=o,o=r,r=null):s=arguments[2],d(r)?(a=e.call(r,"c"),i=e.call(r,"e"),n=e.call(r,"w")):(a=n=!0,i=!1),c={value:o,configurable:a,enumerable:i,writable:n},s?A(M(s),c):c};t.gs=function(r,o,a){var i,n,s,c;return typeof r!="string"?(s=a,a=o,o=r,r=null):s=arguments[3],d(o)?x(o)?d(a)?x(a)||(s=a,a=void 0):a=void 0:(s=o,o=a=void 0):o=void 0,d(r)?(i=e.call(r,"c"),n=e.call(r,"e")):(i=!0,n=!1),c={get:o,set:a,configurable:i,enumerable:n},s?A(M(s),c):c}}}),xx=Ze({"node_modules/es5-ext/function/is-arguments.js"(Z,q){"use strict";var d=Object.prototype.toString,x=d.call(function(){return arguments}());q.exports=function(A){return d.call(A)===x}}}),bx=Ze({"node_modules/es5-ext/string/is-string.js"(Z,q){"use strict";var d=Object.prototype.toString,x=d.call("");q.exports=function(A){return typeof A=="string"||A&&typeof A=="object"&&(A instanceof String||d.call(A)===x)||!1}}}),kj=Ze({"node_modules/ext/global-this/is-implemented.js"(Z,q){"use strict";q.exports=function(){return typeof globalThis!="object"||!globalThis?!1:globalThis.Array===Array}}}),Lj=Ze({"node_modules/ext/global-this/implementation.js"(Z,q){var d=function(){if(typeof self=="object"&&self)return self;if(typeof window=="object"&&window)return window;throw new Error("Unable to resolve global `this`")};q.exports=function(){if(this)return this;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:!0})}catch{return d()}try{return __global__||d()}finally{delete Object.prototype.__global__}}()}}),wx=Ze({"node_modules/ext/global-this/index.js"(Z,q){"use strict";q.exports=kj()()?globalThis:Lj()}}),Pj=Ze({"node_modules/es6-symbol/is-implemented.js"(Z,q){"use strict";var d=wx(),x={object:!0,symbol:!0};q.exports=function(){var A=d.Symbol,M;if(typeof A!="function")return!1;M=A("test symbol");try{String(M)}catch{return!1}return!(!x[typeof A.iterator]||!x[typeof A.toPrimitive]||!x[typeof A.toStringTag])}}}),Ij=Ze({"node_modules/es6-symbol/is-symbol.js"(Z,q){"use strict";q.exports=function(d){return d?typeof d=="symbol"?!0:!d.constructor||d.constructor.name!=="Symbol"?!1:d[d.constructor.toStringTag]==="Symbol":!1}}}),JE=Ze({"node_modules/es6-symbol/validate-symbol.js"(Z,q){"use strict";var d=Ij();q.exports=function(x){if(!d(x))throw new TypeError(x+" is not a symbol");return x}}}),Rj=Ze({"node_modules/es6-symbol/lib/private/generate-name.js"(Z,q){"use strict";var d=rm(),x=Object.create,A=Object.defineProperty,M=Object.prototype,e=x(null);q.exports=function(t){for(var r=0,o,a;e[t+(r||"")];)++r;return t+=r||"",e[t]=!0,o="@@"+t,A(M,o,d.gs(null,function(i){a||(a=!0,A(this,o,d(i)),a=!1)})),o}}}),Dj=Ze({"node_modules/es6-symbol/lib/private/setup/standard-symbols.js"(Z,q){"use strict";var d=rm(),x=wx().Symbol;q.exports=function(A){return Object.defineProperties(A,{hasInstance:d("",x&&x.hasInstance||A("hasInstance")),isConcatSpreadable:d("",x&&x.isConcatSpreadable||A("isConcatSpreadable")),iterator:d("",x&&x.iterator||A("iterator")),match:d("",x&&x.match||A("match")),replace:d("",x&&x.replace||A("replace")),search:d("",x&&x.search||A("search")),species:d("",x&&x.species||A("species")),split:d("",x&&x.split||A("split")),toPrimitive:d("",x&&x.toPrimitive||A("toPrimitive")),toStringTag:d("",x&&x.toStringTag||A("toStringTag")),unscopables:d("",x&&x.unscopables||A("unscopables"))})}}}),zj=Ze({"node_modules/es6-symbol/lib/private/setup/symbol-registry.js"(Z,q){"use strict";var d=rm(),x=JE(),A=Object.create(null);q.exports=function(M){return Object.defineProperties(M,{for:d(function(e){return A[e]?A[e]:A[e]=M(String(e))}),keyFor:d(function(e){var t;x(e);for(t in A)if(A[t]===e)return t})})}}}),Fj=Ze({"node_modules/es6-symbol/polyfill.js"(Z,q){"use strict";var d=rm(),x=JE(),A=wx().Symbol,M=Rj(),e=Dj(),t=zj(),r=Object.create,o=Object.defineProperties,a=Object.defineProperty,i,n,s;if(typeof A=="function")try{String(A()),s=!0}catch{}else A=null;n=function(f){if(this instanceof n)throw new TypeError("Symbol is not a constructor");return i(f)},q.exports=i=function c(f){var g;if(this instanceof c)throw new TypeError("Symbol is not a constructor");return s?A(f):(g=r(n.prototype),f=f===void 0?"":String(f),o(g,{__description__:d("",f),__name__:d("",M(f))}))},e(i),t(i),o(n.prototype,{constructor:d(i),toString:d("",function(){return this.__name__})}),o(i.prototype,{toString:d(function(){return"Symbol ("+x(this).__description__+")"}),valueOf:d(function(){return x(this)})}),a(i.prototype,i.toPrimitive,d("",function(){var c=x(this);return typeof c=="symbol"?c:c.toString()})),a(i.prototype,i.toStringTag,d("c","Symbol")),a(n.prototype,i.toStringTag,d("c",i.prototype[i.toStringTag])),a(n.prototype,i.toPrimitive,d("c",i.prototype[i.toPrimitive]))}}),y0=Ze({"node_modules/es6-symbol/index.js"(Z,q){"use strict";q.exports=Pj()()?wx().Symbol:Fj()}}),Oj=Ze({"node_modules/es5-ext/array/#/clear.js"(Z,q){"use strict";var d=tm();q.exports=function(){return d(this).length=0,this}}}),L1=Ze({"node_modules/es5-ext/object/valid-callable.js"(Z,q){"use strict";q.exports=function(d){if(typeof d!="function")throw new TypeError(d+" is not a function");return d}}}),Bj=Ze({"node_modules/type/string/coerce.js"(Z,q){"use strict";var d=yg(),x=yT(),A=Object.prototype.toString;q.exports=function(M){if(!d(M))return null;if(x(M)){var e=M.toString;if(typeof e!="function"||e===A)return null}try{return""+M}catch{return null}}}}),Nj=Ze({"node_modules/type/lib/safe-to-string.js"(Z,q){"use strict";q.exports=function(d){try{return d.toString()}catch{try{return String(d)}catch{return null}}}}}),Uj=Ze({"node_modules/type/lib/to-short-string.js"(Z,q){"use strict";var d=Nj(),x=/[\n\r\u2028\u2029]/g;q.exports=function(A){var M=d(A);return M===null?"":(M.length>100&&(M=M.slice(0,99)+"\u2026"),M=M.replace(x,function(e){switch(e){case` `:return"\\n";case"\r":return"\\r";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw new Error("Unexpected character")}}),M)}}}),$E=Ze({"node_modules/type/lib/resolve-exception.js"(Z,q){"use strict";var d=yg(),x=yT(),A=Bj(),M=Uj(),e=function(t,r){return t.replace("%v",M(r))};q.exports=function(t,r,o){if(!x(o))throw new TypeError(e(r,t));if(!d(t)){if("default"in o)return o.default;if(o.isOptional)return null}var a=A(o.errorMessage);throw d(a)||(a=r),new TypeError(e(a,t))}}}),jj=Ze({"node_modules/type/value/ensure.js"(Z,q){"use strict";var d=$E(),x=yg();q.exports=function(A){return x(A)?A:d(A,"Cannot use %v",arguments[1])}}}),qj=Ze({"node_modules/type/plain-function/ensure.js"(Z,q){"use strict";var d=$E(),x=ZE();q.exports=function(A){return x(A)?A:d(A,"%v is not a plain function",arguments[1])}}}),Vj=Ze({"node_modules/es5-ext/array/from/is-implemented.js"(Z,q){"use strict";q.exports=function(){var d=Array.from,x,A;return typeof d!="function"?!1:(x=["raz","dwa"],A=d(x),!!(A&&A!==x&&A[1]==="dwa"))}}}),Gj=Ze({"node_modules/es5-ext/function/is-function.js"(Z,q){"use strict";var d=Object.prototype.toString,x=RegExp.prototype.test.bind(/^[object [A-Za-z0-9]*Function]$/);q.exports=function(A){return typeof A=="function"&&x(d.call(A))}}}),Hj=Ze({"node_modules/es5-ext/math/sign/is-implemented.js"(Z,q){"use strict";q.exports=function(){var d=Math.sign;return typeof d!="function"?!1:d(10)===1&&d(-20)===-1}}}),Wj=Ze({"node_modules/es5-ext/math/sign/shim.js"(Z,q){"use strict";q.exports=function(d){return d=Number(d),isNaN(d)||d===0?d:d>0?1:-1}}}),Xj=Ze({"node_modules/es5-ext/math/sign/index.js"(Z,q){"use strict";q.exports=Hj()()?Math.sign:Wj()}}),Zj=Ze({"node_modules/es5-ext/number/to-integer.js"(Z,q){"use strict";var d=Xj(),x=Math.abs,A=Math.floor;q.exports=function(M){return isNaN(M)?0:(M=Number(M),M===0||!isFinite(M)?M:d(M)*A(x(M)))}}}),Yj=Ze({"node_modules/es5-ext/number/to-pos-integer.js"(Z,q){"use strict";var d=Zj(),x=Math.max;q.exports=function(A){return x(0,d(A))}}}),Kj=Ze({"node_modules/es5-ext/array/from/shim.js"(Z,q){"use strict";var d=y0().iterator,x=xx(),A=Gj(),M=Yj(),e=L1(),t=tm(),r=g0(),o=bx(),a=Array.isArray,i=Function.prototype.call,n={configurable:!0,enumerable:!0,writable:!0,value:null},s=Object.defineProperty;q.exports=function(c){var f=arguments[1],g=arguments[2],v,T,l,_,w,S,E,y,b,p;if(c=Object(t(c)),r(f)&&e(f),!this||this===Array||!A(this)){if(!f){if(x(c))return w=c.length,w!==1?Array.apply(null,c):(_=new Array(1),_[0]=c[0],_);if(a(c)){for(_=new Array(w=c.length),T=0;T=55296&&S<=56319&&(p+=c[++T])),p=f?i.call(f,g,p,l):p,v?(n.value=p,s(_,l,n)):_[l]=p,++l;w=l}}if(w===void 0)for(w=M(c.length),v&&(_=new v(w)),T=0;T=this.__nextIndex__)){if(++this.__nextIndex__,!this.__redo__){o(this,"__redo__",e("c",[n]));return}this.__redo__.forEach(function(s,c){s>=n&&(this.__redo__[c]=++s)},this),this.__redo__.push(n)}}),_onDelete:e(function(n){var s;n>=this.__nextIndex__||(--this.__nextIndex__,this.__redo__&&(s=this.__redo__.indexOf(n),s!==-1&&this.__redo__.splice(s,1),this.__redo__.forEach(function(c,f){c>n&&(this.__redo__[f]=--c)},this)))}),_onClear:e(function(){this.__redo__&&d.call(this.__redo__),this.__nextIndex__=0})}))),o(i.prototype,r.iterator,e(function(){return this}))}}),aq=Ze({"node_modules/es6-iterator/array.js"(Z,q){"use strict";var d=gT(),x=KE(),A=rm(),M=y0(),e=QE(),t=Object.defineProperty,r;r=q.exports=function(o,a){if(!(this instanceof r))throw new TypeError("Constructor requires 'new'");e.call(this,o),a?x.call(a,"key+value")?a="key+value":x.call(a,"key")?a="key":a="value":a="value",t(this,"__kind__",A("",a))},d&&d(r,e),delete r.prototype.constructor,r.prototype=Object.create(e.prototype,{_resolve:A(function(o){return this.__kind__==="value"?this.__list__[o]:this.__kind__==="key+value"?[o,this.__list__[o]]:o})}),t(r.prototype,M.toStringTag,A("c","Array Iterator"))}}),iq=Ze({"node_modules/es6-iterator/string.js"(Z,q){"use strict";var d=gT(),x=rm(),A=y0(),M=QE(),e=Object.defineProperty,t;t=q.exports=function(r){if(!(this instanceof t))throw new TypeError("Constructor requires 'new'");r=String(r),M.call(this,r),e(this,"__length__",x("",r.length))},d&&d(t,M),delete t.prototype.constructor,t.prototype=Object.create(M.prototype,{_next:x(function(){if(this.__list__){if(this.__nextIndex__=55296&&a<=56319?o+this.__list__[this.__nextIndex__++]:o)})}),e(t.prototype,A.toStringTag,x("c","String Iterator"))}}),nq=Ze({"node_modules/es6-iterator/is-iterable.js"(Z,q){"use strict";var d=xx(),x=g0(),A=bx(),M=y0().iterator,e=Array.isArray;q.exports=function(t){return x(t)?e(t)||A(t)||d(t)?!0:typeof t[M]=="function":!1}}}),oq=Ze({"node_modules/es6-iterator/valid-iterable.js"(Z,q){"use strict";var d=nq();q.exports=function(x){if(!d(x))throw new TypeError(x+" is not iterable");return x}}}),e6=Ze({"node_modules/es6-iterator/get.js"(Z,q){"use strict";var d=xx(),x=bx(),A=aq(),M=iq(),e=oq(),t=y0().iterator;q.exports=function(r){return typeof e(r)[t]=="function"?r[t]():d(r)?new A(r):x(r)?new M(r):new A(r)}}}),sq=Ze({"node_modules/es6-iterator/for-of.js"(Z,q){"use strict";var d=xx(),x=L1(),A=bx(),M=e6(),e=Array.isArray,t=Function.prototype.call,r=Array.prototype.some;q.exports=function(o,a){var i,n=arguments[2],s,c,f,g,v,T,l;if(e(o)||d(o)?i="array":A(o)?i="string":o=M(o),x(a),c=function(){f=!0},i==="array"){r.call(o,function(_){return t.call(a,n,_,c),f});return}if(i==="string"){for(v=o.length,g=0;g=55296&&l<=56319&&(T+=o[++g])),t.call(a,n,T,c),!f);++g);return}for(s=o.next();!s.done;){if(t.call(a,n,s.value,c),f)return;s=o.next()}}}}),lq=Ze({"node_modules/es6-weak-map/is-native-implemented.js"(Z,q){"use strict";q.exports=function(){return typeof WeakMap!="function"?!1:Object.prototype.toString.call(new WeakMap)==="[object WeakMap]"}()}}),uq=Ze({"node_modules/es6-weak-map/polyfill.js"(Z,q){"use strict";var d=g0(),x=gT(),A=yj(),M=tm(),e=_j(),t=rm(),r=e6(),o=sq(),a=y0().toStringTag,i=lq(),n=Array.isArray,s=Object.defineProperty,c=Object.prototype.hasOwnProperty,f=Object.getPrototypeOf,g;q.exports=g=function(){var v=arguments[0],T;if(!(this instanceof g))throw new TypeError("Constructor requires 'new'");return T=i&&x&&WeakMap!==g?x(new WeakMap,f(this)):this,d(v)&&(n(v)||(v=r(v))),s(T,"__weakMapData__",t("c","$weakMap$"+e())),v&&o(v,function(l){M(l),T.set(l[0],l[1])}),T},i&&(x&&x(g,WeakMap),g.prototype=Object.create(WeakMap.prototype,{constructor:t(g)})),Object.defineProperties(g.prototype,{delete:t(function(v){return c.call(A(v),this.__weakMapData__)?(delete v[this.__weakMapData__],!0):!1}),get:t(function(v){if(c.call(A(v),this.__weakMapData__))return v[this.__weakMapData__]}),has:t(function(v){return c.call(A(v),this.__weakMapData__)}),set:t(function(v,T){return s(A(v),this.__weakMapData__,t("c",T)),this}),toString:t(function(){return"[object WeakMap]"})}),s(g.prototype,a,t("c","WeakMap"))}}),t6=Ze({"node_modules/es6-weak-map/index.js"(Z,q){"use strict";q.exports=vj()()?WeakMap:uq()}}),cq=Ze({"node_modules/array-find-index/index.js"(Z,q){"use strict";q.exports=function(d,x,A){if(typeof Array.prototype.findIndex=="function")return d.findIndex(x,A);if(typeof x!="function")throw new TypeError("predicate must be a function");var M=Object(d),e=M.length;if(e===0)return-1;for(var t=0;t 0. && baClipping < length(normalWidth * endBotJoin)) { //handle miter clipping bTopCoord -= normalWidth * endTopJoin; bTopCoord += normalize(endTopJoin * normalWidth) * baClipping; } if (nextReverse) { //make join rectangular vec2 miterShift = normalWidth * endJoinDirection * miterLimit * .5; float normalAdjust = 1. - min(miterLimit / endMiterRatio, 1.); bBotCoord = bCoord + miterShift - normalAdjust * normalWidth * currNormal * .5; bTopCoord = bCoord + miterShift + normalAdjust * normalWidth * currNormal * .5; } else if (!prevReverse && abClipping > 0. && abClipping < length(normalWidth * startBotJoin)) { //handle miter clipping aBotCoord -= normalWidth * startBotJoin; aBotCoord += normalize(startBotJoin * normalWidth) * abClipping; } vec2 aTopPosition = (aTopCoord) * adjustedScale + translate; vec2 aBotPosition = (aBotCoord) * adjustedScale + translate; vec2 bTopPosition = (bTopCoord) * adjustedScale + translate; vec2 bBotPosition = (bBotCoord) * adjustedScale + translate; //position is normalized 0..1 coord on the screen vec2 position = (aTopPosition * lineTop + aBotPosition * lineBot) * lineStart + (bTopPosition * lineTop + bBotPosition * lineBot) * lineEnd; startCoord = aCoord * scaleRatio + translate * viewport.zw + viewport.xy; endCoord = bCoord * scaleRatio + translate * viewport.zw + viewport.xy; gl_Position = vec4(position * 2.0 - 1.0, depth, 1); enableStartMiter = step(dot(currTangent, prevTangent), .5); enableEndMiter = step(dot(currTangent, nextTangent), .5); //bevel miter cutoffs if (miterMode == 1.) { if (enableStartMiter == 1.) { vec2 startMiterWidth = vec2(startJoinDirection) * thickness * miterLimit * .5; startCutoff = vec4(aCoord, aCoord); startCutoff.zw += vec2(-startJoinDirection.y, startJoinDirection.x) / scaleRatio; startCutoff = startCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw; startCutoff += viewport.xyxy; startCutoff += startMiterWidth.xyxy; } if (enableEndMiter == 1.) { vec2 endMiterWidth = vec2(endJoinDirection) * thickness * miterLimit * .5; endCutoff = vec4(bCoord, bCoord); endCutoff.zw += vec2(-endJoinDirection.y, endJoinDirection.x) / scaleRatio; endCutoff = endCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw; endCutoff += viewport.xyxy; endCutoff += endMiterWidth.xyxy; } } //round miter cutoffs else if (miterMode == 2.) { if (enableStartMiter == 1.) { vec2 startMiterWidth = vec2(startJoinDirection) * thickness * abs(dot(startJoinDirection, currNormal)) * .5; startCutoff = vec4(aCoord, aCoord); startCutoff.zw += vec2(-startJoinDirection.y, startJoinDirection.x) / scaleRatio; startCutoff = startCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw; startCutoff += viewport.xyxy; startCutoff += startMiterWidth.xyxy; } if (enableEndMiter == 1.) { vec2 endMiterWidth = vec2(endJoinDirection) * thickness * abs(dot(endJoinDirection, currNormal)) * .5; endCutoff = vec4(bCoord, bCoord); endCutoff.zw += vec2(-endJoinDirection.y, endJoinDirection.x) / scaleRatio; endCutoff = endCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw; endCutoff += viewport.xyxy; endCutoff += endMiterWidth.xyxy; } } } `,l=` precision highp float; uniform float dashLength, pixelRatio, thickness, opacity, id, miterMode; uniform sampler2D dashTexture; varying vec4 fragColor; varying vec2 tangent; varying vec4 startCutoff, endCutoff; varying vec2 startCoord, endCoord; varying float enableStartMiter, enableEndMiter; float distToLine(vec2 p, vec2 a, vec2 b) { vec2 diff = b - a; vec2 perp = normalize(vec2(-diff.y, diff.x)); return dot(p - a, perp); } void main() { float alpha = 1., distToStart, distToEnd; float cutoff = thickness * .5; //bevel miter if (miterMode == 1.) { if (enableStartMiter == 1.) { distToStart = distToLine(gl_FragCoord.xy, startCutoff.xy, startCutoff.zw); if (distToStart < -1.) { discard; return; } alpha *= min(max(distToStart + 1., 0.), 1.); } if (enableEndMiter == 1.) { distToEnd = distToLine(gl_FragCoord.xy, endCutoff.xy, endCutoff.zw); if (distToEnd < -1.) { discard; return; } alpha *= min(max(distToEnd + 1., 0.), 1.); } } // round miter else if (miterMode == 2.) { if (enableStartMiter == 1.) { distToStart = distToLine(gl_FragCoord.xy, startCutoff.xy, startCutoff.zw); if (distToStart < 0.) { float radius = length(gl_FragCoord.xy - startCoord); if(radius > cutoff + .5) { discard; return; } alpha -= smoothstep(cutoff - .5, cutoff + .5, radius); } } if (enableEndMiter == 1.) { distToEnd = distToLine(gl_FragCoord.xy, endCutoff.xy, endCutoff.zw); if (distToEnd < 0.) { float radius = length(gl_FragCoord.xy - endCoord); if(radius > cutoff + .5) { discard; return; } alpha -= smoothstep(cutoff - .5, cutoff + .5, radius); } } } float t = fract(dot(tangent, gl_FragCoord.xy) / dashLength) * .5 + .25; float dash = texture2D(dashTexture, vec2(t, .5)).r; gl_FragColor = fragColor; gl_FragColor.a *= alpha * opacity * dash; } `;q.exports=_;function _(w,S){if(!(this instanceof _))return new _(w,S);if(typeof w=="function"?(S||(S={}),S.regl=w):S=w,S.length&&(S.positions=S),w=S.regl,!w.hasExtension("ANGLE_instanced_arrays"))throw Error("regl-error2d: `ANGLE_instanced_arrays` extension should be enabled");this.gl=w._gl,this.regl=w,this.passes=[],this.shaders=_.shaders.has(w)?_.shaders.get(w):_.shaders.set(w,_.createShaders(w)).get(w),this.update(S)}_.dashMult=2,_.maxPatternLength=256,_.precisionThreshold=3e6,_.maxPoints=1e4,_.maxLines=2048,_.shaders=new i,_.createShaders=function(w){let S=w.buffer({usage:"static",type:"float",data:[0,1,0,0,1,1,1,0]}),E={primitive:"triangle strip",instances:w.prop("count"),count:4,offset:0,uniforms:{miterMode:(u,m)=>m.join==="round"?2:1,miterLimit:w.prop("miterLimit"),scale:w.prop("scale"),scaleFract:w.prop("scaleFract"),translateFract:w.prop("translateFract"),translate:w.prop("translate"),thickness:w.prop("thickness"),dashTexture:w.prop("dashTexture"),opacity:w.prop("opacity"),pixelRatio:w.context("pixelRatio"),id:w.prop("id"),dashLength:w.prop("dashLength"),viewport:(u,m)=>[m.viewport.x,m.viewport.y,u.viewportWidth,u.viewportHeight],depth:w.prop("depth")},blend:{enable:!0,color:[0,0,0,0],equation:{rgb:"add",alpha:"add"},func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},depth:{enable:(u,m)=>!m.overlay},stencil:{enable:!1},scissor:{enable:!0,box:w.prop("viewport")},viewport:w.prop("viewport")},y=w(A({vert:c,frag:f,attributes:{lineEnd:{buffer:S,divisor:0,stride:8,offset:0},lineTop:{buffer:S,divisor:0,stride:8,offset:4},aCoord:{buffer:w.prop("positionBuffer"),stride:8,offset:8,divisor:1},bCoord:{buffer:w.prop("positionBuffer"),stride:8,offset:16,divisor:1},aCoordFract:{buffer:w.prop("positionFractBuffer"),stride:8,offset:8,divisor:1},bCoordFract:{buffer:w.prop("positionFractBuffer"),stride:8,offset:16,divisor:1},color:{buffer:w.prop("colorBuffer"),stride:4,offset:0,divisor:1}}},E)),b;try{b=w(A({cull:{enable:!0,face:"back"},vert:T,frag:l,attributes:{lineEnd:{buffer:S,divisor:0,stride:8,offset:0},lineTop:{buffer:S,divisor:0,stride:8,offset:4},aColor:{buffer:w.prop("colorBuffer"),stride:4,offset:0,divisor:1},bColor:{buffer:w.prop("colorBuffer"),stride:4,offset:4,divisor:1},prevCoord:{buffer:w.prop("positionBuffer"),stride:8,offset:0,divisor:1},aCoord:{buffer:w.prop("positionBuffer"),stride:8,offset:8,divisor:1},bCoord:{buffer:w.prop("positionBuffer"),stride:8,offset:16,divisor:1},nextCoord:{buffer:w.prop("positionBuffer"),stride:8,offset:24,divisor:1}}},E))}catch{b=y}return{fill:w({primitive:"triangle",elements:(u,m)=>m.triangles,offset:0,vert:g,frag:v,uniforms:{scale:w.prop("scale"),color:w.prop("fill"),scaleFract:w.prop("scaleFract"),translateFract:w.prop("translateFract"),translate:w.prop("translate"),opacity:w.prop("opacity"),pixelRatio:w.context("pixelRatio"),id:w.prop("id"),viewport:(u,m)=>[m.viewport.x,m.viewport.y,u.viewportWidth,u.viewportHeight]},attributes:{position:{buffer:w.prop("positionBuffer"),stride:8,offset:8},positionFract:{buffer:w.prop("positionFractBuffer"),stride:8,offset:8}},blend:E.blend,depth:{enable:!1},scissor:E.scissor,stencil:E.stencil,viewport:E.viewport}),rect:y,miter:b}},_.defaults={dashes:null,join:"miter",miterLimit:1,thickness:10,cap:"square",color:"black",opacity:1,overlay:!1,viewport:null,range:null,close:!1,fill:null},_.prototype.render=function(...w){w.length&&this.update(...w),this.draw()},_.prototype.draw=function(...w){return(w.length?w:this.passes).forEach((S,E)=>{if(S&&Array.isArray(S))return this.draw(...S);typeof S=="number"&&(S=this.passes[S]),S&&S.count>1&&S.opacity&&(this.regl._refresh(),S.fill&&S.triangles&&S.triangles.length>2&&this.shaders.fill(S),S.thickness&&(S.scale[0]*S.viewport.width>_.precisionThreshold||S.scale[1]*S.viewport.height>_.precisionThreshold?this.shaders.rect(S):S.join==="rect"||!S.join&&(S.thickness<=2||S.count>=_.maxPoints)?this.shaders.rect(S):this.shaders.miter(S)))}),this},_.prototype.update=function(w){if(!w)return;w.length!=null?typeof w[0]=="number"&&(w=[{positions:w}]):Array.isArray(w)||(w=[w]);let{regl:S,gl:E}=this;if(w.forEach((b,p)=>{let u=this.passes[p];if(b!==void 0){if(b===null){this.passes[p]=null;return}if(typeof b[0]=="number"&&(b={positions:b}),b=M(b,{positions:"positions points data coords",thickness:"thickness lineWidth lineWidths line-width linewidth width stroke-width strokewidth strokeWidth",join:"lineJoin linejoin join type mode",miterLimit:"miterlimit miterLimit",dashes:"dash dashes dasharray dash-array dashArray",color:"color colour stroke colors colours stroke-color strokeColor",fill:"fill fill-color fillColor",opacity:"alpha opacity",overlay:"overlay crease overlap intersect",close:"closed close closed-path closePath",range:"range dataBox",viewport:"viewport viewBox",hole:"holes hole hollow",splitNull:"splitNull"}),u||(this.passes[p]=u={id:p,scale:null,scaleFract:null,translate:null,translateFract:null,count:0,hole:[],depth:0,dashLength:1,dashTexture:S.texture({channels:1,data:new Uint8Array([255]),width:1,height:1,mag:"linear",min:"linear"}),colorBuffer:S.buffer({usage:"dynamic",type:"uint8",data:new Uint8Array}),positionBuffer:S.buffer({usage:"dynamic",type:"float",data:new Uint8Array}),positionFractBuffer:S.buffer({usage:"dynamic",type:"float",data:new Uint8Array})},b=A({},_.defaults,b)),b.thickness!=null&&(u.thickness=parseFloat(b.thickness)),b.opacity!=null&&(u.opacity=parseFloat(b.opacity)),b.miterLimit!=null&&(u.miterLimit=parseFloat(b.miterLimit)),b.overlay!=null&&(u.overlay=!!b.overlay,p<_.maxLines&&(u.depth=2*(_.maxLines-1-p%_.maxLines)/_.maxLines-1)),b.join!=null&&(u.join=b.join),b.hole!=null&&(u.hole=b.hole),b.fill!=null&&(u.fill=b.fill?d(b.fill,"uint8"):null),b.viewport!=null&&(u.viewport=n(b.viewport)),u.viewport||(u.viewport=n([E.drawingBufferWidth,E.drawingBufferHeight])),b.close!=null&&(u.close=b.close),b.positions===null&&(b.positions=[]),b.positions){let P,L;if(b.positions.x&&b.positions.y){let O=b.positions.x,I=b.positions.y;L=u.count=Math.max(O.length,I.length),P=new Float64Array(L*2);for(let N=0;Nle-he),W=[],Q=0,ue=u.hole!=null?u.hole[0]:null;if(ue!=null){let le=s(U,he=>he>=ue);U=U.slice(0,le),U.push(ue)}for(let le=0;leJ-ue+(U[le]-Q)),$=t(he,G);$=$.map(J=>J+Q+(J+Q{w.colorBuffer.destroy(),w.positionBuffer.destroy(),w.dashTexture.destroy()}),this.passes.length=0,this}}}),fq=Ze({"node_modules/regl-error2d/index.js"(Z,q){"use strict";var d=vg(),x=h0(),A=VE(),M=Ev(),e=sh(),t=mg(),{float32:r,fract32:o}=mT();q.exports=i;var a=[[1,0,0,1,0,0],[1,0,0,-1,0,0],[-1,0,0,-1,0,0],[-1,0,0,-1,0,0],[-1,0,0,1,0,0],[1,0,0,1,0,0],[1,0,-1,0,0,1],[1,0,-1,0,0,-1],[1,0,1,0,0,-1],[1,0,1,0,0,-1],[1,0,1,0,0,1],[1,0,-1,0,0,1],[-1,0,-1,0,0,1],[-1,0,-1,0,0,-1],[-1,0,1,0,0,-1],[-1,0,1,0,0,-1],[-1,0,1,0,0,1],[-1,0,-1,0,0,1],[0,1,1,0,0,0],[0,1,-1,0,0,0],[0,-1,-1,0,0,0],[0,-1,-1,0,0,0],[0,1,1,0,0,0],[0,-1,1,0,0,0],[0,1,0,-1,1,0],[0,1,0,-1,-1,0],[0,1,0,1,-1,0],[0,1,0,1,1,0],[0,1,0,-1,1,0],[0,1,0,1,-1,0],[0,-1,0,-1,1,0],[0,-1,0,-1,-1,0],[0,-1,0,1,-1,0],[0,-1,0,1,1,0],[0,-1,0,-1,1,0],[0,-1,0,1,-1,0]];function i(n,s){if(typeof n=="function"?(s||(s={}),s.regl=n):s=n,s.length&&(s.positions=s),n=s.regl,!n.hasExtension("ANGLE_instanced_arrays"))throw Error("regl-error2d: `ANGLE_instanced_arrays` extension should be enabled");let c=n._gl,f,g,v,T,l,_,w={color:"black",capSize:5,lineWidth:1,opacity:1,viewport:null,range:null,offset:0,count:0,bounds:null,positions:[],errors:[]},S=[];return T=n.buffer({usage:"dynamic",type:"uint8",data:new Uint8Array(0)}),g=n.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),v=n.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),l=n.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),_=n.buffer({usage:"static",type:"float",data:a}),p(s),f=n({vert:` precision highp float; attribute vec2 position, positionFract; attribute vec4 error; attribute vec4 color; attribute vec2 direction, lineOffset, capOffset; uniform vec4 viewport; uniform float lineWidth, capSize; uniform vec2 scale, scaleFract, translate, translateFract; varying vec4 fragColor; void main() { fragColor = color / 255.; vec2 pixelOffset = lineWidth * lineOffset + (capSize + lineWidth) * capOffset; vec2 dxy = -step(.5, direction.xy) * error.xz + step(direction.xy, vec2(-.5)) * error.yw; vec2 position = position + dxy; vec2 pos = (position + translate) * scale + (positionFract + translateFract) * scale + (position + translate) * scaleFract + (positionFract + translateFract) * scaleFract; pos += pixelOffset / viewport.zw; gl_Position = vec4(pos * 2. - 1., 0, 1); } `,frag:` precision highp float; varying vec4 fragColor; uniform float opacity; void main() { gl_FragColor = fragColor; gl_FragColor.a *= opacity; } `,uniforms:{range:n.prop("range"),lineWidth:n.prop("lineWidth"),capSize:n.prop("capSize"),opacity:n.prop("opacity"),scale:n.prop("scale"),translate:n.prop("translate"),scaleFract:n.prop("scaleFract"),translateFract:n.prop("translateFract"),viewport:(m,h)=>[h.viewport.x,h.viewport.y,m.viewportWidth,m.viewportHeight]},attributes:{color:{buffer:T,offset:(m,h)=>h.offset*4,divisor:1},position:{buffer:g,offset:(m,h)=>h.offset*8,divisor:1},positionFract:{buffer:v,offset:(m,h)=>h.offset*8,divisor:1},error:{buffer:l,offset:(m,h)=>h.offset*16,divisor:1},direction:{buffer:_,stride:24,offset:0},lineOffset:{buffer:_,stride:24,offset:8},capOffset:{buffer:_,stride:24,offset:16}},primitive:"triangles",blend:{enable:!0,color:[0,0,0,0],equation:{rgb:"add",alpha:"add"},func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},depth:{enable:!1},scissor:{enable:!0,box:n.prop("viewport")},viewport:n.prop("viewport"),stencil:!1,instances:n.prop("count"),count:a.length}),e(E,{update:p,draw:y,destroy:u,regl:n,gl:c,canvas:c.canvas,groups:S}),E;function E(m){m?p(m):m===null&&u(),y()}function y(m){if(typeof m=="number")return b(m);m&&!Array.isArray(m)&&(m=[m]),n._refresh(),S.forEach((h,P)=>{if(h){if(m&&(m[P]?h.draw=!0:h.draw=!1),!h.draw){h.draw=!0;return}b(P)}})}function b(m){typeof m=="number"&&(m=S[m]),m!=null&&m&&m.count&&m.color&&m.opacity&&m.positions&&m.positions.length>1&&(m.scaleRatio=[m.scale[0]*m.viewport.width,m.scale[1]*m.viewport.height],f(m),m.after&&m.after(m))}function p(m){if(!m)return;m.length!=null?typeof m[0]=="number"&&(m=[{positions:m}]):Array.isArray(m)||(m=[m]);let h=0,P=0;if(E.groups=S=m.map((F,B)=>{let O=S[B];if(F)typeof F=="function"?F={after:F}:typeof F[0]=="number"&&(F={positions:F});else return O;return F=M(F,{color:"color colors fill",capSize:"capSize cap capsize cap-size",lineWidth:"lineWidth line-width width line thickness",opacity:"opacity alpha",range:"range dataBox",viewport:"viewport viewBox",errors:"errors error",positions:"positions position data points"}),O||(S[B]=O={id:B,scale:null,translate:null,scaleFract:null,translateFract:null,draw:!0},F=e({},w,F)),A(O,F,[{lineWidth:I=>+I*.5,capSize:I=>+I*.5,opacity:parseFloat,errors:I=>(I=t(I),P+=I.length,I),positions:(I,N)=>(I=t(I,"float64"),N.count=Math.floor(I.length/2),N.bounds=d(I,2),N.offset=h,h+=N.count,I)},{color:(I,N)=>{let U=N.count;if(I||(I="transparent"),!Array.isArray(I)||typeof I[0]=="number"){let Q=I;I=Array(U);for(let ue=0;ue{let W=N.bounds;return I||(I=W),N.scale=[1/(I[2]-I[0]),1/(I[3]-I[1])],N.translate=[-I[0],-I[1]],N.scaleFract=o(N.scale),N.translateFract=o(N.translate),I},viewport:I=>{let N;return Array.isArray(I)?N={x:I[0],y:I[1],width:I[2]-I[0],height:I[3]-I[1]}:I?(N={x:I.x||I.left||0,y:I.y||I.top||0},I.right?N.width=I.right-N.x:N.width=I.w||I.width||0,I.bottom?N.height=I.bottom-N.y:N.height=I.h||I.height||0):N={x:0,y:0,width:c.drawingBufferWidth,height:c.drawingBufferHeight},N}}]),O}),h||P){let F=S.reduce((N,U,W)=>N+(U?U.count:0),0),B=new Float64Array(F*2),O=new Uint8Array(F*4),I=new Float32Array(F*4);S.forEach((N,U)=>{if(!N)return;let{positions:W,count:Q,offset:ue,color:le,errors:he}=N;Q&&(O.set(le,ue*4),I.set(he,ue*4),B.set(W,ue*2))});var L=r(B);g(L);var z=o(B,L);v(z),T(O),l(I)}}function u(){g.destroy(),v.destroy(),T.destroy(),l.destroy(),_.destroy()}}}}),hq=Ze({"node_modules/unquote/index.js"(Z,q){var d=/[\'\"]/;q.exports=function(A){return A?(d.test(A.charAt(0))&&(A=A.substr(1)),d.test(A.charAt(A.length-1))&&(A=A.substr(0,A.length-1)),A):""}}}),a6=Ze({"node_modules/css-global-keywords/index.json"(Z,q){q.exports=["inherit","initial","unset"]}}),i6=Ze({"node_modules/css-system-font-keywords/index.json"(Z,q){q.exports=["caption","icon","menu","message-box","small-caption","status-bar"]}}),n6=Ze({"node_modules/css-font-weight-keywords/index.json"(Z,q){q.exports=["normal","bold","bolder","lighter","100","200","300","400","500","600","700","800","900"]}}),o6=Ze({"node_modules/css-font-style-keywords/index.json"(Z,q){q.exports=["normal","italic","oblique"]}}),s6=Ze({"node_modules/css-font-stretch-keywords/index.json"(Z,q){q.exports=["normal","condensed","semi-condensed","extra-condensed","ultra-condensed","expanded","semi-expanded","extra-expanded","ultra-expanded"]}}),pq=Ze({"node_modules/parenthesis/index.js"(Z,q){"use strict";function d(M,e){if(typeof M!="string")return[M];var t=[M];typeof e=="string"||Array.isArray(e)?e={brackets:e}:e||(e={});var r=e.brackets?Array.isArray(e.brackets)?e.brackets:[e.brackets]:["{}","[]","()"],o=e.escape||"___",a=!!e.flat;r.forEach(function(s){var c=new RegExp(["\\",s[0],"[^\\",s[0],"\\",s[1],"]*\\",s[1]].join("")),f=[];function g(v,T,l){var _=t.push(v.slice(s[0].length,-s[1].length))-1;return f.push(_),o+_+o}t.forEach(function(v,T){for(var l,_=0;v!=l;)if(l=v,v=v.replace(c,g),_++>1e4)throw Error("References have circular dependency. Please, check them.");t[T]=v}),f=f.reverse(),t=t.map(function(v){return f.forEach(function(T){v=v.replace(new RegExp("(\\"+o+T+"\\"+o+")","g"),s[0]+"$1"+s[1])}),v})});var i=new RegExp("\\"+o+"([0-9]+)\\"+o);function n(s,c,f){for(var g=[],v,T=0;v=i.exec(s);){if(T++>1e4)throw Error("Circular references in parenthesis");g.push(s.slice(0,v.index)),g.push(n(c[v[1]],c)),s=s.slice(v.index+v[0].length)}return g.push(s),g}return a?t:n(t[0],t)}function x(M,e){if(e&&e.flat){var t=e&&e.escape||"___",r=M[0],o;if(!r)return"";for(var a=new RegExp("\\"+t+"([0-9]+)\\"+t),i=0;r!=o;){if(i++>1e4)throw Error("Circular references in "+M);o=r,r=r.replace(a,n)}return r}return M.reduce(function s(c,f){return Array.isArray(f)&&(f=f.reduce(s,"")),c+f},"");function n(s,c){if(M[c]==null)throw Error("Reference "+c+"is undefined");return M[c]}}function A(M,e){return Array.isArray(M)?x(M,e):d(M,e)}A.parse=d,A.stringify=x,q.exports=A}}),dq=Ze({"node_modules/string-split-by/index.js"(Z,q){"use strict";var d=pq();q.exports=function(A,M,e){if(A==null)throw Error("First argument should be a string");if(M==null)throw Error("Separator should be a string or a RegExp");e?(typeof e=="string"||Array.isArray(e))&&(e={ignore:e}):e={},e.escape==null&&(e.escape=!0),e.ignore==null?e.ignore=["[]","()","{}","<>",'""',"''","``","\u201C\u201D","\xAB\xBB"]:(typeof e.ignore=="string"&&(e.ignore=[e.ignore]),e.ignore=e.ignore.map(function(c){return c.length===1&&(c=c+c),c}));var t=d.parse(A,{flat:!0,brackets:e.ignore}),r=t[0],o=r.split(M);if(e.escape){for(var a=[],i=0;i1&&Yt===cr&&(Yt==='"'||Yt==="'"))return['"'+r(nt.substr(1,nt.length-2))+'"'];var ua=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(nt);if(ua)return o(nt.substr(0,ua.index)).concat(o(ua[1])).concat(o(nt.substr(ua.index+ua[0].length)));var Aa=nt.split(".");if(Aa.length===1)return['"'+r(nt)+'"'];for(var xa=[],wa=0;wa"u"?1:window.devicePixelRatio,fi=!1,yn={},Oi=function(ea){},ki=function(){};if(typeof Yt=="string"?cr=document.querySelector(Yt):typeof Yt=="object"&&(_(Yt)?cr=Yt:w(Yt)?(xa=Yt,Aa=xa.canvas):("gl"in Yt?xa=Yt.gl:"canvas"in Yt?Aa=E(Yt.canvas):"container"in Yt&&(ua=E(Yt.container)),"attributes"in Yt&&(wa=Yt.attributes),"extensions"in Yt&&(Ja=S(Yt.extensions)),"optionalExtensions"in Yt&&(Ai=S(Yt.optionalExtensions)),"onDone"in Yt&&(Oi=Yt.onDone),"profile"in Yt&&(fi=!!Yt.profile),"pixelRatio"in Yt&&(bi=+Yt.pixelRatio),"cachedCode"in Yt&&(yn=Yt.cachedCode))),cr&&(cr.nodeName.toLowerCase()==="canvas"?Aa=cr:ua=cr),!xa){if(!Aa){var qa=T(ua||document.body,Oi,bi);if(!qa)return null;Aa=qa.canvas,ki=qa.onDestroy}wa.premultipliedAlpha===void 0&&(wa.premultipliedAlpha=!0),xa=l(Aa,wa)}return xa?{gl:xa,canvas:Aa,container:ua,extensions:Ja,optionalExtensions:Ai,pixelRatio:bi,profile:fi,cachedCode:yn,onDone:Oi,onDestroy:ki}:(ki(),Oi("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function b(nt,Yt){var cr={};function ua(wa){var Ja=wa.toLowerCase(),Ai;try{Ai=cr[Ja]=nt.getExtension(Ja)}catch{}return!!Ai}for(var Aa=0;Aa65535)<<4,nt>>>=Yt,cr=(nt>255)<<3,nt>>>=cr,Yt|=cr,cr=(nt>15)<<2,nt>>>=cr,Yt|=cr,cr=(nt>3)<<1,nt>>>=cr,Yt|=cr,Yt|nt>>1}function I(){var nt=p(8,function(){return[]});function Yt(xa){var wa=B(xa),Ja=nt[O(wa)>>2];return Ja.length>0?Ja.pop():new ArrayBuffer(wa)}function cr(xa){nt[O(xa.byteLength)>>2].push(xa)}function ua(xa,wa){var Ja=null;switch(xa){case u:Ja=new Int8Array(Yt(wa),0,wa);break;case m:Ja=new Uint8Array(Yt(wa),0,wa);break;case h:Ja=new Int16Array(Yt(2*wa),0,wa);break;case P:Ja=new Uint16Array(Yt(2*wa),0,wa);break;case L:Ja=new Int32Array(Yt(4*wa),0,wa);break;case z:Ja=new Uint32Array(Yt(4*wa),0,wa);break;case F:Ja=new Float32Array(Yt(4*wa),0,wa);break;default:return null}return Ja.length!==wa?Ja.subarray(0,wa):Ja}function Aa(xa){cr(xa.buffer)}return{alloc:Yt,free:cr,allocType:ua,freeType:Aa}}var N=I();N.zero=I();var U=3408,W=3410,Q=3411,ue=3412,le=3413,he=3414,G=3415,$=33901,J=33902,X=3379,oe=3386,ie=34921,j=36347,ee=36348,re=35661,ce=35660,be=34930,Ae=36349,ze=34076,Re=34024,Xe=7936,it=7937,ot=7938,tt=35724,lt=34047,Ee=36063,_e=34852,fe=3553,Fe=34067,rt=34069,st=33984,Qe=6408,Lt=5126,kt=5121,Vt=36160,Zt=36053,Sr=36064,xr=16384,jr=function(nt,Yt){var cr=1;Yt.ext_texture_filter_anisotropic&&(cr=nt.getParameter(lt));var ua=1,Aa=1;Yt.webgl_draw_buffers&&(ua=nt.getParameter(_e),Aa=nt.getParameter(Ee));var xa=!!Yt.oes_texture_float;if(xa){var wa=nt.createTexture();nt.bindTexture(fe,wa),nt.texImage2D(fe,0,Qe,1,1,0,Qe,Lt,null);var Ja=nt.createFramebuffer();if(nt.bindFramebuffer(Vt,Ja),nt.framebufferTexture2D(Vt,Sr,fe,wa,0),nt.bindTexture(fe,null),nt.checkFramebufferStatus(Vt)!==Zt)xa=!1;else{nt.viewport(0,0,1,1),nt.clearColor(1,0,0,1),nt.clear(xr);var Ai=N.allocType(Lt,4);nt.readPixels(0,0,1,1,Qe,Lt,Ai),nt.getError()?xa=!1:(nt.deleteFramebuffer(Ja),nt.deleteTexture(wa),xa=Ai[0]===1),N.freeType(Ai)}}var bi=typeof navigator<"u"&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion)||/Edge/.test(navigator.userAgent)),fi=!0;if(!bi){var yn=nt.createTexture(),Oi=N.allocType(kt,36);nt.activeTexture(st),nt.bindTexture(Fe,yn),nt.texImage2D(rt,0,Qe,3,3,0,Qe,kt,Oi),N.freeType(Oi),nt.bindTexture(Fe,null),nt.deleteTexture(yn),fi=!nt.getError()}return{colorBits:[nt.getParameter(W),nt.getParameter(Q),nt.getParameter(ue),nt.getParameter(le)],depthBits:nt.getParameter(he),stencilBits:nt.getParameter(G),subpixelBits:nt.getParameter(U),extensions:Object.keys(Yt).filter(function(ki){return!!Yt[ki]}),maxAnisotropic:cr,maxDrawbuffers:ua,maxColorAttachments:Aa,pointSizeDims:nt.getParameter($),lineWidthDims:nt.getParameter(J),maxViewportDims:nt.getParameter(oe),maxCombinedTextureUnits:nt.getParameter(re),maxCubeMapSize:nt.getParameter(ze),maxRenderbufferSize:nt.getParameter(Re),maxTextureUnits:nt.getParameter(be),maxTextureSize:nt.getParameter(X),maxAttributes:nt.getParameter(ie),maxVertexUniforms:nt.getParameter(j),maxVertexTextureUnits:nt.getParameter(ce),maxVaryingVectors:nt.getParameter(ee),maxFragmentUniforms:nt.getParameter(Ae),glsl:nt.getParameter(tt),renderer:nt.getParameter(it),vendor:nt.getParameter(Xe),version:nt.getParameter(ot),readFloat:xa,npotTextureCube:fi}},wr=function(nt){return nt instanceof Uint8Array||nt instanceof Uint16Array||nt instanceof Uint32Array||nt instanceof Int8Array||nt instanceof Int16Array||nt instanceof Int32Array||nt instanceof Float32Array||nt instanceof Float64Array||nt instanceof Uint8ClampedArray};function Ir(nt){return!!nt&&typeof nt=="object"&&Array.isArray(nt.shape)&&Array.isArray(nt.stride)&&typeof nt.offset=="number"&&nt.shape.length===nt.stride.length&&(Array.isArray(nt.data)||wr(nt.data))}var bt=function(nt){return Object.keys(nt).map(function(Yt){return nt[Yt]})},Be={shape:Te,flatten:Ce};function Ke(nt,Yt,cr){for(var ua=0;ua0){var hn;if(Array.isArray(Ea[0])){Ii=za(Ea);for(var Za=1,Va=1;Va0){if(typeof Za[0]=="number"){var Si=N.allocType(Wa.dtype,Za.length);Pr(Si,Za),Ii(Si,$i),N.freeType(Si)}else if(Array.isArray(Za[0])||wr(Za[0])){zi=za(Za);var Ti=ei(Za,zi,Wa.dtype);Ii(Ti,$i),N.freeType(Ti)}}}else if(Ir(Za)){zi=Za.shape;var Ki=Za.stride,mn=0,In=0,Di=0,nn=0;zi.length===1?(mn=zi[0],In=1,Di=Ki[0],nn=0):zi.length===2&&(mn=zi[0],In=zi[1],Di=Ki[0],nn=Ki[1]);var En=Array.isArray(Za.data)?Wa.dtype:Wt(Za.data),Rn=N.allocType(En,mn*In);ta(Rn,Za.data,mn,In,Di,nn,Za.offset),Ii(Rn,$i),N.freeType(Rn)}return ji}return ii||ji(ea),ji._reglType="buffer",ji._buffer=Wa,ji.subdata=hn,cr.profile&&(ji.stats=Wa.stats),ji.destroy=function(){Oi(Wa)},ji}function qa(){bt(xa).forEach(function(ea){ea.buffer=nt.createBuffer(),nt.bindBuffer(ea.type,ea.buffer),nt.bufferData(ea.type,ea.persistentData||ea.byteLength,ea.usage)})}return cr.profile&&(Yt.getTotalBufferSize=function(){var ea=0;return Object.keys(xa).forEach(function(Ea){ea+=xa[Ea].stats.size}),ea}),{create:ki,createStream:Ai,destroyStream:bi,clear:function(){bt(xa).forEach(Oi),Ja.forEach(Oi)},getBuffer:function(ea){return ea&&ea._buffer instanceof wa?ea._buffer:null},restore:qa,_initBuffer:yn}}var ra=0,Ia=0,Ha=1,$a=1,ai=4,mi=4,xt={points:ra,point:Ia,lines:Ha,line:$a,triangles:ai,triangle:mi,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},ct=0,Nr=1,Or=4,Rr=5120,Lr=5121,Gr=5122,Kr=5123,Ur=5124,aa=5125,da=34963,fa=35040,It=35044;function dr(nt,Yt,cr,ua){var Aa={},xa=0,wa={uint8:Lr,uint16:Kr};Yt.oes_element_index_uint&&(wa.uint32=aa);function Ja(qa){this.id=xa++,Aa[this.id]=this,this.buffer=qa,this.primType=Or,this.vertCount=0,this.type=0}Ja.prototype.bind=function(){this.buffer.bind()};var Ai=[];function bi(qa){var ea=Ai.pop();return ea||(ea=new Ja(cr.create(null,da,!0,!1)._buffer)),yn(ea,qa,fa,-1,-1,0,0),ea}function fi(qa){Ai.push(qa)}function yn(qa,ea,Ea,ii,gi,Wa,ji){qa.buffer.bind();var Ii;if(ea){var hn=ji;!ji&&(!wr(ea)||Ir(ea)&&!wr(ea.data))&&(hn=Yt.oes_element_index_uint?aa:Kr),cr._initBuffer(qa.buffer,ea,Ea,hn,3)}else nt.bufferData(da,Wa,Ea),qa.buffer.dtype=Ii||Lr,qa.buffer.usage=Ea,qa.buffer.dimension=3,qa.buffer.byteLength=Wa;if(Ii=ji,!ji){switch(qa.buffer.dtype){case Lr:case Rr:Ii=Lr;break;case Kr:case Gr:Ii=Kr;break;case aa:case Ur:Ii=aa;break;default:}qa.buffer.dtype=Ii}qa.type=Ii;var Za=gi;Za<0&&(Za=qa.buffer.byteLength,Ii===Kr?Za>>=1:Ii===aa&&(Za>>=2)),qa.vertCount=Za;var Va=ii;if(ii<0){Va=Or;var $i=qa.buffer.dimension;$i===1&&(Va=ct),$i===2&&(Va=Nr),$i===3&&(Va=Or)}qa.primType=Va}function Oi(qa){ua.elementsCount--,delete Aa[qa.id],qa.buffer.destroy(),qa.buffer=null}function ki(qa,ea){var Ea=cr.create(null,da,!0),ii=new Ja(Ea._buffer);ua.elementsCount++;function gi(Wa){if(!Wa)Ea(),ii.primType=Or,ii.vertCount=0,ii.type=Lr;else if(typeof Wa=="number")Ea(Wa),ii.primType=Or,ii.vertCount=Wa|0,ii.type=Lr;else{var ji=null,Ii=It,hn=-1,Za=-1,Va=0,$i=0;Array.isArray(Wa)||wr(Wa)||Ir(Wa)?ji=Wa:("data"in Wa&&(ji=Wa.data),"usage"in Wa&&(Ii=Ra[Wa.usage]),"primitive"in Wa&&(hn=xt[Wa.primitive]),"count"in Wa&&(Za=Wa.count|0),"type"in Wa&&($i=wa[Wa.type]),"length"in Wa?Va=Wa.length|0:(Va=Za,$i===Kr||$i===Gr?Va*=2:($i===aa||$i===Ur)&&(Va*=4))),yn(ii,ji,Ii,hn,Za,Va,$i)}return gi}return gi(qa),gi._reglType="elements",gi._elements=ii,gi.subdata=function(Wa,ji){return Ea.subdata(Wa,ji),gi},gi.destroy=function(){Oi(ii)},gi}return{create:ki,createStream:bi,destroyStream:fi,getElements:function(qa){return typeof qa=="function"&&qa._elements instanceof Ja?qa._elements:null},clear:function(){bt(Aa).forEach(Oi)}}}var kr=new Float32Array(1),ia=new Uint32Array(kr.buffer),Ca=5123;function Fa(nt){for(var Yt=N.allocType(Ca,nt.length),cr=0;cr>>31<<15,xa=(ua<<1>>>24)-127,wa=ua>>13&1023;if(xa<-24)Yt[cr]=Aa;else if(xa<-14){var Ja=-14-xa;Yt[cr]=Aa+(wa+1024>>Ja)}else xa>15?Yt[cr]=Aa+31744:Yt[cr]=Aa+(xa+15<<10)+wa}return Yt}function Ya(nt){return Array.isArray(nt)||wr(nt)}var ha=34467,Da=3553,Xi=34067,Li=34069,fn=6408,An=6406,kn=6407,zn=6409,Xn=6410,to=32854,mo=32855,pn=36194,Jo=32819,Xo=32820,Ts=33635,Po=34042,so=6402,Vn=34041,To=35904,qo=35906,Oo=36193,lo=33776,Co=33777,os=33778,Ys=33779,Os=35986,Yo=35987,Ui=34798,Cn=35840,tl=35841,Bs=35842,uo=35843,$s=36196,ms=5121,Is=5123,rl=5125,Sn=5126,po=10242,ro=10243,As=10497,al=33071,$n=33648,zs=10240,au=10241,fl=9728,xu=9729,zl=9984,Ns=9985,iu=9986,Eu=9987,Bc=33170,Cu=4352,Af=4353,pf=4354,Us=34046,Vc=3317,Sf=37440,nu=37441,Ll=37443,ic=37444,Ou=33984,il=[zl,iu,Ns,Eu],vl=[0,zn,Xn,kn,fn],gs={};gs[zn]=gs[An]=gs[so]=1,gs[Vn]=gs[Xn]=2,gs[kn]=gs[To]=3,gs[fn]=gs[qo]=4;function Vs(nt){return"[object "+nt+"]"}var nc=Vs("HTMLCanvasElement"),Nl=Vs("OffscreenCanvas"),qu=Vs("CanvasRenderingContext2D"),cl=Vs("ImageBitmap"),yh=Vs("HTMLImageElement"),ls=Vs("HTMLVideoElement"),_h=Object.keys(Pe).concat([nc,Nl,qu,cl,yh,ls]),Ss=[];Ss[ms]=1,Ss[Sn]=4,Ss[Oo]=2,Ss[Is]=2,Ss[rl]=4;var Qn=[];Qn[to]=2,Qn[mo]=2,Qn[pn]=2,Qn[Vn]=4,Qn[lo]=.5,Qn[Co]=.5,Qn[os]=1,Qn[Ys]=1,Qn[Os]=.5,Qn[Yo]=1,Qn[Ui]=1,Qn[Cn]=.5,Qn[tl]=.25,Qn[Bs]=.5,Qn[uo]=.25,Qn[$s]=.5;function Gc(nt){return Array.isArray(nt)&&(nt.length===0||typeof nt[0]=="number")}function Vu(nt){if(!Array.isArray(nt))return!1;var Yt=nt.length;return!(Yt===0||!Ya(nt[0]))}function Ul(nt){return Object.prototype.toString.call(nt)}function Mf(nt){return Ul(nt)===nc}function wc(nt){return Ul(nt)===Nl}function rf(nt){return Ul(nt)===qu}function Kl(nt){return Ul(nt)===cl}function Yf(nt){return Ul(nt)===yh}function zf(nt){return Ul(nt)===ls}function af(nt){if(!nt)return!1;var Yt=Ul(nt);return _h.indexOf(Yt)>=0?!0:Gc(nt)||Vu(nt)||Ir(nt)}function Nc(nt){return Pe[Object.prototype.toString.call(nt)]|0}function Ff(nt,Yt){var cr=Yt.length;switch(nt.type){case ms:case Is:case rl:case Sn:var ua=N.allocType(nt.type,cr);ua.set(Yt),nt.data=ua;break;case Oo:nt.data=Fa(Yt);break;default:}}function Of(nt,Yt){return N.allocType(nt.type===Oo?Sn:nt.type,Yt)}function Gu(nt,Yt){nt.type===Oo?(nt.data=Fa(Yt),N.freeType(Yt)):nt.data=Yt}function Ef(nt,Yt,cr,ua,Aa,xa){for(var wa=nt.width,Ja=nt.height,Ai=nt.channels,bi=wa*Ja*Ai,fi=Of(nt,bi),yn=0,Oi=0;Oi=1;)Ja+=wa*Ai*Ai,Ai/=2;return Ja}else return wa*cr*ua}function Hc(nt,Yt,cr,ua,Aa,xa,wa){var Ja={"don't care":Cu,"dont care":Cu,nice:pf,fast:Af},Ai={repeat:As,clamp:al,mirror:$n},bi={nearest:fl,linear:xu},fi=d({mipmap:Eu,"nearest mipmap nearest":zl,"linear mipmap nearest":Ns,"nearest mipmap linear":iu,"linear mipmap linear":Eu},bi),yn={none:0,browser:ic},Oi={uint8:ms,rgba4:Jo,rgb565:Ts,"rgb5 a1":Xo},ki={alpha:An,luminance:zn,"luminance alpha":Xn,rgb:kn,rgba:fn,rgba4:to,"rgb5 a1":mo,rgb565:pn},qa={};Yt.ext_srgb&&(ki.srgb=To,ki.srgba=qo),Yt.oes_texture_float&&(Oi.float32=Oi.float=Sn),Yt.oes_texture_half_float&&(Oi.float16=Oi["half float"]=Oo),Yt.webgl_depth_texture&&(d(ki,{depth:so,"depth stencil":Vn}),d(Oi,{uint16:Is,uint32:rl,"depth stencil":Po})),Yt.webgl_compressed_texture_s3tc&&d(qa,{"rgb s3tc dxt1":lo,"rgba s3tc dxt1":Co,"rgba s3tc dxt3":os,"rgba s3tc dxt5":Ys}),Yt.webgl_compressed_texture_atc&&d(qa,{"rgb atc":Os,"rgba atc explicit alpha":Yo,"rgba atc interpolated alpha":Ui}),Yt.webgl_compressed_texture_pvrtc&&d(qa,{"rgb pvrtc 4bppv1":Cn,"rgb pvrtc 2bppv1":tl,"rgba pvrtc 4bppv1":Bs,"rgba pvrtc 2bppv1":uo}),Yt.webgl_compressed_texture_etc1&&(qa["rgb etc1"]=$s);var ea=Array.prototype.slice.call(nt.getParameter(ha));Object.keys(qa).forEach(function(Le){var $e=qa[Le];ea.indexOf($e)>=0&&(ki[Le]=$e)});var Ea=Object.keys(ki);cr.textureFormats=Ea;var ii=[];Object.keys(ki).forEach(function(Le){var $e=ki[Le];ii[$e]=Le});var gi=[];Object.keys(Oi).forEach(function(Le){var $e=Oi[Le];gi[$e]=Le});var Wa=[];Object.keys(bi).forEach(function(Le){var $e=bi[Le];Wa[$e]=Le});var ji=[];Object.keys(fi).forEach(function(Le){var $e=fi[Le];ji[$e]=Le});var Ii=[];Object.keys(Ai).forEach(function(Le){var $e=Ai[Le];Ii[$e]=Le});var hn=Ea.reduce(function(Le,$e){var mt=ki[$e];return mt===zn||mt===An||mt===zn||mt===Xn||mt===so||mt===Vn||Yt.ext_srgb&&(mt===To||mt===qo)?Le[mt]=mt:mt===mo||$e.indexOf("rgba")>=0?Le[mt]=fn:Le[mt]=kn,Le},{});function Za(){this.internalformat=fn,this.format=fn,this.type=ms,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=ic,this.width=0,this.height=0,this.channels=0}function Va(Le,$e){Le.internalformat=$e.internalformat,Le.format=$e.format,Le.type=$e.type,Le.compressed=$e.compressed,Le.premultiplyAlpha=$e.premultiplyAlpha,Le.flipY=$e.flipY,Le.unpackAlignment=$e.unpackAlignment,Le.colorSpace=$e.colorSpace,Le.width=$e.width,Le.height=$e.height,Le.channels=$e.channels}function $i(Le,$e){if(!(typeof $e!="object"||!$e)){if("premultiplyAlpha"in $e&&(Le.premultiplyAlpha=$e.premultiplyAlpha),"flipY"in $e&&(Le.flipY=$e.flipY),"alignment"in $e&&(Le.unpackAlignment=$e.alignment),"colorSpace"in $e&&(Le.colorSpace=yn[$e.colorSpace]),"type"in $e){var mt=$e.type;Le.type=Oi[mt]}var jt=Le.width,_r=Le.height,Fr=Le.channels,hr=!1;"shape"in $e?(jt=$e.shape[0],_r=$e.shape[1],$e.shape.length===3&&(Fr=$e.shape[2],hr=!0)):("radius"in $e&&(jt=_r=$e.radius),"width"in $e&&(jt=$e.width),"height"in $e&&(_r=$e.height),"channels"in $e&&(Fr=$e.channels,hr=!0)),Le.width=jt|0,Le.height=_r|0,Le.channels=Fr|0;var gt=!1;if("format"in $e){var Et=$e.format,Ft=Le.internalformat=ki[Et];Le.format=hn[Ft],Et in Oi&&("type"in $e||(Le.type=Oi[Et])),Et in qa&&(Le.compressed=!0),gt=!0}!hr&>?Le.channels=gs[Le.format]:hr&&!gt&&Le.channels!==vl[Le.format]&&(Le.format=Le.internalformat=vl[Le.channels])}}function zi(Le){nt.pixelStorei(Sf,Le.flipY),nt.pixelStorei(nu,Le.premultiplyAlpha),nt.pixelStorei(Ll,Le.colorSpace),nt.pixelStorei(Vc,Le.unpackAlignment)}function Si(){Za.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function Ti(Le,$e){var mt=null;if(af($e)?mt=$e:$e&&($i(Le,$e),"x"in $e&&(Le.xOffset=$e.x|0),"y"in $e&&(Le.yOffset=$e.y|0),af($e.data)&&(mt=$e.data)),$e.copy){var jt=Aa.viewportWidth,_r=Aa.viewportHeight;Le.width=Le.width||jt-Le.xOffset,Le.height=Le.height||_r-Le.yOffset,Le.needsCopy=!0}else if(!mt)Le.width=Le.width||1,Le.height=Le.height||1,Le.channels=Le.channels||4;else if(wr(mt))Le.channels=Le.channels||4,Le.data=mt,!("type"in $e)&&Le.type===ms&&(Le.type=Nc(mt));else if(Gc(mt))Le.channels=Le.channels||4,Ff(Le,mt),Le.alignment=1,Le.needsFree=!0;else if(Ir(mt)){var Fr=mt.data;!Array.isArray(Fr)&&Le.type===ms&&(Le.type=Nc(Fr));var hr=mt.shape,gt=mt.stride,Et,Ft,ir,fr,sr,pr;hr.length===3?(ir=hr[2],pr=gt[2]):(ir=1,pr=1),Et=hr[0],Ft=hr[1],fr=gt[0],sr=gt[1],Le.alignment=1,Le.width=Et,Le.height=Ft,Le.channels=ir,Le.format=Le.internalformat=vl[ir],Le.needsFree=!0,Ef(Le,Fr,fr,sr,pr,mt.offset)}else if(Mf(mt)||wc(mt)||rf(mt))Mf(mt)||wc(mt)?Le.element=mt:Le.element=mt.canvas,Le.width=Le.element.width,Le.height=Le.element.height,Le.channels=4;else if(Kl(mt))Le.element=mt,Le.width=mt.width,Le.height=mt.height,Le.channels=4;else if(Yf(mt))Le.element=mt,Le.width=mt.naturalWidth,Le.height=mt.naturalHeight,Le.channels=4;else if(zf(mt))Le.element=mt,Le.width=mt.videoWidth,Le.height=mt.videoHeight,Le.channels=4;else if(Vu(mt)){var lr=Le.width||mt[0].length,Xt=Le.height||mt.length,or=Le.channels;Ya(mt[0][0])?or=or||mt[0][0].length:or=or||1;for(var qt=Be.shape(mt),Dr=1,Jr=0;Jr>=_r,mt.height>>=_r,Ti(mt,jt[_r]),Le.mipmask|=1<<_r;else mt=Le.images[0]=Di(),Va(mt,Le),Ti(mt,$e),Le.mipmask=1;Va(Le,Le.images[0]),Le.compressed&&(Le.internalformat===lo||Le.internalformat===Co||Le.internalformat===os||Le.internalformat)}function Ps(Le,$e){for(var mt=Le.images,jt=0;jt=0&&!("faces"in $e)&&(Le.genMipmaps=!0)}if("mag"in $e){var jt=$e.mag;Le.magFilter=bi[jt]}var _r=Le.wrapS,Fr=Le.wrapT;if("wrap"in $e){var hr=$e.wrap;typeof hr=="string"?_r=Fr=Ai[hr]:Array.isArray(hr)&&(_r=Ai[hr[0]],Fr=Ai[hr[1]])}else{if("wrapS"in $e){var gt=$e.wrapS;_r=Ai[gt]}if("wrapT"in $e){var Et=$e.wrapT;Fr=Ai[Et]}}if(Le.wrapS=_r,Le.wrapT=Fr,"anisotropic"in $e){var Ft=$e.anisotropic;Le.anisotropic=$e.anisotropic}if("mipmap"in $e){var ir=!1;switch(typeof $e.mipmap){case"string":Le.mipmapHint=Ja[$e.mipmap],Le.genMipmaps=!0,ir=!0;break;case"boolean":ir=Le.genMipmaps=$e.mipmap;break;case"object":Le.genMipmaps=!1,ir=!0;break;default:}ir&&!("min"in $e)&&(Le.minFilter=zl)}}function El(Le,$e){nt.texParameteri($e,au,Le.minFilter),nt.texParameteri($e,zs,Le.magFilter),nt.texParameteri($e,po,Le.wrapS),nt.texParameteri($e,ro,Le.wrapT),Yt.ext_texture_filter_anisotropic&&nt.texParameteri($e,Us,Le.anisotropic),Le.genMipmaps&&(nt.hint(Bc,Le.mipmapHint),nt.generateMipmap($e))}var Ql=0,Fs={},pl=cr.maxTextureUnits,bl=Array(pl).map(function(){return null});function Hn(Le){Za.call(this),this.mipmask=0,this.internalformat=fn,this.id=Ql++,this.refCount=1,this.target=Le,this.texture=nt.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new fs,wa.profile&&(this.stats={size:0})}function Cl(Le){nt.activeTexture(Ou),nt.bindTexture(Le.target,Le.texture)}function Lo(){var Le=bl[0];Le?nt.bindTexture(Le.target,Le.texture):nt.bindTexture(Da,null)}function ve(Le){var $e=Le.texture,mt=Le.unit,jt=Le.target;mt>=0&&(nt.activeTexture(Ou+mt),nt.bindTexture(jt,null),bl[mt]=null),nt.deleteTexture($e),Le.texture=null,Le.params=null,Le.pixels=null,Le.refCount=0,delete Fs[Le.id],xa.textureCount--}d(Hn.prototype,{bind:function(){var Le=this;Le.bindCount+=1;var $e=Le.unit;if($e<0){for(var mt=0;mt0)continue;jt.unit=-1}bl[mt]=Le,$e=mt;break}$e>=pl,wa.profile&&xa.maxTextureUnits<$e+1&&(xa.maxTextureUnits=$e+1),Le.unit=$e,nt.activeTexture(Ou+$e),nt.bindTexture(Le.target,Le.texture)}return $e},unbind:function(){this.bindCount-=1},decRef:function(){--this.refCount<=0&&ve(this)}});function Y(Le,$e){var mt=new Hn(Da);Fs[mt.id]=mt,xa.textureCount++;function jt(hr,gt){var Et=mt.texInfo;fs.call(Et);var Ft=ho();return typeof hr=="number"?typeof gt=="number"?Rn(Ft,hr|0,gt|0):Rn(Ft,hr|0,hr|0):hr?(Al(Et,hr),Gn(Ft,hr)):Rn(Ft,1,1),Et.genMipmaps&&(Ft.mipmask=(Ft.width<<1)-1),mt.mipmask=Ft.mipmask,Va(mt,Ft),mt.internalformat=Ft.internalformat,jt.width=Ft.width,jt.height=Ft.height,Cl(mt),Ps(Ft,Da),El(Et,Da),Lo(),Hl(Ft),wa.profile&&(mt.stats.size=oc(mt.internalformat,mt.type,Ft.width,Ft.height,Et.genMipmaps,!1)),jt.format=ii[mt.internalformat],jt.type=gi[mt.type],jt.mag=Wa[Et.magFilter],jt.min=ji[Et.minFilter],jt.wrapS=Ii[Et.wrapS],jt.wrapT=Ii[Et.wrapT],jt}function _r(hr,gt,Et,Ft){var ir=gt|0,fr=Et|0,sr=Ft|0,pr=Di();return Va(pr,mt),pr.width=0,pr.height=0,Ti(pr,hr),pr.width=pr.width||(mt.width>>sr)-ir,pr.height=pr.height||(mt.height>>sr)-fr,Cl(mt),mn(pr,Da,ir,fr,sr),Lo(),nn(pr),jt}function Fr(hr,gt){var Et=hr|0,Ft=gt|0||Et;if(Et===mt.width&&Ft===mt.height)return jt;jt.width=mt.width=Et,jt.height=mt.height=Ft,Cl(mt);for(var ir=0;mt.mipmask>>ir;++ir){var fr=Et>>ir,sr=Ft>>ir;if(!fr||!sr)break;nt.texImage2D(Da,ir,mt.format,fr,sr,0,mt.format,mt.type,null)}return Lo(),wa.profile&&(mt.stats.size=oc(mt.internalformat,mt.type,Et,Ft,!1,!1)),jt}return jt(Le,$e),jt.subimage=_r,jt.resize=Fr,jt._reglType="texture2d",jt._texture=mt,wa.profile&&(jt.stats=mt.stats),jt.destroy=function(){mt.decRef()},jt}function ye(Le,$e,mt,jt,_r,Fr){var hr=new Hn(Xi);Fs[hr.id]=hr,xa.cubeCount++;var gt=new Array(6);function Et(fr,sr,pr,lr,Xt,or){var qt,Dr=hr.texInfo;for(fs.call(Dr),qt=0;qt<6;++qt)gt[qt]=ho();if(typeof fr=="number"||!fr){var Jr=fr|0||1;for(qt=0;qt<6;++qt)Rn(gt[qt],Jr,Jr)}else if(typeof fr=="object")if(sr)Gn(gt[0],fr),Gn(gt[1],sr),Gn(gt[2],pr),Gn(gt[3],lr),Gn(gt[4],Xt),Gn(gt[5],or);else if(Al(Dr,fr),$i(hr,fr),"faces"in fr){var ba=fr.faces;for(qt=0;qt<6;++qt)Va(gt[qt],hr),Gn(gt[qt],ba[qt])}else for(qt=0;qt<6;++qt)Gn(gt[qt],fr);for(Va(hr,gt[0]),Dr.genMipmaps?hr.mipmask=(gt[0].width<<1)-1:hr.mipmask=gt[0].mipmask,hr.internalformat=gt[0].internalformat,Et.width=gt[0].width,Et.height=gt[0].height,Cl(hr),qt=0;qt<6;++qt)Ps(gt[qt],Li+qt);for(El(Dr,Xi),Lo(),wa.profile&&(hr.stats.size=oc(hr.internalformat,hr.type,Et.width,Et.height,Dr.genMipmaps,!0)),Et.format=ii[hr.internalformat],Et.type=gi[hr.type],Et.mag=Wa[Dr.magFilter],Et.min=ji[Dr.minFilter],Et.wrapS=Ii[Dr.wrapS],Et.wrapT=Ii[Dr.wrapT],qt=0;qt<6;++qt)Hl(gt[qt]);return Et}function Ft(fr,sr,pr,lr,Xt){var or=pr|0,qt=lr|0,Dr=Xt|0,Jr=Di();return Va(Jr,hr),Jr.width=0,Jr.height=0,Ti(Jr,sr),Jr.width=Jr.width||(hr.width>>Dr)-or,Jr.height=Jr.height||(hr.height>>Dr)-qt,Cl(hr),mn(Jr,Li+fr,or,qt,Dr),Lo(),nn(Jr),Et}function ir(fr){var sr=fr|0;if(sr!==hr.width){Et.width=hr.width=sr,Et.height=hr.height=sr,Cl(hr);for(var pr=0;pr<6;++pr)for(var lr=0;hr.mipmask>>lr;++lr)nt.texImage2D(Li+pr,lr,hr.format,sr>>lr,sr>>lr,0,hr.format,hr.type,null);return Lo(),wa.profile&&(hr.stats.size=oc(hr.internalformat,hr.type,Et.width,Et.height,!1,!0)),Et}}return Et(Le,$e,mt,jt,_r,Fr),Et.subimage=Ft,Et.resize=ir,Et._reglType="textureCube",Et._texture=hr,wa.profile&&(Et.stats=hr.stats),Et.destroy=function(){hr.decRef()},Et}function te(){for(var Le=0;Le>jt,mt.height>>jt,0,mt.internalformat,mt.type,null);else for(var _r=0;_r<6;++_r)nt.texImage2D(Li+_r,jt,mt.internalformat,mt.width>>jt,mt.height>>jt,0,mt.internalformat,mt.type,null);El(mt.texInfo,mt.target)})}function Ge(){for(var Le=0;Le=0?Hl=!0:Ai.indexOf(fs)>=0&&(Hl=!1))),("depthTexture"in Hn||"depthStencilTexture"in Hn)&&(bl=!!(Hn.depthTexture||Hn.depthStencilTexture)),"depth"in Hn&&(typeof Hn.depth=="boolean"?Ps=Hn.depth:(Ql=Hn.depth,xl=!1)),"stencil"in Hn&&(typeof Hn.stencil=="boolean"?xl=Hn.stencil:(Fs=Hn.stencil,Ps=!1)),"depthStencil"in Hn&&(typeof Hn.depthStencil=="boolean"?Ps=xl=Hn.depthStencil:(pl=Hn.depthStencil,Ps=!1,xl=!1))}var Lo=null,ve=null,Y=null,ye=null;if(Array.isArray(ho))Lo=ho.map(qa);else if(ho)Lo=[qa(ho)];else for(Lo=new Array(El),En=0;En0&&(nn.depth=Ti[0].depth,nn.stencil=Ti[0].stencil,nn.depthStencil=Ti[0].depthStencil),Ti[Di]?Ti[Di](nn):Ti[Di]=Va(nn)}return d(Ki,{width:En,height:En,color:fs})}function mn(In){var Di,nn=In|0;if(nn===Ki.width)return Ki;var En=Ki.color;for(Di=0;Di=En.byteLength?Rn.subdata(En):(Rn.destroy(),Va.buffers[In]=null)),Va.buffers[In]||(Rn=Va.buffers[In]=Aa.create(Di,vf,!1,!0)),nn.buffer=Aa.getBuffer(Rn),nn.size=nn.buffer.dimension|0,nn.normalized=!1,nn.type=nn.buffer.dtype,nn.offset=0,nn.stride=0,nn.divisor=0,nn.state=1,Ki[In]=1}else Aa.getBuffer(Di)?(nn.buffer=Aa.getBuffer(Di),nn.size=nn.buffer.dimension|0,nn.normalized=!1,nn.type=nn.buffer.dtype,nn.offset=0,nn.stride=0,nn.divisor=0,nn.state=1):Aa.getBuffer(Di.buffer)?(nn.buffer=Aa.getBuffer(Di.buffer),nn.size=(+Di.size||nn.buffer.dimension)|0,nn.normalized=!!Di.normalized||!1,"type"in Di?nn.type=la[Di.type]:nn.type=nn.buffer.dtype,nn.offset=(Di.offset||0)|0,nn.stride=(Di.stride||0)|0,nn.divisor=(Di.divisor||0)|0,nn.state=1):"x"in Di&&(nn.x=+Di.x||0,nn.y=+Di.y||0,nn.z=+Di.z||0,nn.w=+Di.w||0,nn.state=2)}for(var Gn=0;Gn1)for(var zi=0;ziea&&(ea=Ea.stats.uniformsCount)}),ea},cr.getMaxAttributesCount=function(){var ea=0;return fi.forEach(function(Ea){Ea.stats.attributesCount>ea&&(ea=Ea.stats.attributesCount)}),ea});function qa(){Aa={},xa={};for(var ea=0;ea16&&(cr=Ri(cr,nt.length*8));for(var ua=Array(16),Aa=Array(16),xa=0;xa<16;xa++)ua[xa]=cr[xa]^909522486,Aa[xa]=cr[xa]^1549556828;var wa=Ri(ua.concat(kc(Yt)),512+Yt.length*8);return er(Ri(Aa.concat(wa),768))}function gu(nt){for(var Yt=jf?"0123456789ABCDEF":"0123456789abcdef",cr="",ua,Aa=0;Aa>>4&15)+Yt.charAt(ua&15);return cr}function Cc(nt){for(var Yt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",cr="",ua=nt.length,Aa=0;Aant.length*8?cr+=Xu:cr+=Yt.charAt(xa>>>6*(3-wa)&63);return cr}function Yc(nt,Yt){var cr=Yt.length,ua=Array(),Aa,xa,wa,Ja,Ai=Array(Math.ceil(nt.length/2));for(Aa=0;Aa0;){for(Ja=Array(),wa=0,Aa=0;Aa0||xa>0)&&(Ja[Ja.length]=xa);ua[ua.length]=wa,Ai=Ja}var bi="";for(Aa=ua.length-1;Aa>=0;Aa--)bi+=Yt.charAt(ua[Aa]);var fi=Math.ceil(nt.length*8/(Math.log(Yt.length)/Math.log(2)));for(Aa=bi.length;Aa>>6&31,128|ua&63):ua<=65535?Yt+=String.fromCharCode(224|ua>>>12&15,128|ua>>>6&63,128|ua&63):ua<=2097151&&(Yt+=String.fromCharCode(240|ua>>>18&7,128|ua>>>12&63,128|ua>>>6&63,128|ua&63));return Yt}function kc(nt){for(var Yt=Array(nt.length>>2),cr=0;cr>5]|=(nt.charCodeAt(cr/8)&255)<<24-cr%32;return Yt}function er(nt){for(var Yt="",cr=0;cr>5]>>>24-cr%32&255);return Yt}function yr(nt,Yt){return nt>>>Yt|nt<<32-Yt}function na(nt,Yt){return nt>>>Yt}function $r(nt,Yt,cr){return nt&Yt^~nt&cr}function La(nt,Yt,cr){return nt&Yt^nt&cr^Yt&cr}function hi(nt){return yr(nt,2)^yr(nt,13)^yr(nt,22)}function Pi(nt){return yr(nt,6)^yr(nt,11)^yr(nt,25)}function Zi(nt){return yr(nt,7)^yr(nt,18)^na(nt,3)}function tn(nt){return yr(nt,17)^yr(nt,19)^na(nt,10)}var dn=new Array(1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998);function Ri(nt,Yt){var cr=new Array(1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225),ua=new Array(64),Aa,xa,wa,Ja,Ai,bi,fi,yn,Oi,ki,qa,ea;for(nt[Yt>>5]|=128<<24-Yt%32,nt[(Yt+64>>9<<4)+15]=Yt,Oi=0;Oi>16)+(Yt>>16)+(cr>>16);return ua<<16|cr&65535}function qi(nt){return Array.prototype.slice.call(nt)}function _i(nt){return qi(nt).join("")}function Mn(nt){var Yt=nt&&nt.cache,cr=0,ua=[],Aa=[],xa=[];function wa(qa,ea){var Ea=ea&&ea.stable;if(!Ea){for(var ii=0;ii0&&(qa.push(gi,"="),qa.push.apply(qa,qi(arguments)),qa.push(";")),gi}return d(ea,{def:ii,toString:function(){return _i([Ea.length>0?"var "+Ea.join(",")+";":"",_i(qa)])}})}function Ai(){var qa=Ja(),ea=Ja(),Ea=qa.toString,ii=ea.toString;function gi(Wa,ji){ea(Wa,ji,"=",qa.def(Wa,ji),";")}return d(function(){qa.apply(qa,qi(arguments))},{def:qa.def,entry:qa,exit:ea,save:gi,set:function(Wa,ji,Ii){gi(Wa,ji),qa(Wa,ji,"=",Ii,";")},toString:function(){return Ea()+ii()}})}function bi(){var qa=_i(arguments),ea=Ai(),Ea=Ai(),ii=ea.toString,gi=Ea.toString;return d(ea,{then:function(){return ea.apply(ea,qi(arguments)),this},else:function(){return Ea.apply(Ea,qi(arguments)),this},toString:function(){var Wa=gi();return Wa&&(Wa="else{"+Wa+"}"),_i(["if(",qa,"){",ii(),"}",Wa])}})}var fi=Ja(),yn={};function Oi(qa,ea){var Ea=[];function ii(){var hn="a"+Ea.length;return Ea.push(hn),hn}ea=ea||0;for(var gi=0;gi":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},Na={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},Ka={cw:et,ccw:vt};function vi(nt){return Array.isArray(nt)||wr(nt)||Ir(nt)}function ui(nt){return nt.sort(function(Yt,cr){return Yt===Se?-1:cr===Se?1:Yt=1,ua>=2,Yt)}else if(cr===xs){var Aa=nt.data;return new Pa(Aa.thisDep,Aa.contextDep,Aa.propDep,Yt)}else{if(cr===Qs)return new Pa(!1,!1,!1,Yt);if(cr===Rs){for(var xa=!1,wa=!1,Ja=!1,Ai=0;Ai=1&&(wa=!0),fi>=2&&(Ja=!0)}else bi.type===xs&&(xa=xa||bi.data.thisDep,wa=wa||bi.data.contextDep,Ja=Ja||bi.data.propDep)}return new Pa(xa,wa,Ja,Yt)}else return new Pa(cr===Qo,cr===_o,cr===un,Yt)}}var Pn=new Pa(!1,!1,!1,function(){});function Zn(nt,Yt,cr,ua,Aa,xa,wa,Ja,Ai,bi,fi,yn,Oi,ki,qa,ea){var Ea=bi.Record,ii={add:32774,subtract:32778,"reverse subtract":32779};cr.ext_blend_minmax&&(ii.min=_t,ii.max=St);var gi=cr.angle_instanced_arrays,Wa=cr.webgl_draw_buffers,ji=cr.oes_vertex_array_object,Ii={dirty:!0,profile:ea.profile},hn={},Za=[],Va={},$i={};function zi(gt){return gt.replace(".","_")}function Si(gt,Et,Ft){var ir=zi(gt);Za.push(gt),hn[ir]=Ii[ir]=!!Ft,Va[ir]=Et}function Ti(gt,Et,Ft){var ir=zi(gt);Za.push(gt),Array.isArray(Ft)?(Ii[ir]=Ft.slice(),hn[ir]=Ft.slice()):Ii[ir]=hn[ir]=Ft,$i[ir]=Et}function Ki(gt){return!!isNaN(gt)}Si(Ks,di),Si(ys,Oa),Ti(Fl,"blendColor",[0,0,0,0]),Ti(yl,"blendEquationSeparate",[Wr,Wr]),Ti(sl,"blendFuncSeparate",[Vr,gr,Vr,gr]),Si(Un,Gi,!0),Ti(Io,"depthFunc",Ta),Ti(Xs,"depthRange",[0,1]),Ti(Ls,"depthMask",!0),Ti(ou,ou,[!0,!0,!0,!0]),Si(Iu,Sa),Ti(Zu,"cullFace",De),Ti(Lc,Lc,vt),Ti(yu,yu,1),Si(Pc,Tn),Ti(wu,"polygonOffset",[0,0]),Si(gc,Wn),Si(fo,Bn),Ti(zo,"sampleCoverage",[1,!1]),Si(Ic,Wi),Ti(lc,"stencilMask",-1),Ti(Yu,"stencilFunc",[ar,0,-1]),Ti(Ne,"stencilOpSeparate",[de,zt,zt,zt]),Ti(R,"stencilOpSeparate",[De,zt,zt,zt]),Si(ae,on),Ti(we,"scissor",[0,0,nt.drawingBufferWidth,nt.drawingBufferHeight]),Ti(Se,Se,[0,0,nt.drawingBufferWidth,nt.drawingBufferHeight]);var mn={gl:nt,context:Oi,strings:Yt,next:hn,current:Ii,draw:yn,elements:xa,buffer:Aa,shader:fi,attributes:bi.state,vao:bi,uniforms:Ai,framebuffer:Ja,extensions:cr,timer:ki,isBufferArgs:vi},In={primTypes:xt,compareFuncs:Ma,blendFuncs:ni,blendEquations:ii,stencilOps:Na,glTypes:la,orientationType:Ka};Wa&&(In.backBuffer=[De],In.drawBuffer=p(ua.maxDrawbuffers,function(gt){return gt===0?[0]:p(gt,function(Et){return ri+Et})}));var Di=0;function nn(){var gt=Mn({cache:qa}),Et=gt.link,Ft=gt.global;gt.id=Di++,gt.batchId="0";var ir=Et(mn),fr=gt.shared={props:"a0"};Object.keys(mn).forEach(function(or){fr[or]=Ft.def(ir,".",or)});var sr=gt.next={},pr=gt.current={};Object.keys($i).forEach(function(or){Array.isArray(Ii[or])&&(sr[or]=Ft.def(fr.next,".",or),pr[or]=Ft.def(fr.current,".",or))});var lr=gt.constants={};Object.keys(In).forEach(function(or){lr[or]=Ft.def(JSON.stringify(In[or]))}),gt.invoke=function(or,qt){switch(qt.type){case wn:var Dr=["this",fr.context,fr.props,gt.batchId];return or.def(Et(qt.data),".call(",Dr.slice(0,Math.max(qt.data.length+1,4)),")");case un:return or.def(fr.props,qt.data);case _o:return or.def(fr.context,qt.data);case Qo:return or.def("this",qt.data);case xs:return qt.data.append(gt,or),qt.data.ref;case Qs:return qt.data.toString();case Rs:return qt.data.map(function(Jr){return gt.invoke(or,Jr)})}},gt.attribCache={};var Xt={};return gt.scopeAttrib=function(or){var qt=Yt.id(or);if(qt in Xt)return Xt[qt];var Dr=bi.scope[qt];Dr||(Dr=bi.scope[qt]=new Ea);var Jr=Xt[qt]=Et(Dr);return Jr},gt}function En(gt){var Et=gt.static,Ft=gt.dynamic,ir;if(Oe in Et){var fr=!!Et[Oe];ir=an(function(pr,lr){return fr}),ir.enable=fr}else if(Oe in Ft){var sr=Ft[Oe];ir=vn(sr,function(pr,lr){return pr.invoke(lr,sr)})}return ir}function Rn(gt,Et){var Ft=gt.static,ir=gt.dynamic;if(pt in Ft){var fr=Ft[pt];return fr?(fr=Ja.getFramebuffer(fr),an(function(pr,lr){var Xt=pr.link(fr),or=pr.shared;lr.set(or.framebuffer,".next",Xt);var qt=or.context;return lr.set(qt,"."+dt,Xt+".width"),lr.set(qt,"."+Ct,Xt+".height"),Xt})):an(function(pr,lr){var Xt=pr.shared;lr.set(Xt.framebuffer,".next","null");var or=Xt.context;return lr.set(or,"."+dt,or+"."+mr),lr.set(or,"."+Ct,or+"."+Er),"null"})}else if(pt in ir){var sr=ir[pt];return vn(sr,function(pr,lr){var Xt=pr.invoke(lr,sr),or=pr.shared,qt=or.framebuffer,Dr=lr.def(qt,".getFramebuffer(",Xt,")");lr.set(qt,".next",Dr);var Jr=or.context;return lr.set(Jr,"."+dt,Dr+"?"+Dr+".width:"+Jr+"."+mr),lr.set(Jr,"."+Ct,Dr+"?"+Dr+".height:"+Jr+"."+Er),Dr})}else return null}function Gn(gt,Et,Ft){var ir=gt.static,fr=gt.dynamic;function sr(Xt){if(Xt in ir){var or=ir[Xt],qt=!0,Dr=or.x|0,Jr=or.y|0,ba,yi;return"width"in or?ba=or.width|0:qt=!1,"height"in or?yi=or.height|0:qt=!1,new Pa(!qt&&Et&&Et.thisDep,!qt&&Et&&Et.contextDep,!qt&&Et&&Et.propDep,function(Ji,Bi){var pi=Ji.shared.context,wi=ba;"width"in or||(wi=Bi.def(pi,".",dt,"-",Dr));var Mi=yi;return"height"in or||(Mi=Bi.def(pi,".",Ct,"-",Jr)),[Dr,Jr,wi,Mi]})}else if(Xt in fr){var Xa=fr[Xt],si=vn(Xa,function(Ji,Bi){var pi=Ji.invoke(Bi,Xa),wi=Ji.shared.context,Mi=Bi.def(pi,".x|0"),Vi=Bi.def(pi,".y|0"),cn=Bi.def('"width" in ',pi,"?",pi,".width|0:","(",wi,".",dt,"-",Mi,")"),xo=Bi.def('"height" in ',pi,"?",pi,".height|0:","(",wi,".",Ct,"-",Vi,")");return[Mi,Vi,cn,xo]});return Et&&(si.thisDep=si.thisDep||Et.thisDep,si.contextDep=si.contextDep||Et.contextDep,si.propDep=si.propDep||Et.propDep),si}else return Et?new Pa(Et.thisDep,Et.contextDep,Et.propDep,function(Ji,Bi){var pi=Ji.shared.context;return[0,0,Bi.def(pi,".",dt),Bi.def(pi,".",Ct)]}):null}var pr=sr(Se);if(pr){var lr=pr;pr=new Pa(pr.thisDep,pr.contextDep,pr.propDep,function(Xt,or){var qt=lr.append(Xt,or),Dr=Xt.shared.context;return or.set(Dr,"."+wt,qt[2]),or.set(Dr,"."+Dt,qt[3]),qt})}return{viewport:pr,scissor_box:sr(we)}}function Ps(gt,Et){var Ft=gt.static,ir=typeof Ft[Bt]=="string"&&typeof Ft[At]=="string";if(ir){if(Object.keys(Et.dynamic).length>0)return null;var fr=Et.static,sr=Object.keys(fr);if(sr.length>0&&typeof fr[sr[0]]=="number"){for(var pr=[],lr=0;lr"+Mi+"?"+qt+".constant["+Mi+"]:0;"}).join(""),"}}else{","if(",ba,"(",qt,".buffer)){",Ji,"=",yi,".createStream(",Qr,",",qt,".buffer);","}else{",Ji,"=",yi,".getBuffer(",qt,".buffer);","}",Bi,'="type" in ',qt,"?",Jr.glTypes,"[",qt,".type]:",Ji,".dtype;",Xa.normalized,"=!!",qt,".normalized;");function pi(wi){or(Xa[wi],"=",qt,".",wi,"|0;")}return pi("size"),pi("offset"),pi("stride"),pi("divisor"),or("}}"),or.exit("if(",Xa.isStream,"){",yi,".destroyStream(",Ji,");","}"),Xa}fr[sr]=vn(pr,lr)}),fr}function El(gt){var Et=gt.static,Ft=gt.dynamic,ir={};return Object.keys(Et).forEach(function(fr){var sr=Et[fr];ir[fr]=an(function(pr,lr){return typeof sr=="number"||typeof sr=="boolean"?""+sr:pr.link(sr)})}),Object.keys(Ft).forEach(function(fr){var sr=Ft[fr];ir[fr]=vn(sr,function(pr,lr){return pr.invoke(lr,sr)})}),ir}function Ql(gt,Et,Ft,ir,fr){var sr=gt.static,pr=gt.dynamic,lr=Ps(gt,Et),Xt=Rn(gt,fr),or=Gn(gt,Xt,fr),qt=ho(gt,fr),Dr=Hl(gt,fr),Jr=xl(gt,fr,lr);function ba(pi){var wi=or[pi];wi&&(Dr[pi]=wi)}ba(Se),ba(zi(we));var yi=Object.keys(Dr).length>0,Xa={framebuffer:Xt,draw:qt,shader:Jr,state:Dr,dirty:yi,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(Xa.profile=En(gt,fr),Xa.uniforms=fs(Ft,fr),Xa.drawVAO=Xa.scopeVAO=qt.vao,!Xa.drawVAO&&Jr.program&&!lr&&cr.angle_instanced_arrays&&qt.static.elements){var si=!0,Ji=Jr.program.attributes.map(function(pi){var wi=Et.static[pi];return si=si&&!!wi,wi});if(si&&Ji.length>0){var Bi=bi.getVAO(bi.createVAO({attributes:Ji,elements:qt.static.elements}));Xa.drawVAO=new Pa(null,null,null,function(pi,wi){return pi.link(Bi)}),Xa.useVAO=!0}}return lr?Xa.useVAO=!0:Xa.attributes=Al(Et,fr),Xa.context=El(ir,fr),Xa}function Fs(gt,Et,Ft){var ir=gt.shared,fr=ir.context,sr=gt.scope();Object.keys(Ft).forEach(function(pr){Et.save(fr,"."+pr);var lr=Ft[pr],Xt=lr.append(gt,Et);Array.isArray(Xt)?sr(fr,".",pr,"=[",Xt.join(),"];"):sr(fr,".",pr,"=",Xt,";")}),Et(sr)}function pl(gt,Et,Ft,ir){var fr=gt.shared,sr=fr.gl,pr=fr.framebuffer,lr;Wa&&(lr=Et.def(fr.extensions,".webgl_draw_buffers"));var Xt=gt.constants,or=Xt.drawBuffer,qt=Xt.backBuffer,Dr;Ft?Dr=Ft.append(gt,Et):Dr=Et.def(pr,".next"),ir||Et("if(",Dr,"!==",pr,".cur){"),Et("if(",Dr,"){",sr,".bindFramebuffer(",ya,",",Dr,".framebuffer);"),Wa&&Et(lr,".drawBuffersWEBGL(",or,"[",Dr,".colorAttachments.length]);"),Et("}else{",sr,".bindFramebuffer(",ya,",null);"),Wa&&Et(lr,".drawBuffersWEBGL(",qt,");"),Et("}",pr,".cur=",Dr,";"),ir||Et("}")}function bl(gt,Et,Ft){var ir=gt.shared,fr=ir.gl,sr=gt.current,pr=gt.next,lr=ir.current,Xt=ir.next,or=gt.cond(lr,".dirty");Za.forEach(function(qt){var Dr=zi(qt);if(!(Dr in Ft.state)){var Jr,ba;if(Dr in pr){Jr=pr[Dr],ba=sr[Dr];var yi=p(Ii[Dr].length,function(si){return or.def(Jr,"[",si,"]")});or(gt.cond(yi.map(function(si,Ji){return si+"!=="+ba+"["+Ji+"]"}).join("||")).then(fr,".",$i[Dr],"(",yi,");",yi.map(function(si,Ji){return ba+"["+Ji+"]="+si}).join(";"),";"))}else{Jr=or.def(Xt,".",Dr);var Xa=gt.cond(Jr,"!==",lr,".",Dr);or(Xa),Dr in Va?Xa(gt.cond(Jr).then(fr,".enable(",Va[Dr],");").else(fr,".disable(",Va[Dr],");"),lr,".",Dr,"=",Jr,";"):Xa(fr,".",$i[Dr],"(",Jr,");",lr,".",Dr,"=",Jr,";")}}}),Object.keys(Ft.state).length===0&&or(lr,".dirty=false;"),Et(or)}function Hn(gt,Et,Ft,ir){var fr=gt.shared,sr=gt.current,pr=fr.current,lr=fr.gl,Xt;ui(Object.keys(Ft)).forEach(function(or){var qt=Ft[or];if(!(ir&&!ir(qt))){var Dr=qt.append(gt,Et);if(Va[or]){var Jr=Va[or];sn(qt)?(Xt=gt.link(Dr,{stable:!0}),Et(gt.cond(Xt).then(lr,".enable(",Jr,");").else(lr,".disable(",Jr,");")),Et(pr,".",or,"=",Xt,";")):(Et(gt.cond(Dr).then(lr,".enable(",Jr,");").else(lr,".disable(",Jr,");")),Et(pr,".",or,"=",Dr,";"))}else if(Ya(Dr)){var ba=sr[or];Et(lr,".",$i[or],"(",Dr,");",Dr.map(function(yi,Xa){return ba+"["+Xa+"]="+yi}).join(";"),";")}else sn(qt)?(Xt=gt.link(Dr,{stable:!0}),Et(lr,".",$i[or],"(",Xt,");",pr,".",or,"=",Xt,";")):Et(lr,".",$i[or],"(",Dr,");",pr,".",or,"=",Dr,";")}})}function Cl(gt,Et){gi&&(gt.instancing=Et.def(gt.shared.extensions,".angle_instanced_arrays"))}function Lo(gt,Et,Ft,ir,fr){var sr=gt.shared,pr=gt.stats,lr=sr.current,Xt=sr.timer,or=Ft.profile;function qt(){return typeof performance>"u"?"Date.now()":"performance.now()"}var Dr,Jr;function ba(pi){Dr=Et.def(),pi(Dr,"=",qt(),";"),typeof fr=="string"?pi(pr,".count+=",fr,";"):pi(pr,".count++;"),ki&&(ir?(Jr=Et.def(),pi(Jr,"=",Xt,".getNumPendingQueries();")):pi(Xt,".beginQuery(",pr,");"))}function yi(pi){pi(pr,".cpuTime+=",qt(),"-",Dr,";"),ki&&(ir?pi(Xt,".pushScopeStats(",Jr,",",Xt,".getNumPendingQueries(),",pr,");"):pi(Xt,".endQuery();"))}function Xa(pi){var wi=Et.def(lr,".profile");Et(lr,".profile=",pi,";"),Et.exit(lr,".profile=",wi,";")}var si;if(or){if(sn(or)){or.enable?(ba(Et),yi(Et.exit),Xa("true")):Xa("false");return}si=or.append(gt,Et),Xa(si)}else si=Et.def(lr,".profile");var Ji=gt.block();ba(Ji),Et("if(",si,"){",Ji,"}");var Bi=gt.block();yi(Bi),Et.exit("if(",si,"){",Bi,"}")}function ve(gt,Et,Ft,ir,fr){var sr=gt.shared;function pr(Xt){switch(Xt){case ss:case ll:case Pl:return 2;case So:case Js:case $l:return 3;case Ko:case es:case Ru:return 4;default:return 1}}function lr(Xt,or,qt){var Dr=sr.gl,Jr=Et.def(Xt,".location"),ba=Et.def(sr.attributes,"[",Jr,"]"),yi=qt.state,Xa=qt.buffer,si=[qt.x,qt.y,qt.z,qt.w],Ji=["buffer","normalized","offset","stride"];function Bi(){Et("if(!",ba,".buffer){",Dr,".enableVertexAttribArray(",Jr,");}");var wi=qt.type,Mi;if(qt.size?Mi=Et.def(qt.size,"||",or):Mi=or,Et("if(",ba,".type!==",wi,"||",ba,".size!==",Mi,"||",Ji.map(function(cn){return ba+"."+cn+"!=="+qt[cn]}).join("||"),"){",Dr,".bindBuffer(",Qr,",",Xa,".buffer);",Dr,".vertexAttribPointer(",[Jr,Mi,wi,qt.normalized,qt.stride,qt.offset],");",ba,".type=",wi,";",ba,".size=",Mi,";",Ji.map(function(cn){return ba+"."+cn+"="+qt[cn]+";"}).join(""),"}"),gi){var Vi=qt.divisor;Et("if(",ba,".divisor!==",Vi,"){",gt.instancing,".vertexAttribDivisorANGLE(",[Jr,Vi],");",ba,".divisor=",Vi,";}")}}function pi(){Et("if(",ba,".buffer){",Dr,".disableVertexAttribArray(",Jr,");",ba,".buffer=null;","}if(",Kn.map(function(wi,Mi){return ba+"."+wi+"!=="+si[Mi]}).join("||"),"){",Dr,".vertexAttrib4f(",Jr,",",si,");",Kn.map(function(wi,Mi){return ba+"."+wi+"="+si[Mi]+";"}).join(""),"}")}yi===Jn?Bi():yi===co?pi():(Et("if(",yi,"===",Jn,"){"),Bi(),Et("}else{"),pi(),Et("}"))}ir.forEach(function(Xt){var or=Xt.name,qt=Ft.attributes[or],Dr;if(qt){if(!fr(qt))return;Dr=qt.append(gt,Et)}else{if(!fr(Pn))return;var Jr=gt.scopeAttrib(or);Dr={},Object.keys(new Ea).forEach(function(ba){Dr[ba]=Et.def(Jr,".",ba)})}lr(gt.link(Xt),pr(Xt.info.type),Dr)})}function Y(gt,Et,Ft,ir,fr,sr){for(var pr=gt.shared,lr=pr.gl,Xt,or=0;or1){for(var jo=[],ks=[],Fo=0;Fo>1)",Xa],");")}function Vi(){Ft(si,".drawArraysInstancedANGLE(",[Jr,ba,yi,Xa],");")}qt&&qt!=="null"?Bi?Mi():(Ft("if(",qt,"){"),Mi(),Ft("}else{"),Vi(),Ft("}")):Vi()}function wi(){function Mi(){Ft(sr+".drawElements("+[Jr,yi,Ji,ba+"<<(("+Ji+"-"+ao+")>>1)"]+");")}function Vi(){Ft(sr+".drawArrays("+[Jr,ba,yi]+");")}qt&&qt!=="null"?Bi?Mi():(Ft("if(",qt,"){"),Mi(),Ft("}else{"),Vi(),Ft("}")):Vi()}gi&&(typeof Xa!="number"||Xa>=0)?typeof Xa=="string"?(Ft("if(",Xa,">0){"),pi(),Ft("}else if(",Xa,"<0){"),wi(),Ft("}")):pi():wi()}function te(gt,Et,Ft,ir,fr){var sr=nn(),pr=sr.proc("body",fr);return gi&&(sr.instancing=pr.def(sr.shared.extensions,".angle_instanced_arrays")),gt(sr,pr,Ft,ir),sr.compile().body}function me(gt,Et,Ft,ir){Cl(gt,Et),Ft.useVAO?Ft.drawVAO?Et(gt.shared.vao,".setVAO(",Ft.drawVAO.append(gt,Et),");"):Et(gt.shared.vao,".setVAO(",gt.shared.vao,".targetVAO);"):(Et(gt.shared.vao,".setVAO(null);"),ve(gt,Et,Ft,ir.attributes,function(){return!0})),Y(gt,Et,Ft,ir.uniforms,function(){return!0},!1),ye(gt,Et,Et,Ft)}function Ge(gt,Et){var Ft=gt.proc("draw",1);Cl(gt,Ft),Fs(gt,Ft,Et.context),pl(gt,Ft,Et.framebuffer),bl(gt,Ft,Et),Hn(gt,Ft,Et.state),Lo(gt,Ft,Et,!1,!0);var ir=Et.shader.progVar.append(gt,Ft);if(Ft(gt.shared.gl,".useProgram(",ir,".program);"),Et.shader.program)me(gt,Ft,Et,Et.shader.program);else{Ft(gt.shared.vao,".setVAO(null);");var fr=gt.global.def("{}"),sr=Ft.def(ir,".id"),pr=Ft.def(fr,"[",sr,"]");Ft(gt.cond(pr).then(pr,".call(this,a0);").else(pr,"=",fr,"[",sr,"]=",gt.link(function(lr){return te(me,gt,Et,lr,1)}),"(",ir,");",pr,".call(this,a0);"))}Object.keys(Et.state).length>0&&Ft(gt.shared.current,".dirty=true;"),gt.shared.vao&&Ft(gt.shared.vao,".setVAO(null);")}function Le(gt,Et,Ft,ir){gt.batchId="a1",Cl(gt,Et);function fr(){return!0}ve(gt,Et,Ft,ir.attributes,fr),Y(gt,Et,Ft,ir.uniforms,fr,!1),ye(gt,Et,Et,Ft)}function $e(gt,Et,Ft,ir){Cl(gt,Et);var fr=Ft.contextDep,sr=Et.def(),pr="a0",lr="a1",Xt=Et.def();gt.shared.props=Xt,gt.batchId=sr;var or=gt.scope(),qt=gt.scope();Et(or.entry,"for(",sr,"=0;",sr,"<",lr,";++",sr,"){",Xt,"=",pr,"[",sr,"];",qt,"}",or.exit);function Dr(Ji){return Ji.contextDep&&fr||Ji.propDep}function Jr(Ji){return!Dr(Ji)}if(Ft.needsContext&&Fs(gt,qt,Ft.context),Ft.needsFramebuffer&&pl(gt,qt,Ft.framebuffer),Hn(gt,qt,Ft.state,Dr),Ft.profile&&Dr(Ft.profile)&&Lo(gt,qt,Ft,!1,!0),ir)Ft.useVAO?Ft.drawVAO?Dr(Ft.drawVAO)?qt(gt.shared.vao,".setVAO(",Ft.drawVAO.append(gt,qt),");"):or(gt.shared.vao,".setVAO(",Ft.drawVAO.append(gt,or),");"):or(gt.shared.vao,".setVAO(",gt.shared.vao,".targetVAO);"):(or(gt.shared.vao,".setVAO(null);"),ve(gt,or,Ft,ir.attributes,Jr),ve(gt,qt,Ft,ir.attributes,Dr)),Y(gt,or,Ft,ir.uniforms,Jr,!1),Y(gt,qt,Ft,ir.uniforms,Dr,!0),ye(gt,or,qt,Ft);else{var ba=gt.global.def("{}"),yi=Ft.shader.progVar.append(gt,qt),Xa=qt.def(yi,".id"),si=qt.def(ba,"[",Xa,"]");qt(gt.shared.gl,".useProgram(",yi,".program);","if(!",si,"){",si,"=",ba,"[",Xa,"]=",gt.link(function(Ji){return te(Le,gt,Ft,Ji,2)}),"(",yi,");}",si,".call(this,a0[",sr,"],",sr,");")}}function mt(gt,Et){var Ft=gt.proc("batch",2);gt.batchId="0",Cl(gt,Ft);var ir=!1,fr=!0;Object.keys(Et.context).forEach(function(ba){ir=ir||Et.context[ba].propDep}),ir||(Fs(gt,Ft,Et.context),fr=!1);var sr=Et.framebuffer,pr=!1;sr?(sr.propDep?ir=pr=!0:sr.contextDep&&ir&&(pr=!0),pr||pl(gt,Ft,sr)):pl(gt,Ft,null),Et.state.viewport&&Et.state.viewport.propDep&&(ir=!0);function lr(ba){return ba.contextDep&&ir||ba.propDep}bl(gt,Ft,Et),Hn(gt,Ft,Et.state,function(ba){return!lr(ba)}),(!Et.profile||!lr(Et.profile))&&Lo(gt,Ft,Et,!1,"a1"),Et.contextDep=ir,Et.needsContext=fr,Et.needsFramebuffer=pr;var Xt=Et.shader.progVar;if(Xt.contextDep&&ir||Xt.propDep)$e(gt,Ft,Et,null);else{var or=Xt.append(gt,Ft);if(Ft(gt.shared.gl,".useProgram(",or,".program);"),Et.shader.program)$e(gt,Ft,Et,Et.shader.program);else{Ft(gt.shared.vao,".setVAO(null);");var qt=gt.global.def("{}"),Dr=Ft.def(or,".id"),Jr=Ft.def(qt,"[",Dr,"]");Ft(gt.cond(Jr).then(Jr,".call(this,a0,a1);").else(Jr,"=",qt,"[",Dr,"]=",gt.link(function(ba){return te($e,gt,Et,ba,2)}),"(",or,");",Jr,".call(this,a0,a1);"))}}Object.keys(Et.state).length>0&&Ft(gt.shared.current,".dirty=true;"),gt.shared.vao&&Ft(gt.shared.vao,".setVAO(null);")}function jt(gt,Et){var Ft=gt.proc("scope",3);gt.batchId="a2";var ir=gt.shared,fr=ir.current;if(Fs(gt,Ft,Et.context),Et.framebuffer&&Et.framebuffer.append(gt,Ft),ui(Object.keys(Et.state)).forEach(function(lr){var Xt=Et.state[lr],or=Xt.append(gt,Ft);Ya(or)?or.forEach(function(qt,Dr){Ki(qt)?Ft.set(gt.next[lr],"["+Dr+"]",qt):Ft.set(gt.next[lr],"["+Dr+"]",gt.link(qt,{stable:!0}))}):sn(Xt)?Ft.set(ir.next,"."+lr,gt.link(or,{stable:!0})):Ft.set(ir.next,"."+lr,or)}),Lo(gt,Ft,Et,!0,!0),[$t,Yr,Ar,sa,br].forEach(function(lr){var Xt=Et.draw[lr];if(Xt){var or=Xt.append(gt,Ft);Ki(or)?Ft.set(ir.draw,"."+lr,or):Ft.set(ir.draw,"."+lr,gt.link(or),{stable:!0})}}),Object.keys(Et.uniforms).forEach(function(lr){var Xt=Et.uniforms[lr].append(gt,Ft);Array.isArray(Xt)&&(Xt="["+Xt.map(function(or){return Ki(or)?or:gt.link(or,{stable:!0})})+"]"),Ft.set(ir.uniforms,"["+gt.link(Yt.id(lr),{stable:!0})+"]",Xt)}),Object.keys(Et.attributes).forEach(function(lr){var Xt=Et.attributes[lr].append(gt,Ft),or=gt.scopeAttrib(lr);Object.keys(new Ea).forEach(function(qt){Ft.set(or,"."+qt,Xt[qt])})}),Et.scopeVAO){var sr=Et.scopeVAO.append(gt,Ft);Ki(sr)?Ft.set(ir.vao,".targetVAO",sr):Ft.set(ir.vao,".targetVAO",gt.link(sr,{stable:!0}))}function pr(lr){var Xt=Et.shader[lr];if(Xt){var or=Xt.append(gt,Ft);Ki(or)?Ft.set(ir.shader,"."+lr,or):Ft.set(ir.shader,"."+lr,gt.link(or,{stable:!0}))}}pr(At),pr(Bt),Object.keys(Et.state).length>0&&(Ft(fr,".dirty=true;"),Ft.exit(fr,".dirty=true;")),Ft("a1(",gt.shared.context,",a0,",gt.batchId,");")}function _r(gt){if(!(typeof gt!="object"||Ya(gt))){for(var Et=Object.keys(gt),Ft=0;Ft=0;--te){var me=mn[te];me&&me(qa,null,0)}cr.flush(),fi&&fi.update()}function Gn(){!En&&mn.length>0&&(En=f.next(Rn))}function Ps(){En&&(f.cancel(Rn),En=null)}function xl(te){te.preventDefault(),Aa=!0,Ps(),In.forEach(function(me){me()})}function ho(te){cr.getError(),Aa=!1,xa.restore(),hn.restore(),gi.restore(),Za.restore(),Va.restore(),$i.restore(),ji.restore(),fi&&fi.restore(),zi.procs.refresh(),Gn(),Di.forEach(function(me){me()})}Ki&&(Ki.addEventListener(cs,xl,!1),Ki.addEventListener(ps,ho,!1));function Hl(){mn.length=0,Ps(),Ki&&(Ki.removeEventListener(cs,xl),Ki.removeEventListener(ps,ho)),hn.clear(),$i.clear(),Va.clear(),ji.clear(),Za.clear(),Wa.clear(),gi.clear(),fi&&fi.clear(),nn.forEach(function(te){te()})}function fs(te){function me(sr){var pr=d({},sr);delete pr.uniforms,delete pr.attributes,delete pr.context,delete pr.vao,"stencil"in pr&&pr.stencil.op&&(pr.stencil.opBack=pr.stencil.opFront=pr.stencil.op,delete pr.stencil.op);function lr(Xt){if(Xt in pr){var or=pr[Xt];delete pr[Xt],Object.keys(or).forEach(function(qt){pr[Xt+"."+qt]=or[qt]})}}return lr("blend"),lr("depth"),lr("cull"),lr("stencil"),lr("polygonOffset"),lr("scissor"),lr("sample"),"vao"in sr&&(pr.vao=sr.vao),pr}function Ge(sr,pr){var lr={},Xt={};return Object.keys(sr).forEach(function(or){var qt=sr[or];if(c.isDynamic(qt)){Xt[or]=c.unbox(qt,or);return}else if(pr&&Array.isArray(qt)){for(var Dr=0;Dr0)return gt.call(this,ir(sr|0),sr|0)}else if(Array.isArray(sr)){if(sr.length)return gt.call(this,sr,sr.length)}else return hr.call(this,sr)}return d(fr,{stats:_r,destroy:function(){Fr.destroy()}})}var Al=$i.setFBO=fs({framebuffer:c.define.call(null,Tl,"framebuffer")});function El(te,me){var Ge=0;zi.procs.poll();var Le=me.color;Le&&(cr.clearColor(+Le[0]||0,+Le[1]||0,+Le[2]||0,+Le[3]||0),Ge|=el),"depth"in me&&(cr.clearDepth(+me.depth),Ge|=_l),"stencil"in me&&(cr.clearStencil(me.stencil|0),Ge|=gn),cr.clear(Ge)}function Ql(te){if("framebuffer"in te)if(te.framebuffer&&te.framebuffer_reglType==="framebufferCube")for(var me=0;me<6;++me)Al(d({framebuffer:te.framebuffer.faces[me]},te),El);else Al(te,El);else El(null,te)}function Fs(te){mn.push(te);function me(){var Ge=Il(mn,te);function Le(){var $e=Il(mn,Le);mn[$e]=mn[mn.length-1],mn.length-=1,mn.length<=0&&Ps()}mn[Ge]=Le}return Gn(),{cancel:me}}function pl(){var te=Ti.viewport,me=Ti.scissor_box;te[0]=te[1]=me[0]=me[1]=0,qa.viewportWidth=qa.framebufferWidth=qa.drawingBufferWidth=te[2]=me[2]=cr.drawingBufferWidth,qa.viewportHeight=qa.framebufferHeight=qa.drawingBufferHeight=te[3]=me[3]=cr.drawingBufferHeight}function bl(){qa.tick+=1,qa.time=Cl(),pl(),zi.procs.poll()}function Hn(){Za.refresh(),pl(),zi.procs.refresh(),fi&&fi.update()}function Cl(){return(g()-yn)/1e3}Hn();function Lo(te,me){var Ge;switch(te){case"frame":return Fs(me);case"lost":Ge=In;break;case"restore":Ge=Di;break;case"destroy":Ge=nn;break;default:}return Ge.push(me),{cancel:function(){for(var Le=0;Le=0},read:Si,destroy:Hl,_gl:cr,_refresh:Hn,poll:function(){bl(),fi&&fi.update()},now:Cl,stats:Ja,getCachedCode:ve,preloadCachedCode:Y});return Yt.onDone(null,ye),ye}return yc})}}),_q=Ze({"node_modules/gl-util/context.js"(Z,q){"use strict";var d=Ev();q.exports=function(o){if(o?typeof o=="string"&&(o={container:o}):o={},A(o)?o={container:o}:M(o)?o={container:o}:e(o)?o={gl:o}:o=d(o,{container:"container target element el canvas holder parent parentNode wrapper use ref root node",gl:"gl context webgl glContext",attrs:"attributes attrs contextAttributes",pixelRatio:"pixelRatio pxRatio px ratio pxratio pixelratio",width:"w width",height:"h height"},!0),o.pixelRatio||(o.pixelRatio=window.pixelRatio||1),o.gl)return o.gl;if(o.canvas&&(o.container=o.canvas.parentNode),o.container){if(typeof o.container=="string"){var a=document.querySelector(o.container);if(!a)throw Error("Element "+o.container+" is not found");o.container=a}A(o.container)?(o.canvas=o.container,o.container=o.canvas.parentNode):o.canvas||(o.canvas=t(),o.container.appendChild(o.canvas),x(o))}else if(!o.canvas)if(typeof document<"u")o.container=document.body||document.documentElement,o.canvas=t(),o.container.appendChild(o.canvas),x(o);else throw Error("Not DOM environment. Use headless-gl.");return o.gl||["webgl","experimental-webgl","webgl-experimental"].some(function(i){try{o.gl=o.canvas.getContext(i,o.attrs)}catch{}return o.gl}),o.gl};function x(r){if(r.container)if(r.container==document.body)document.body.style.width||(r.canvas.width=r.width||r.pixelRatio*window.innerWidth),document.body.style.height||(r.canvas.height=r.height||r.pixelRatio*window.innerHeight);else{var o=r.container.getBoundingClientRect();r.canvas.width=r.width||o.right-o.left,r.canvas.height=r.height||o.bottom-o.top}}function A(r){return typeof r.getContext=="function"&&"width"in r&&"height"in r}function M(r){return typeof r.nodeName=="string"&&typeof r.appendChild=="function"&&typeof r.getBoundingClientRect=="function"}function e(r){return typeof r.drawArrays=="function"||typeof r.drawElements=="function"}function t(){var r=document.createElement("canvas");return r.style.position="absolute",r.style.top=0,r.style.left=0,r}}}),xq=Ze({"node_modules/font-atlas/index.js"(Z,q){"use strict";var d=u6(),x=[32,126];q.exports=A;function A(M){M=M||{};var e=M.shape?M.shape:M.canvas?[M.canvas.width,M.canvas.height]:[512,512],t=M.canvas||document.createElement("canvas"),r=M.font,o=typeof M.step=="number"?[M.step,M.step]:M.step||[32,32],a=M.chars||x;if(r&&typeof r!="string"&&(r=d(r)),!Array.isArray(a))a=String(a).split("");else if(a.length===2&&typeof a[0]=="number"&&typeof a[1]=="number"){for(var i=[],n=a[0],s=0;n<=a[1];n++)i[s++]=String.fromCharCode(n);a=i}e=e.slice(),t.width=e[0],t.height=e[1];var c=t.getContext("2d");c.fillStyle="#000",c.fillRect(0,0,t.width,t.height),c.font=r,c.textAlign="center",c.textBaseline="middle",c.fillStyle="#fff";for(var f=o[0]/2,g=o[1]/2,n=0;ne[0]-o[0]/2&&(f=o[0]/2,g+=o[1]);return t}}}),c6=Ze({"node_modules/bit-twiddle/twiddle.js"(Z){"use strict";"use restrict";var q=32;Z.INT_BITS=q,Z.INT_MAX=2147483647,Z.INT_MIN=-1<0)-(A<0)},Z.abs=function(A){var M=A>>q-1;return(A^M)-M},Z.min=function(A,M){return M^(A^M)&-(A65535)<<4,A>>>=M,e=(A>255)<<3,A>>>=e,M|=e,e=(A>15)<<2,A>>>=e,M|=e,e=(A>3)<<1,A>>>=e,M|=e,M|A>>1},Z.log10=function(A){return A>=1e9?9:A>=1e8?8:A>=1e7?7:A>=1e6?6:A>=1e5?5:A>=1e4?4:A>=1e3?3:A>=100?2:A>=10?1:0},Z.popCount=function(A){return A=A-(A>>>1&1431655765),A=(A&858993459)+(A>>>2&858993459),(A+(A>>>4)&252645135)*16843009>>>24};function d(A){var M=32;return A&=-A,A&&M--,A&65535&&(M-=16),A&16711935&&(M-=8),A&252645135&&(M-=4),A&858993459&&(M-=2),A&1431655765&&(M-=1),M}Z.countTrailingZeros=d,Z.nextPow2=function(A){return A+=A===0,--A,A|=A>>>1,A|=A>>>2,A|=A>>>4,A|=A>>>8,A|=A>>>16,A+1},Z.prevPow2=function(A){return A|=A>>>1,A|=A>>>2,A|=A>>>4,A|=A>>>8,A|=A>>>16,A-(A>>>1)},Z.parity=function(A){return A^=A>>>16,A^=A>>>8,A^=A>>>4,A&=15,27030>>>A&1};var x=new Array(256);(function(A){for(var M=0;M<256;++M){var e=M,t=M,r=7;for(e>>>=1;e;e>>>=1)t<<=1,t|=e&1,--r;A[M]=t<>>8&255]<<16|x[A>>>16&255]<<8|x[A>>>24&255]},Z.interleave2=function(A,M){return A&=65535,A=(A|A<<8)&16711935,A=(A|A<<4)&252645135,A=(A|A<<2)&858993459,A=(A|A<<1)&1431655765,M&=65535,M=(M|M<<8)&16711935,M=(M|M<<4)&252645135,M=(M|M<<2)&858993459,M=(M|M<<1)&1431655765,A|M<<1},Z.deinterleave2=function(A,M){return A=A>>>M&1431655765,A=(A|A>>>1)&858993459,A=(A|A>>>2)&252645135,A=(A|A>>>4)&16711935,A=(A|A>>>16)&65535,A<<16>>16},Z.interleave3=function(A,M,e){return A&=1023,A=(A|A<<16)&4278190335,A=(A|A<<8)&251719695,A=(A|A<<4)&3272356035,A=(A|A<<2)&1227133513,M&=1023,M=(M|M<<16)&4278190335,M=(M|M<<8)&251719695,M=(M|M<<4)&3272356035,M=(M|M<<2)&1227133513,A|=M<<1,e&=1023,e=(e|e<<16)&4278190335,e=(e|e<<8)&251719695,e=(e|e<<4)&3272356035,e=(e|e<<2)&1227133513,A|e<<2},Z.deinterleave3=function(A,M){return A=A>>>M&1227133513,A=(A|A>>>2)&3272356035,A=(A|A>>>4)&251719695,A=(A|A>>>8)&4278190335,A=(A|A>>>16)&1023,A<<22>>22},Z.nextCombination=function(A){var M=A|A-1;return M+1|(~M&-~M)-1>>>d(A)+1}}}),bq=Ze({"node_modules/dup/dup.js"(Z,q){"use strict";function d(M,e,t){var r=M[t]|0;if(r<=0)return[];var o=new Array(r),a;if(t===M.length-1)for(a=0;a"u"&&(e=0),typeof M){case"number":if(M>0)return x(M|0,e);break;case"object":if(typeof M.length=="number")return d(M,e,0);break}return[]}q.exports=A}}),wq=Ze({"node_modules/typedarray-pool/pool.js"(Z){"use strict";var q=c6(),d=bq(),x=tg().Buffer;window.__TYPEDARRAY_POOL||(window.__TYPEDARRAY_POOL={UINT8:d([32,0]),UINT16:d([32,0]),UINT32:d([32,0]),BIGUINT64:d([32,0]),INT8:d([32,0]),INT16:d([32,0]),INT32:d([32,0]),BIGINT64:d([32,0]),FLOAT:d([32,0]),DOUBLE:d([32,0]),DATA:d([32,0]),UINT8C:d([32,0]),BUFFER:d([32,0])});var A=typeof Uint8ClampedArray<"u",M=typeof BigUint64Array<"u",e=typeof BigInt64Array<"u",t=window.__TYPEDARRAY_POOL;t.UINT8C||(t.UINT8C=d([32,0])),t.BIGUINT64||(t.BIGUINT64=d([32,0])),t.BIGINT64||(t.BIGINT64=d([32,0])),t.BUFFER||(t.BUFFER=d([32,0]));var r=t.DATA,o=t.BUFFER;Z.free=function(u){if(x.isBuffer(u))o[q.log2(u.length)].push(u);else{if(Object.prototype.toString.call(u)!=="[object ArrayBuffer]"&&(u=u.buffer),!u)return;var m=u.length||u.byteLength,h=q.log2(m)|0;r[h].push(u)}};function a(p){if(p){var u=p.length||p.byteLength,m=q.log2(u);r[m].push(p)}}function i(p){a(p.buffer)}Z.freeUint8=Z.freeUint16=Z.freeUint32=Z.freeBigUint64=Z.freeInt8=Z.freeInt16=Z.freeInt32=Z.freeBigInt64=Z.freeFloat32=Z.freeFloat=Z.freeFloat64=Z.freeDouble=Z.freeUint8Clamped=Z.freeDataView=i,Z.freeArrayBuffer=a,Z.freeBuffer=function(u){o[q.log2(u.length)].push(u)},Z.malloc=function(u,m){if(m===void 0||m==="arraybuffer")return n(u);switch(m){case"uint8":return s(u);case"uint16":return c(u);case"uint32":return f(u);case"int8":return g(u);case"int16":return v(u);case"int32":return T(u);case"float":case"float32":return l(u);case"double":case"float64":return _(u);case"uint8_clamped":return w(u);case"bigint64":return E(u);case"biguint64":return S(u);case"buffer":return b(u);case"data":case"dataview":return y(u);default:return null}return null};function n(u){var u=q.nextPow2(u),m=q.log2(u),h=r[m];return h.length>0?h.pop():new ArrayBuffer(u)}Z.mallocArrayBuffer=n;function s(p){return new Uint8Array(n(p),0,p)}Z.mallocUint8=s;function c(p){return new Uint16Array(n(2*p),0,p)}Z.mallocUint16=c;function f(p){return new Uint32Array(n(4*p),0,p)}Z.mallocUint32=f;function g(p){return new Int8Array(n(p),0,p)}Z.mallocInt8=g;function v(p){return new Int16Array(n(2*p),0,p)}Z.mallocInt16=v;function T(p){return new Int32Array(n(4*p),0,p)}Z.mallocInt32=T;function l(p){return new Float32Array(n(4*p),0,p)}Z.mallocFloat32=Z.mallocFloat=l;function _(p){return new Float64Array(n(8*p),0,p)}Z.mallocFloat64=Z.mallocDouble=_;function w(p){return A?new Uint8ClampedArray(n(p),0,p):s(p)}Z.mallocUint8Clamped=w;function S(p){return M?new BigUint64Array(n(8*p),0,p):null}Z.mallocBigUint64=S;function E(p){return e?new BigInt64Array(n(8*p),0,p):null}Z.mallocBigInt64=E;function y(p){return new DataView(n(p),0,p)}Z.mallocDataView=y;function b(p){p=q.nextPow2(p);var u=q.log2(p),m=o[u];return m.length>0?m.pop():new x(p)}Z.mallocBuffer=b,Z.clearCache=function(){for(var u=0;u<32;++u)t.UINT8[u].length=0,t.UINT16[u].length=0,t.UINT32[u].length=0,t.INT8[u].length=0,t.INT16[u].length=0,t.INT32[u].length=0,t.FLOAT[u].length=0,t.DOUBLE[u].length=0,t.BIGUINT64[u].length=0,t.BIGINT64[u].length=0,t.UINT8C[u].length=0,r[u].length=0,o[u].length=0}}}),Tq=Ze({"node_modules/is-plain-obj/index.js"(Z,q){"use strict";var d=Object.prototype.toString;q.exports=function(x){var A;return d.call(x)==="[object Object]"&&(A=Object.getPrototypeOf(x),A===null||A===Object.getPrototypeOf({}))}}}),f6=Ze({"node_modules/parse-unit/index.js"(Z,q){q.exports=function(x,A){A||(A=[0,""]),x=String(x);var M=parseFloat(x,10);return A[0]=M,A[1]=x.match(/[\d.\-\+]*\s*(.*)/)[1]||"",A}}}),Aq=Ze({"node_modules/to-px/topx.js"(Z,q){"use strict";var d=f6();q.exports=e;var x=96;function A(t,r){var o=d(getComputedStyle(t).getPropertyValue(r));return o[0]*e(o[1],t)}function M(t,r){var o=document.createElement("div");o.style["font-size"]="128"+t,r.appendChild(o);var a=A(o,"font-size")/128;return r.removeChild(o),a}function e(t,r){switch(r=r||document.body,t=(t||"px").trim().toLowerCase(),(r===window||r===document)&&(r=document.body),t){case"%":return r.clientHeight/100;case"ch":case"ex":return M(t,r);case"em":return A(r,"font-size");case"rem":return A(document.body,"font-size");case"vw":return window.innerWidth/100;case"vh":return window.innerHeight/100;case"vmin":return Math.min(window.innerWidth,window.innerHeight)/100;case"vmax":return Math.max(window.innerWidth,window.innerHeight)/100;case"in":return x;case"cm":return x/2.54;case"mm":return x/25.4;case"pt":return x/72;case"pc":return x/6}return 1}}}),Sq=Ze({"node_modules/detect-kerning/index.js"(Z,q){"use strict";q.exports=M;var d=M.canvas=document.createElement("canvas"),x=d.getContext("2d"),A=e([32,126]);M.createPairs=e,M.ascii=A;function M(t,r){Array.isArray(t)&&(t=t.join(", "));var o={},a,i=16,n=.05;r&&(r.length===2&&typeof r[0]=="number"?a=e(r):Array.isArray(r)?a=r:(r.o?a=e(r.o):r.pairs&&(a=r.pairs),r.fontSize&&(i=r.fontSize),r.threshold!=null&&(n=r.threshold))),a||(a=A),x.font=i+"px "+t;for(var s=0;si*n){var v=(g-f)/i;o[c]=v*1e3}}return o}function e(t){for(var r=[],o=t[0];o<=t[1];o++)for(var a=String.fromCharCode(o),i=t[0];i0;o-=4)if(r[o]!==0)return Math.floor((o-3)*.25/t)}}}),Eq=Ze({"node_modules/gl-text/dist.js"(Z,q){"use strict";var d=gq(),x=Ev(),A=yq(),M=_q(),e=t6(),t=h0(),r=xq(),o=wq(),a=k1(),i=Tq(),n=f6(),s=Aq(),c=Sq(),f=sh(),g=Mq(),v=mg(),T=c6(),l=T.nextPow2,_=new e,w=!1;document.body&&(S=document.body.appendChild(document.createElement("div")),S.style.font="italic small-caps bold condensed 16px/2 cursive",getComputedStyle(S).fontStretch&&(w=!0),document.body.removeChild(S));var S,E=function(p){y(p)?(p={regl:p},this.gl=p.regl._gl):this.gl=M(p),this.shader=_.get(this.gl),this.shader?this.regl=this.shader.regl:this.regl=p.regl||A({gl:this.gl}),this.charBuffer=this.regl.buffer({type:"uint8",usage:"stream"}),this.sizeBuffer=this.regl.buffer({type:"float",usage:"stream"}),this.shader||(this.shader=this.createShader(),_.set(this.gl,this.shader)),this.batch=[],this.fontSize=[],this.font=[],this.fontAtlas=[],this.draw=this.shader.draw.bind(this),this.render=function(){this.regl._refresh(),this.draw(this.batch)},this.canvas=this.gl.canvas,this.update(i(p)?p:{})};E.prototype.createShader=function(){var p=this.regl,u=p({blend:{enable:!0,color:[0,0,0,1],func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},stencil:{enable:!1},depth:{enable:!1},count:p.prop("count"),offset:p.prop("offset"),attributes:{charOffset:{offset:4,stride:8,buffer:p.this("sizeBuffer")},width:{offset:0,stride:8,buffer:p.this("sizeBuffer")},char:p.this("charBuffer"),position:p.this("position")},uniforms:{atlasSize:function(h,P){return[P.atlas.width,P.atlas.height]},atlasDim:function(h,P){return[P.atlas.cols,P.atlas.rows]},atlas:function(h,P){return P.atlas.texture},charStep:function(h,P){return P.atlas.step},em:function(h,P){return P.atlas.em},color:p.prop("color"),opacity:p.prop("opacity"),viewport:p.this("viewportArray"),scale:p.this("scale"),align:p.prop("align"),baseline:p.prop("baseline"),translate:p.this("translate"),positionOffset:p.prop("positionOffset")},primitive:"points",viewport:p.this("viewport"),vert:` precision highp float; attribute float width, charOffset, char; attribute vec2 position; uniform float fontSize, charStep, em, align, baseline; uniform vec4 viewport; uniform vec4 color; uniform vec2 atlasSize, atlasDim, scale, translate, positionOffset; varying vec2 charCoord, charId; varying float charWidth; varying vec4 fontColor; void main () { vec2 offset = floor(em * (vec2(align + charOffset, baseline) + vec2(positionOffset.x, -positionOffset.y))) / (viewport.zw * scale.xy); vec2 position = (position + translate) * scale; position += offset * scale; charCoord = position * viewport.zw + viewport.xy; gl_Position = vec4(position * 2. - 1., 0, 1); gl_PointSize = charStep; charId.x = mod(char, atlasDim.x); charId.y = floor(char / atlasDim.x); charWidth = width * em; fontColor = color / 255.; }`,frag:` precision highp float; uniform float fontSize, charStep, opacity; uniform vec2 atlasSize; uniform vec4 viewport; uniform sampler2D atlas; varying vec4 fontColor; varying vec2 charCoord, charId; varying float charWidth; float lightness(vec4 color) { return color.r * 0.299 + color.g * 0.587 + color.b * 0.114; } void main () { vec2 uv = gl_FragCoord.xy - charCoord + charStep * .5; float halfCharStep = floor(charStep * .5 + .5); // invert y and shift by 1px (FF expecially needs that) uv.y = charStep - uv.y; // ignore points outside of character bounding box float halfCharWidth = ceil(charWidth * .5); if (floor(uv.x) > halfCharStep + halfCharWidth || floor(uv.x) < halfCharStep - halfCharWidth) return; uv += charId * charStep; uv = uv / atlasSize; vec4 color = fontColor; vec4 mask = texture2D(atlas, uv); float maskY = lightness(mask); // float colorY = lightness(color); color.a *= maskY; color.a *= opacity; // color.a += .1; // antialiasing, see yiq color space y-channel formula // color.rgb += (1. - color.rgb) * (1. - mask.rgb); gl_FragColor = color; }`}),m={};return{regl:p,draw:u,atlas:m}},E.prototype.update=function(p){var u=this;if(typeof p=="string")p={text:p};else if(!p)return;p=x(p,{position:"position positions coord coords coordinates",font:"font fontFace fontface typeface cssFont css-font family fontFamily",fontSize:"fontSize fontsize size font-size",text:"text texts chars characters value values symbols",align:"align alignment textAlign textbaseline",baseline:"baseline textBaseline textbaseline",direction:"dir direction textDirection",color:"color colour fill fill-color fillColor textColor textcolor",kerning:"kerning kern",range:"range dataBox",viewport:"vp viewport viewBox viewbox viewPort",opacity:"opacity alpha transparency visible visibility opaque",offset:"offset positionOffset padding shift indent indentation"},!0),p.opacity!=null&&(Array.isArray(p.opacity)?this.opacity=p.opacity.map(function(fe){return parseFloat(fe)}):this.opacity=parseFloat(p.opacity)),p.viewport!=null&&(this.viewport=a(p.viewport),this.viewportArray=[this.viewport.x,this.viewport.y,this.viewport.width,this.viewport.height]),this.viewport==null&&(this.viewport={x:0,y:0,width:this.gl.drawingBufferWidth,height:this.gl.drawingBufferHeight},this.viewportArray=[this.viewport.x,this.viewport.y,this.viewport.width,this.viewport.height]),p.kerning!=null&&(this.kerning=p.kerning),p.offset!=null&&(typeof p.offset=="number"&&(p.offset=[p.offset,0]),this.positionOffset=v(p.offset)),p.direction&&(this.direction=p.direction),p.range&&(this.range=p.range,this.scale=[1/(p.range[2]-p.range[0]),1/(p.range[3]-p.range[1])],this.translate=[-p.range[0],-p.range[1]]),p.scale&&(this.scale=p.scale),p.translate&&(this.translate=p.translate),this.scale||(this.scale=[1/this.viewport.width,1/this.viewport.height]),this.translate||(this.translate=[0,0]),!this.font.length&&!p.font&&(p.font=E.baseFontSize+"px sans-serif");var m=!1,h=!1;if(p.font&&(Array.isArray(p.font)?p.font:[p.font]).forEach(function(fe,Fe){if(typeof fe=="string")try{fe=d.parse(fe)}catch{fe=d.parse(E.baseFontSize+"px "+fe)}else{var rt=fe.style,st=fe.weight,Qe=fe.stretch,Lt=fe.variant;fe=d.parse(d.stringify(fe)),rt&&(fe.style=rt),st&&(fe.weight=st),Qe&&(fe.stretch=Qe),Lt&&(fe.variant=Lt)}var kt=d.stringify({size:E.baseFontSize,family:fe.family,stretch:w?fe.stretch:void 0,variant:fe.variant,weight:fe.weight,style:fe.style}),Vt=n(fe.size),Zt=Math.round(Vt[0]*s(Vt[1]));if(Zt!==u.fontSize[Fe]&&(h=!0,u.fontSize[Fe]=Zt),(!u.font[Fe]||kt!=u.font[Fe].baseString)&&(m=!0,u.font[Fe]=E.fonts[kt],!u.font[Fe])){var Sr=fe.family.join(", "),xr=[fe.style];fe.style!=fe.variant&&xr.push(fe.variant),fe.variant!=fe.weight&&xr.push(fe.weight),w&&fe.weight!=fe.stretch&&xr.push(fe.stretch),u.font[Fe]={baseString:kt,family:Sr,weight:fe.weight,stretch:fe.stretch,style:fe.style,variant:fe.variant,width:{},kerning:{},metrics:g(Sr,{origin:"top",fontSize:E.baseFontSize,fontStyle:xr.join(" ")})},E.fonts[kt]=u.font[Fe]}}),(m||h)&&this.font.forEach(function(fe,Fe){var rt=d.stringify({size:u.fontSize[Fe],family:fe.family,stretch:w?fe.stretch:void 0,variant:fe.variant,weight:fe.weight,style:fe.style});if(u.fontAtlas[Fe]=u.shader.atlas[rt],!u.fontAtlas[Fe]){var st=fe.metrics;u.shader.atlas[rt]=u.fontAtlas[Fe]={fontString:rt,step:Math.ceil(u.fontSize[Fe]*st.bottom*.5)*2,em:u.fontSize[Fe],cols:0,rows:0,height:0,width:0,chars:[],ids:{},texture:u.regl.texture()}}p.text==null&&(p.text=u.text)}),typeof p.text=="string"&&p.position&&p.position.length>2){for(var P=Array(p.position.length*.5),L=0;L2){for(var B=!p.position[0].length,O=o.mallocFloat(this.count*2),I=0,N=0;I1?u.align[Fe]:u.align[0]:u.align;if(typeof rt=="number")return rt;switch(rt){case"right":case"end":return-fe;case"center":case"centre":case"middle":return-fe*.5}return 0})),this.baseline==null&&p.baseline==null&&(p.baseline=0),p.baseline!=null&&(this.baseline=p.baseline,Array.isArray(this.baseline)||(this.baseline=[this.baseline]),this.baselineOffset=this.baseline.map(function(fe,Fe){var rt=(u.font[Fe]||u.font[0]).metrics,st=0;return st+=rt.bottom*.5,typeof fe=="number"?st+=fe-rt.baseline:st+=-rt[fe],st*=-1,st})),p.color!=null)if(p.color||(p.color="transparent"),typeof p.color=="string"||!isNaN(p.color))this.color=t(p.color,"uint8");else{var ze;if(typeof p.color[0]=="number"&&p.color.length>this.counts.length){var Re=p.color.length;ze=o.mallocUint8(Re);for(var Xe=(p.color.subarray||p.color.slice).bind(p.color),it=0;it4||this.baselineOffset.length>1||this.align&&this.align.length>1||this.fontAtlas.length>1||this.positionOffset.length>2;if(lt){var Ee=Math.max(this.position.length*.5||0,this.color.length*.25||0,this.baselineOffset.length||0,this.alignOffset.length||0,this.font.length||0,this.opacity.length||0,this.positionOffset.length*.5||0);this.batch=Array(Ee);for(var _e=0;_e1?this.counts[_e]:this.counts[0],offset:this.textOffsets.length>1?this.textOffsets[_e]:this.textOffsets[0],color:this.color?this.color.length<=4?this.color:this.color.subarray(_e*4,_e*4+4):[0,0,0,255],opacity:Array.isArray(this.opacity)?this.opacity[_e]:this.opacity,baseline:this.baselineOffset[_e]!=null?this.baselineOffset[_e]:this.baselineOffset[0],align:this.align?this.alignOffset[_e]!=null?this.alignOffset[_e]:this.alignOffset[0]:0,atlas:this.fontAtlas[_e]||this.fontAtlas[0],positionOffset:this.positionOffset.length>2?this.positionOffset.subarray(_e*2,_e*2+2):this.positionOffset}}else this.count?this.batch=[{count:this.count,offset:0,color:this.color||[0,0,0,255],opacity:Array.isArray(this.opacity)?this.opacity[0]:this.opacity,baseline:this.baselineOffset[0],align:this.alignOffset?this.alignOffset[0]:0,atlas:this.fontAtlas[0],positionOffset:this.positionOffset}]:this.batch=[]}},E.prototype.destroy=function(){},E.prototype.kerning=!0,E.prototype.position={constant:new Float32Array(2)},E.prototype.translate=null,E.prototype.scale=null,E.prototype.font=null,E.prototype.text="",E.prototype.positionOffset=[0,0],E.prototype.opacity=1,E.prototype.color=new Uint8Array([0,0,0,255]),E.prototype.alignOffset=[0,0],E.maxAtlasSize=1024,E.atlasCanvas=document.createElement("canvas"),E.atlasContext=E.atlasCanvas.getContext("2d",{alpha:!1}),E.baseFontSize=64,E.fonts={};function y(b){return typeof b=="function"&&b._gl&&b.prop&&b.texture&&b.buffer}q.exports=E}}),Cq=Ze({"node_modules/@plotly/regl/dist/regl.unchecked.js"(Z,q){(function(d,x){typeof Z=="object"&&typeof q<"u"?q.exports=x():d.createREGL=x()})(Z,function(){"use strict";var d=function(nt,Yt){for(var cr=Object.keys(Yt),ua=0;ua1&&Yt===cr&&(Yt==='"'||Yt==="'"))return['"'+r(nt.substr(1,nt.length-2))+'"'];var ua=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(nt);if(ua)return o(nt.substr(0,ua.index)).concat(o(ua[1])).concat(o(nt.substr(ua.index+ua[0].length)));var Aa=nt.split(".");if(Aa.length===1)return['"'+r(nt)+'"'];for(var xa=[],wa=0;wa"u"?1:window.devicePixelRatio,fi=!1,yn={},Oi=function(ea){},ki=function(){};if(typeof Yt=="string"?cr=document.querySelector(Yt):typeof Yt=="object"&&(_(Yt)?cr=Yt:w(Yt)?(xa=Yt,Aa=xa.canvas):("gl"in Yt?xa=Yt.gl:"canvas"in Yt?Aa=E(Yt.canvas):"container"in Yt&&(ua=E(Yt.container)),"attributes"in Yt&&(wa=Yt.attributes),"extensions"in Yt&&(Ja=S(Yt.extensions)),"optionalExtensions"in Yt&&(Ai=S(Yt.optionalExtensions)),"onDone"in Yt&&(Oi=Yt.onDone),"profile"in Yt&&(fi=!!Yt.profile),"pixelRatio"in Yt&&(bi=+Yt.pixelRatio),"cachedCode"in Yt&&(yn=Yt.cachedCode))),cr&&(cr.nodeName.toLowerCase()==="canvas"?Aa=cr:ua=cr),!xa){if(!Aa){var qa=T(ua||document.body,Oi,bi);if(!qa)return null;Aa=qa.canvas,ki=qa.onDestroy}wa.premultipliedAlpha===void 0&&(wa.premultipliedAlpha=!0),xa=l(Aa,wa)}return xa?{gl:xa,canvas:Aa,container:ua,extensions:Ja,optionalExtensions:Ai,pixelRatio:bi,profile:fi,cachedCode:yn,onDone:Oi,onDestroy:ki}:(ki(),Oi("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function b(nt,Yt){var cr={};function ua(wa){var Ja=wa.toLowerCase(),Ai;try{Ai=cr[Ja]=nt.getExtension(Ja)}catch{}return!!Ai}for(var Aa=0;Aa65535)<<4,nt>>>=Yt,cr=(nt>255)<<3,nt>>>=cr,Yt|=cr,cr=(nt>15)<<2,nt>>>=cr,Yt|=cr,cr=(nt>3)<<1,nt>>>=cr,Yt|=cr,Yt|nt>>1}function I(){var nt=p(8,function(){return[]});function Yt(xa){var wa=B(xa),Ja=nt[O(wa)>>2];return Ja.length>0?Ja.pop():new ArrayBuffer(wa)}function cr(xa){nt[O(xa.byteLength)>>2].push(xa)}function ua(xa,wa){var Ja=null;switch(xa){case u:Ja=new Int8Array(Yt(wa),0,wa);break;case m:Ja=new Uint8Array(Yt(wa),0,wa);break;case h:Ja=new Int16Array(Yt(2*wa),0,wa);break;case P:Ja=new Uint16Array(Yt(2*wa),0,wa);break;case L:Ja=new Int32Array(Yt(4*wa),0,wa);break;case z:Ja=new Uint32Array(Yt(4*wa),0,wa);break;case F:Ja=new Float32Array(Yt(4*wa),0,wa);break;default:return null}return Ja.length!==wa?Ja.subarray(0,wa):Ja}function Aa(xa){cr(xa.buffer)}return{alloc:Yt,free:cr,allocType:ua,freeType:Aa}}var N=I();N.zero=I();var U=3408,W=3410,Q=3411,ue=3412,le=3413,he=3414,G=3415,$=33901,J=33902,X=3379,oe=3386,ie=34921,j=36347,ee=36348,re=35661,ce=35660,be=34930,Ae=36349,ze=34076,Re=34024,Xe=7936,it=7937,ot=7938,tt=35724,lt=34047,Ee=36063,_e=34852,fe=3553,Fe=34067,rt=34069,st=33984,Qe=6408,Lt=5126,kt=5121,Vt=36160,Zt=36053,Sr=36064,xr=16384,jr=function(nt,Yt){var cr=1;Yt.ext_texture_filter_anisotropic&&(cr=nt.getParameter(lt));var ua=1,Aa=1;Yt.webgl_draw_buffers&&(ua=nt.getParameter(_e),Aa=nt.getParameter(Ee));var xa=!!Yt.oes_texture_float;if(xa){var wa=nt.createTexture();nt.bindTexture(fe,wa),nt.texImage2D(fe,0,Qe,1,1,0,Qe,Lt,null);var Ja=nt.createFramebuffer();if(nt.bindFramebuffer(Vt,Ja),nt.framebufferTexture2D(Vt,Sr,fe,wa,0),nt.bindTexture(fe,null),nt.checkFramebufferStatus(Vt)!==Zt)xa=!1;else{nt.viewport(0,0,1,1),nt.clearColor(1,0,0,1),nt.clear(xr);var Ai=N.allocType(Lt,4);nt.readPixels(0,0,1,1,Qe,Lt,Ai),nt.getError()?xa=!1:(nt.deleteFramebuffer(Ja),nt.deleteTexture(wa),xa=Ai[0]===1),N.freeType(Ai)}}var bi=typeof navigator<"u"&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion)||/Edge/.test(navigator.userAgent)),fi=!0;if(!bi){var yn=nt.createTexture(),Oi=N.allocType(kt,36);nt.activeTexture(st),nt.bindTexture(Fe,yn),nt.texImage2D(rt,0,Qe,3,3,0,Qe,kt,Oi),N.freeType(Oi),nt.bindTexture(Fe,null),nt.deleteTexture(yn),fi=!nt.getError()}return{colorBits:[nt.getParameter(W),nt.getParameter(Q),nt.getParameter(ue),nt.getParameter(le)],depthBits:nt.getParameter(he),stencilBits:nt.getParameter(G),subpixelBits:nt.getParameter(U),extensions:Object.keys(Yt).filter(function(ki){return!!Yt[ki]}),maxAnisotropic:cr,maxDrawbuffers:ua,maxColorAttachments:Aa,pointSizeDims:nt.getParameter($),lineWidthDims:nt.getParameter(J),maxViewportDims:nt.getParameter(oe),maxCombinedTextureUnits:nt.getParameter(re),maxCubeMapSize:nt.getParameter(ze),maxRenderbufferSize:nt.getParameter(Re),maxTextureUnits:nt.getParameter(be),maxTextureSize:nt.getParameter(X),maxAttributes:nt.getParameter(ie),maxVertexUniforms:nt.getParameter(j),maxVertexTextureUnits:nt.getParameter(ce),maxVaryingVectors:nt.getParameter(ee),maxFragmentUniforms:nt.getParameter(Ae),glsl:nt.getParameter(tt),renderer:nt.getParameter(it),vendor:nt.getParameter(Xe),version:nt.getParameter(ot),readFloat:xa,npotTextureCube:fi}},wr=function(nt){return nt instanceof Uint8Array||nt instanceof Uint16Array||nt instanceof Uint32Array||nt instanceof Int8Array||nt instanceof Int16Array||nt instanceof Int32Array||nt instanceof Float32Array||nt instanceof Float64Array||nt instanceof Uint8ClampedArray};function Ir(nt){return!!nt&&typeof nt=="object"&&Array.isArray(nt.shape)&&Array.isArray(nt.stride)&&typeof nt.offset=="number"&&nt.shape.length===nt.stride.length&&(Array.isArray(nt.data)||wr(nt.data))}var bt=function(nt){return Object.keys(nt).map(function(Yt){return nt[Yt]})},Be={shape:Te,flatten:Ce};function Ke(nt,Yt,cr){for(var ua=0;ua0){var hn;if(Array.isArray(Ea[0])){Ii=za(Ea);for(var Za=1,Va=1;Va0){if(typeof Za[0]=="number"){var Si=N.allocType(Wa.dtype,Za.length);Pr(Si,Za),Ii(Si,$i),N.freeType(Si)}else if(Array.isArray(Za[0])||wr(Za[0])){zi=za(Za);var Ti=ei(Za,zi,Wa.dtype);Ii(Ti,$i),N.freeType(Ti)}}}else if(Ir(Za)){zi=Za.shape;var Ki=Za.stride,mn=0,In=0,Di=0,nn=0;zi.length===1?(mn=zi[0],In=1,Di=Ki[0],nn=0):zi.length===2&&(mn=zi[0],In=zi[1],Di=Ki[0],nn=Ki[1]);var En=Array.isArray(Za.data)?Wa.dtype:Wt(Za.data),Rn=N.allocType(En,mn*In);ta(Rn,Za.data,mn,In,Di,nn,Za.offset),Ii(Rn,$i),N.freeType(Rn)}return ji}return ii||ji(ea),ji._reglType="buffer",ji._buffer=Wa,ji.subdata=hn,cr.profile&&(ji.stats=Wa.stats),ji.destroy=function(){Oi(Wa)},ji}function qa(){bt(xa).forEach(function(ea){ea.buffer=nt.createBuffer(),nt.bindBuffer(ea.type,ea.buffer),nt.bufferData(ea.type,ea.persistentData||ea.byteLength,ea.usage)})}return cr.profile&&(Yt.getTotalBufferSize=function(){var ea=0;return Object.keys(xa).forEach(function(Ea){ea+=xa[Ea].stats.size}),ea}),{create:ki,createStream:Ai,destroyStream:bi,clear:function(){bt(xa).forEach(Oi),Ja.forEach(Oi)},getBuffer:function(ea){return ea&&ea._buffer instanceof wa?ea._buffer:null},restore:qa,_initBuffer:yn}}var ra=0,Ia=0,Ha=1,$a=1,ai=4,mi=4,xt={points:ra,point:Ia,lines:Ha,line:$a,triangles:ai,triangle:mi,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},ct=0,Nr=1,Or=4,Rr=5120,Lr=5121,Gr=5122,Kr=5123,Ur=5124,aa=5125,da=34963,fa=35040,It=35044;function dr(nt,Yt,cr,ua){var Aa={},xa=0,wa={uint8:Lr,uint16:Kr};Yt.oes_element_index_uint&&(wa.uint32=aa);function Ja(qa){this.id=xa++,Aa[this.id]=this,this.buffer=qa,this.primType=Or,this.vertCount=0,this.type=0}Ja.prototype.bind=function(){this.buffer.bind()};var Ai=[];function bi(qa){var ea=Ai.pop();return ea||(ea=new Ja(cr.create(null,da,!0,!1)._buffer)),yn(ea,qa,fa,-1,-1,0,0),ea}function fi(qa){Ai.push(qa)}function yn(qa,ea,Ea,ii,gi,Wa,ji){qa.buffer.bind();var Ii;if(ea){var hn=ji;!ji&&(!wr(ea)||Ir(ea)&&!wr(ea.data))&&(hn=Yt.oes_element_index_uint?aa:Kr),cr._initBuffer(qa.buffer,ea,Ea,hn,3)}else nt.bufferData(da,Wa,Ea),qa.buffer.dtype=Ii||Lr,qa.buffer.usage=Ea,qa.buffer.dimension=3,qa.buffer.byteLength=Wa;if(Ii=ji,!ji){switch(qa.buffer.dtype){case Lr:case Rr:Ii=Lr;break;case Kr:case Gr:Ii=Kr;break;case aa:case Ur:Ii=aa;break;default:}qa.buffer.dtype=Ii}qa.type=Ii;var Za=gi;Za<0&&(Za=qa.buffer.byteLength,Ii===Kr?Za>>=1:Ii===aa&&(Za>>=2)),qa.vertCount=Za;var Va=ii;if(ii<0){Va=Or;var $i=qa.buffer.dimension;$i===1&&(Va=ct),$i===2&&(Va=Nr),$i===3&&(Va=Or)}qa.primType=Va}function Oi(qa){ua.elementsCount--,delete Aa[qa.id],qa.buffer.destroy(),qa.buffer=null}function ki(qa,ea){var Ea=cr.create(null,da,!0),ii=new Ja(Ea._buffer);ua.elementsCount++;function gi(Wa){if(!Wa)Ea(),ii.primType=Or,ii.vertCount=0,ii.type=Lr;else if(typeof Wa=="number")Ea(Wa),ii.primType=Or,ii.vertCount=Wa|0,ii.type=Lr;else{var ji=null,Ii=It,hn=-1,Za=-1,Va=0,$i=0;Array.isArray(Wa)||wr(Wa)||Ir(Wa)?ji=Wa:("data"in Wa&&(ji=Wa.data),"usage"in Wa&&(Ii=Ra[Wa.usage]),"primitive"in Wa&&(hn=xt[Wa.primitive]),"count"in Wa&&(Za=Wa.count|0),"type"in Wa&&($i=wa[Wa.type]),"length"in Wa?Va=Wa.length|0:(Va=Za,$i===Kr||$i===Gr?Va*=2:($i===aa||$i===Ur)&&(Va*=4))),yn(ii,ji,Ii,hn,Za,Va,$i)}return gi}return gi(qa),gi._reglType="elements",gi._elements=ii,gi.subdata=function(Wa,ji){return Ea.subdata(Wa,ji),gi},gi.destroy=function(){Oi(ii)},gi}return{create:ki,createStream:bi,destroyStream:fi,getElements:function(qa){return typeof qa=="function"&&qa._elements instanceof Ja?qa._elements:null},clear:function(){bt(Aa).forEach(Oi)}}}var kr=new Float32Array(1),ia=new Uint32Array(kr.buffer),Ca=5123;function Fa(nt){for(var Yt=N.allocType(Ca,nt.length),cr=0;cr>>31<<15,xa=(ua<<1>>>24)-127,wa=ua>>13&1023;if(xa<-24)Yt[cr]=Aa;else if(xa<-14){var Ja=-14-xa;Yt[cr]=Aa+(wa+1024>>Ja)}else xa>15?Yt[cr]=Aa+31744:Yt[cr]=Aa+(xa+15<<10)+wa}return Yt}function Ya(nt){return Array.isArray(nt)||wr(nt)}var ha=34467,Da=3553,Xi=34067,Li=34069,fn=6408,An=6406,kn=6407,zn=6409,Xn=6410,to=32854,mo=32855,pn=36194,Jo=32819,Xo=32820,Ts=33635,Po=34042,so=6402,Vn=34041,To=35904,qo=35906,Oo=36193,lo=33776,Co=33777,os=33778,Ys=33779,Os=35986,Yo=35987,Ui=34798,Cn=35840,tl=35841,Bs=35842,uo=35843,$s=36196,ms=5121,Is=5123,rl=5125,Sn=5126,po=10242,ro=10243,As=10497,al=33071,$n=33648,zs=10240,au=10241,fl=9728,xu=9729,zl=9984,Ns=9985,iu=9986,Eu=9987,Bc=33170,Cu=4352,Af=4353,pf=4354,Us=34046,Vc=3317,Sf=37440,nu=37441,Ll=37443,ic=37444,Ou=33984,il=[zl,iu,Ns,Eu],vl=[0,zn,Xn,kn,fn],gs={};gs[zn]=gs[An]=gs[so]=1,gs[Vn]=gs[Xn]=2,gs[kn]=gs[To]=3,gs[fn]=gs[qo]=4;function Vs(nt){return"[object "+nt+"]"}var nc=Vs("HTMLCanvasElement"),Nl=Vs("OffscreenCanvas"),qu=Vs("CanvasRenderingContext2D"),cl=Vs("ImageBitmap"),yh=Vs("HTMLImageElement"),ls=Vs("HTMLVideoElement"),_h=Object.keys(Pe).concat([nc,Nl,qu,cl,yh,ls]),Ss=[];Ss[ms]=1,Ss[Sn]=4,Ss[Oo]=2,Ss[Is]=2,Ss[rl]=4;var Qn=[];Qn[to]=2,Qn[mo]=2,Qn[pn]=2,Qn[Vn]=4,Qn[lo]=.5,Qn[Co]=.5,Qn[os]=1,Qn[Ys]=1,Qn[Os]=.5,Qn[Yo]=1,Qn[Ui]=1,Qn[Cn]=.5,Qn[tl]=.25,Qn[Bs]=.5,Qn[uo]=.25,Qn[$s]=.5;function Gc(nt){return Array.isArray(nt)&&(nt.length===0||typeof nt[0]=="number")}function Vu(nt){if(!Array.isArray(nt))return!1;var Yt=nt.length;return!(Yt===0||!Ya(nt[0]))}function Ul(nt){return Object.prototype.toString.call(nt)}function Mf(nt){return Ul(nt)===nc}function wc(nt){return Ul(nt)===Nl}function rf(nt){return Ul(nt)===qu}function Kl(nt){return Ul(nt)===cl}function Yf(nt){return Ul(nt)===yh}function zf(nt){return Ul(nt)===ls}function af(nt){if(!nt)return!1;var Yt=Ul(nt);return _h.indexOf(Yt)>=0?!0:Gc(nt)||Vu(nt)||Ir(nt)}function Nc(nt){return Pe[Object.prototype.toString.call(nt)]|0}function Ff(nt,Yt){var cr=Yt.length;switch(nt.type){case ms:case Is:case rl:case Sn:var ua=N.allocType(nt.type,cr);ua.set(Yt),nt.data=ua;break;case Oo:nt.data=Fa(Yt);break;default:}}function Of(nt,Yt){return N.allocType(nt.type===Oo?Sn:nt.type,Yt)}function Gu(nt,Yt){nt.type===Oo?(nt.data=Fa(Yt),N.freeType(Yt)):nt.data=Yt}function Ef(nt,Yt,cr,ua,Aa,xa){for(var wa=nt.width,Ja=nt.height,Ai=nt.channels,bi=wa*Ja*Ai,fi=Of(nt,bi),yn=0,Oi=0;Oi=1;)Ja+=wa*Ai*Ai,Ai/=2;return Ja}else return wa*cr*ua}function Hc(nt,Yt,cr,ua,Aa,xa,wa){var Ja={"don't care":Cu,"dont care":Cu,nice:pf,fast:Af},Ai={repeat:As,clamp:al,mirror:$n},bi={nearest:fl,linear:xu},fi=d({mipmap:Eu,"nearest mipmap nearest":zl,"linear mipmap nearest":Ns,"nearest mipmap linear":iu,"linear mipmap linear":Eu},bi),yn={none:0,browser:ic},Oi={uint8:ms,rgba4:Jo,rgb565:Ts,"rgb5 a1":Xo},ki={alpha:An,luminance:zn,"luminance alpha":Xn,rgb:kn,rgba:fn,rgba4:to,"rgb5 a1":mo,rgb565:pn},qa={};Yt.ext_srgb&&(ki.srgb=To,ki.srgba=qo),Yt.oes_texture_float&&(Oi.float32=Oi.float=Sn),Yt.oes_texture_half_float&&(Oi.float16=Oi["half float"]=Oo),Yt.webgl_depth_texture&&(d(ki,{depth:so,"depth stencil":Vn}),d(Oi,{uint16:Is,uint32:rl,"depth stencil":Po})),Yt.webgl_compressed_texture_s3tc&&d(qa,{"rgb s3tc dxt1":lo,"rgba s3tc dxt1":Co,"rgba s3tc dxt3":os,"rgba s3tc dxt5":Ys}),Yt.webgl_compressed_texture_atc&&d(qa,{"rgb atc":Os,"rgba atc explicit alpha":Yo,"rgba atc interpolated alpha":Ui}),Yt.webgl_compressed_texture_pvrtc&&d(qa,{"rgb pvrtc 4bppv1":Cn,"rgb pvrtc 2bppv1":tl,"rgba pvrtc 4bppv1":Bs,"rgba pvrtc 2bppv1":uo}),Yt.webgl_compressed_texture_etc1&&(qa["rgb etc1"]=$s);var ea=Array.prototype.slice.call(nt.getParameter(ha));Object.keys(qa).forEach(function(Le){var $e=qa[Le];ea.indexOf($e)>=0&&(ki[Le]=$e)});var Ea=Object.keys(ki);cr.textureFormats=Ea;var ii=[];Object.keys(ki).forEach(function(Le){var $e=ki[Le];ii[$e]=Le});var gi=[];Object.keys(Oi).forEach(function(Le){var $e=Oi[Le];gi[$e]=Le});var Wa=[];Object.keys(bi).forEach(function(Le){var $e=bi[Le];Wa[$e]=Le});var ji=[];Object.keys(fi).forEach(function(Le){var $e=fi[Le];ji[$e]=Le});var Ii=[];Object.keys(Ai).forEach(function(Le){var $e=Ai[Le];Ii[$e]=Le});var hn=Ea.reduce(function(Le,$e){var mt=ki[$e];return mt===zn||mt===An||mt===zn||mt===Xn||mt===so||mt===Vn||Yt.ext_srgb&&(mt===To||mt===qo)?Le[mt]=mt:mt===mo||$e.indexOf("rgba")>=0?Le[mt]=fn:Le[mt]=kn,Le},{});function Za(){this.internalformat=fn,this.format=fn,this.type=ms,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=ic,this.width=0,this.height=0,this.channels=0}function Va(Le,$e){Le.internalformat=$e.internalformat,Le.format=$e.format,Le.type=$e.type,Le.compressed=$e.compressed,Le.premultiplyAlpha=$e.premultiplyAlpha,Le.flipY=$e.flipY,Le.unpackAlignment=$e.unpackAlignment,Le.colorSpace=$e.colorSpace,Le.width=$e.width,Le.height=$e.height,Le.channels=$e.channels}function $i(Le,$e){if(!(typeof $e!="object"||!$e)){if("premultiplyAlpha"in $e&&(Le.premultiplyAlpha=$e.premultiplyAlpha),"flipY"in $e&&(Le.flipY=$e.flipY),"alignment"in $e&&(Le.unpackAlignment=$e.alignment),"colorSpace"in $e&&(Le.colorSpace=yn[$e.colorSpace]),"type"in $e){var mt=$e.type;Le.type=Oi[mt]}var jt=Le.width,_r=Le.height,Fr=Le.channels,hr=!1;"shape"in $e?(jt=$e.shape[0],_r=$e.shape[1],$e.shape.length===3&&(Fr=$e.shape[2],hr=!0)):("radius"in $e&&(jt=_r=$e.radius),"width"in $e&&(jt=$e.width),"height"in $e&&(_r=$e.height),"channels"in $e&&(Fr=$e.channels,hr=!0)),Le.width=jt|0,Le.height=_r|0,Le.channels=Fr|0;var gt=!1;if("format"in $e){var Et=$e.format,Ft=Le.internalformat=ki[Et];Le.format=hn[Ft],Et in Oi&&("type"in $e||(Le.type=Oi[Et])),Et in qa&&(Le.compressed=!0),gt=!0}!hr&>?Le.channels=gs[Le.format]:hr&&!gt&&Le.channels!==vl[Le.format]&&(Le.format=Le.internalformat=vl[Le.channels])}}function zi(Le){nt.pixelStorei(Sf,Le.flipY),nt.pixelStorei(nu,Le.premultiplyAlpha),nt.pixelStorei(Ll,Le.colorSpace),nt.pixelStorei(Vc,Le.unpackAlignment)}function Si(){Za.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function Ti(Le,$e){var mt=null;if(af($e)?mt=$e:$e&&($i(Le,$e),"x"in $e&&(Le.xOffset=$e.x|0),"y"in $e&&(Le.yOffset=$e.y|0),af($e.data)&&(mt=$e.data)),$e.copy){var jt=Aa.viewportWidth,_r=Aa.viewportHeight;Le.width=Le.width||jt-Le.xOffset,Le.height=Le.height||_r-Le.yOffset,Le.needsCopy=!0}else if(!mt)Le.width=Le.width||1,Le.height=Le.height||1,Le.channels=Le.channels||4;else if(wr(mt))Le.channels=Le.channels||4,Le.data=mt,!("type"in $e)&&Le.type===ms&&(Le.type=Nc(mt));else if(Gc(mt))Le.channels=Le.channels||4,Ff(Le,mt),Le.alignment=1,Le.needsFree=!0;else if(Ir(mt)){var Fr=mt.data;!Array.isArray(Fr)&&Le.type===ms&&(Le.type=Nc(Fr));var hr=mt.shape,gt=mt.stride,Et,Ft,ir,fr,sr,pr;hr.length===3?(ir=hr[2],pr=gt[2]):(ir=1,pr=1),Et=hr[0],Ft=hr[1],fr=gt[0],sr=gt[1],Le.alignment=1,Le.width=Et,Le.height=Ft,Le.channels=ir,Le.format=Le.internalformat=vl[ir],Le.needsFree=!0,Ef(Le,Fr,fr,sr,pr,mt.offset)}else if(Mf(mt)||wc(mt)||rf(mt))Mf(mt)||wc(mt)?Le.element=mt:Le.element=mt.canvas,Le.width=Le.element.width,Le.height=Le.element.height,Le.channels=4;else if(Kl(mt))Le.element=mt,Le.width=mt.width,Le.height=mt.height,Le.channels=4;else if(Yf(mt))Le.element=mt,Le.width=mt.naturalWidth,Le.height=mt.naturalHeight,Le.channels=4;else if(zf(mt))Le.element=mt,Le.width=mt.videoWidth,Le.height=mt.videoHeight,Le.channels=4;else if(Vu(mt)){var lr=Le.width||mt[0].length,Xt=Le.height||mt.length,or=Le.channels;Ya(mt[0][0])?or=or||mt[0][0].length:or=or||1;for(var qt=Be.shape(mt),Dr=1,Jr=0;Jr>=_r,mt.height>>=_r,Ti(mt,jt[_r]),Le.mipmask|=1<<_r;else mt=Le.images[0]=Di(),Va(mt,Le),Ti(mt,$e),Le.mipmask=1;Va(Le,Le.images[0]),Le.compressed&&(Le.internalformat===lo||Le.internalformat===Co||Le.internalformat===os||Le.internalformat)}function Ps(Le,$e){for(var mt=Le.images,jt=0;jt=0&&!("faces"in $e)&&(Le.genMipmaps=!0)}if("mag"in $e){var jt=$e.mag;Le.magFilter=bi[jt]}var _r=Le.wrapS,Fr=Le.wrapT;if("wrap"in $e){var hr=$e.wrap;typeof hr=="string"?_r=Fr=Ai[hr]:Array.isArray(hr)&&(_r=Ai[hr[0]],Fr=Ai[hr[1]])}else{if("wrapS"in $e){var gt=$e.wrapS;_r=Ai[gt]}if("wrapT"in $e){var Et=$e.wrapT;Fr=Ai[Et]}}if(Le.wrapS=_r,Le.wrapT=Fr,"anisotropic"in $e){var Ft=$e.anisotropic;Le.anisotropic=$e.anisotropic}if("mipmap"in $e){var ir=!1;switch(typeof $e.mipmap){case"string":Le.mipmapHint=Ja[$e.mipmap],Le.genMipmaps=!0,ir=!0;break;case"boolean":ir=Le.genMipmaps=$e.mipmap;break;case"object":Le.genMipmaps=!1,ir=!0;break;default:}ir&&!("min"in $e)&&(Le.minFilter=zl)}}function El(Le,$e){nt.texParameteri($e,au,Le.minFilter),nt.texParameteri($e,zs,Le.magFilter),nt.texParameteri($e,po,Le.wrapS),nt.texParameteri($e,ro,Le.wrapT),Yt.ext_texture_filter_anisotropic&&nt.texParameteri($e,Us,Le.anisotropic),Le.genMipmaps&&(nt.hint(Bc,Le.mipmapHint),nt.generateMipmap($e))}var Ql=0,Fs={},pl=cr.maxTextureUnits,bl=Array(pl).map(function(){return null});function Hn(Le){Za.call(this),this.mipmask=0,this.internalformat=fn,this.id=Ql++,this.refCount=1,this.target=Le,this.texture=nt.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new fs,wa.profile&&(this.stats={size:0})}function Cl(Le){nt.activeTexture(Ou),nt.bindTexture(Le.target,Le.texture)}function Lo(){var Le=bl[0];Le?nt.bindTexture(Le.target,Le.texture):nt.bindTexture(Da,null)}function ve(Le){var $e=Le.texture,mt=Le.unit,jt=Le.target;mt>=0&&(nt.activeTexture(Ou+mt),nt.bindTexture(jt,null),bl[mt]=null),nt.deleteTexture($e),Le.texture=null,Le.params=null,Le.pixels=null,Le.refCount=0,delete Fs[Le.id],xa.textureCount--}d(Hn.prototype,{bind:function(){var Le=this;Le.bindCount+=1;var $e=Le.unit;if($e<0){for(var mt=0;mt0)continue;jt.unit=-1}bl[mt]=Le,$e=mt;break}$e>=pl,wa.profile&&xa.maxTextureUnits<$e+1&&(xa.maxTextureUnits=$e+1),Le.unit=$e,nt.activeTexture(Ou+$e),nt.bindTexture(Le.target,Le.texture)}return $e},unbind:function(){this.bindCount-=1},decRef:function(){--this.refCount<=0&&ve(this)}});function Y(Le,$e){var mt=new Hn(Da);Fs[mt.id]=mt,xa.textureCount++;function jt(hr,gt){var Et=mt.texInfo;fs.call(Et);var Ft=ho();return typeof hr=="number"?typeof gt=="number"?Rn(Ft,hr|0,gt|0):Rn(Ft,hr|0,hr|0):hr?(Al(Et,hr),Gn(Ft,hr)):Rn(Ft,1,1),Et.genMipmaps&&(Ft.mipmask=(Ft.width<<1)-1),mt.mipmask=Ft.mipmask,Va(mt,Ft),mt.internalformat=Ft.internalformat,jt.width=Ft.width,jt.height=Ft.height,Cl(mt),Ps(Ft,Da),El(Et,Da),Lo(),Hl(Ft),wa.profile&&(mt.stats.size=oc(mt.internalformat,mt.type,Ft.width,Ft.height,Et.genMipmaps,!1)),jt.format=ii[mt.internalformat],jt.type=gi[mt.type],jt.mag=Wa[Et.magFilter],jt.min=ji[Et.minFilter],jt.wrapS=Ii[Et.wrapS],jt.wrapT=Ii[Et.wrapT],jt}function _r(hr,gt,Et,Ft){var ir=gt|0,fr=Et|0,sr=Ft|0,pr=Di();return Va(pr,mt),pr.width=0,pr.height=0,Ti(pr,hr),pr.width=pr.width||(mt.width>>sr)-ir,pr.height=pr.height||(mt.height>>sr)-fr,Cl(mt),mn(pr,Da,ir,fr,sr),Lo(),nn(pr),jt}function Fr(hr,gt){var Et=hr|0,Ft=gt|0||Et;if(Et===mt.width&&Ft===mt.height)return jt;jt.width=mt.width=Et,jt.height=mt.height=Ft,Cl(mt);for(var ir=0;mt.mipmask>>ir;++ir){var fr=Et>>ir,sr=Ft>>ir;if(!fr||!sr)break;nt.texImage2D(Da,ir,mt.format,fr,sr,0,mt.format,mt.type,null)}return Lo(),wa.profile&&(mt.stats.size=oc(mt.internalformat,mt.type,Et,Ft,!1,!1)),jt}return jt(Le,$e),jt.subimage=_r,jt.resize=Fr,jt._reglType="texture2d",jt._texture=mt,wa.profile&&(jt.stats=mt.stats),jt.destroy=function(){mt.decRef()},jt}function ye(Le,$e,mt,jt,_r,Fr){var hr=new Hn(Xi);Fs[hr.id]=hr,xa.cubeCount++;var gt=new Array(6);function Et(fr,sr,pr,lr,Xt,or){var qt,Dr=hr.texInfo;for(fs.call(Dr),qt=0;qt<6;++qt)gt[qt]=ho();if(typeof fr=="number"||!fr){var Jr=fr|0||1;for(qt=0;qt<6;++qt)Rn(gt[qt],Jr,Jr)}else if(typeof fr=="object")if(sr)Gn(gt[0],fr),Gn(gt[1],sr),Gn(gt[2],pr),Gn(gt[3],lr),Gn(gt[4],Xt),Gn(gt[5],or);else if(Al(Dr,fr),$i(hr,fr),"faces"in fr){var ba=fr.faces;for(qt=0;qt<6;++qt)Va(gt[qt],hr),Gn(gt[qt],ba[qt])}else for(qt=0;qt<6;++qt)Gn(gt[qt],fr);for(Va(hr,gt[0]),Dr.genMipmaps?hr.mipmask=(gt[0].width<<1)-1:hr.mipmask=gt[0].mipmask,hr.internalformat=gt[0].internalformat,Et.width=gt[0].width,Et.height=gt[0].height,Cl(hr),qt=0;qt<6;++qt)Ps(gt[qt],Li+qt);for(El(Dr,Xi),Lo(),wa.profile&&(hr.stats.size=oc(hr.internalformat,hr.type,Et.width,Et.height,Dr.genMipmaps,!0)),Et.format=ii[hr.internalformat],Et.type=gi[hr.type],Et.mag=Wa[Dr.magFilter],Et.min=ji[Dr.minFilter],Et.wrapS=Ii[Dr.wrapS],Et.wrapT=Ii[Dr.wrapT],qt=0;qt<6;++qt)Hl(gt[qt]);return Et}function Ft(fr,sr,pr,lr,Xt){var or=pr|0,qt=lr|0,Dr=Xt|0,Jr=Di();return Va(Jr,hr),Jr.width=0,Jr.height=0,Ti(Jr,sr),Jr.width=Jr.width||(hr.width>>Dr)-or,Jr.height=Jr.height||(hr.height>>Dr)-qt,Cl(hr),mn(Jr,Li+fr,or,qt,Dr),Lo(),nn(Jr),Et}function ir(fr){var sr=fr|0;if(sr!==hr.width){Et.width=hr.width=sr,Et.height=hr.height=sr,Cl(hr);for(var pr=0;pr<6;++pr)for(var lr=0;hr.mipmask>>lr;++lr)nt.texImage2D(Li+pr,lr,hr.format,sr>>lr,sr>>lr,0,hr.format,hr.type,null);return Lo(),wa.profile&&(hr.stats.size=oc(hr.internalformat,hr.type,Et.width,Et.height,!1,!0)),Et}}return Et(Le,$e,mt,jt,_r,Fr),Et.subimage=Ft,Et.resize=ir,Et._reglType="textureCube",Et._texture=hr,wa.profile&&(Et.stats=hr.stats),Et.destroy=function(){hr.decRef()},Et}function te(){for(var Le=0;Le>jt,mt.height>>jt,0,mt.internalformat,mt.type,null);else for(var _r=0;_r<6;++_r)nt.texImage2D(Li+_r,jt,mt.internalformat,mt.width>>jt,mt.height>>jt,0,mt.internalformat,mt.type,null);El(mt.texInfo,mt.target)})}function Ge(){for(var Le=0;Le=0?Hl=!0:Ai.indexOf(fs)>=0&&(Hl=!1))),("depthTexture"in Hn||"depthStencilTexture"in Hn)&&(bl=!!(Hn.depthTexture||Hn.depthStencilTexture)),"depth"in Hn&&(typeof Hn.depth=="boolean"?Ps=Hn.depth:(Ql=Hn.depth,xl=!1)),"stencil"in Hn&&(typeof Hn.stencil=="boolean"?xl=Hn.stencil:(Fs=Hn.stencil,Ps=!1)),"depthStencil"in Hn&&(typeof Hn.depthStencil=="boolean"?Ps=xl=Hn.depthStencil:(pl=Hn.depthStencil,Ps=!1,xl=!1))}var Lo=null,ve=null,Y=null,ye=null;if(Array.isArray(ho))Lo=ho.map(qa);else if(ho)Lo=[qa(ho)];else for(Lo=new Array(El),En=0;En0&&(nn.depth=Ti[0].depth,nn.stencil=Ti[0].stencil,nn.depthStencil=Ti[0].depthStencil),Ti[Di]?Ti[Di](nn):Ti[Di]=Va(nn)}return d(Ki,{width:En,height:En,color:fs})}function mn(In){var Di,nn=In|0;if(nn===Ki.width)return Ki;var En=Ki.color;for(Di=0;Di=En.byteLength?Rn.subdata(En):(Rn.destroy(),Va.buffers[In]=null)),Va.buffers[In]||(Rn=Va.buffers[In]=Aa.create(Di,vf,!1,!0)),nn.buffer=Aa.getBuffer(Rn),nn.size=nn.buffer.dimension|0,nn.normalized=!1,nn.type=nn.buffer.dtype,nn.offset=0,nn.stride=0,nn.divisor=0,nn.state=1,Ki[In]=1}else Aa.getBuffer(Di)?(nn.buffer=Aa.getBuffer(Di),nn.size=nn.buffer.dimension|0,nn.normalized=!1,nn.type=nn.buffer.dtype,nn.offset=0,nn.stride=0,nn.divisor=0,nn.state=1):Aa.getBuffer(Di.buffer)?(nn.buffer=Aa.getBuffer(Di.buffer),nn.size=(+Di.size||nn.buffer.dimension)|0,nn.normalized=!!Di.normalized||!1,"type"in Di?nn.type=la[Di.type]:nn.type=nn.buffer.dtype,nn.offset=(Di.offset||0)|0,nn.stride=(Di.stride||0)|0,nn.divisor=(Di.divisor||0)|0,nn.state=1):"x"in Di&&(nn.x=+Di.x||0,nn.y=+Di.y||0,nn.z=+Di.z||0,nn.w=+Di.w||0,nn.state=2)}for(var Gn=0;Gn1)for(var zi=0;ziea&&(ea=Ea.stats.uniformsCount)}),ea},cr.getMaxAttributesCount=function(){var ea=0;return fi.forEach(function(Ea){Ea.stats.attributesCount>ea&&(ea=Ea.stats.attributesCount)}),ea});function qa(){Aa={},xa={};for(var ea=0;ea16&&(cr=Ri(cr,nt.length*8));for(var ua=Array(16),Aa=Array(16),xa=0;xa<16;xa++)ua[xa]=cr[xa]^909522486,Aa[xa]=cr[xa]^1549556828;var wa=Ri(ua.concat(kc(Yt)),512+Yt.length*8);return er(Ri(Aa.concat(wa),768))}function gu(nt){for(var Yt=jf?"0123456789ABCDEF":"0123456789abcdef",cr="",ua,Aa=0;Aa>>4&15)+Yt.charAt(ua&15);return cr}function Cc(nt){for(var Yt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",cr="",ua=nt.length,Aa=0;Aant.length*8?cr+=Xu:cr+=Yt.charAt(xa>>>6*(3-wa)&63);return cr}function Yc(nt,Yt){var cr=Yt.length,ua=Array(),Aa,xa,wa,Ja,Ai=Array(Math.ceil(nt.length/2));for(Aa=0;Aa0;){for(Ja=Array(),wa=0,Aa=0;Aa0||xa>0)&&(Ja[Ja.length]=xa);ua[ua.length]=wa,Ai=Ja}var bi="";for(Aa=ua.length-1;Aa>=0;Aa--)bi+=Yt.charAt(ua[Aa]);var fi=Math.ceil(nt.length*8/(Math.log(Yt.length)/Math.log(2)));for(Aa=bi.length;Aa>>6&31,128|ua&63):ua<=65535?Yt+=String.fromCharCode(224|ua>>>12&15,128|ua>>>6&63,128|ua&63):ua<=2097151&&(Yt+=String.fromCharCode(240|ua>>>18&7,128|ua>>>12&63,128|ua>>>6&63,128|ua&63));return Yt}function kc(nt){for(var Yt=Array(nt.length>>2),cr=0;cr>5]|=(nt.charCodeAt(cr/8)&255)<<24-cr%32;return Yt}function er(nt){for(var Yt="",cr=0;cr>5]>>>24-cr%32&255);return Yt}function yr(nt,Yt){return nt>>>Yt|nt<<32-Yt}function na(nt,Yt){return nt>>>Yt}function $r(nt,Yt,cr){return nt&Yt^~nt&cr}function La(nt,Yt,cr){return nt&Yt^nt&cr^Yt&cr}function hi(nt){return yr(nt,2)^yr(nt,13)^yr(nt,22)}function Pi(nt){return yr(nt,6)^yr(nt,11)^yr(nt,25)}function Zi(nt){return yr(nt,7)^yr(nt,18)^na(nt,3)}function tn(nt){return yr(nt,17)^yr(nt,19)^na(nt,10)}var dn=new Array(1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998);function Ri(nt,Yt){var cr=new Array(1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225),ua=new Array(64),Aa,xa,wa,Ja,Ai,bi,fi,yn,Oi,ki,qa,ea;for(nt[Yt>>5]|=128<<24-Yt%32,nt[(Yt+64>>9<<4)+15]=Yt,Oi=0;Oi>16)+(Yt>>16)+(cr>>16);return ua<<16|cr&65535}function qi(nt){return Array.prototype.slice.call(nt)}function _i(nt){return qi(nt).join("")}function Mn(nt){var Yt=nt&&nt.cache,cr=0,ua=[],Aa=[],xa=[];function wa(qa,ea){var Ea=ea&&ea.stable;if(!Ea){for(var ii=0;ii0&&(qa.push(gi,"="),qa.push.apply(qa,qi(arguments)),qa.push(";")),gi}return d(ea,{def:ii,toString:function(){return _i([Ea.length>0?"var "+Ea.join(",")+";":"",_i(qa)])}})}function Ai(){var qa=Ja(),ea=Ja(),Ea=qa.toString,ii=ea.toString;function gi(Wa,ji){ea(Wa,ji,"=",qa.def(Wa,ji),";")}return d(function(){qa.apply(qa,qi(arguments))},{def:qa.def,entry:qa,exit:ea,save:gi,set:function(Wa,ji,Ii){gi(Wa,ji),qa(Wa,ji,"=",Ii,";")},toString:function(){return Ea()+ii()}})}function bi(){var qa=_i(arguments),ea=Ai(),Ea=Ai(),ii=ea.toString,gi=Ea.toString;return d(ea,{then:function(){return ea.apply(ea,qi(arguments)),this},else:function(){return Ea.apply(Ea,qi(arguments)),this},toString:function(){var Wa=gi();return Wa&&(Wa="else{"+Wa+"}"),_i(["if(",qa,"){",ii(),"}",Wa])}})}var fi=Ja(),yn={};function Oi(qa,ea){var Ea=[];function ii(){var hn="a"+Ea.length;return Ea.push(hn),hn}ea=ea||0;for(var gi=0;gi":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},Na={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},Ka={cw:et,ccw:vt};function vi(nt){return Array.isArray(nt)||wr(nt)||Ir(nt)}function ui(nt){return nt.sort(function(Yt,cr){return Yt===Se?-1:cr===Se?1:Yt=1,ua>=2,Yt)}else if(cr===xs){var Aa=nt.data;return new Pa(Aa.thisDep,Aa.contextDep,Aa.propDep,Yt)}else{if(cr===Qs)return new Pa(!1,!1,!1,Yt);if(cr===Rs){for(var xa=!1,wa=!1,Ja=!1,Ai=0;Ai=1&&(wa=!0),fi>=2&&(Ja=!0)}else bi.type===xs&&(xa=xa||bi.data.thisDep,wa=wa||bi.data.contextDep,Ja=Ja||bi.data.propDep)}return new Pa(xa,wa,Ja,Yt)}else return new Pa(cr===Qo,cr===_o,cr===un,Yt)}}var Pn=new Pa(!1,!1,!1,function(){});function Zn(nt,Yt,cr,ua,Aa,xa,wa,Ja,Ai,bi,fi,yn,Oi,ki,qa,ea){var Ea=bi.Record,ii={add:32774,subtract:32778,"reverse subtract":32779};cr.ext_blend_minmax&&(ii.min=_t,ii.max=St);var gi=cr.angle_instanced_arrays,Wa=cr.webgl_draw_buffers,ji=cr.oes_vertex_array_object,Ii={dirty:!0,profile:ea.profile},hn={},Za=[],Va={},$i={};function zi(gt){return gt.replace(".","_")}function Si(gt,Et,Ft){var ir=zi(gt);Za.push(gt),hn[ir]=Ii[ir]=!!Ft,Va[ir]=Et}function Ti(gt,Et,Ft){var ir=zi(gt);Za.push(gt),Array.isArray(Ft)?(Ii[ir]=Ft.slice(),hn[ir]=Ft.slice()):Ii[ir]=hn[ir]=Ft,$i[ir]=Et}function Ki(gt){return!!isNaN(gt)}Si(Ks,di),Si(ys,Oa),Ti(Fl,"blendColor",[0,0,0,0]),Ti(yl,"blendEquationSeparate",[Wr,Wr]),Ti(sl,"blendFuncSeparate",[Vr,gr,Vr,gr]),Si(Un,Gi,!0),Ti(Io,"depthFunc",Ta),Ti(Xs,"depthRange",[0,1]),Ti(Ls,"depthMask",!0),Ti(ou,ou,[!0,!0,!0,!0]),Si(Iu,Sa),Ti(Zu,"cullFace",De),Ti(Lc,Lc,vt),Ti(yu,yu,1),Si(Pc,Tn),Ti(wu,"polygonOffset",[0,0]),Si(gc,Wn),Si(fo,Bn),Ti(zo,"sampleCoverage",[1,!1]),Si(Ic,Wi),Ti(lc,"stencilMask",-1),Ti(Yu,"stencilFunc",[ar,0,-1]),Ti(Ne,"stencilOpSeparate",[de,zt,zt,zt]),Ti(R,"stencilOpSeparate",[De,zt,zt,zt]),Si(ae,on),Ti(we,"scissor",[0,0,nt.drawingBufferWidth,nt.drawingBufferHeight]),Ti(Se,Se,[0,0,nt.drawingBufferWidth,nt.drawingBufferHeight]);var mn={gl:nt,context:Oi,strings:Yt,next:hn,current:Ii,draw:yn,elements:xa,buffer:Aa,shader:fi,attributes:bi.state,vao:bi,uniforms:Ai,framebuffer:Ja,extensions:cr,timer:ki,isBufferArgs:vi},In={primTypes:xt,compareFuncs:Ma,blendFuncs:ni,blendEquations:ii,stencilOps:Na,glTypes:la,orientationType:Ka};Wa&&(In.backBuffer=[De],In.drawBuffer=p(ua.maxDrawbuffers,function(gt){return gt===0?[0]:p(gt,function(Et){return ri+Et})}));var Di=0;function nn(){var gt=Mn({cache:qa}),Et=gt.link,Ft=gt.global;gt.id=Di++,gt.batchId="0";var ir=Et(mn),fr=gt.shared={props:"a0"};Object.keys(mn).forEach(function(or){fr[or]=Ft.def(ir,".",or)});var sr=gt.next={},pr=gt.current={};Object.keys($i).forEach(function(or){Array.isArray(Ii[or])&&(sr[or]=Ft.def(fr.next,".",or),pr[or]=Ft.def(fr.current,".",or))});var lr=gt.constants={};Object.keys(In).forEach(function(or){lr[or]=Ft.def(JSON.stringify(In[or]))}),gt.invoke=function(or,qt){switch(qt.type){case wn:var Dr=["this",fr.context,fr.props,gt.batchId];return or.def(Et(qt.data),".call(",Dr.slice(0,Math.max(qt.data.length+1,4)),")");case un:return or.def(fr.props,qt.data);case _o:return or.def(fr.context,qt.data);case Qo:return or.def("this",qt.data);case xs:return qt.data.append(gt,or),qt.data.ref;case Qs:return qt.data.toString();case Rs:return qt.data.map(function(Jr){return gt.invoke(or,Jr)})}},gt.attribCache={};var Xt={};return gt.scopeAttrib=function(or){var qt=Yt.id(or);if(qt in Xt)return Xt[qt];var Dr=bi.scope[qt];Dr||(Dr=bi.scope[qt]=new Ea);var Jr=Xt[qt]=Et(Dr);return Jr},gt}function En(gt){var Et=gt.static,Ft=gt.dynamic,ir;if(Oe in Et){var fr=!!Et[Oe];ir=an(function(pr,lr){return fr}),ir.enable=fr}else if(Oe in Ft){var sr=Ft[Oe];ir=vn(sr,function(pr,lr){return pr.invoke(lr,sr)})}return ir}function Rn(gt,Et){var Ft=gt.static,ir=gt.dynamic;if(pt in Ft){var fr=Ft[pt];return fr?(fr=Ja.getFramebuffer(fr),an(function(pr,lr){var Xt=pr.link(fr),or=pr.shared;lr.set(or.framebuffer,".next",Xt);var qt=or.context;return lr.set(qt,"."+dt,Xt+".width"),lr.set(qt,"."+Ct,Xt+".height"),Xt})):an(function(pr,lr){var Xt=pr.shared;lr.set(Xt.framebuffer,".next","null");var or=Xt.context;return lr.set(or,"."+dt,or+"."+mr),lr.set(or,"."+Ct,or+"."+Er),"null"})}else if(pt in ir){var sr=ir[pt];return vn(sr,function(pr,lr){var Xt=pr.invoke(lr,sr),or=pr.shared,qt=or.framebuffer,Dr=lr.def(qt,".getFramebuffer(",Xt,")");lr.set(qt,".next",Dr);var Jr=or.context;return lr.set(Jr,"."+dt,Dr+"?"+Dr+".width:"+Jr+"."+mr),lr.set(Jr,"."+Ct,Dr+"?"+Dr+".height:"+Jr+"."+Er),Dr})}else return null}function Gn(gt,Et,Ft){var ir=gt.static,fr=gt.dynamic;function sr(Xt){if(Xt in ir){var or=ir[Xt],qt=!0,Dr=or.x|0,Jr=or.y|0,ba,yi;return"width"in or?ba=or.width|0:qt=!1,"height"in or?yi=or.height|0:qt=!1,new Pa(!qt&&Et&&Et.thisDep,!qt&&Et&&Et.contextDep,!qt&&Et&&Et.propDep,function(Ji,Bi){var pi=Ji.shared.context,wi=ba;"width"in or||(wi=Bi.def(pi,".",dt,"-",Dr));var Mi=yi;return"height"in or||(Mi=Bi.def(pi,".",Ct,"-",Jr)),[Dr,Jr,wi,Mi]})}else if(Xt in fr){var Xa=fr[Xt],si=vn(Xa,function(Ji,Bi){var pi=Ji.invoke(Bi,Xa),wi=Ji.shared.context,Mi=Bi.def(pi,".x|0"),Vi=Bi.def(pi,".y|0"),cn=Bi.def('"width" in ',pi,"?",pi,".width|0:","(",wi,".",dt,"-",Mi,")"),xo=Bi.def('"height" in ',pi,"?",pi,".height|0:","(",wi,".",Ct,"-",Vi,")");return[Mi,Vi,cn,xo]});return Et&&(si.thisDep=si.thisDep||Et.thisDep,si.contextDep=si.contextDep||Et.contextDep,si.propDep=si.propDep||Et.propDep),si}else return Et?new Pa(Et.thisDep,Et.contextDep,Et.propDep,function(Ji,Bi){var pi=Ji.shared.context;return[0,0,Bi.def(pi,".",dt),Bi.def(pi,".",Ct)]}):null}var pr=sr(Se);if(pr){var lr=pr;pr=new Pa(pr.thisDep,pr.contextDep,pr.propDep,function(Xt,or){var qt=lr.append(Xt,or),Dr=Xt.shared.context;return or.set(Dr,"."+wt,qt[2]),or.set(Dr,"."+Dt,qt[3]),qt})}return{viewport:pr,scissor_box:sr(we)}}function Ps(gt,Et){var Ft=gt.static,ir=typeof Ft[Bt]=="string"&&typeof Ft[At]=="string";if(ir){if(Object.keys(Et.dynamic).length>0)return null;var fr=Et.static,sr=Object.keys(fr);if(sr.length>0&&typeof fr[sr[0]]=="number"){for(var pr=[],lr=0;lr"+Mi+"?"+qt+".constant["+Mi+"]:0;"}).join(""),"}}else{","if(",ba,"(",qt,".buffer)){",Ji,"=",yi,".createStream(",Qr,",",qt,".buffer);","}else{",Ji,"=",yi,".getBuffer(",qt,".buffer);","}",Bi,'="type" in ',qt,"?",Jr.glTypes,"[",qt,".type]:",Ji,".dtype;",Xa.normalized,"=!!",qt,".normalized;");function pi(wi){or(Xa[wi],"=",qt,".",wi,"|0;")}return pi("size"),pi("offset"),pi("stride"),pi("divisor"),or("}}"),or.exit("if(",Xa.isStream,"){",yi,".destroyStream(",Ji,");","}"),Xa}fr[sr]=vn(pr,lr)}),fr}function El(gt){var Et=gt.static,Ft=gt.dynamic,ir={};return Object.keys(Et).forEach(function(fr){var sr=Et[fr];ir[fr]=an(function(pr,lr){return typeof sr=="number"||typeof sr=="boolean"?""+sr:pr.link(sr)})}),Object.keys(Ft).forEach(function(fr){var sr=Ft[fr];ir[fr]=vn(sr,function(pr,lr){return pr.invoke(lr,sr)})}),ir}function Ql(gt,Et,Ft,ir,fr){var sr=gt.static,pr=gt.dynamic,lr=Ps(gt,Et),Xt=Rn(gt,fr),or=Gn(gt,Xt,fr),qt=ho(gt,fr),Dr=Hl(gt,fr),Jr=xl(gt,fr,lr);function ba(pi){var wi=or[pi];wi&&(Dr[pi]=wi)}ba(Se),ba(zi(we));var yi=Object.keys(Dr).length>0,Xa={framebuffer:Xt,draw:qt,shader:Jr,state:Dr,dirty:yi,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(Xa.profile=En(gt,fr),Xa.uniforms=fs(Ft,fr),Xa.drawVAO=Xa.scopeVAO=qt.vao,!Xa.drawVAO&&Jr.program&&!lr&&cr.angle_instanced_arrays&&qt.static.elements){var si=!0,Ji=Jr.program.attributes.map(function(pi){var wi=Et.static[pi];return si=si&&!!wi,wi});if(si&&Ji.length>0){var Bi=bi.getVAO(bi.createVAO({attributes:Ji,elements:qt.static.elements}));Xa.drawVAO=new Pa(null,null,null,function(pi,wi){return pi.link(Bi)}),Xa.useVAO=!0}}return lr?Xa.useVAO=!0:Xa.attributes=Al(Et,fr),Xa.context=El(ir,fr),Xa}function Fs(gt,Et,Ft){var ir=gt.shared,fr=ir.context,sr=gt.scope();Object.keys(Ft).forEach(function(pr){Et.save(fr,"."+pr);var lr=Ft[pr],Xt=lr.append(gt,Et);Array.isArray(Xt)?sr(fr,".",pr,"=[",Xt.join(),"];"):sr(fr,".",pr,"=",Xt,";")}),Et(sr)}function pl(gt,Et,Ft,ir){var fr=gt.shared,sr=fr.gl,pr=fr.framebuffer,lr;Wa&&(lr=Et.def(fr.extensions,".webgl_draw_buffers"));var Xt=gt.constants,or=Xt.drawBuffer,qt=Xt.backBuffer,Dr;Ft?Dr=Ft.append(gt,Et):Dr=Et.def(pr,".next"),ir||Et("if(",Dr,"!==",pr,".cur){"),Et("if(",Dr,"){",sr,".bindFramebuffer(",ya,",",Dr,".framebuffer);"),Wa&&Et(lr,".drawBuffersWEBGL(",or,"[",Dr,".colorAttachments.length]);"),Et("}else{",sr,".bindFramebuffer(",ya,",null);"),Wa&&Et(lr,".drawBuffersWEBGL(",qt,");"),Et("}",pr,".cur=",Dr,";"),ir||Et("}")}function bl(gt,Et,Ft){var ir=gt.shared,fr=ir.gl,sr=gt.current,pr=gt.next,lr=ir.current,Xt=ir.next,or=gt.cond(lr,".dirty");Za.forEach(function(qt){var Dr=zi(qt);if(!(Dr in Ft.state)){var Jr,ba;if(Dr in pr){Jr=pr[Dr],ba=sr[Dr];var yi=p(Ii[Dr].length,function(si){return or.def(Jr,"[",si,"]")});or(gt.cond(yi.map(function(si,Ji){return si+"!=="+ba+"["+Ji+"]"}).join("||")).then(fr,".",$i[Dr],"(",yi,");",yi.map(function(si,Ji){return ba+"["+Ji+"]="+si}).join(";"),";"))}else{Jr=or.def(Xt,".",Dr);var Xa=gt.cond(Jr,"!==",lr,".",Dr);or(Xa),Dr in Va?Xa(gt.cond(Jr).then(fr,".enable(",Va[Dr],");").else(fr,".disable(",Va[Dr],");"),lr,".",Dr,"=",Jr,";"):Xa(fr,".",$i[Dr],"(",Jr,");",lr,".",Dr,"=",Jr,";")}}}),Object.keys(Ft.state).length===0&&or(lr,".dirty=false;"),Et(or)}function Hn(gt,Et,Ft,ir){var fr=gt.shared,sr=gt.current,pr=fr.current,lr=fr.gl,Xt;ui(Object.keys(Ft)).forEach(function(or){var qt=Ft[or];if(!(ir&&!ir(qt))){var Dr=qt.append(gt,Et);if(Va[or]){var Jr=Va[or];sn(qt)?(Xt=gt.link(Dr,{stable:!0}),Et(gt.cond(Xt).then(lr,".enable(",Jr,");").else(lr,".disable(",Jr,");")),Et(pr,".",or,"=",Xt,";")):(Et(gt.cond(Dr).then(lr,".enable(",Jr,");").else(lr,".disable(",Jr,");")),Et(pr,".",or,"=",Dr,";"))}else if(Ya(Dr)){var ba=sr[or];Et(lr,".",$i[or],"(",Dr,");",Dr.map(function(yi,Xa){return ba+"["+Xa+"]="+yi}).join(";"),";")}else sn(qt)?(Xt=gt.link(Dr,{stable:!0}),Et(lr,".",$i[or],"(",Xt,");",pr,".",or,"=",Xt,";")):Et(lr,".",$i[or],"(",Dr,");",pr,".",or,"=",Dr,";")}})}function Cl(gt,Et){gi&&(gt.instancing=Et.def(gt.shared.extensions,".angle_instanced_arrays"))}function Lo(gt,Et,Ft,ir,fr){var sr=gt.shared,pr=gt.stats,lr=sr.current,Xt=sr.timer,or=Ft.profile;function qt(){return typeof performance>"u"?"Date.now()":"performance.now()"}var Dr,Jr;function ba(pi){Dr=Et.def(),pi(Dr,"=",qt(),";"),typeof fr=="string"?pi(pr,".count+=",fr,";"):pi(pr,".count++;"),ki&&(ir?(Jr=Et.def(),pi(Jr,"=",Xt,".getNumPendingQueries();")):pi(Xt,".beginQuery(",pr,");"))}function yi(pi){pi(pr,".cpuTime+=",qt(),"-",Dr,";"),ki&&(ir?pi(Xt,".pushScopeStats(",Jr,",",Xt,".getNumPendingQueries(),",pr,");"):pi(Xt,".endQuery();"))}function Xa(pi){var wi=Et.def(lr,".profile");Et(lr,".profile=",pi,";"),Et.exit(lr,".profile=",wi,";")}var si;if(or){if(sn(or)){or.enable?(ba(Et),yi(Et.exit),Xa("true")):Xa("false");return}si=or.append(gt,Et),Xa(si)}else si=Et.def(lr,".profile");var Ji=gt.block();ba(Ji),Et("if(",si,"){",Ji,"}");var Bi=gt.block();yi(Bi),Et.exit("if(",si,"){",Bi,"}")}function ve(gt,Et,Ft,ir,fr){var sr=gt.shared;function pr(Xt){switch(Xt){case ss:case ll:case Pl:return 2;case So:case Js:case $l:return 3;case Ko:case es:case Ru:return 4;default:return 1}}function lr(Xt,or,qt){var Dr=sr.gl,Jr=Et.def(Xt,".location"),ba=Et.def(sr.attributes,"[",Jr,"]"),yi=qt.state,Xa=qt.buffer,si=[qt.x,qt.y,qt.z,qt.w],Ji=["buffer","normalized","offset","stride"];function Bi(){Et("if(!",ba,".buffer){",Dr,".enableVertexAttribArray(",Jr,");}");var wi=qt.type,Mi;if(qt.size?Mi=Et.def(qt.size,"||",or):Mi=or,Et("if(",ba,".type!==",wi,"||",ba,".size!==",Mi,"||",Ji.map(function(cn){return ba+"."+cn+"!=="+qt[cn]}).join("||"),"){",Dr,".bindBuffer(",Qr,",",Xa,".buffer);",Dr,".vertexAttribPointer(",[Jr,Mi,wi,qt.normalized,qt.stride,qt.offset],");",ba,".type=",wi,";",ba,".size=",Mi,";",Ji.map(function(cn){return ba+"."+cn+"="+qt[cn]+";"}).join(""),"}"),gi){var Vi=qt.divisor;Et("if(",ba,".divisor!==",Vi,"){",gt.instancing,".vertexAttribDivisorANGLE(",[Jr,Vi],");",ba,".divisor=",Vi,";}")}}function pi(){Et("if(",ba,".buffer){",Dr,".disableVertexAttribArray(",Jr,");",ba,".buffer=null;","}if(",Kn.map(function(wi,Mi){return ba+"."+wi+"!=="+si[Mi]}).join("||"),"){",Dr,".vertexAttrib4f(",Jr,",",si,");",Kn.map(function(wi,Mi){return ba+"."+wi+"="+si[Mi]+";"}).join(""),"}")}yi===Jn?Bi():yi===co?pi():(Et("if(",yi,"===",Jn,"){"),Bi(),Et("}else{"),pi(),Et("}"))}ir.forEach(function(Xt){var or=Xt.name,qt=Ft.attributes[or],Dr;if(qt){if(!fr(qt))return;Dr=qt.append(gt,Et)}else{if(!fr(Pn))return;var Jr=gt.scopeAttrib(or);Dr={},Object.keys(new Ea).forEach(function(ba){Dr[ba]=Et.def(Jr,".",ba)})}lr(gt.link(Xt),pr(Xt.info.type),Dr)})}function Y(gt,Et,Ft,ir,fr,sr){for(var pr=gt.shared,lr=pr.gl,Xt,or=0;or1){for(var jo=[],ks=[],Fo=0;Fo>1)",Xa],");")}function Vi(){Ft(si,".drawArraysInstancedANGLE(",[Jr,ba,yi,Xa],");")}qt&&qt!=="null"?Bi?Mi():(Ft("if(",qt,"){"),Mi(),Ft("}else{"),Vi(),Ft("}")):Vi()}function wi(){function Mi(){Ft(sr+".drawElements("+[Jr,yi,Ji,ba+"<<(("+Ji+"-"+ao+")>>1)"]+");")}function Vi(){Ft(sr+".drawArrays("+[Jr,ba,yi]+");")}qt&&qt!=="null"?Bi?Mi():(Ft("if(",qt,"){"),Mi(),Ft("}else{"),Vi(),Ft("}")):Vi()}gi&&(typeof Xa!="number"||Xa>=0)?typeof Xa=="string"?(Ft("if(",Xa,">0){"),pi(),Ft("}else if(",Xa,"<0){"),wi(),Ft("}")):pi():wi()}function te(gt,Et,Ft,ir,fr){var sr=nn(),pr=sr.proc("body",fr);return gi&&(sr.instancing=pr.def(sr.shared.extensions,".angle_instanced_arrays")),gt(sr,pr,Ft,ir),sr.compile().body}function me(gt,Et,Ft,ir){Cl(gt,Et),Ft.useVAO?Ft.drawVAO?Et(gt.shared.vao,".setVAO(",Ft.drawVAO.append(gt,Et),");"):Et(gt.shared.vao,".setVAO(",gt.shared.vao,".targetVAO);"):(Et(gt.shared.vao,".setVAO(null);"),ve(gt,Et,Ft,ir.attributes,function(){return!0})),Y(gt,Et,Ft,ir.uniforms,function(){return!0},!1),ye(gt,Et,Et,Ft)}function Ge(gt,Et){var Ft=gt.proc("draw",1);Cl(gt,Ft),Fs(gt,Ft,Et.context),pl(gt,Ft,Et.framebuffer),bl(gt,Ft,Et),Hn(gt,Ft,Et.state),Lo(gt,Ft,Et,!1,!0);var ir=Et.shader.progVar.append(gt,Ft);if(Ft(gt.shared.gl,".useProgram(",ir,".program);"),Et.shader.program)me(gt,Ft,Et,Et.shader.program);else{Ft(gt.shared.vao,".setVAO(null);");var fr=gt.global.def("{}"),sr=Ft.def(ir,".id"),pr=Ft.def(fr,"[",sr,"]");Ft(gt.cond(pr).then(pr,".call(this,a0);").else(pr,"=",fr,"[",sr,"]=",gt.link(function(lr){return te(me,gt,Et,lr,1)}),"(",ir,");",pr,".call(this,a0);"))}Object.keys(Et.state).length>0&&Ft(gt.shared.current,".dirty=true;"),gt.shared.vao&&Ft(gt.shared.vao,".setVAO(null);")}function Le(gt,Et,Ft,ir){gt.batchId="a1",Cl(gt,Et);function fr(){return!0}ve(gt,Et,Ft,ir.attributes,fr),Y(gt,Et,Ft,ir.uniforms,fr,!1),ye(gt,Et,Et,Ft)}function $e(gt,Et,Ft,ir){Cl(gt,Et);var fr=Ft.contextDep,sr=Et.def(),pr="a0",lr="a1",Xt=Et.def();gt.shared.props=Xt,gt.batchId=sr;var or=gt.scope(),qt=gt.scope();Et(or.entry,"for(",sr,"=0;",sr,"<",lr,";++",sr,"){",Xt,"=",pr,"[",sr,"];",qt,"}",or.exit);function Dr(Ji){return Ji.contextDep&&fr||Ji.propDep}function Jr(Ji){return!Dr(Ji)}if(Ft.needsContext&&Fs(gt,qt,Ft.context),Ft.needsFramebuffer&&pl(gt,qt,Ft.framebuffer),Hn(gt,qt,Ft.state,Dr),Ft.profile&&Dr(Ft.profile)&&Lo(gt,qt,Ft,!1,!0),ir)Ft.useVAO?Ft.drawVAO?Dr(Ft.drawVAO)?qt(gt.shared.vao,".setVAO(",Ft.drawVAO.append(gt,qt),");"):or(gt.shared.vao,".setVAO(",Ft.drawVAO.append(gt,or),");"):or(gt.shared.vao,".setVAO(",gt.shared.vao,".targetVAO);"):(or(gt.shared.vao,".setVAO(null);"),ve(gt,or,Ft,ir.attributes,Jr),ve(gt,qt,Ft,ir.attributes,Dr)),Y(gt,or,Ft,ir.uniforms,Jr,!1),Y(gt,qt,Ft,ir.uniforms,Dr,!0),ye(gt,or,qt,Ft);else{var ba=gt.global.def("{}"),yi=Ft.shader.progVar.append(gt,qt),Xa=qt.def(yi,".id"),si=qt.def(ba,"[",Xa,"]");qt(gt.shared.gl,".useProgram(",yi,".program);","if(!",si,"){",si,"=",ba,"[",Xa,"]=",gt.link(function(Ji){return te(Le,gt,Ft,Ji,2)}),"(",yi,");}",si,".call(this,a0[",sr,"],",sr,");")}}function mt(gt,Et){var Ft=gt.proc("batch",2);gt.batchId="0",Cl(gt,Ft);var ir=!1,fr=!0;Object.keys(Et.context).forEach(function(ba){ir=ir||Et.context[ba].propDep}),ir||(Fs(gt,Ft,Et.context),fr=!1);var sr=Et.framebuffer,pr=!1;sr?(sr.propDep?ir=pr=!0:sr.contextDep&&ir&&(pr=!0),pr||pl(gt,Ft,sr)):pl(gt,Ft,null),Et.state.viewport&&Et.state.viewport.propDep&&(ir=!0);function lr(ba){return ba.contextDep&&ir||ba.propDep}bl(gt,Ft,Et),Hn(gt,Ft,Et.state,function(ba){return!lr(ba)}),(!Et.profile||!lr(Et.profile))&&Lo(gt,Ft,Et,!1,"a1"),Et.contextDep=ir,Et.needsContext=fr,Et.needsFramebuffer=pr;var Xt=Et.shader.progVar;if(Xt.contextDep&&ir||Xt.propDep)$e(gt,Ft,Et,null);else{var or=Xt.append(gt,Ft);if(Ft(gt.shared.gl,".useProgram(",or,".program);"),Et.shader.program)$e(gt,Ft,Et,Et.shader.program);else{Ft(gt.shared.vao,".setVAO(null);");var qt=gt.global.def("{}"),Dr=Ft.def(or,".id"),Jr=Ft.def(qt,"[",Dr,"]");Ft(gt.cond(Jr).then(Jr,".call(this,a0,a1);").else(Jr,"=",qt,"[",Dr,"]=",gt.link(function(ba){return te($e,gt,Et,ba,2)}),"(",or,");",Jr,".call(this,a0,a1);"))}}Object.keys(Et.state).length>0&&Ft(gt.shared.current,".dirty=true;"),gt.shared.vao&&Ft(gt.shared.vao,".setVAO(null);")}function jt(gt,Et){var Ft=gt.proc("scope",3);gt.batchId="a2";var ir=gt.shared,fr=ir.current;if(Fs(gt,Ft,Et.context),Et.framebuffer&&Et.framebuffer.append(gt,Ft),ui(Object.keys(Et.state)).forEach(function(lr){var Xt=Et.state[lr],or=Xt.append(gt,Ft);Ya(or)?or.forEach(function(qt,Dr){Ki(qt)?Ft.set(gt.next[lr],"["+Dr+"]",qt):Ft.set(gt.next[lr],"["+Dr+"]",gt.link(qt,{stable:!0}))}):sn(Xt)?Ft.set(ir.next,"."+lr,gt.link(or,{stable:!0})):Ft.set(ir.next,"."+lr,or)}),Lo(gt,Ft,Et,!0,!0),[$t,Yr,Ar,sa,br].forEach(function(lr){var Xt=Et.draw[lr];if(Xt){var or=Xt.append(gt,Ft);Ki(or)?Ft.set(ir.draw,"."+lr,or):Ft.set(ir.draw,"."+lr,gt.link(or),{stable:!0})}}),Object.keys(Et.uniforms).forEach(function(lr){var Xt=Et.uniforms[lr].append(gt,Ft);Array.isArray(Xt)&&(Xt="["+Xt.map(function(or){return Ki(or)?or:gt.link(or,{stable:!0})})+"]"),Ft.set(ir.uniforms,"["+gt.link(Yt.id(lr),{stable:!0})+"]",Xt)}),Object.keys(Et.attributes).forEach(function(lr){var Xt=Et.attributes[lr].append(gt,Ft),or=gt.scopeAttrib(lr);Object.keys(new Ea).forEach(function(qt){Ft.set(or,"."+qt,Xt[qt])})}),Et.scopeVAO){var sr=Et.scopeVAO.append(gt,Ft);Ki(sr)?Ft.set(ir.vao,".targetVAO",sr):Ft.set(ir.vao,".targetVAO",gt.link(sr,{stable:!0}))}function pr(lr){var Xt=Et.shader[lr];if(Xt){var or=Xt.append(gt,Ft);Ki(or)?Ft.set(ir.shader,"."+lr,or):Ft.set(ir.shader,"."+lr,gt.link(or,{stable:!0}))}}pr(At),pr(Bt),Object.keys(Et.state).length>0&&(Ft(fr,".dirty=true;"),Ft.exit(fr,".dirty=true;")),Ft("a1(",gt.shared.context,",a0,",gt.batchId,");")}function _r(gt){if(!(typeof gt!="object"||Ya(gt))){for(var Et=Object.keys(gt),Ft=0;Ft=0;--te){var me=mn[te];me&&me(qa,null,0)}cr.flush(),fi&&fi.update()}function Gn(){!En&&mn.length>0&&(En=f.next(Rn))}function Ps(){En&&(f.cancel(Rn),En=null)}function xl(te){te.preventDefault(),Aa=!0,Ps(),In.forEach(function(me){me()})}function ho(te){cr.getError(),Aa=!1,xa.restore(),hn.restore(),gi.restore(),Za.restore(),Va.restore(),$i.restore(),ji.restore(),fi&&fi.restore(),zi.procs.refresh(),Gn(),Di.forEach(function(me){me()})}Ki&&(Ki.addEventListener(cs,xl,!1),Ki.addEventListener(ps,ho,!1));function Hl(){mn.length=0,Ps(),Ki&&(Ki.removeEventListener(cs,xl),Ki.removeEventListener(ps,ho)),hn.clear(),$i.clear(),Va.clear(),ji.clear(),Za.clear(),Wa.clear(),gi.clear(),fi&&fi.clear(),nn.forEach(function(te){te()})}function fs(te){function me(sr){var pr=d({},sr);delete pr.uniforms,delete pr.attributes,delete pr.context,delete pr.vao,"stencil"in pr&&pr.stencil.op&&(pr.stencil.opBack=pr.stencil.opFront=pr.stencil.op,delete pr.stencil.op);function lr(Xt){if(Xt in pr){var or=pr[Xt];delete pr[Xt],Object.keys(or).forEach(function(qt){pr[Xt+"."+qt]=or[qt]})}}return lr("blend"),lr("depth"),lr("cull"),lr("stencil"),lr("polygonOffset"),lr("scissor"),lr("sample"),"vao"in sr&&(pr.vao=sr.vao),pr}function Ge(sr,pr){var lr={},Xt={};return Object.keys(sr).forEach(function(or){var qt=sr[or];if(c.isDynamic(qt)){Xt[or]=c.unbox(qt,or);return}else if(pr&&Array.isArray(qt)){for(var Dr=0;Dr0)return gt.call(this,ir(sr|0),sr|0)}else if(Array.isArray(sr)){if(sr.length)return gt.call(this,sr,sr.length)}else return hr.call(this,sr)}return d(fr,{stats:_r,destroy:function(){Fr.destroy()}})}var Al=$i.setFBO=fs({framebuffer:c.define.call(null,Tl,"framebuffer")});function El(te,me){var Ge=0;zi.procs.poll();var Le=me.color;Le&&(cr.clearColor(+Le[0]||0,+Le[1]||0,+Le[2]||0,+Le[3]||0),Ge|=el),"depth"in me&&(cr.clearDepth(+me.depth),Ge|=_l),"stencil"in me&&(cr.clearStencil(me.stencil|0),Ge|=gn),cr.clear(Ge)}function Ql(te){if("framebuffer"in te)if(te.framebuffer&&te.framebuffer_reglType==="framebufferCube")for(var me=0;me<6;++me)Al(d({framebuffer:te.framebuffer.faces[me]},te),El);else Al(te,El);else El(null,te)}function Fs(te){mn.push(te);function me(){var Ge=Il(mn,te);function Le(){var $e=Il(mn,Le);mn[$e]=mn[mn.length-1],mn.length-=1,mn.length<=0&&Ps()}mn[Ge]=Le}return Gn(),{cancel:me}}function pl(){var te=Ti.viewport,me=Ti.scissor_box;te[0]=te[1]=me[0]=me[1]=0,qa.viewportWidth=qa.framebufferWidth=qa.drawingBufferWidth=te[2]=me[2]=cr.drawingBufferWidth,qa.viewportHeight=qa.framebufferHeight=qa.drawingBufferHeight=te[3]=me[3]=cr.drawingBufferHeight}function bl(){qa.tick+=1,qa.time=Cl(),pl(),zi.procs.poll()}function Hn(){Za.refresh(),pl(),zi.procs.refresh(),fi&&fi.update()}function Cl(){return(g()-yn)/1e3}Hn();function Lo(te,me){var Ge;switch(te){case"frame":return Fs(me);case"lost":Ge=In;break;case"restore":Ge=Di;break;case"destroy":Ge=nn;break;default:}return Ge.push(me),{cancel:function(){for(var Le=0;Le=0},read:Si,destroy:Hl,_gl:cr,_refresh:Hn,poll:function(){bl(),fi&&fi.update()},now:Cl,stats:Ja,getCachedCode:ve,preloadCachedCode:Y});return Yt.onDone(null,ye),ye}return yc})}}),xT=Ze({"src/lib/prepare_regl.js"(Z,q){"use strict";var d=wE(),x=Cq();q.exports=function(M,e,t){var r=M._fullLayout,o=!0;return r._glcanvas.each(function(a){if(a.regl){a.regl.preloadCachedCode(t);return}if(!(a.pick&&!r._has("parcoords"))){try{a.regl=x({canvas:this,attributes:{antialias:!a.pick,preserveDrawingBuffer:!0},pixelRatio:M._context.plotGlPixelRatio||window.devicePixelRatio,extensions:e||[],cachedCode:t||{}})}catch{o=!1}a.regl||(o=!1),o&&this.addEventListener("webglcontextlost",function(i){M&&M.emit&&M.emit("plotly_webglcontextlost",{event:i,layer:a.key})},!1)}}),o||d({container:r._glcontainer.node()}),o}}}),h6=Ze({"src/traces/scattergl/plot.js"(c,q){"use strict";var d=GE(),x=r6(),A=fq(),M=Eq(),e=ca(),t=Jd().selectMode,r=xT(),o=Fu(),a=F5(),i=jE().styleTextSelection,n={};function s(f,g,v,T){var l=f._size,_=f.width*T,w=f.height*T,S=l.l*T,E=l.b*T,y=l.r*T,b=l.t*T,p=l.w*T,u=l.h*T;return[S+g.domain[0]*p,E+v.domain[0]*u,_-y-(1-g.domain[1])*p,w-b-(1-v.domain[1])*u]}var c=q.exports=function(g,v,T){if(T.length){var l=g._fullLayout,_=v._scene,w=v.xaxis,S=v.yaxis,E,y;if(_){var b=r(g,["ANGLE_instanced_arrays","OES_element_index_uint"],n);if(!b){_.init();return}var p=_.count,u=l._glcanvas.data()[0].regl;if(a(g,v,T),_.dirty){if((_.line2d||_.error2d)&&!(_.scatter2d||_.fill2d||_.glText)&&u.clear({color:!0,depth:!0}),_.error2d===!0&&(_.error2d=A(u)),_.line2d===!0&&(_.line2d=x(u)),_.scatter2d===!0&&(_.scatter2d=d(u)),_.fill2d===!0&&(_.fill2d=x(u)),_.glText===!0)for(_.glText=new Array(p),E=0;E_.glText.length){var m=p-_.glText.length;for(E=0;Ere&&(isNaN(ee[ce])||isNaN(ee[ce+1]));)ce-=2;j.positions=ee.slice(re,ce+2)}return j}),_.line2d.update(_.lineOptions)),_.error2d){var L=(_.errorXOptions||[]).concat(_.errorYOptions||[]);_.error2d.update(L)}_.scatter2d&&_.scatter2d.update(_.markerOptions),_.fillOrder=e.repeat(null,p),_.fill2d&&(_.fillOptions=_.fillOptions.map(function(j,ee){var re=T[ee];if(!(!j||!re||!re[0]||!re[0].trace)){var ce=re[0],be=ce.trace,Ae=ce.t,ze=_.lineOptions[ee],Re,Xe,it=[];be._ownfill&&it.push(ee),be._nexttrace&&it.push(ee+1),it.length&&(_.fillOrder[ee]=it);var ot=[],tt=ze&&ze.positions||Ae.positions,lt,Ee;if(be.fill==="tozeroy"){for(lt=0;ltlt&&isNaN(tt[Ee+1]);)Ee-=2;tt[lt+1]!==0&&(ot=[tt[lt],0]),ot=ot.concat(tt.slice(lt,Ee+2)),tt[Ee+1]!==0&&(ot=ot.concat([tt[Ee],0]))}else if(be.fill==="tozerox"){for(lt=0;ltlt&&isNaN(tt[Ee]);)Ee-=2;tt[lt]!==0&&(ot=[0,tt[lt+1]]),ot=ot.concat(tt.slice(lt,Ee+2)),tt[Ee]!==0&&(ot=ot.concat([0,tt[Ee+1]]))}else if(be.fill==="toself"||be.fill==="tonext"){for(ot=[],Re=0,j.splitNull=!0,Xe=0;Xe-1;for(E=0;Ew&&v||_i,h;for(m?h=v.sizeAvg||Math.max(v.size,3):h=A(c,g),S=0;S<_.length;S++)w=_[S],E=f[w],y=x.getFromId(s,c._diag[w][0])||{},b=x.getFromId(s,c._diag[w][1])||{},M(s,c,y,b,T[S],T[S],h);var P=o(s,c);return P.matrix||(P.matrix=!0),P.matrixOptions=v,P.selectedOptions=t(s,c,c.selected),P.unselectedOptions=t(s,c,c.unselected),[{x:!1,y:!1,t:{},trace:c}]}}}),Dq=Ze({"node_modules/performance-now/lib/performance-now.js"(Z,q){(function(){var d,x,A,M,e,t;typeof performance<"u"&&performance!==null&&performance.now?q.exports=function(){return performance.now()}:typeof process<"u"&&process!==null&&process.hrtime?(q.exports=function(){return(d()-e)/1e6},x=process.hrtime,d=function(){var r;return r=x(),r[0]*1e9+r[1]},M=d(),t=process.uptime()*1e9,e=M-t):Date.now?(q.exports=function(){return Date.now()-A},A=Date.now()):(q.exports=function(){return new Date().getTime()-A},A=new Date().getTime())}).call(Z)}}),zq=Ze({"node_modules/raf/index.js"(Z,q){var d=Dq(),x=window,A=["moz","webkit"],M="AnimationFrame",e=x["request"+M],t=x["cancel"+M]||x["cancelRequest"+M];for(r=0;!e&&r{this.draw(),this.dirty=!0,this.planned=null})):(this.draw(),this.dirty=!0,M(()=>{this.dirty=!1})),this)},o.prototype.update=function(...s){if(!s.length)return;for(let g=0;gh||!v.lower&&m{c[T+_]=g})}this.scatter.draw(...c)}return this},o.prototype.destroy=function(){return this.traces.forEach(s=>{s.buffer&&s.buffer.destroy&&s.buffer.destroy()}),this.traces=null,this.passes=null,this.scatter.destroy(),this};function a(s,c,f){let g=s.id!=null?s.id:s,v=c,T=f;return g<<16|(v&255)<<8|T&255}function i(s,c,f){let g,v,T,l,_,w,S,E,y=s[c],b=s[f];return y.length>2?(g=y[0],T=y[2],v=y[1],l=y[3]):y.length?(g=v=y[0],T=l=y[1]):(g=y.x,v=y.y,T=y.x+y.width,l=y.y+y.height),b.length>2?(_=b[0],S=b[2],w=b[1],E=b[3]):b.length?(_=w=b[0],S=E=b[1]):(_=b.x,w=b.y,S=b.x+b.width,E=b.y+b.height),[_,v,S,l]}function n(s){if(typeof s=="number")return[s,s,s,s];if(s.length===2)return[s[0],s[1],s[0],s[1]];{let c=t(s);return[c.x,c.y,c.x+c.width,c.y+c.height]}}}}),Bq=Ze({"src/traces/splom/plot.js"(Z,q){"use strict";var d=Oq(),x=ca(),A=$c(),M=Jd().selectMode;q.exports=function(r,o,a){if(a.length)for(var i=0;i-1,B=M(v)||!!i.selectedpoints||F,O=!0;if(B){var I=i._length;if(i.selectedpoints){s.selectBatch=i.selectedpoints;var N=i.selectedpoints,U={};for(_=0;_=W[Q][0]&&U<=W[Q][1])return!0;return!1}function c(U){U.attr("x",-d.bar.captureWidth/2).attr("width",d.bar.captureWidth)}function f(U){U.attr("visibility","visible").style("visibility","visible").attr("fill","yellow").attr("opacity",0)}function g(U){if(!U.brush.filterSpecified)return"0,"+U.height;for(var W=v(U.brush.filter.getConsolidated(),U.height),Q=[0],ue,le,he,G=W.length?W[0][0]:null,$=0;$U[1]+Q||W=.9*U[1]+.1*U[0]?"n":W<=.9*U[0]+.1*U[1]?"s":"ns"}function l(){x.select(document.body).style("cursor",null)}function _(U){U.attr("stroke-dasharray",g)}function w(U,W){var Q=x.select(U).selectAll(".highlight, .highlight-shadow"),ue=W?Q.transition().duration(d.bar.snapDuration).each("end",W):Q;_(ue)}function S(U,W){var Q=U.brush,ue=Q.filterSpecified,le=NaN,he={},G;if(ue){var $=U.height,J=Q.filter.getConsolidated(),X=v(J,$),oe=NaN,ie=NaN,j=NaN;for(G=0;G<=X.length;G++){var ee=X[G];if(ee&&ee[0]<=W&&W<=ee[1]){oe=G;break}else if(ie=G?G-1:NaN,ee&&ee[0]>W){j=G;break}}if(le=oe,isNaN(le)&&(isNaN(ie)||isNaN(j)?le=isNaN(ie)?j:ie:le=W-X[ie][1]=ze[0]&&Ae<=ze[1]){he.clickableOrdinalRange=ze;break}}}return he}function E(U,W){x.event.sourceEvent.stopPropagation();var Q=W.height-x.mouse(U)[1]-2*d.verticalPadding,ue=W.unitToPaddedPx.invert(Q),le=W.brush,he=S(W,Q),G=he.interval,$=le.svgBrush;if($.wasDragged=!1,$.grabbingBar=he.region==="ns",$.grabbingBar){var J=G.map(W.unitToPaddedPx);$.grabPoint=Q-J[0]-d.verticalPadding,$.barLength=J[1]-J[0]}$.clickableOrdinalRange=he.clickableOrdinalRange,$.stayingIntervals=W.multiselect&&le.filterSpecified?le.filter.getConsolidated():[],G&&($.stayingIntervals=$.stayingIntervals.filter(function(X){return X[0]!==G[0]&&X[1]!==G[1]})),$.startExtent=he.region?G[he.region==="s"?1:0]:ue,W.parent.inBrushDrag=!0,$.brushStartCallback()}function y(U,W){x.event.sourceEvent.stopPropagation();var Q=W.height-x.mouse(U)[1]-2*d.verticalPadding,ue=W.brush.svgBrush;ue.wasDragged=!0,ue._dragging=!0,ue.grabbingBar?ue.newExtent=[Q-ue.grabPoint,Q+ue.barLength-ue.grabPoint].map(W.unitToPaddedPx.invert):ue.newExtent=[ue.startExtent,W.unitToPaddedPx.invert(Q)].sort(e),W.brush.filterSpecified=!0,ue.extent=ue.stayingIntervals.concat([ue.newExtent]),ue.brushCallback(W),w(U.parentNode)}function b(U,W){var Q=W.brush,ue=Q.filter,le=Q.svgBrush;le._dragging||(p(U,W),y(U,W),W.brush.svgBrush.wasDragged=!1),le._dragging=!1;var he=x.event;he.sourceEvent.stopPropagation();var G=le.grabbingBar;if(le.grabbingBar=!1,le.grabLocation=void 0,W.parent.inBrushDrag=!1,l(),!le.wasDragged){le.wasDragged=void 0,le.clickableOrdinalRange?Q.filterSpecified&&W.multiselect?le.extent.push(le.clickableOrdinalRange):(le.extent=[le.clickableOrdinalRange],Q.filterSpecified=!0):G?(le.extent=le.stayingIntervals,le.extent.length===0&&z(Q)):z(Q),le.brushCallback(W),w(U.parentNode),le.brushEndCallback(Q.filterSpecified?ue.getConsolidated():[]);return}var $=function(){ue.set(ue.getConsolidated())};if(W.ordinal){var J=W.unitTickvals;J[J.length-1]le.newExtent[0];le.extent=le.stayingIntervals.concat(X?[le.newExtent]:[]),le.extent.length||z(Q),le.brushCallback(W),X?w(U.parentNode,$):($(),w(U.parentNode))}else $();le.brushEndCallback(Q.filterSpecified?ue.getConsolidated():[])}function p(U,W){var Q=W.height-x.mouse(U)[1]-2*d.verticalPadding,ue=S(W,Q),le="crosshair";ue.clickableOrdinalRange?le="pointer":ue.region&&(le=ue.region+"-resize"),x.select(document.body).style("cursor",le)}function u(U){U.on("mousemove",function(W){x.event.preventDefault(),W.parent.inBrushDrag||p(this,W)}).on("mouseleave",function(W){W.parent.inBrushDrag||l()}).call(x.behavior.drag().on("dragstart",function(W){E(this,W)}).on("drag",function(W){y(this,W)}).on("dragend",function(W){b(this,W)}))}function m(U,W){return U[0]-W[0]}function h(U,W,Q){var ue=Q._context.staticPlot,le=U.selectAll(".background").data(M);le.enter().append("rect").classed("background",!0).call(c).call(f).style("pointer-events",ue?"none":"auto").attr("transform",t(0,d.verticalPadding)),le.call(u).attr("height",function($){return $.height-d.verticalPadding});var he=U.selectAll(".highlight-shadow").data(M);he.enter().append("line").classed("highlight-shadow",!0).attr("x",-d.bar.width/2).attr("stroke-width",d.bar.width+d.bar.strokeWidth).attr("stroke",W).attr("opacity",d.bar.strokeOpacity).attr("stroke-linecap","butt"),he.attr("y1",function($){return $.height}).call(_);var G=U.selectAll(".highlight").data(M);G.enter().append("line").classed("highlight",!0).attr("x",-d.bar.width/2).attr("stroke-width",d.bar.width-d.bar.strokeWidth).attr("stroke",d.bar.fillColor).attr("opacity",d.bar.fillOpacity).attr("stroke-linecap","butt"),G.attr("y1",function($){return $.height}).call(_)}function P(U,W,Q){var ue=U.selectAll("."+d.cn.axisBrush).data(M,A);ue.enter().append("g").classed(d.cn.axisBrush,!0),h(ue,W,Q)}function L(U){return U.svgBrush.extent.map(function(W){return W.slice()})}function z(U){U.filterSpecified=!1,U.svgBrush.extent=[[-1/0,1/0]]}function F(U){return function(Q){var ue=Q.brush,le=L(ue),he=le.slice();ue.filter.set(he),U()}}function B(U){for(var W=U.slice(),Q=[],ue,le=W.shift();le;){for(ue=le.slice();(le=W.shift())&&le[0]<=ue[1];)ue[1]=Math.max(ue[1],le[1]);Q.push(ue)}return Q.length===1&&Q[0][0]>Q[0][1]&&(Q=[]),Q}function O(){var U=[],W,Q;return{set:function(ue){U=ue.map(function(le){return le.slice().sort(e)}).sort(m),U.length===1&&U[0][0]===-1/0&&U[0][1]===1/0&&(U=[[0,-1]]),W=B(U),Q=U.reduce(function(le,he){return[Math.min(le[0],he[0]),Math.max(le[1],he[1])]},[1/0,-1/0])},get:function(){return U.slice()},getConsolidated:function(){return W},getBounds:function(){return Q}}}function I(U,W,Q,ue,le,he){var G=O();return G.set(Q),{filter:G,filterSpecified:W,svgBrush:{extent:[],brushStartCallback:ue,brushCallback:F(le),brushEndCallback:he}}}function N(U,W){if(Array.isArray(U[0])?(U=U.map(function(ue){return ue.sort(e)}),W.multiselect?U=B(U.sort(m)):U=[U[0]]):U=[U.sort(e)],W.tickvals){var Q=W.tickvals.slice().sort(e);if(U=U.map(function(ue){var le=[n(0,Q,ue[0],[]),n(1,Q,ue[1],[])];if(le[1]>le[0])return le}).filter(function(ue){return ue}),!U.length)return}return U.length>1?U:U[0]}q.exports={makeBrush:I,ensureAxisBrush:P,cleanRanges:N}}}),Wq=Ze({"src/traces/parcoords/defaults.js"(Z,q){"use strict";var d=ca(),x=bp().hasColorscale,A=gh(),M=bc().defaults,e=fp(),t=Wo(),r=v6(),o=m6(),a=Tx().maxDimensionCount,i=bT();function n(c,f,g,v,T){var l=T("line.color",g);if(x(c,"line")&&d.isArrayOrTypedArray(l)){if(l.length)return T("line.colorscale"),A(c,f,v,T,{prefix:"line.",cLetter:"c"}),l.length;f.line.color=g}return 1/0}function s(c,f,g,v){function T(E,y){return d.coerce(c,f,r.dimensions,E,y)}var l=T("values"),_=T("visible");if(l&&l.length||(_=f.visible=!1),_){T("label"),T("tickvals"),T("ticktext"),T("tickformat");var w=T("range");f._ax={_id:"y",type:"linear",showexponent:"all",exponentformat:"B",range:w},t.setConvert(f._ax,v.layout),T("multiselect");var S=T("constraintrange");S&&(f.constraintrange=o.cleanRanges(S,f))}}q.exports=function(f,g,v,T){function l(y,b){return d.coerce(f,g,r,y,b)}var _=f.dimensions;Array.isArray(_)&&_.length>a&&(d.log("parcoords traces support up to "+a+" dimensions at the moment"),_.splice(a));var w=e(f,g,{name:"dimensions",layout:T,handleItemDefaults:s}),S=n(f,g,v,T,l);M(g,T,l),(!Array.isArray(w)||!w.length)&&(g.visible=!1),i(g,w,"values",S);var E=d.extendFlat({},T.font,{size:Math.round(T.font.size/1.2)});d.coerceFont(l,"labelfont",E),d.coerceFont(l,"tickfont",E,{autoShadowDflt:!0}),d.coerceFont(l,"rangefont",E),l("labelangle"),l("labelside"),l("unselected.line.color"),l("unselected.line.opacity")}}}),Xq=Ze({"src/traces/parcoords/calc.js"(Z,q){"use strict";var d=ca().isArrayOrTypedArray,x=rc(),A=Cv().wrap;q.exports=function(t,r){var o,a;return x.hasColorscale(r,"line")&&d(r.line.color)?(o=r.line.color,a=x.extractOpts(r.line).colorscale,x.calc(t,r,{vals:o,containerStr:"line",cLetter:"c"})):(o=M(r._length),a=[[0,r.line.color],[1,r.line.color]]),A({lineColor:o,cscale:a})};function M(e){for(var t=new Array(e),r=0;r>>16,(Z&65280)>>>8,Z&255],alpha:1};if(typeof Z=="number")return{space:"rgb",values:[Z>>>16,(Z&65280)>>>8,Z&255],alpha:1};if(Z=String(Z).toLowerCase(),wT.default[Z])A=wT.default[Z].slice(),e="rgb";else if(Z==="transparent")M=0,e="rgb",A=[0,0,0];else if(Z[0]==="#"){var t=Z.slice(1),r=t.length,o=r<=4;M=1,o?(A=[parseInt(t[0]+t[0],16),parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16)],r===4&&(M=parseInt(t[3]+t[3],16)/255)):(A=[parseInt(t[0]+t[1],16),parseInt(t[2]+t[3],16),parseInt(t[4]+t[5],16)],r===8&&(M=parseInt(t[6]+t[7],16)/255)),A[0]||(A[0]=0),A[1]||(A[1]=0),A[2]||(A[2]=0),e="rgb"}else if(x=/^((?:rgba?|hs[lvb]a?|hwba?|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms|oklch|oklab|color))\s*\(([^\)]*)\)/.exec(Z)){var a=x[1];e=a.replace(/a$/,"");var i=e==="cmyk"?4:e==="gray"?1:3;A=x[2].trim().split(/\s*[,\/]\s*|\s+/),e==="color"&&(e=A.shift()),A=A.map(function(n,s){if(n[n.length-1]==="%")return n=parseFloat(n)/100,s===3?n:e==="rgb"?n*255:e[0]==="h"||e[0]==="l"&&!s?n*100:e==="lab"?n*125:e==="lch"?s<2?n*150:n*360:e[0]==="o"&&!s?n:e==="oklab"?n*.4:e==="oklch"?s<2?n*.4:n*360:n;if(e[s]==="h"||s===2&&e[e.length-1]==="h"){if(TT[n]!==void 0)return TT[n];if(n.endsWith("deg"))return parseFloat(n);if(n.endsWith("turn"))return parseFloat(n)*360;if(n.endsWith("grad"))return parseFloat(n)*360/400;if(n.endsWith("rad"))return parseFloat(n)*180/Math.PI}return n==="none"?0:parseFloat(n)}),M=A.length>i?A.pop():1}else/[0-9](?:\s|\/|,)/.test(Z)&&(A=Z.match(/([0-9]+)/g).map(function(n){return parseFloat(n)}),e=((d=(q=Z.match(/([a-z])/ig))==null?void 0:q.join(""))==null?void 0:d.toLowerCase())||"rgb");return{space:e,values:A,alpha:M}}var wT,g6,TT,Yq=wo({"node_modules/color-parse/index.js"(){wT=cu(_E(),1),g6=Zq,TT={red:0,orange:60,yellow:120,green:180,blue:240,purple:300}}}),Ax,y6=wo({"node_modules/color-space/rgb.js"(){Ax={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]}}}),Sx,Kq=wo({"node_modules/color-space/hsl.js"(){y6(),Sx={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(Z){var q=Z[0]/360,d=Z[1]/100,x=Z[2]/100,A,M,e,t,r,o=0;if(d===0)return r=x*255,[r,r,r];for(M=x<.5?x*(1+d):x+d-x*d,A=2*x-M,t=[0,0,0];o<3;)e=q+1/3*-(o-1),e<0?e++:e>1&&e--,r=6*e<1?A+(M-A)*6*e:2*e<1?M:3*e<2?A+(M-A)*(2/3-e)*6:A,t[o++]=r*255;return t}},Ax.hsl=function(Z){var q=Z[0]/255,d=Z[1]/255,x=Z[2]/255,A=Math.min(q,d,x),M=Math.max(q,d,x),e=M-A,t,r,o;return M===A?t=0:q===M?t=(d-x)/e:d===M?t=2+(x-q)/e:x===M&&(t=4+(q-d)/e),t=Math.min(t*60,360),t<0&&(t+=360),o=(A+M)/2,M===A?r=0:o<=.5?r=e/(M+A):r=e/(2-M-A),[t,r*100,o*100]}}}),_6={};Ws(_6,{default:()=>Jq});function Jq(Z){Array.isArray(Z)&&Z.raw&&(Z=String.raw(...arguments)),Z instanceof Number&&(Z=+Z);var q,d,x,A=g6(Z);if(!A.space)return[];let M=A.space[0]==="h"?Sx.min:Ax.min,e=A.space[0]==="h"?Sx.max:Ax.max;return q=Array(3),q[0]=Math.min(Math.max(A.values[0],M[0]),e[0]),q[1]=Math.min(Math.max(A.values[1],M[1]),e[1]),q[2]=Math.min(Math.max(A.values[2],M[2]),e[2]),A.space[0]==="h"&&(q=Sx.rgb(q)),q.push(Math.min(Math.max(A.alpha,0),1)),q}var $q=wo({"node_modules/color-rgba/index.js"(){Yq(),y6(),Kq()}}),x6=Ze({"src/traces/parcoords/helpers.js"(Z){"use strict";var q=ca().isTypedArray;Z.convertTypedArray=function(d){return q(d)?Array.prototype.slice.call(d):d},Z.isOrdinal=function(d){return!!d.tickvals},Z.isVisible=function(d){return d.visible||!("visible"in d)}}}),Qq=Ze({"src/traces/parcoords/lines.js"(Z,q){"use strict";var d=["precision highp float;","","varying vec4 fragColor;","","attribute vec4 p01_04, p05_08, p09_12, p13_16,"," p17_20, p21_24, p25_28, p29_32,"," p33_36, p37_40, p41_44, p45_48,"," p49_52, p53_56, p57_60, colors;","","uniform mat4 dim0A, dim1A, dim0B, dim1B, dim0C, dim1C, dim0D, dim1D,"," loA, hiA, loB, hiB, loC, hiC, loD, hiD;","","uniform vec2 resolution, viewBoxPos, viewBoxSize;","uniform float maskHeight;","uniform float drwLayer; // 0: context, 1: focus, 2: pick","uniform vec4 contextColor;","uniform sampler2D maskTexture, palette;","","bool isPick = (drwLayer > 1.5);","bool isContext = (drwLayer < 0.5);","","const vec4 ZEROS = vec4(0.0, 0.0, 0.0, 0.0);","const vec4 UNITS = vec4(1.0, 1.0, 1.0, 1.0);","","float val(mat4 p, mat4 v) {"," return dot(matrixCompMult(p, v) * UNITS, UNITS);","}","","float axisY(float ratio, mat4 A, mat4 B, mat4 C, mat4 D) {"," float y1 = val(A, dim0A) + val(B, dim0B) + val(C, dim0C) + val(D, dim0D);"," float y2 = val(A, dim1A) + val(B, dim1B) + val(C, dim1C) + val(D, dim1D);"," return y1 * (1.0 - ratio) + y2 * ratio;","}","","int iMod(int a, int b) {"," return a - b * (a / b);","}","","bool fOutside(float p, float lo, float hi) {"," return (lo < hi) && (lo > p || p > hi);","}","","bool vOutside(vec4 p, vec4 lo, vec4 hi) {"," return ("," fOutside(p[0], lo[0], hi[0]) ||"," fOutside(p[1], lo[1], hi[1]) ||"," fOutside(p[2], lo[2], hi[2]) ||"," fOutside(p[3], lo[3], hi[3])"," );","}","","bool mOutside(mat4 p, mat4 lo, mat4 hi) {"," return ("," vOutside(p[0], lo[0], hi[0]) ||"," vOutside(p[1], lo[1], hi[1]) ||"," vOutside(p[2], lo[2], hi[2]) ||"," vOutside(p[3], lo[3], hi[3])"," );","}","","bool outsideBoundingBox(mat4 A, mat4 B, mat4 C, mat4 D) {"," return mOutside(A, loA, hiA) ||"," mOutside(B, loB, hiB) ||"," mOutside(C, loC, hiC) ||"," mOutside(D, loD, hiD);","}","","bool outsideRasterMask(mat4 A, mat4 B, mat4 C, mat4 D) {"," mat4 pnts[4];"," pnts[0] = A;"," pnts[1] = B;"," pnts[2] = C;"," pnts[3] = D;",""," for(int i = 0; i < 4; ++i) {"," for(int j = 0; j < 4; ++j) {"," for(int k = 0; k < 4; ++k) {"," if(0 == iMod("," int(255.0 * texture2D(maskTexture,"," vec2("," (float(i * 2 + j / 2) + 0.5) / 8.0,"," (pnts[i][j][k] * (maskHeight - 1.0) + 1.0) / maskHeight"," ))[3]"," ) / int(pow(2.0, float(iMod(j * 4 + k, 8)))),"," 2"," )) return true;"," }"," }"," }"," return false;","}","","vec4 position(bool isContext, float v, mat4 A, mat4 B, mat4 C, mat4 D) {"," float x = 0.5 * sign(v) + 0.5;"," float y = axisY(x, A, B, C, D);"," float z = 1.0 - abs(v);",""," z += isContext ? 0.0 : 2.0 * float("," outsideBoundingBox(A, B, C, D) ||"," outsideRasterMask(A, B, C, D)"," );",""," return vec4("," 2.0 * (vec2(x, y) * viewBoxSize + viewBoxPos) / resolution - 1.0,"," z,"," 1.0"," );","}","","void main() {"," mat4 A = mat4(p01_04, p05_08, p09_12, p13_16);"," mat4 B = mat4(p17_20, p21_24, p25_28, p29_32);"," mat4 C = mat4(p33_36, p37_40, p41_44, p45_48);"," mat4 D = mat4(p49_52, p53_56, p57_60, ZEROS);",""," float v = colors[3];",""," gl_Position = position(isContext, v, A, B, C, D);",""," fragColor ="," isContext ? vec4(contextColor) :"," isPick ? vec4(colors.rgb, 1.0) : texture2D(palette, vec2(abs(v), 0.5));","}"].join(` `),x=["precision highp float;","","varying vec4 fragColor;","","void main() {"," gl_FragColor = fragColor;","}"].join(` `),A=Tx().maxDimensionCount,M=ca(),e=1e-6,t=2048,r=new Uint8Array(4),o=new Uint8Array(4),a={shape:[256,1],format:"rgba",type:"uint8",mag:"nearest",min:"nearest"};function i(b){b.read({x:0,y:0,width:1,height:1,data:r})}function n(b,p,u,m,h){var P=b._gl;P.enable(P.SCISSOR_TEST),P.scissor(p,u,m,h),b.clear({color:[0,0,0,0],depth:1})}function s(b,p,u,m,h,P){var L=P.key;function z(F){var B=Math.min(m,h-F*m);F===0&&(window.cancelAnimationFrame(u.currentRafs[L]),delete u.currentRafs[L],n(b,P.scissorX,P.scissorY,P.scissorWidth,P.viewBoxSize[1])),!u.clearOnly&&(P.count=2*B,P.offset=2*F*m,p(P),F*m+B>>8*p)%256/255}function v(b,p,u){for(var m=new Array(b*(A+4)),h=0,P=0;PRe&&(Re=ie[ce].dim1.canvasX,Ae=ce);re===0&&n(h,0,0,B.canvasWidth,B.canvasHeight);var Xe=G(u);for(ce=0;cece._length&&(lt=lt.slice(0,ce._length));var Ee=ce.tickvals,_e;function fe(Lt,kt){return{val:Lt,text:_e[kt]}}function Fe(Lt,kt){return Lt.val-kt.val}if(A(Ee)&&Ee.length){x.isTypedArray(Ee)&&(Ee=Array.from(Ee)),_e=ce.ticktext,!A(_e)||!_e.length?_e=Ee.map(M(ce.tickformat)):_e.length>Ee.length?_e=_e.slice(0,Ee.length):Ee.length>_e.length&&(Ee=Ee.slice(0,_e.length));for(var rt=1;rt=kt||xr>=Vt)return;var jr=Qe.lineLayer.readPixel(Sr,Vt-1-xr),wr=jr[3]!==0,Ir=wr?jr[2]+256*(jr[1]+256*jr[0]):null,bt={x:Sr,y:xr,clientX:Lt.clientX,clientY:Lt.clientY,dataIndex:Qe.model.key,curveNumber:Ir};Ir!==Ae&&(wr?$.hover(bt):$.unhover&&$.unhover(bt),Ae=Ir)}}),be.style("opacity",function(Qe){return Qe.pick?0:1}),oe.style("background","rgba(255, 255, 255, 0)");var Re=oe.selectAll("."+T.cn.parcoords).data(ce,c);Re.exit().remove(),Re.enter().append("g").classed(T.cn.parcoords,!0).style("shape-rendering","crispEdges").style("pointer-events","none"),Re.attr("transform",function(Qe){return o(Qe.model.translateX,Qe.model.translateY)});var Xe=Re.selectAll("."+T.cn.parcoordsControlView).data(f,c);Xe.enter().append("g").classed(T.cn.parcoordsControlView,!0),Xe.attr("transform",function(Qe){return o(Qe.model.pad.l,Qe.model.pad.t)});var it=Xe.selectAll("."+T.cn.yAxis).data(function(Qe){return Qe.dimensions},c);it.enter().append("g").classed(T.cn.yAxis,!0),Xe.each(function(Qe){N(it,Qe,j)}),be.each(function(Qe){if(Qe.viewModel){!Qe.lineLayer||$?Qe.lineLayer=_(this,Qe):Qe.lineLayer.update(Qe),(Qe.key||Qe.key===0)&&(Qe.viewModel[Qe.key]=Qe.lineLayer);var Lt=!Qe.context||$;Qe.lineLayer.render(Qe.viewModel.panels,Lt)}}),it.attr("transform",function(Qe){return o(Qe.xScale(Qe.xIndex),0)}),it.call(d.behavior.drag().origin(function(Qe){return Qe}).on("drag",function(Qe){var Lt=Qe.parent;re.linePickActive(!1),Qe.x=Math.max(-T.overdrag,Math.min(Qe.model.width+T.overdrag,d.event.x)),Qe.canvasX=Qe.x*Qe.model.canvasPixelRatio,it.sort(function(kt,Vt){return kt.x-Vt.x}).each(function(kt,Vt){kt.xIndex=Vt,kt.x=Qe===kt?kt.x:kt.xScale(kt.xIndex),kt.canvasX=kt.x*kt.model.canvasPixelRatio}),N(it,Lt,j),it.filter(function(kt){return Math.abs(Qe.xIndex-kt.xIndex)!==0}).attr("transform",function(kt){return o(kt.xScale(kt.xIndex),0)}),d.select(this).attr("transform",o(Qe.x,0)),it.each(function(kt,Vt,Zt){Zt===Qe.parent.key&&(Lt.dimensions[Vt]=kt)}),Lt.contextLayer&&Lt.contextLayer.render(Lt.panels,!1,!L(Lt)),Lt.focusLayer.render&&Lt.focusLayer.render(Lt.panels)}).on("dragend",function(Qe){var Lt=Qe.parent;Qe.x=Qe.xScale(Qe.xIndex),Qe.canvasX=Qe.x*Qe.model.canvasPixelRatio,N(it,Lt,j),d.select(this).attr("transform",function(kt){return o(kt.x,0)}),Lt.contextLayer&&Lt.contextLayer.render(Lt.panels,!1,!L(Lt)),Lt.focusLayer&&Lt.focusLayer.render(Lt.panels),Lt.pickLayer&&Lt.pickLayer.render(Lt.panels,!0),re.linePickActive(!0),$&&$.axesMoved&&$.axesMoved(Lt.key,Lt.dimensions.map(function(kt){return kt.crossfilterDimensionIndex}))})),it.exit().remove();var ot=it.selectAll("."+T.cn.axisOverlays).data(f,c);ot.enter().append("g").classed(T.cn.axisOverlays,!0),ot.selectAll("."+T.cn.axis).remove();var tt=ot.selectAll("."+T.cn.axis).data(f,c);tt.enter().append("g").classed(T.cn.axis,!0),tt.each(function(Qe){var Lt=Qe.model.height/Qe.model.tickDistance,kt=Qe.domainScale,Vt=kt.domain();d.select(this).call(d.svg.axis().orient("left").tickSize(4).outerTickSize(2).ticks(Lt,Qe.tickFormat).tickValues(Qe.ordinal?Vt:null).tickFormat(function(Zt){return v.isOrdinal(Qe)?Zt:W(Qe.model.dimensions[Qe.visibleIndex],Zt)}).scale(kt)),i.font(tt.selectAll("text"),Qe.model.tickFont)}),tt.selectAll(".domain, .tick>line").attr("fill","none").attr("stroke","black").attr("stroke-opacity",.25).attr("stroke-width","1px"),tt.selectAll("text").style("cursor","default");var lt=ot.selectAll("."+T.cn.axisHeading).data(f,c);lt.enter().append("g").classed(T.cn.axisHeading,!0);var Ee=lt.selectAll("."+T.cn.axisTitle).data(f,c);Ee.enter().append("text").classed(T.cn.axisTitle,!0).attr("text-anchor","middle").style("cursor","ew-resize").style("pointer-events",J?"none":"auto"),Ee.text(function(Qe){return Qe.label}).each(function(Qe){var Lt=d.select(this);i.font(Lt,Qe.model.labelFont),a.convertToTspans(Lt,le)}).attr("transform",function(Qe){var Lt=I(Qe.model.labelAngle,Qe.model.labelSide),kt=T.axisTitleOffset;return(Lt.dir>0?"":o(0,2*kt+Qe.model.height))+r(Lt.degrees)+o(-kt*Lt.dx,-kt*Lt.dy)}).attr("text-anchor",function(Qe){var Lt=I(Qe.model.labelAngle,Qe.model.labelSide),kt=Math.abs(Lt.dx),Vt=Math.abs(Lt.dy);return 2*kt>Vt?Lt.dir*Lt.dx<0?"start":"end":"middle"});var _e=ot.selectAll("."+T.cn.axisExtent).data(f,c);_e.enter().append("g").classed(T.cn.axisExtent,!0);var fe=_e.selectAll("."+T.cn.axisExtentTop).data(f,c);fe.enter().append("g").classed(T.cn.axisExtentTop,!0),fe.attr("transform",o(0,-T.axisExtentOffset));var Fe=fe.selectAll("."+T.cn.axisExtentTopText).data(f,c);Fe.enter().append("text").classed(T.cn.axisExtentTopText,!0).call(B),Fe.text(function(Qe){return Q(Qe,!0)}).each(function(Qe){i.font(d.select(this),Qe.model.rangeFont)});var rt=_e.selectAll("."+T.cn.axisExtentBottom).data(f,c);rt.enter().append("g").classed(T.cn.axisExtentBottom,!0),rt.attr("transform",function(Qe){return o(0,Qe.model.height+T.axisExtentOffset)});var st=rt.selectAll("."+T.cn.axisExtentBottomText).data(f,c);st.enter().append("text").classed(T.cn.axisExtentBottomText,!0).attr("dy","0.75em").call(B),st.text(function(Qe){return Q(Qe,!1)}).each(function(Qe){i.font(d.select(this),Qe.model.rangeFont)}),l.ensureAxisBrush(ot,ee,le)}}}),b6=Ze({"src/traces/parcoords/plot.js"(r,q){"use strict";var d=eV(),x=xT(),A=x6().isVisible,M={};function e(o,a,i){var n=a.indexOf(i),s=o.indexOf(n);return s===-1&&(s+=a.length),s}function t(o,a){return function(n,s){return e(o,a,n)-e(o,a,s)}}var r=q.exports=function(a,i){var n=a._fullLayout,s=x(a,[],M);if(s){var c={},f={},g={},v={},T=n._size;i.forEach(function(E,y){var b=E[0].trace;g[y]=b.index;var p=v[y]=b.index;c[y]=a.data[p].dimensions,f[y]=a.data[p].dimensions.slice()});var l=function(E,y,b){var p=f[E][y],u=b.map(function(F){return F.slice()}),m="dimensions["+y+"].constraintrange",h=n._tracePreGUI[a._fullData[g[E]]._fullInput.uid];if(h[m]===void 0){var P=p.constraintrange;h[m]=P||null}var L=a._fullData[g[E]].dimensions[y];u.length?(u.length===1&&(u=u[0]),p.constraintrange=u,L.constraintrange=u.slice(),u=[u]):(delete p.constraintrange,delete L.constraintrange,u=null);var z={};z[m]=u,a.emit("plotly_restyle",[z,[v[E]]])},_=function(E){a.emit("plotly_hover",E)},w=function(E){a.emit("plotly_unhover",E)},S=function(E,y){var b=t(y,f[E].filter(A));c[E].sort(b),f[E].filter(function(p){return!A(p)}).sort(function(p){return f[E].indexOf(p)}).forEach(function(p){c[E].splice(c[E].indexOf(p),1),c[E].splice(f[E].indexOf(p),0,p)}),a.emit("plotly_restyle",[{dimensions:[c[E]]},[v[E]]])};d(a,i,{width:T.w,height:T.h,margin:{t:T.t,r:T.r,b:T.b,l:T.l}},{filterChanged:l,hover:_,unhover:w,axesMoved:S})}};r.reglPrecompiled=M}}),tV=Ze({"src/traces/parcoords/base_plot.js"(Z){"use strict";var q=On(),d=Hh().getModuleCalcData,x=b6(),A=vd();Z.name="parcoords",Z.plot=function(M){var e=d(M.calcdata,"parcoords")[0];e.length&&x(M,e)},Z.clean=function(M,e,t,r){var o=r._has&&r._has("parcoords"),a=e._has&&e._has("parcoords");o&&!a&&(r._paperdiv.selectAll(".parcoords").remove(),r._glimages.selectAll("*").remove())},Z.toSVG=function(M){var e=M._fullLayout._glimages,t=q.select(M).selectAll(".svg-container"),r=t.filter(function(a,i){return i===t.size()-1}).selectAll(".gl-canvas-context, .gl-canvas-focus");function o(){var a=this,i=a.toDataURL("image/png"),n=e.append("svg:image");n.attr({xmlns:A.svg,"xlink:href":i,preserveAspectRatio:"none",x:0,y:0,width:a.style.width,height:a.style.height})}r.each(o),window.setTimeout(function(){q.selectAll("#filterBarPattern").attr("id","filterBarPattern")},60)}}}),rV=Ze({"src/traces/parcoords/base_index.js"(Z,q){"use strict";q.exports={attributes:v6(),supplyDefaults:Wq(),calc:Xq(),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcoords",basePlotModule:tV(),categories:["gl","regl","noOpacity","noHover"],meta:{}}}}),aV=Ze({"src/traces/parcoords/index.js"(Z,q){"use strict";var d=rV();d.plot=b6(),q.exports=d}}),iV=Ze({"lib/parcoords.js"(Z,q){"use strict";q.exports=aV()}}),w6=Ze({"src/traces/parcats/attributes.js"(Z,q){"use strict";var d=rs().extendFlat,x=eu(),A=tc(),M=Mu(),e=Cs().hovertemplateAttrs,t=bc().attributes,r=d({editType:"calc"},M("line",{editTypeOverride:"calc"}),{shape:{valType:"enumerated",values:["linear","hspline"],dflt:"linear",editType:"plot"},hovertemplate:e({editType:"plot",arrayOk:!1},{keys:["count","probability"]})});q.exports={domain:t({name:"parcats",trace:!0,editType:"calc"}),hoverinfo:d({},x.hoverinfo,{flags:["count","probability"],editType:"plot",arrayOk:!1}),hoveron:{valType:"enumerated",values:["category","color","dimension"],dflt:"category",editType:"plot"},hovertemplate:e({editType:"plot",arrayOk:!1},{keys:["count","probability","category","categorycount","colorcount","bandcolorcount"]}),arrangement:{valType:"enumerated",values:["perpendicular","freeform","fixed"],dflt:"perpendicular",editType:"plot"},bundlecolors:{valType:"boolean",dflt:!0,editType:"plot"},sortpaths:{valType:"enumerated",values:["forward","backward"],dflt:"forward",editType:"plot"},labelfont:A({editType:"calc"}),tickfont:A({autoShadowDflt:!0,editType:"calc"}),dimensions:{_isLinkedToArray:"dimension",label:{valType:"string",editType:"calc"},categoryorder:{valType:"enumerated",values:["trace","category ascending","category descending","array"],dflt:"trace",editType:"calc"},categoryarray:{valType:"data_array",editType:"calc"},ticktext:{valType:"data_array",editType:"calc"},values:{valType:"data_array",dflt:[],editType:"calc"},displayindex:{valType:"integer",editType:"calc"},editType:"calc",visible:{valType:"boolean",dflt:!0,editType:"calc"}},line:r,counts:{valType:"number",min:0,dflt:1,arrayOk:!0,editType:"calc"},customdata:void 0,hoverlabel:void 0,ids:void 0,legend:void 0,legendgroup:void 0,legendrank:void 0,opacity:void 0,selectedpoints:void 0,showlegend:void 0}}}),nV=Ze({"src/traces/parcats/defaults.js"(Z,q){"use strict";var d=ca(),x=bp().hasColorscale,A=gh(),M=bc().defaults,e=fp(),t=w6(),r=bT(),o=xp().isTypedArraySpec;function a(n,s,c,f,g){g("line.shape"),g("line.hovertemplate");var v=g("line.color",f.colorway[0]);if(x(n,"line")&&d.isArrayOrTypedArray(v)){if(v.length)return g("line.colorscale"),A(n,s,f,g,{prefix:"line.",cLetter:"c"}),v.length;s.line.color=c}return 1/0}function i(n,s){function c(w,S){return d.coerce(n,s,t.dimensions,w,S)}var f=c("values"),g=c("visible");if(f&&f.length||(g=s.visible=!1),g){c("label"),c("displayindex",s._index);var v=n.categoryarray,T=d.isArrayOrTypedArray(v)&&v.length>0||o(v),l;T&&(l="array");var _=c("categoryorder",l);_==="array"?(c("categoryarray"),c("ticktext")):(delete n.categoryarray,delete n.ticktext),!T&&_==="array"&&(s.categoryorder="trace")}}q.exports=function(s,c,f,g){function v(w,S){return d.coerce(s,c,t,w,S)}var T=e(s,c,{name:"dimensions",handleItemDefaults:i}),l=a(s,c,f,g,v);M(c,g,v),(!Array.isArray(T)||!T.length)&&(c.visible=!1),r(c,T,"values",l),v("hoveron"),v("hovertemplate"),v("arrangement"),v("bundlecolors"),v("sortpaths"),v("counts");var _=g.font;d.coerceFont(v,"labelfont",_,{overrideDflt:{size:Math.round(_.size)}}),d.coerceFont(v,"tickfont",_,{autoShadowDflt:!0,overrideDflt:{size:Math.round(_.size/1.2)}})}}}),oV=Ze({"src/traces/parcats/calc.js"(Z,q){"use strict";var d=Cv().wrap,x=bp().hasColorscale,A=wp(),M=r5(),e=as(),t=ca(),r=ns();q.exports=function(_,w){var S=t.filterVisible(w.dimensions);if(S.length===0)return[];var E=S.map(function(G){var $;if(G.categoryorder==="trace")$=null;else if(G.categoryorder==="array")$=G.categoryarray;else{$=M(G.values);for(var J=!0,X=0;X<$.length;X++)if(!r($[X])){J=!1;break}$.sort(J?t.sorterAsc:void 0),G.categoryorder==="category descending"&&($=$.reverse())}return f(G.values,$)}),y,b,p;t.isArrayOrTypedArray(w.counts)?y=w.counts:y=[w.counts],g(S),S.forEach(function(G,$){v(G,E[$])});var u=w.line,m;u?(x(w,"line")&&A(_,w,{vals:w.line.color,containerStr:"line",cLetter:"c"}),m=e.tryColorscale(u)):m=t.identity;function h(G){var $,J;return t.isArrayOrTypedArray(u.color)?($=u.color[G%u.color.length],J=$):$=u.color,{color:m($),rawColor:J}}var P=S[0].values.length,L={},z=E.map(function(G){return G.inds});p=0;var F,B;for(F=0;F=l.length||_[l[w]]!==void 0)return!1;_[l[w]]=!0}return!0}}}),sV=Ze({"src/traces/parcats/parcats.js"(Z,q){"use strict";var d=On(),x=(hg(),nh(f0)).interpolateNumber,A=C2(),M=ef(),e=ca(),t=e.strTranslate,r=as(),o=Ch(),a=fu();function i(X,oe,ie,j){var ee=oe._context.staticPlot,re=X.map(le.bind(0,oe,ie)),ce=j.selectAll("g.parcatslayer").data([null]);ce.enter().append("g").attr("class","parcatslayer").style("pointer-events",ee?"none":"all");var be=ce.selectAll("g.trace.parcats").data(re,n),Ae=be.enter().append("g").attr("class","trace parcats");be.attr("transform",function(fe){return t(fe.x,fe.y)}),Ae.append("g").attr("class","paths");var ze=be.select("g.paths"),Re=ze.selectAll("path.path").data(function(fe){return fe.paths},n);Re.attr("fill",function(fe){return fe.model.color});var Xe=Re.enter().append("path").attr("class","path").attr("stroke-opacity",0).attr("fill",function(fe){return fe.model.color}).attr("fill-opacity",0);_(Xe),Re.attr("d",function(fe){return fe.svgD}),Xe.empty()||Re.sort(c),Re.exit().remove(),Re.on("mouseover",f).on("mouseout",g).on("click",l),Ae.append("g").attr("class","dimensions");var it=be.select("g.dimensions"),ot=it.selectAll("g.dimension").data(function(fe){return fe.dimensions},n);ot.enter().append("g").attr("class","dimension"),ot.attr("transform",function(fe){return t(fe.x,0)}),ot.exit().remove();var tt=ot.selectAll("g.category").data(function(fe){return fe.categories},n),lt=tt.enter().append("g").attr("class","category");tt.attr("transform",function(fe){return t(0,fe.y)}),lt.append("rect").attr("class","catrect").attr("pointer-events","none"),tt.select("rect.catrect").attr("fill","none").attr("width",function(fe){return fe.width}).attr("height",function(fe){return fe.height}),E(lt);var Ee=tt.selectAll("rect.bandrect").data(function(fe){return fe.bands},n);Ee.each(function(){e.raiseToTop(this)}),Ee.attr("fill",function(fe){return fe.color});var _e=Ee.enter().append("rect").attr("class","bandrect").attr("stroke-opacity",0).attr("fill",function(fe){return fe.color}).attr("fill-opacity",0);Ee.attr("fill",function(fe){return fe.color}).attr("width",function(fe){return fe.width}).attr("height",function(fe){return fe.height}).attr("y",function(fe){return fe.y}).attr("cursor",function(fe){return fe.parcatsViewModel.arrangement==="fixed"?"default":fe.parcatsViewModel.arrangement==="perpendicular"?"ns-resize":"move"}),b(_e),Ee.exit().remove(),lt.append("text").attr("class","catlabel").attr("pointer-events","none"),tt.select("text.catlabel").attr("text-anchor",function(fe){return s(fe)?"start":"end"}).attr("alignment-baseline","middle").style("fill","rgb(0, 0, 0)").attr("x",function(fe){return s(fe)?fe.width+5:-5}).attr("y",function(fe){return fe.height/2}).text(function(fe){return fe.model.categoryLabel}).each(function(fe){r.font(d.select(this),fe.parcatsViewModel.categorylabelfont),a.convertToTspans(d.select(this),oe)}),lt.append("text").attr("class","dimlabel"),tt.select("text.dimlabel").attr("text-anchor","middle").attr("alignment-baseline","baseline").attr("cursor",function(fe){return fe.parcatsViewModel.arrangement==="fixed"?"default":"ew-resize"}).attr("x",function(fe){return fe.width/2}).attr("y",-5).text(function(fe,Fe){return Fe===0?fe.parcatsViewModel.model.dimensions[fe.model.dimensionInd].dimensionLabel:null}).each(function(fe){r.font(d.select(this),fe.parcatsViewModel.labelfont)}),tt.selectAll("rect.bandrect").on("mouseover",B).on("mouseout",O),tt.exit().remove(),ot.call(d.behavior.drag().origin(function(fe){return{x:fe.x,y:0}}).on("dragstart",I).on("drag",N).on("dragend",U)),be.each(function(fe){fe.traceSelection=d.select(this),fe.pathSelection=d.select(this).selectAll("g.paths").selectAll("path.path"),fe.dimensionSelection=d.select(this).selectAll("g.dimensions").selectAll("g.dimension")}),be.exit().remove()}q.exports=function(X,oe,ie,j){i(ie,X,j,oe)};function n(X){return X.key}function s(X){var oe=X.parcatsViewModel.dimensions.length,ie=X.parcatsViewModel.dimensions[oe-1].model.dimensionInd;return X.model.dimensionInd===ie}function c(X,oe){return X.model.rawColor>oe.model.rawColor?1:X.model.rawColor"),Qe=d.mouse(ee)[0];M.loneHover({trace:re,x:tt-be.left+Ae.left,y:lt-be.top+Ae.top,text:st,color:X.model.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:10,fontColor:Ee,idealAlign:Qe1&&ze.displayInd===Ae.dimensions.length-1?(it=ce.left,ot="left"):(it=ce.left+ce.width,ot="right");var tt=be.model.count,lt=be.model.categoryLabel,Ee=tt/be.parcatsViewModel.model.count,_e={countLabel:tt,categoryLabel:lt,probabilityLabel:Ee.toFixed(3)},fe=[];be.parcatsViewModel.hoverinfoItems.indexOf("count")!==-1&&fe.push(["Count:",_e.countLabel].join(" ")),be.parcatsViewModel.hoverinfoItems.indexOf("probability")!==-1&&fe.push(["P("+_e.categoryLabel+"):",_e.probabilityLabel].join(" "));var Fe=fe.join("
");return{trace:Re,x:j*(it-oe.left),y:ee*(Xe-oe.top),text:Fe,color:"lightgray",borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:12,fontColor:"black",idealAlign:ot,hovertemplate:Re.hovertemplate,hovertemplateLabels:_e,eventData:[{data:Re._input,fullData:Re,count:tt,category:lt,probability:Ee}]}}function z(X,oe,ie){var j=[];return d.select(ie.parentNode.parentNode).selectAll("g.category").select("rect.catrect").each(function(){var ee=this;j.push(L(X,oe,ee))}),j}function F(X,oe,ie){X._fullLayout._calcInverseTransform(X);var j=X._fullLayout._invScaleX,ee=X._fullLayout._invScaleY,re=ie.getBoundingClientRect(),ce=d.select(ie).datum(),be=ce.categoryViewModel,Ae=be.parcatsViewModel,ze=Ae.model.dimensions[be.model.dimensionInd],Re=Ae.trace,Xe=re.y+re.height/2,it,ot;Ae.dimensions.length>1&&ze.displayInd===Ae.dimensions.length-1?(it=re.left,ot="left"):(it=re.left+re.width,ot="right");var tt=be.model.categoryLabel,lt=ce.parcatsViewModel.model.count,Ee=0;ce.categoryViewModel.bands.forEach(function(Zt){Zt.color===ce.color&&(Ee+=Zt.count)});var _e=be.model.count,fe=0;Ae.pathSelection.each(function(Zt){Zt.model.color===ce.color&&(fe+=Zt.model.count)});var Fe=Ee/lt,rt=Ee/fe,st=Ee/_e,Qe={countLabel:Ee,categoryLabel:tt,probabilityLabel:Fe.toFixed(3)},Lt=[];be.parcatsViewModel.hoverinfoItems.indexOf("count")!==-1&&Lt.push(["Count:",Qe.countLabel].join(" ")),be.parcatsViewModel.hoverinfoItems.indexOf("probability")!==-1&&(Lt.push("P(color \u2229 "+tt+"): "+Qe.probabilityLabel),Lt.push("P("+tt+" | color): "+rt.toFixed(3)),Lt.push("P(color | "+tt+"): "+st.toFixed(3)));var kt=Lt.join("
"),Vt=o.mostReadable(ce.color,["black","white"]);return{trace:Re,x:j*(it-oe.left),y:ee*(Xe-oe.top),text:kt,color:ce.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontColor:Vt,fontSize:10,idealAlign:ot,hovertemplate:Re.hovertemplate,hovertemplateLabels:Qe,eventData:[{data:Re._input,fullData:Re,category:tt,count:lt,probability:Fe,categorycount:_e,colorcount:fe,bandcolorcount:Ee}]}}function B(X){if(!X.parcatsViewModel.dragDimension&&X.parcatsViewModel.hoverinfoItems.indexOf("skip")===-1){var oe=d.mouse(this)[1];if(oe<-1)return;var ie=X.parcatsViewModel.graphDiv,j=ie._fullLayout,ee=j._paperdiv.node().getBoundingClientRect(),re=X.parcatsViewModel.hoveron,ce=this;if(re==="color"?(m(ce),P(ce,"plotly_hover",d.event)):(u(ce),h(ce,"plotly_hover",d.event)),X.parcatsViewModel.hoverinfoItems.indexOf("none")===-1){var be;re==="category"?be=L(ie,ee,ce):re==="color"?be=F(ie,ee,ce):re==="dimension"&&(be=z(ie,ee,ce)),be&&M.loneHover(be,{container:j._hoverlayer.node(),outerContainer:j._paper.node(),gd:ie})}}}function O(X){var oe=X.parcatsViewModel;if(!oe.dragDimension&&(_(oe.pathSelection),E(oe.dimensionSelection.selectAll("g.category")),b(oe.dimensionSelection.selectAll("g.category").selectAll("rect.bandrect")),M.loneUnhover(oe.graphDiv._fullLayout._hoverlayer.node()),oe.pathSelection.sort(c),oe.hoverinfoItems.indexOf("skip")===-1)){var ie=X.parcatsViewModel.hoveron,j=this;ie==="color"?P(j,"plotly_unhover",d.event):h(j,"plotly_unhover",d.event)}}function I(X){X.parcatsViewModel.arrangement!=="fixed"&&(X.dragDimensionDisplayInd=X.model.displayInd,X.initialDragDimensionDisplayInds=X.parcatsViewModel.model.dimensions.map(function(oe){return oe.displayInd}),X.dragHasMoved=!1,X.dragCategoryDisplayInd=null,d.select(this).selectAll("g.category").select("rect.catrect").each(function(oe){var ie=d.mouse(this)[0],j=d.mouse(this)[1];-2<=ie&&ie<=oe.width+2&&-2<=j&&j<=oe.height+2&&(X.dragCategoryDisplayInd=oe.model.displayInd,X.initialDragCategoryDisplayInds=X.model.categories.map(function(ee){return ee.displayInd}),oe.model.dragY=oe.y,e.raiseToTop(this.parentNode),d.select(this.parentNode).selectAll("rect.bandrect").each(function(ee){ee.yRe.y+Re.height/2&&(re.model.displayInd=Re.model.displayInd,Re.model.displayInd=be),X.dragCategoryDisplayInd=re.model.displayInd}if(X.dragCategoryDisplayInd===null||X.parcatsViewModel.arrangement==="freeform"){ee.model.dragX=d.event.x;var Xe=X.parcatsViewModel.dimensions[ie],it=X.parcatsViewModel.dimensions[j];Xe!==void 0&&ee.model.dragXit.x&&(ee.model.displayInd=it.model.displayInd,it.model.displayInd=X.dragDimensionDisplayInd),X.dragDimensionDisplayInd=ee.model.displayInd}$(X.parcatsViewModel),G(X.parcatsViewModel),ue(X.parcatsViewModel),Q(X.parcatsViewModel)}}function U(X){if(X.parcatsViewModel.arrangement!=="fixed"&&X.dragDimensionDisplayInd!==null){d.select(this).selectAll("text").attr("font-weight","normal");var oe={},ie=W(X.parcatsViewModel),j=X.parcatsViewModel.model.dimensions.map(function(it){return it.displayInd}),ee=X.initialDragDimensionDisplayInds.some(function(it,ot){return it!==j[ot]});ee&&j.forEach(function(it,ot){var tt=X.parcatsViewModel.model.dimensions[ot].containerInd;oe["dimensions["+tt+"].displayindex"]=it});var re=!1;if(X.dragCategoryDisplayInd!==null){var ce=X.model.categories.map(function(it){return it.displayInd});if(re=X.initialDragCategoryDisplayInds.some(function(it,ot){return it!==ce[ot]}),re){var be=X.model.categories.slice().sort(function(it,ot){return it.displayInd-ot.displayInd}),Ae=be.map(function(it){return it.categoryValue}),ze=be.map(function(it){return it.categoryLabel});oe["dimensions["+X.model.containerInd+"].categoryarray"]=[Ae],oe["dimensions["+X.model.containerInd+"].ticktext"]=[ze],oe["dimensions["+X.model.containerInd+"].categoryorder"]="array"}}if(X.parcatsViewModel.hoverinfoItems.indexOf("skip")===-1&&!X.dragHasMoved&&X.potentialClickBand&&(X.parcatsViewModel.hoveron==="color"?P(X.potentialClickBand,"plotly_click",d.event.sourceEvent):h(X.potentialClickBand,"plotly_click",d.event.sourceEvent)),X.model.dragX=null,X.dragCategoryDisplayInd!==null){var Re=X.parcatsViewModel.dimensions[X.dragDimensionDisplayInd].categories[X.dragCategoryDisplayInd];Re.model.dragY=null,X.dragCategoryDisplayInd=null}X.dragDimensionDisplayInd=null,X.parcatsViewModel.dragDimension=null,X.dragHasMoved=null,X.potentialClickBand=null,$(X.parcatsViewModel),G(X.parcatsViewModel);var Xe=d.transition().duration(300).ease("cubic-in-out");Xe.each(function(){ue(X.parcatsViewModel,!0),Q(X.parcatsViewModel,!0)}).each("end",function(){(ee||re)&&A.restyle(X.parcatsViewModel.graphDiv,oe,[ie])})}}function W(X){for(var oe,ie=X.graphDiv._fullData,j=0;j=0;Ae--)ze+="C"+ce[Ae]+","+(oe[Ae+1]+j)+" "+re[Ae]+","+(oe[Ae]+j)+" "+(X[Ae]+ie[Ae])+","+(oe[Ae]+j),ze+="l-"+ie[Ae]+",0 ";return ze+="Z",ze}function G(X){var oe=X.dimensions,ie=X.model,j=oe.map(function(jr){return jr.categories.map(function(wr){return wr.y})}),ee=X.model.dimensions.map(function(jr){return jr.categories.map(function(wr){return wr.displayInd})}),re=X.model.dimensions.map(function(jr){return jr.displayInd}),ce=X.dimensions.map(function(jr){return jr.model.dimensionInd}),be=oe.map(function(jr){return jr.x}),Ae=oe.map(function(jr){return jr.width}),ze=[];for(var Re in ie.paths)ie.paths.hasOwnProperty(Re)&&ze.push(ie.paths[Re]);function Xe(jr){var wr=jr.categoryInds.map(function(bt,Be){return ee[Be][bt]}),Ir=ce.map(function(bt){return wr[bt]});return Ir}ze.sort(function(jr,wr){var Ir=Xe(jr),bt=Xe(wr);return X.sortpaths==="backward"&&(Ir.reverse(),bt.reverse()),Ir.push(jr.valueInds[0]),bt.push(wr.valueInds[0]),X.bundlecolors&&(Ir.unshift(jr.rawColor),bt.unshift(wr.rawColor)),Irbt?1:0});for(var it=new Array(ze.length),ot=oe[0].model.count,tt=oe[0].categories.map(function(jr){return jr.height}).reduce(function(jr,wr){return jr+wr}),lt=0;lt0?_e=tt*(Ee.count/ot):_e=0;for(var fe=new Array(j.length),Fe=0;Fe1?ce=(X.width-2*ie-j)/(ee-1):ce=0,be=ie,Ae=be+ce*re;var ze=[],Re=X.model.maxCats,Xe=oe.categories.length,it=8,ot=oe.count,tt=X.height-it*(Re-1),lt,Ee,_e,fe,Fe,rt=(Re-Xe)*it/2,st=oe.categories.map(function(Qe){return{displayInd:Qe.displayInd,categoryInd:Qe.categoryInd}});for(st.sort(function(Qe,Lt){return Qe.displayInd-Lt.displayInd}),Fe=0;Fe0?lt=Ee.count/ot*tt:lt=0,_e={key:Ee.valueInds[0],model:Ee,width:j,height:lt,y:Ee.dragY!==null?Ee.dragY:rt,bands:[],parcatsViewModel:X},rt=rt+lt+it,ze.push(_e);return{key:oe.dimensionInd,x:oe.dragX!==null?oe.dragX:Ae,y:0,width:j,model:oe,categories:ze,parcatsViewModel:X,dragCategoryDisplayInd:null,dragDimensionDisplayInd:null,initialDragDimensionDisplayInds:null,initialDragCategoryDisplayInds:null,dragHasMoved:null,potentialClickBand:null}}}}),T6=Ze({"src/traces/parcats/plot.js"(Z,q){"use strict";var d=sV();q.exports=function(A,M,e,t){var r=A._fullLayout,o=r._paper,a=r._size;d(A,o,M,{width:a.w,height:a.h,margin:{t:a.t,r:a.r,b:a.b,l:a.l}},e,t)}}}),lV=Ze({"src/traces/parcats/base_plot.js"(Z){"use strict";var q=Hh().getModuleCalcData,d=T6(),x="parcats";Z.name=x,Z.plot=function(A,M,e,t){var r=q(A.calcdata,x);if(r.length){var o=r[0];d(A,o,e,t)}},Z.clean=function(A,M,e,t){var r=t._has&&t._has("parcats"),o=M._has&&M._has("parcats");r&&!o&&t._paperdiv.selectAll(".parcats").remove()}}}),uV=Ze({"src/traces/parcats/index.js"(Z,q){"use strict";q.exports={attributes:w6(),supplyDefaults:nV(),calc:oV(),plot:T6(),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcats",basePlotModule:lV(),categories:["noOpacity"],meta:{}}}}),cV=Ze({"lib/parcats.js"(Z,q){"use strict";q.exports=uV()}}),am=Ze({"src/plots/mapbox/constants.js"(Z,q){"use strict";var d=Km(),x="1.13.4",A='\xA9 OpenStreetMap contributors',M=['\xA9 Carto',A].join(" "),e=['Map tiles by Stamen Design','under CC BY 3.0',"|",'Data by OpenStreetMap contributors','under ODbL'].join(" "),t=['Map tiles by Stamen Design','under CC BY 3.0',"|",'Data by OpenStreetMap contributors','under CC BY SA'].join(" "),r={"open-street-map":{id:"osm",version:8,sources:{"plotly-osm-tiles":{type:"raster",attribution:A,tiles:["https://a.tile.openstreetmap.org/{z}/{x}/{y}.png","https://b.tile.openstreetmap.org/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-osm-tiles",type:"raster",source:"plotly-osm-tiles",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"white-bg":{id:"white-bg",version:8,sources:{},layers:[{id:"white-bg",type:"background",paint:{"background-color":"#FFFFFF"},minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"carto-positron":{id:"carto-positron",version:8,sources:{"plotly-carto-positron":{type:"raster",attribution:M,tiles:["https://cartodb-basemaps-c.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-carto-positron",type:"raster",source:"plotly-carto-positron",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"carto-darkmatter":{id:"carto-darkmatter",version:8,sources:{"plotly-carto-darkmatter":{type:"raster",attribution:M,tiles:["https://cartodb-basemaps-c.global.ssl.fastly.net/dark_all/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-carto-darkmatter",type:"raster",source:"plotly-carto-darkmatter",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"stamen-terrain":{id:"stamen-terrain",version:8,sources:{"plotly-stamen-terrain":{type:"raster",attribution:e,tiles:["https://tiles.stadiamaps.com/tiles/stamen_terrain/{z}/{x}/{y}.png?api_key="],tileSize:256}},layers:[{id:"plotly-stamen-terrain",type:"raster",source:"plotly-stamen-terrain",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"stamen-toner":{id:"stamen-toner",version:8,sources:{"plotly-stamen-toner":{type:"raster",attribution:e,tiles:["https://tiles.stadiamaps.com/tiles/stamen_toner/{z}/{x}/{y}.png?api_key="],tileSize:256}},layers:[{id:"plotly-stamen-toner",type:"raster",source:"plotly-stamen-toner",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"stamen-watercolor":{id:"stamen-watercolor",version:8,sources:{"plotly-stamen-watercolor":{type:"raster",attribution:t,tiles:["https://tiles.stadiamaps.com/tiles/stamen_watercolor/{z}/{x}/{y}.jpg?api_key="],tileSize:256}},layers:[{id:"plotly-stamen-watercolor",type:"raster",source:"plotly-stamen-watercolor",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"}},o=d(r);q.exports={requiredVersion:x,styleUrlPrefix:"mapbox://styles/mapbox/",styleUrlSuffix:"v9",styleValuesMapbox:["basic","streets","outdoors","light","dark","satellite","satellite-streets"],styleValueDflt:"basic",stylesNonMapbox:r,styleValuesNonMapbox:o,traceLayerPrefix:"plotly-trace-layer-",layoutLayerPrefix:"plotly-layout-layer-",wrongVersionErrorMsg:["Your custom plotly.js bundle is not using the correct mapbox-gl version","Please install @plotly/mapbox-gl@"+x+"."].join(` `),noAccessTokenErrorMsg:["Missing Mapbox access token.","Mapbox trace type require a Mapbox access token to be registered.","For example:"," Plotly.newPlot(gd, data, layout, { mapboxAccessToken: 'my-access-token' });","More info here: https://www.mapbox.com/help/define-access-token/"].join(` `),missingStyleErrorMsg:["No valid mapbox style found, please set `mapbox.style` to one of:",o.join(", "),"or register a Mapbox access token to use a Mapbox-served style."].join(` `),multipleTokensErrorMsg:["Set multiple mapbox access token across different mapbox subplot,","using first token found as mapbox-gl does not allow multipleaccess tokens on the same page."].join(` `),mapOnErrorMsg:"Mapbox error.",mapboxLogo:{path0:"m 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z",path1:"M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z",path2:"M 14.74,6.25 C 12.9,4.41 9.98,4.35 8.23,6.1 5.07,9.27 6.09,14.91 6.09,14.91 c 0,0 5.64,1.02 8.81,-2.14 C 16.64,11 16.59,8.09 14.74,6.25 Z m -2.27,4.09 -0.91,1.87 -0.9,-1.87 -1.86,-0.91 1.86,-0.9 0.9,-1.87 0.91,1.87 1.86,0.9 z",polygon:"11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 14.33,9.43 12.47,10.34"},styleRules:{map:"overflow:hidden;position:relative;","missing-css":"display:none;",canary:"background-color:salmon;","ctrl-bottom-left":"position: absolute; pointer-events: none; z-index: 2; bottom: 0; left: 0;","ctrl-bottom-right":"position: absolute; pointer-events: none; z-index: 2; right: 0; bottom: 0;",ctrl:"clear: both; pointer-events: auto; transform: translate(0, 0);","ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-inner":"display: none;","ctrl-attrib.mapboxgl-compact:hover .mapboxgl-ctrl-attrib-inner":"display: block; margin-top:2px","ctrl-attrib.mapboxgl-compact:hover":"padding: 2px 24px 2px 4px; visibility: visible; margin-top: 6px;","ctrl-attrib.mapboxgl-compact::after":`content: ""; cursor: pointer; position: absolute; background-image: url('data:image/svg+xml;charset=utf-8,%3Csvg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"%3E %3Cpath fill="%23333333" fill-rule="evenodd" d="M4,10a6,6 0 1,0 12,0a6,6 0 1,0 -12,0 M9,7a1,1 0 1,0 2,0a1,1 0 1,0 -2,0 M9,10a1,1 0 1,1 2,0l0,3a1,1 0 1,1 -2,0"/%3E %3C/svg%3E'); background-color: rgba(255, 255, 255, 0.5); width: 24px; height: 24px; box-sizing: border-box; border-radius: 12px;`,"ctrl-attrib.mapboxgl-compact":"min-height: 20px; padding: 0; margin: 10px; position: relative; background-color: #fff; border-radius: 3px 12px 12px 3px;","ctrl-bottom-right > .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; right: 0","ctrl-bottom-left > .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; left: 0","ctrl-bottom-left .mapboxgl-ctrl":"margin: 0 0 10px 10px; float: left;","ctrl-bottom-right .mapboxgl-ctrl":"margin: 0 10px 10px 0; float: right;","ctrl-attrib":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a:hover":"color: inherit; text-decoration: underline;","ctrl-attrib .mapbox-improve-map":"font-weight: bold; margin-left: 2px;","attrib-empty":"display: none;","ctrl-logo":`display:block; width: 21px; height: 21px; background-image: url('data:image/svg+xml;charset=utf-8,%3C?xml version="1.0" encoding="utf-8"?%3E %3Csvg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 21 21" style="enable-background:new 0 0 21 21;" xml:space="preserve"%3E%3Cg transform="translate(0,0.01)"%3E%3Cpath d="m 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z" style="opacity:0.9;fill:%23ffffff;enable-background:new" class="st0"/%3E%3Cpath d="M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z" style="opacity:0.35;enable-background:new" class="st1"/%3E%3Cpath d="M 14.74,6.25 C 12.9,4.41 9.98,4.35 8.23,6.1 5.07,9.27 6.09,14.91 6.09,14.91 c 0,0 5.64,1.02 8.81,-2.14 C 16.64,11 16.59,8.09 14.74,6.25 Z m -2.27,4.09 -0.91,1.87 -0.9,-1.87 -1.86,-0.91 1.86,-0.9 0.9,-1.87 0.91,1.87 1.86,0.9 z" style="opacity:0.35;enable-background:new" class="st1"/%3E%3Cpolygon points="11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 14.33,9.43 12.47,10.34 " style="opacity:0.9;fill:%23ffffff;enable-background:new" class="st0"/%3E%3C/g%3E%3C/svg%3E')`}}}}),Mx=Ze({"src/plots/mapbox/layout_attributes.js"(Z,q){"use strict";var d=ca(),x=Yn().defaultLine,A=bc().attributes,M=tc(),e=tf().textposition,t=pc().overrideAll,r=Dl().templatedArray,o=am(),a=M({noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0});a.family.dflt="Open Sans Regular, Arial Unicode MS Regular";var i=q.exports=t({_arrayAttrRegexps:[d.counterRegex("mapbox",".layers",!0)],domain:A({name:"mapbox"}),accesstoken:{valType:"string",noBlank:!0,strict:!0},style:{valType:"any",values:o.styleValuesMapbox.concat(o.styleValuesNonMapbox),dflt:o.styleValueDflt},center:{lon:{valType:"number",dflt:0},lat:{valType:"number",dflt:0}},zoom:{valType:"number",dflt:1},bearing:{valType:"number",dflt:0},pitch:{valType:"number",dflt:0},bounds:{west:{valType:"number"},east:{valType:"number"},south:{valType:"number"},north:{valType:"number"}},layers:r("layer",{visible:{valType:"boolean",dflt:!0},sourcetype:{valType:"enumerated",values:["geojson","vector","raster","image"],dflt:"geojson"},source:{valType:"any"},sourcelayer:{valType:"string",dflt:""},sourceattribution:{valType:"string"},type:{valType:"enumerated",values:["circle","line","fill","symbol","raster"],dflt:"circle"},coordinates:{valType:"any"},below:{valType:"string"},color:{valType:"color",dflt:x},opacity:{valType:"number",min:0,max:1,dflt:1},minzoom:{valType:"number",min:0,max:24,dflt:0},maxzoom:{valType:"number",min:0,max:24,dflt:24},circle:{radius:{valType:"number",dflt:15}},line:{width:{valType:"number",dflt:2},dash:{valType:"data_array"}},fill:{outlinecolor:{valType:"color",dflt:x}},symbol:{icon:{valType:"string",dflt:"marker"},iconsize:{valType:"number",dflt:10},text:{valType:"string",dflt:""},placement:{valType:"enumerated",values:["point","line","line-center"],dflt:"point"},textfont:a,textposition:d.extendFlat({},e,{arrayOk:!1})}})},"plot","from-root");i.uirevision={valType:"any",editType:"none"}}}),AT=Ze({"src/traces/scattermapbox/attributes.js"(Z,q){"use strict";var d=Cs().hovertemplateAttrs,x=Cs().texttemplateAttrs,A=$d(),M=dg(),e=tf(),t=Mx(),r=eu(),o=Mu(),a=rs().extendFlat,i=pc().overrideAll,n=Mx(),s=M.line,c=M.marker;q.exports=i({lon:M.lon,lat:M.lat,cluster:{enabled:{valType:"boolean"},maxzoom:a({},n.layers.maxzoom,{}),step:{valType:"number",arrayOk:!0,dflt:-1,min:-1},size:{valType:"number",arrayOk:!0,dflt:20,min:0},color:{valType:"color",arrayOk:!0},opacity:a({},c.opacity,{dflt:1})},mode:a({},e.mode,{dflt:"markers"}),text:a({},e.text,{}),texttemplate:x({editType:"plot"},{keys:["lat","lon","text"]}),hovertext:a({},e.hovertext,{}),line:{color:s.color,width:s.width},connectgaps:e.connectgaps,marker:a({symbol:{valType:"string",dflt:"circle",arrayOk:!0},angle:{valType:"number",dflt:"auto",arrayOk:!0},allowoverlap:{valType:"boolean",dflt:!1},opacity:c.opacity,size:c.size,sizeref:c.sizeref,sizemin:c.sizemin,sizemode:c.sizemode},o("marker")),fill:M.fill,fillcolor:A(),textfont:t.layers.symbol.textfont,textposition:t.layers.symbol.textposition,below:{valType:"string"},selected:{marker:e.selected.marker},unselected:{marker:e.unselected.marker},hoverinfo:a({},r.hoverinfo,{flags:["lon","lat","text","name"]}),hovertemplate:d()},"calc","nested")}}),A6=Ze({"src/traces/scattermapbox/constants.js"(Z,q){"use strict";var d=["Metropolis Black Italic","Metropolis Black","Metropolis Bold Italic","Metropolis Bold","Metropolis Extra Bold Italic","Metropolis Extra Bold","Metropolis Extra Light Italic","Metropolis Extra Light","Metropolis Light Italic","Metropolis Light","Metropolis Medium Italic","Metropolis Medium","Metropolis Regular Italic","Metropolis Regular","Metropolis Semi Bold Italic","Metropolis Semi Bold","Metropolis Thin Italic","Metropolis Thin","Open Sans Bold Italic","Open Sans Bold","Open Sans Extrabold Italic","Open Sans Extrabold","Open Sans Italic","Open Sans Light Italic","Open Sans Light","Open Sans Regular","Open Sans Semibold Italic","Open Sans Semibold","Klokantech Noto Sans Bold","Klokantech Noto Sans CJK Bold","Klokantech Noto Sans CJK Regular","Klokantech Noto Sans Italic","Klokantech Noto Sans Regular"];q.exports={isSupportedFont:function(x){return d.indexOf(x)!==-1}}}}),fV=Ze({"src/traces/scattermapbox/defaults.js"(Z,q){"use strict";var d=ca(),x=Fu(),A=md(),M=Dd(),e=zd(),t=ev(),r=AT(),o=A6().isSupportedFont;q.exports=function(n,s,c,f){function g(m,h){return d.coerce(n,s,r,m,h)}function v(m,h){return d.coerce2(n,s,r,m,h)}var T=a(n,s,g);if(!T){s.visible=!1;return}if(g("text"),g("texttemplate"),g("hovertext"),g("hovertemplate"),g("mode"),g("below"),x.hasMarkers(s)){A(n,s,c,f,g,{noLine:!0,noAngle:!0}),g("marker.allowoverlap"),g("marker.angle");var l=s.marker;l.symbol!=="circle"&&(d.isArrayOrTypedArray(l.size)&&(l.size=l.size[0]),d.isArrayOrTypedArray(l.color)&&(l.color=l.color[0]))}x.hasLines(s)&&(M(n,s,c,f,g,{noDash:!0}),g("connectgaps"));var _=v("cluster.maxzoom"),w=v("cluster.step"),S=v("cluster.color",s.marker&&s.marker.color||c),E=v("cluster.size"),y=v("cluster.opacity"),b=_!==!1||w!==!1||S!==!1||E!==!1||y!==!1,p=g("cluster.enabled",b);if(p||x.hasText(s)){var u=f.font.family;e(n,s,f,g,{noSelect:!0,noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,font:{family:o(u)?u:"Open Sans Regular",weight:f.font.weight,style:f.font.style,size:f.font.size,color:f.font.color}})}g("fill"),s.fill!=="none"&&t(n,s,c,g),d.coerceSelectionMarkerOpacity(s,g)};function a(i,n,s){var c=s("lon")||[],f=s("lat")||[],g=Math.min(c.length,f.length);return n._length=g,g}}}),S6=Ze({"src/traces/scattermapbox/format_labels.js"(Z,q){"use strict";var d=Wo();q.exports=function(A,M,e){var t={},r=e[M.subplot]._subplot,o=r.mockAxis,a=A.lonlat;return t.lonLabel=d.tickText(o,o.c2l(a[0]),!0).text,t.latLabel=d.tickText(o,o.c2l(a[1]),!0).text,t}}}),M6=Ze({"src/plots/mapbox/convert_text_opts.js"(Z,q){"use strict";var d=ca();q.exports=function(A,M){var e=A.split(" "),t=e[0],r=e[1],o=d.isArrayOrTypedArray(M)?d.mean(M):M,a=.5+o/100,i=1.5+o/100,n=["",""],s=[0,0];switch(t){case"top":n[0]="top",s[1]=-i;break;case"bottom":n[0]="bottom",s[1]=i;break}switch(r){case"left":n[1]="right",s[0]=-a;break;case"right":n[1]="left",s[0]=a;break}var c;return n[0]&&n[1]?c=n.join("-"):n[0]?c=n[0]:n[1]?c=n[1]:c="center",{anchor:c,offset:s}}}}),hV=Ze({"src/traces/scattermapbox/convert.js"(Z,q){"use strict";var d=ns(),x=ca(),A=qs().BADNUM,M=d0(),e=rc(),t=as(),r=r1(),o=Fu(),a=A6().isSupportedFont,i=M6(),n=Qp().appendArrayPointValue,s=fu().NEWLINES,c=fu().BR_TAG_ALL;q.exports=function(y,b){var p=b[0].trace,u=p.visible===!0&&p._length!==0,m=p.fill!=="none",h=o.hasLines(p),P=o.hasMarkers(p),L=o.hasText(p),z=P&&p.marker.symbol==="circle",F=P&&p.marker.symbol!=="circle",B=p.cluster&&p.cluster.enabled,O=f("fill"),I=f("line"),N=f("circle"),U=f("symbol"),W={fill:O,line:I,circle:N,symbol:U};if(!u)return W;var Q;if((m||h)&&(Q=M.calcTraceToLineCoords(b)),m&&(O.geojson=M.makePolygon(Q),O.layout.visibility="visible",x.extendFlat(O.paint,{"fill-color":p.fillcolor})),h&&(I.geojson=M.makeLine(Q),I.layout.visibility="visible",x.extendFlat(I.paint,{"line-width":p.line.width,"line-color":p.line.color,"line-opacity":p.opacity})),z){var ue=g(b);N.geojson=ue.geojson,N.layout.visibility="visible",B&&(N.filter=["!",["has","point_count"]],W.cluster={type:"circle",filter:["has","point_count"],layout:{visibility:"visible"},paint:{"circle-color":w(p.cluster.color,p.cluster.step),"circle-radius":w(p.cluster.size,p.cluster.step),"circle-opacity":w(p.cluster.opacity,p.cluster.step)}},W.clusterCount={type:"symbol",filter:["has","point_count"],paint:{},layout:{"text-field":"{point_count_abbreviated}","text-font":S(p),"text-size":12}}),x.extendFlat(N.paint,{"circle-color":ue.mcc,"circle-radius":ue.mrc,"circle-opacity":ue.mo})}if(z&&B&&(N.filter=["!",["has","point_count"]]),(F||L)&&(U.geojson=v(b,y),x.extendFlat(U.layout,{visibility:"visible","icon-image":"{symbol}-15","text-field":"{text}"}),F&&(x.extendFlat(U.layout,{"icon-size":p.marker.size/10}),"angle"in p.marker&&p.marker.angle!=="auto"&&x.extendFlat(U.layout,{"icon-rotate":{type:"identity",property:"angle"},"icon-rotation-alignment":"map"}),U.layout["icon-allow-overlap"]=p.marker.allowoverlap,x.extendFlat(U.paint,{"icon-opacity":p.opacity*p.marker.opacity,"icon-color":p.marker.color})),L)){var le=(p.marker||{}).size,he=i(p.textposition,le);x.extendFlat(U.layout,{"text-size":p.textfont.size,"text-anchor":he.anchor,"text-offset":he.offset,"text-font":S(p)}),x.extendFlat(U.paint,{"text-color":p.textfont.color,"text-opacity":p.opacity})}return W};function f(E){return{type:E,geojson:M.makeBlank(),layout:{visibility:"none"},filter:null,paint:{}}}function g(E){var y=E[0].trace,b=y.marker,p=y.selectedpoints,u=x.isArrayOrTypedArray(b.color),m=x.isArrayOrTypedArray(b.size),h=x.isArrayOrTypedArray(b.opacity),P;function L(le){return y.opacity*le}function z(le){return le/2}var F;u&&(e.hasColorscale(y,"marker")?F=e.makeColorScaleFuncFromTrace(b):F=x.identity);var B;m&&(B=r(y));var O;h&&(O=function(le){var he=d(le)?+x.constrain(le,0,1):0;return L(he)});var I=[];for(P=0;P850?P+=" Black":u>750?P+=" Extra Bold":u>650?P+=" Bold":u>550?P+=" Semi Bold":u>450?P+=" Medium":u>350?P+=" Regular":u>250?P+=" Light":u>150?P+=" Extra Light":P+=" Thin"):m.slice(0,2).join(" ")==="Open Sans"?(P="Open Sans",u>750?P+=" Extrabold":u>650?P+=" Bold":u>550?P+=" Semibold":u>350?P+=" Regular":P+=" Light"):m.slice(0,3).join(" ")==="Klokantech Noto Sans"&&(P="Klokantech Noto Sans",m[3]==="CJK"&&(P+=" CJK"),P+=u>500?" Bold":" Regular")),h&&(P+=" Italic"),P==="Open Sans Regular Italic"?P="Open Sans Italic":P==="Open Sans Regular Bold"?P="Open Sans Bold":P==="Open Sans Regular Bold Italic"?P="Open Sans Bold Italic":P==="Klokantech Noto Sans Regular Italic"&&(P="Klokantech Noto Sans Italic"),a(P)||(P=b);var L=P.split(", ");return L}}}),pV=Ze({"src/traces/scattermapbox/plot.js"(Z,q){"use strict";var d=ca(),x=hV(),A=am().traceLayerPrefix,M={cluster:["cluster","clusterCount","circle"],nonCluster:["fill","line","circle","symbol"]};function e(r,o,a,i){this.type="scattermapbox",this.subplot=r,this.uid=o,this.clusterEnabled=a,this.isHidden=i,this.sourceIds={fill:"source-"+o+"-fill",line:"source-"+o+"-line",circle:"source-"+o+"-circle",symbol:"source-"+o+"-symbol",cluster:"source-"+o+"-circle",clusterCount:"source-"+o+"-circle"},this.layerIds={fill:A+o+"-fill",line:A+o+"-line",circle:A+o+"-circle",symbol:A+o+"-symbol",cluster:A+o+"-cluster",clusterCount:A+o+"-cluster-count"},this.below=null}var t=e.prototype;t.addSource=function(r,o,a){var i={type:"geojson",data:o.geojson};a&&a.enabled&&d.extendFlat(i,{cluster:!0,clusterMaxZoom:a.maxzoom});var n=this.subplot.map.getSource(this.sourceIds[r]);n?n.setData(o.geojson):this.subplot.map.addSource(this.sourceIds[r],i)},t.setSourceData=function(r,o){this.subplot.map.getSource(this.sourceIds[r]).setData(o.geojson)},t.addLayer=function(r,o,a){var i={type:o.type,id:this.layerIds[r],source:this.sourceIds[r],layout:o.layout,paint:o.paint};o.filter&&(i.filter=o.filter);for(var n=this.layerIds[r],s,c=this.subplot.getMapLayers(),f=0;f=0;h--){var P=m[h];n.removeLayer(v.layerIds[P])}u||n.removeSource(v.sourceIds.circle)}function _(u){for(var m=M.nonCluster,h=0;h=0;h--){var P=m[h];n.removeLayer(v.layerIds[P]),u||n.removeSource(v.sourceIds[P])}}function S(u){g?l(u):w(u)}function E(u){f?T(u):_(u)}function y(){for(var u=f?M.cluster:M.nonCluster,m=0;m=0;i--){var n=a[i];o.removeLayer(this.layerIds[n]),o.removeSource(this.sourceIds[n])}},q.exports=function(o,a){var i=a[0].trace,n=i.cluster&&i.cluster.enabled,s=i.visible!==!0,c=new e(o,i.uid,n,s),f=x(o.gd,a),g=c.below=o.belowLookup["trace-"+i.uid],v,T,l;if(n)for(c.addSource("circle",f.circle,i.cluster),v=0;v=0?Math.floor((i+180)/360):Math.ceil((i-180)/360),E=S*360,y=i-E;function b(B){var O=B.lonlat;if(O[0]===e||_&&T.indexOf(B.i+1)===-1)return 1/0;var I=x.modHalf(O[0],360),N=O[1],U=v.project([I,N]),W=U.x-f.c2p([y,N]),Q=U.y-g.c2p([I,n]),ue=Math.max(3,B.mrc||0);return Math.max(Math.sqrt(W*W+Q*Q)-ue,1-3/ue)}if(d.getClosest(s,b,a),a.index!==!1){var p=s[a.index],u=p.lonlat,m=[x.modHalf(u[0],360)+E,u[1]],h=f.c2p(m),P=g.c2p(m),L=p.mrc||1;a.x0=h-L,a.x1=h+L,a.y0=P-L,a.y1=P+L;var z={};z[c.subplot]={_subplot:v};var F=c._module.formatLabels(p,c,z);return a.lonLabel=F.lonLabel,a.latLabel=F.latLabel,a.color=A(c,p),a.extraText=o(c,p,s[0].t.labels),a.hovertemplate=c.hovertemplate,[a]}}function o(a,i,n){if(a.hovertemplate)return;var s=i.hi||a.hoverinfo,c=s.split("+"),f=c.indexOf("all")!==-1,g=c.indexOf("lon")!==-1,v=c.indexOf("lat")!==-1,T=i.lonlat,l=[];function _(w){return w+"\xB0"}return f||g&&v?l.push("("+_(T[1])+", "+_(T[0])+")"):g?l.push(n.lon+_(T[0])):v&&l.push(n.lat+_(T[1])),(f||c.indexOf("text")!==-1)&&M(i,a,l),l.join("
")}q.exports={hoverPoints:r,getExtraText:o}}}),dV=Ze({"src/traces/scattermapbox/event_data.js"(Z,q){"use strict";q.exports=function(x,A){return x.lon=A.lon,x.lat=A.lat,x}}}),vV=Ze({"src/traces/scattermapbox/select.js"(Z,q){"use strict";var d=ca(),x=Fu(),A=qs().BADNUM;q.exports=function(e,t){var r=e.cd,o=e.xaxis,a=e.yaxis,i=[],n=r[0].trace,s;if(!x.hasMarkers(n))return[];if(t===!1)for(s=0;s"u"&&(k=1e-6);var V,ne,xe,Ie,Ve;for(xe=C,Ve=0;Ve<8;Ve++){if(Ie=this.sampleCurveX(xe)-C,Math.abs(Ie)ne)return ne;for(;VIe?V=xe:ne=xe,xe=(ne-V)*.5+V}return xe},a.prototype.solve=function(C,k){return this.sampleCurveY(this.solveCurveX(C,k))};var i=n;function n(C,k){this.x=C,this.y=k}n.prototype={clone:function(){return new n(this.x,this.y)},add:function(C){return this.clone()._add(C)},sub:function(C){return this.clone()._sub(C)},multByPoint:function(C){return this.clone()._multByPoint(C)},divByPoint:function(C){return this.clone()._divByPoint(C)},mult:function(C){return this.clone()._mult(C)},div:function(C){return this.clone()._div(C)},rotate:function(C){return this.clone()._rotate(C)},rotateAround:function(C,k){return this.clone()._rotateAround(C,k)},matMult:function(C){return this.clone()._matMult(C)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(C){return this.x===C.x&&this.y===C.y},dist:function(C){return Math.sqrt(this.distSqr(C))},distSqr:function(C){var k=C.x-this.x,V=C.y-this.y;return k*k+V*V},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(C){return Math.atan2(this.y-C.y,this.x-C.x)},angleWith:function(C){return this.angleWithSep(C.x,C.y)},angleWithSep:function(C,k){return Math.atan2(this.x*k-this.y*C,this.x*C+this.y*k)},_matMult:function(C){var k=C[0]*this.x+C[1]*this.y,V=C[2]*this.x+C[3]*this.y;return this.x=k,this.y=V,this},_add:function(C){return this.x+=C.x,this.y+=C.y,this},_sub:function(C){return this.x-=C.x,this.y-=C.y,this},_mult:function(C){return this.x*=C,this.y*=C,this},_div:function(C){return this.x/=C,this.y/=C,this},_multByPoint:function(C){return this.x*=C.x,this.y*=C.y,this},_divByPoint:function(C){return this.x/=C.x,this.y/=C.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var C=this.y;return this.y=this.x,this.x=-C,this},_rotate:function(C){var k=Math.cos(C),V=Math.sin(C),ne=k*this.x-V*this.y,xe=V*this.x+k*this.y;return this.x=ne,this.y=xe,this},_rotateAround:function(C,k){var V=Math.cos(C),ne=Math.sin(C),xe=k.x+V*(this.x-k.x)-ne*(this.y-k.y),Ie=k.y+ne*(this.x-k.x)+V*(this.y-k.y);return this.x=xe,this.y=Ie,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},n.convert=function(C){return C instanceof n?C:Array.isArray(C)?new n(C[0],C[1]):C};var s=typeof self<"u"?self:{};function c(C,k){if(Array.isArray(C)){if(!Array.isArray(k)||C.length!==k.length)return!1;for(var V=0;V=1)return 1;var k=C*C,V=k*C;return 4*(C<.5?V:3*(C-k)+V-.75)}function v(C,k,V,ne){var xe=new o(C,k,V,ne);return function(Ie){return xe.solve(Ie)}}var T=v(.25,.1,.25,1);function l(C,k,V){return Math.min(V,Math.max(k,C))}function _(C,k,V){var ne=V-k,xe=((C-k)%ne+ne)%ne+k;return xe===k?V:xe}function w(C,k,V){if(!C.length)return V(null,[]);var ne=C.length,xe=new Array(C.length),Ie=null;C.forEach(function(Ve,ht){k(Ve,function(Rt,Ht){Rt&&(Ie=Rt),xe[ht]=Ht,--ne===0&&V(Ie,xe)})})}function S(C){var k=[];for(var V in C)k.push(C[V]);return k}function E(C,k){var V=[];for(var ne in C)ne in k||V.push(ne);return V}function y(C){for(var k=[],V=arguments.length-1;V-- >0;)k[V]=arguments[V+1];for(var ne=0,xe=k;ne>k/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,C)}return C()}function h(C){return C<=1?1:Math.pow(2,Math.ceil(Math.log(C)/Math.LN2))}function P(C){return C?/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(C):!1}function L(C,k){C.forEach(function(V){k[V]&&(k[V]=k[V].bind(k))})}function z(C,k){return C.indexOf(k,C.length-k.length)!==-1}function F(C,k,V){var ne={};for(var xe in C)ne[xe]=k.call(V||this,C[xe],xe,C);return ne}function B(C,k,V){var ne={};for(var xe in C)k.call(V||this,C[xe],xe,C)&&(ne[xe]=C[xe]);return ne}function O(C){return Array.isArray(C)?C.map(O):typeof C=="object"&&C?F(C,O):C}function I(C,k){for(var V=0;V=0)return!0;return!1}var N={};function U(C){N[C]||(typeof console<"u"&&console.warn(C),N[C]=!0)}function W(C,k,V){return(V.y-C.y)*(k.x-C.x)>(k.y-C.y)*(V.x-C.x)}function Q(C){for(var k=0,V=0,ne=C.length,xe=ne-1,Ie=void 0,Ve=void 0;V@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,V={};if(C.replace(k,function(xe,Ie,Ve,ht){var Rt=Ve||ht;return V[Ie]=Rt?Rt.toLowerCase():!0,""}),V["max-age"]){var ne=parseInt(V["max-age"],10);isNaN(ne)?delete V["max-age"]:V["max-age"]=ne}return V}var G=null;function $(C){if(G==null){var k=C.navigator?C.navigator.userAgent:null;G=!!C.safari||!!(k&&(/\b(iPad|iPhone|iPod)\b/.test(k)||k.match("Safari")&&!k.match("Chrome")))}return G}function J(C){try{var k=s[C];return k.setItem("_mapbox_test_",1),k.removeItem("_mapbox_test_"),!0}catch{return!1}}function X(C){return s.btoa(encodeURIComponent(C).replace(/%([0-9A-F]{2})/g,function(k,V){return String.fromCharCode(+("0x"+V))}))}function oe(C){return decodeURIComponent(s.atob(C).split("").map(function(k){return"%"+("00"+k.charCodeAt(0).toString(16)).slice(-2)}).join(""))}var ie=s.performance&&s.performance.now?s.performance.now.bind(s.performance):Date.now.bind(Date),j=s.requestAnimationFrame||s.mozRequestAnimationFrame||s.webkitRequestAnimationFrame||s.msRequestAnimationFrame,ee=s.cancelAnimationFrame||s.mozCancelAnimationFrame||s.webkitCancelAnimationFrame||s.msCancelAnimationFrame,re,ce,be={now:ie,frame:function(k){var V=j(k);return{cancel:function(){return ee(V)}}},getImageData:function(k,V){V===void 0&&(V=0);var ne=s.document.createElement("canvas"),xe=ne.getContext("2d");if(!xe)throw new Error("failed to create canvas 2d context");return ne.width=k.width,ne.height=k.height,xe.drawImage(k,0,0,k.width,k.height),xe.getImageData(-V,-V,k.width+2*V,k.height+2*V)},resolveURL:function(k){return re||(re=s.document.createElement("a")),re.href=k,re.href},hardwareConcurrency:s.navigator&&s.navigator.hardwareConcurrency||4,get devicePixelRatio(){return s.devicePixelRatio},get prefersReducedMotion(){return s.matchMedia?(ce==null&&(ce=s.matchMedia("(prefers-reduced-motion: reduce)")),ce.matches):!1}},Ae={API_URL:"https://api.mapbox.com",get EVENTS_URL(){return this.API_URL?this.API_URL.indexOf("https://api.mapbox.cn")===0?"https://events.mapbox.cn/events/v2":this.API_URL.indexOf("https://api.mapbox.com")===0?"https://events.mapbox.com/events/v2":null:null},FEEDBACK_URL:"https://apps.mapbox.com/feedback",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},ze={supported:!1,testSupport:tt},Re,Xe=!1,it,ot=!1;s.document&&(it=s.document.createElement("img"),it.onload=function(){Re&<(Re),Re=null,ot=!0},it.onerror=function(){Xe=!0,Re=null},it.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");function tt(C){Xe||!it||(ot?lt(C):Re=C)}function lt(C){var k=C.createTexture();C.bindTexture(C.TEXTURE_2D,k);try{if(C.texImage2D(C.TEXTURE_2D,0,C.RGBA,C.RGBA,C.UNSIGNED_BYTE,it),C.isContextLost())return;ze.supported=!0}catch{}C.deleteTexture(k),Xe=!0}var Ee="01";function _e(){for(var C="1",k="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",V="",ne=0;ne<10;ne++)V+=k[Math.floor(Math.random()*62)];var xe=12*60*60*1e3,Ie=[C,Ee,V].join(""),Ve=Date.now()+xe;return{token:Ie,tokenExpiresAt:Ve}}var fe=function(k,V){this._transformRequestFn=k,this._customAccessToken=V,this._createSkuToken()};fe.prototype._createSkuToken=function(){var k=_e();this._skuToken=k.token,this._skuTokenExpiresAt=k.tokenExpiresAt},fe.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},fe.prototype.transformRequest=function(k,V){return this._transformRequestFn?this._transformRequestFn(k,V)||{url:k}:{url:k}},fe.prototype.normalizeStyleURL=function(k,V){if(!Fe(k))return k;var ne=Vt(k);return ne.path="/styles/v1"+ne.path,this._makeAPIURL(ne,this._customAccessToken||V)},fe.prototype.normalizeGlyphsURL=function(k,V){if(!Fe(k))return k;var ne=Vt(k);return ne.path="/fonts/v1"+ne.path,this._makeAPIURL(ne,this._customAccessToken||V)},fe.prototype.normalizeSourceURL=function(k,V){if(!Fe(k))return k;var ne=Vt(k);return ne.path="/v4/"+ne.authority+".json",ne.params.push("secure"),this._makeAPIURL(ne,this._customAccessToken||V)},fe.prototype.normalizeSpriteURL=function(k,V,ne,xe){var Ie=Vt(k);return Fe(k)?(Ie.path="/styles/v1"+Ie.path+"/sprite"+V+ne,this._makeAPIURL(Ie,this._customAccessToken||xe)):(Ie.path+=""+V+ne,Zt(Ie))},fe.prototype.normalizeTileURL=function(k,V){if(this._isSkuTokenExpired()&&this._createSkuToken(),k&&!Fe(k))return k;var ne=Vt(k),xe=/(\.(png|jpg)\d*)(?=$)/,Ie=/^.+\/v4\//,Ve=be.devicePixelRatio>=2||V===512?"@2x":"",ht=ze.supported?".webp":"$1";ne.path=ne.path.replace(xe,""+Ve+ht),ne.path=ne.path.replace(Ie,"/"),ne.path="/v4"+ne.path;var Rt=this._customAccessToken||Lt(ne.params)||Ae.ACCESS_TOKEN;return Ae.REQUIRE_ACCESS_TOKEN&&Rt&&this._skuToken&&ne.params.push("sku="+this._skuToken),this._makeAPIURL(ne,Rt)},fe.prototype.canonicalizeTileURL=function(k,V){var ne="/v4/",xe=/\.[\w]+$/,Ie=Vt(k);if(!Ie.path.match(/(^\/v4\/)/)||!Ie.path.match(xe))return k;var Ve="mapbox://tiles/";Ve+=Ie.path.replace(ne,"");var ht=Ie.params;return V&&(ht=ht.filter(function(Rt){return!Rt.match(/^access_token=/)})),ht.length&&(Ve+="?"+ht.join("&")),Ve},fe.prototype.canonicalizeTileset=function(k,V){for(var ne=V?Fe(V):!1,xe=[],Ie=0,Ve=k.tiles||[];Ie=0&&k.params.splice(Ie,1)}if(xe.path!=="/"&&(k.path=""+xe.path+k.path),!Ae.REQUIRE_ACCESS_TOKEN)return Zt(k);if(V=V||Ae.ACCESS_TOKEN,!V)throw new Error("An API access token is required to use Mapbox GL. "+ne);if(V[0]==="s")throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+ne);return k.params=k.params.filter(function(Ve){return Ve.indexOf("access_token")===-1}),k.params.push("access_token="+V),Zt(k)};function Fe(C){return C.indexOf("mapbox:")===0}var rt=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function st(C){return rt.test(C)}function Qe(C){return C.indexOf("sku=")>0&&st(C)}function Lt(C){for(var k=0,V=C;k=1&&s.localStorage.setItem(V,JSON.stringify(this.eventData))}catch{U("Unable to write to LocalStorage")}},jr.prototype.processRequests=function(k){},jr.prototype.postEvent=function(k,V,ne,xe){var Ie=this;if(Ae.EVENTS_URL){var Ve=Vt(Ae.EVENTS_URL);Ve.params.push("access_token="+(xe||Ae.ACCESS_TOKEN||""));var ht={event:this.type,created:new Date(k).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:r,skuId:Ee,userId:this.anonId},Rt=V?y(ht,V):ht,Ht={url:Zt(Ve),headers:{"Content-Type":"text/plain"},body:JSON.stringify([Rt])};this.pendingRequest=ra(Ht,function(tr){Ie.pendingRequest=null,ne(tr),Ie.saveEventData(),Ie.processRequests(xe)})}},jr.prototype.queueRequest=function(k,V){this.queue.push(k),this.processRequests(V)};var wr=function(C){function k(){C.call(this,"map.load"),this.success={},this.skuToken=""}return C&&(k.__proto__=C),k.prototype=Object.create(C&&C.prototype),k.prototype.constructor=k,k.prototype.postMapLoadEvent=function(ne,xe,Ie,Ve){this.skuToken=Ie,(Ae.EVENTS_URL&&Ve||Ae.ACCESS_TOKEN&&Array.isArray(ne)&&ne.some(function(ht){return Fe(ht)||st(ht)}))&&this.queueRequest({id:xe,timestamp:Date.now()},Ve)},k.prototype.processRequests=function(ne){var xe=this;if(!(this.pendingRequest||this.queue.length===0)){var Ie=this.queue.shift(),Ve=Ie.id,ht=Ie.timestamp;Ve&&this.success[Ve]||(this.anonId||this.fetchEventData(),P(this.anonId)||(this.anonId=m()),this.postEvent(ht,{skuToken:this.skuToken},function(Rt){Rt||Ve&&(xe.success[Ve]=!0)},ne))}},k}(jr),Ir=function(C){function k(V){C.call(this,"appUserTurnstile"),this._customAccessToken=V}return C&&(k.__proto__=C),k.prototype=Object.create(C&&C.prototype),k.prototype.constructor=k,k.prototype.postTurnstileEvent=function(ne,xe){Ae.EVENTS_URL&&Ae.ACCESS_TOKEN&&Array.isArray(ne)&&ne.some(function(Ie){return Fe(Ie)||st(Ie)})&&this.queueRequest(Date.now(),xe)},k.prototype.processRequests=function(ne){var xe=this;if(!(this.pendingRequest||this.queue.length===0)){(!this.anonId||!this.eventData.lastSuccess||!this.eventData.tokenU)&&this.fetchEventData();var Ie=xr(Ae.ACCESS_TOKEN),Ve=Ie?Ie.u:Ae.ACCESS_TOKEN,ht=Ve!==this.eventData.tokenU;P(this.anonId)||(this.anonId=m(),ht=!0);var Rt=this.queue.shift();if(this.eventData.lastSuccess){var Ht=new Date(this.eventData.lastSuccess),tr=new Date(Rt),Cr=(Rt-this.eventData.lastSuccess)/(24*60*60*1e3);ht=ht||Cr>=1||Cr<-1||Ht.getDate()!==tr.getDate()}else ht=!0;if(!ht)return this.processRequests();this.postEvent(Rt,{"enabled.telemetry":!1},function(Xr){Xr||(xe.eventData.lastSuccess=Rt,xe.eventData.tokenU=Ve)},ne)}},k}(jr),bt=new Ir,Be=bt.postTurnstileEvent.bind(bt),Ke=new wr,Ue=Ke.postMapLoadEvent.bind(Ke),Me="mapbox-tiles",qe=500,Ce=50,Te=1e3*60*7,Pe;function at(){s.caches&&!Pe&&(Pe=s.caches.open(Me))}var yt;function Tt(C,k){if(yt===void 0)try{new Response(new ReadableStream),yt=!0}catch{yt=!1}yt?k(C.body):C.blob().then(k)}function Ot(C,k,V){if(at(),!!Pe){var ne={status:k.status,statusText:k.statusText,headers:new s.Headers};k.headers.forEach(function(Ve,ht){return ne.headers.set(ht,Ve)});var xe=he(k.headers.get("Cache-Control")||"");if(!xe["no-store"]){xe["max-age"]&&ne.headers.set("Expires",new Date(V+xe["max-age"]*1e3).toUTCString());var Ie=new Date(ne.headers.get("Expires")).getTime()-V;IeDate.now()&&!V["no-cache"]}var Tr=1/0;function la(C){Tr++,Tr>Ce&&(C.getActor().send("enforceCacheSizeLimit",qe),Tr=0)}function Ua(C){at(),Pe&&Pe.then(function(k){k.keys().then(function(V){for(var ne=0;ne=200&&V.status<300||V.status===0)&&V.response!==null){var xe=V.response;if(C.type==="json")try{xe=JSON.parse(V.response)}catch(Ie){return k(Ie)}k(null,xe,V.getResponseHeader("Cache-Control"),V.getResponseHeader("Expires"))}else k(new Ci(V.statusText,V.status,C.url))},V.send(C.body),{cancel:function(){return V.abort()}}}var Pr=function(C,k){if(!Nt(C.url)){if(s.fetch&&s.Request&&s.AbortController&&s.Request.prototype.hasOwnProperty("signal"))return Kt(C,k);if(le()&&self.worker&&self.worker.actor){var V=!0;return self.worker.actor.send("getResource",C,k,void 0,V)}}return Wt(C,k)},ta=function(C,k){return Pr(y(C,{type:"json"}),k)},ma=function(C,k){return Pr(y(C,{type:"arrayBuffer"}),k)},ra=function(C,k){return Pr(y(C,{method:"POST"}),k)};function Ia(C){var k=s.document.createElement("a");return k.href=C,k.protocol===s.document.location.protocol&&k.host===s.document.location.host}var Ha="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function $a(C,k,V,ne){var xe=new s.Image,Ie=s.URL;xe.onload=function(){k(null,xe),Ie.revokeObjectURL(xe.src),xe.onload=null,s.requestAnimationFrame(function(){xe.src=Ha})},xe.onerror=function(){return k(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))};var Ve=new s.Blob([new Uint8Array(C)],{type:"image/png"});xe.cacheControl=V,xe.expires=ne,xe.src=C.byteLength?Ie.createObjectURL(Ve):Ha}function ai(C,k){var V=new s.Blob([new Uint8Array(C)],{type:"image/png"});s.createImageBitmap(V).then(function(ne){k(null,ne)}).catch(function(ne){k(new Error("Could not load image because of "+ne.message+". Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))})}var mi,xt,ct=function(){mi=[],xt=0};ct();var Nr=function(C,k){if(ze.supported&&(C.headers||(C.headers={}),C.headers.accept="image/webp,*/*"),xt>=Ae.MAX_PARALLEL_IMAGE_REQUESTS){var V={requestParameters:C,callback:k,cancelled:!1,cancel:function(){this.cancelled=!0}};return mi.push(V),V}xt++;var ne=!1,xe=function(){if(!ne)for(ne=!0,xt--;mi.length&&xt0||this._oneTimeListeners&&this._oneTimeListeners[k]&&this._oneTimeListeners[k].length>0||this._eventedParent&&this._eventedParent.listens(k)},Ur.prototype.setEventedParent=function(k,V){return this._eventedParent=k,this._eventedParentData=V,this};var aa=8,da={version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},fa={"*":{type:"source"}},It=["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],dr={type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},kr={type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},ia={type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},Ca={type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},Fa={type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},Ya={type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},ha={id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},Da=["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],Xi={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Li={"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},fn={"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},An={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},kn={"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},zn={"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Xn={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},to={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},mo={type:"array",value:"*"},pn={type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},Jo={type:"enum",values:{Point:{},LineString:{},Polygon:{}}},Xo={type:"array",minimum:0,maximum:24,value:["number","color"],length:2},Ts={type:"array",value:"*",minimum:1},Po={anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},so=["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],Vn={"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},To={"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},qo={"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},Oo={"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},lo={"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},Co={"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},os={"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},Ys={"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},Os={duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},Yo={"*":{type:"string"}},Ui={$version:aa,$root:da,sources:fa,source:It,source_vector:dr,source_raster:kr,source_raster_dem:ia,source_geojson:Ca,source_video:Fa,source_image:Ya,layer:ha,layout:Da,layout_background:Xi,layout_fill:Li,layout_circle:fn,layout_heatmap:An,"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:kn,layout_symbol:zn,layout_raster:Xn,layout_hillshade:to,filter:mo,filter_operator:pn,geometry_type:Jo,function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:Xo,expression:Ts,light:Po,paint:so,paint_fill:Vn,"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:To,paint_circle:qo,paint_heatmap:Oo,paint_symbol:lo,paint_raster:Co,paint_hillshade:os,paint_background:Ys,transition:Os,"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:Yo},Cn=function(k,V,ne,xe){this.message=(k?k+": ":"")+ne,xe&&(this.identifier=xe),V!=null&&V.__line__&&(this.line=V.__line__)};function tl(C){var k=C.key,V=C.value;return V?[new Cn(k,V,"constants have been deprecated as of v8")]:[]}function Bs(C){for(var k=[],V=arguments.length-1;V-- >0;)k[V]=arguments[V+1];for(var ne=0,xe=k;ne":C.itemType.kind==="value"?"array":"array<"+k+">"}else return C.kind}var iu=[rl,Sn,po,ro,As,fl,al,zl($n),xu];function Eu(C,k){if(k.kind==="error")return null;if(C.kind==="array"){if(k.kind==="array"&&(k.N===0&&k.itemType.kind==="value"||!Eu(C.itemType,k.itemType))&&(typeof C.N!="number"||C.N===k.N))return null}else{if(C.kind===k.kind)return null;if(C.kind==="value")for(var V=0,ne=iu;V255?255:Ht}function xe(Ht){return Ht<0?0:Ht>1?1:Ht}function Ie(Ht){return Ht[Ht.length-1]==="%"?ne(parseFloat(Ht)/100*255):ne(parseInt(Ht))}function Ve(Ht){return Ht[Ht.length-1]==="%"?xe(parseFloat(Ht)/100):xe(parseFloat(Ht))}function ht(Ht,tr,Cr){return Cr<0?Cr+=1:Cr>1&&(Cr-=1),Cr*6<1?Ht+(tr-Ht)*Cr*6:Cr*2<1?tr:Cr*3<2?Ht+(tr-Ht)*(2/3-Cr)*6:Ht}function Rt(Ht){var tr=Ht.replace(/ /g,"").toLowerCase();if(tr in V)return V[tr].slice();if(tr[0]==="#"){if(tr.length===4){var Cr=parseInt(tr.substr(1),16);return Cr>=0&&Cr<=4095?[(Cr&3840)>>4|(Cr&3840)>>8,Cr&240|(Cr&240)>>4,Cr&15|(Cr&15)<<4,1]:null}else if(tr.length===7){var Cr=parseInt(tr.substr(1),16);return Cr>=0&&Cr<=16777215?[(Cr&16711680)>>16,(Cr&65280)>>8,Cr&255,1]:null}return null}var Xr=tr.indexOf("("),qr=tr.indexOf(")");if(Xr!==-1&&qr+1===tr.length){var pa=tr.substr(0,Xr),ja=tr.substr(Xr+1,qr-(Xr+1)).split(","),Ei=1;switch(pa){case"rgba":if(ja.length!==4)return null;Ei=Ve(ja.pop());case"rgb":return ja.length!==3?null:[Ie(ja[0]),Ie(ja[1]),Ie(ja[2]),Ei];case"hsla":if(ja.length!==4)return null;Ei=Ve(ja.pop());case"hsl":if(ja.length!==3)return null;var li=(parseFloat(ja[0])%360+360)%360/360,en=Ve(ja[1]),Ni=Ve(ja[2]),Qi=Ni<=.5?Ni*(en+1):Ni+en-Ni*en,ln=Ni*2-Qi;return[ne(ht(ln,Qi,li+1/3)*255),ne(ht(ln,Qi,li)*255),ne(ht(ln,Qi,li-1/3)*255),Ei];default:return null}}return null}try{k.parseCSSColor=Rt}catch{}}),pf=Af.parseCSSColor,Us=function(k,V,ne,xe){xe===void 0&&(xe=1),this.r=k,this.g=V,this.b=ne,this.a=xe};Us.parse=function(k){if(k){if(k instanceof Us)return k;if(typeof k=="string"){var V=pf(k);if(V)return new Us(V[0]/255*V[3],V[1]/255*V[3],V[2]/255*V[3],V[3])}}},Us.prototype.toString=function(){var k=this.toArray(),V=k[0],ne=k[1],xe=k[2],Ie=k[3];return"rgba("+Math.round(V)+","+Math.round(ne)+","+Math.round(xe)+","+Ie+")"},Us.prototype.toArray=function(){var k=this,V=k.r,ne=k.g,xe=k.b,Ie=k.a;return Ie===0?[0,0,0,0]:[V*255/Ie,ne*255/Ie,xe*255/Ie,Ie]},Us.black=new Us(0,0,0,1),Us.white=new Us(1,1,1,1),Us.transparent=new Us(0,0,0,0),Us.red=new Us(1,0,0,1);var Vc=function(k,V,ne){k?this.sensitivity=V?"variant":"case":this.sensitivity=V?"accent":"base",this.locale=ne,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};Vc.prototype.compare=function(k,V){return this.collator.compare(k,V)},Vc.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var Sf=function(k,V,ne,xe,Ie){this.text=k,this.image=V,this.scale=ne,this.fontStack=xe,this.textColor=Ie},nu=function(k){this.sections=k};nu.fromString=function(k){return new nu([new Sf(k,null,null,null,null)])},nu.prototype.isEmpty=function(){return this.sections.length===0?!0:!this.sections.some(function(k){return k.text.length!==0||k.image&&k.image.name.length!==0})},nu.factory=function(k){return k instanceof nu?k:nu.fromString(k)},nu.prototype.toString=function(){return this.sections.length===0?"":this.sections.map(function(k){return k.text}).join("")},nu.prototype.serialize=function(){for(var k=["format"],V=0,ne=this.sections;V=0&&C<=255&&typeof k=="number"&&k>=0&&k<=255&&typeof V=="number"&&V>=0&&V<=255)){var xe=typeof ne=="number"?[C,k,V,ne]:[C,k,V];return"Invalid rgba value ["+xe.join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}return typeof ne>"u"||typeof ne=="number"&&ne>=0&&ne<=1?null:"Invalid rgba value ["+[C,k,V,ne].join(", ")+"]: 'a' must be between 0 and 1."}function Ou(C){if(C===null)return!0;if(typeof C=="string")return!0;if(typeof C=="boolean")return!0;if(typeof C=="number")return!0;if(C instanceof Us)return!0;if(C instanceof Vc)return!0;if(C instanceof nu)return!0;if(C instanceof Ll)return!0;if(Array.isArray(C)){for(var k=0,V=C;k2){var ht=k[1];if(typeof ht!="string"||!(ht in nc)||ht==="object")return V.error('The item type argument of "array" must be one of string, number, boolean',1);Ve=nc[ht],ne++}else Ve=$n;var Rt;if(k.length>3){if(k[2]!==null&&(typeof k[2]!="number"||k[2]<0||k[2]!==Math.floor(k[2])))return V.error('The length argument to "array" must be a positive integer literal',2);Rt=k[2],ne++}xe=zl(Ve,Rt)}else xe=nc[Ie];for(var Ht=[];ne1)&&V.push(xe)}}return V.concat(this.args.map(function(Ie){return Ie.serialize()}))};var qu=function(k){this.type=fl,this.sections=k};qu.parse=function(k,V){if(k.length<2)return V.error("Expected at least one argument.");var ne=k[1];if(!Array.isArray(ne)&&typeof ne=="object")return V.error("First argument must be an image or text section.");for(var xe=[],Ie=!1,Ve=1;Ve<=k.length-1;++Ve){var ht=k[Ve];if(Ie&&typeof ht=="object"&&!Array.isArray(ht)){Ie=!1;var Rt=null;if(ht["font-scale"]&&(Rt=V.parse(ht["font-scale"],1,Sn),!Rt))return null;var Ht=null;if(ht["text-font"]&&(Ht=V.parse(ht["text-font"],1,zl(po)),!Ht))return null;var tr=null;if(ht["text-color"]&&(tr=V.parse(ht["text-color"],1,As),!tr))return null;var Cr=xe[xe.length-1];Cr.scale=Rt,Cr.font=Ht,Cr.textColor=tr}else{var Xr=V.parse(k[Ve],1,$n);if(!Xr)return null;var qr=Xr.type.kind;if(qr!=="string"&&qr!=="value"&&qr!=="null"&&qr!=="resolvedImage")return V.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");Ie=!0,xe.push({content:Xr,scale:null,font:null,textColor:null})}}return new qu(xe)},qu.prototype.evaluate=function(k){var V=function(ne){var xe=ne.content.evaluate(k);return il(xe)===xu?new Sf("",xe,null,null,null):new Sf(vl(xe),null,ne.scale?ne.scale.evaluate(k):null,ne.font?ne.font.evaluate(k).join(","):null,ne.textColor?ne.textColor.evaluate(k):null)};return new nu(this.sections.map(V))},qu.prototype.eachChild=function(k){for(var V=0,ne=this.sections;V-1),ne},cl.prototype.eachChild=function(k){k(this.input)},cl.prototype.outputDefined=function(){return!1},cl.prototype.serialize=function(){return["image",this.input.serialize()]};var yh={"to-boolean":ro,"to-color":As,"to-number":Sn,"to-string":po},ls=function(k,V){this.type=k,this.args=V};ls.parse=function(k,V){if(k.length<2)return V.error("Expected at least one argument.");var ne=k[0];if((ne==="to-boolean"||ne==="to-string")&&k.length!==2)return V.error("Expected one argument.");for(var xe=yh[ne],Ie=[],Ve=1;Ve4?ne="Invalid rbga value "+JSON.stringify(V)+": expected an array containing either three or four numeric values.":ne=ic(V[0],V[1],V[2],V[3]),!ne))return new Us(V[0]/255,V[1]/255,V[2]/255,V[3])}throw new Vs(ne||"Could not parse color from value '"+(typeof V=="string"?V:String(JSON.stringify(V)))+"'")}else if(this.type.kind==="number"){for(var Rt=null,Ht=0,tr=this.args;Ht=k[2]||C[1]<=k[1]||C[3]>=k[3])}function Yf(C,k){var V=wc(C[0]),ne=rf(C[1]),xe=Math.pow(2,k.z);return[Math.round(V*xe*Ul),Math.round(ne*xe*Ul)]}function zf(C,k,V){var ne=C[0]-k[0],xe=C[1]-k[1],Ie=C[0]-V[0],Ve=C[1]-V[1];return ne*Ve-Ie*xe===0&&ne*Ie<=0&&xe*Ve<=0}function af(C,k,V){return k[1]>C[1]!=V[1]>C[1]&&C[0]<(V[0]-k[0])*(C[1]-k[1])/(V[1]-k[1])+k[0]}function Nc(C,k){for(var V=!1,ne=0,xe=k.length;ne0&&Cr<0||tr<0&&Cr>0}function Ef(C,k,V,ne){var xe=[k[0]-C[0],k[1]-C[1]],Ie=[ne[0]-V[0],ne[1]-V[1]];return Of(Ie,xe)===0?!1:!!(Gu(C,k,V,ne)&&Gu(V,ne,C,k))}function oc(C,k,V){for(var ne=0,xe=V;neV[2]){var xe=ne*.5,Ie=C[0]-V[0]>xe?-ne:V[0]-C[0]>xe?ne:0;Ie===0&&(Ie=C[0]-V[2]>xe?-ne:V[2]-C[0]>xe?ne:0),C[0]+=Ie}Mf(k,C)}function Cf(C){C[0]=C[1]=1/0,C[2]=C[3]=-1/0}function lh(C,k,V,ne){for(var xe=Math.pow(2,ne.z)*Ul,Ie=[ne.x*Ul,ne.y*Ul],Ve=[],ht=0,Rt=C;ht=0)return!1;var V=!0;return C.eachChild(function(ne){V&&!Lu(ne,k)&&(V=!1)}),V}var Ac=function(k,V){this.type=V.type,this.name=k,this.boundExpression=V};Ac.parse=function(k,V){if(k.length!==2||typeof k[1]!="string")return V.error("'var' expression requires exactly one string literal argument.");var ne=k[1];return V.scope.has(ne)?new Ac(ne,V.scope.get(ne)):V.error('Unknown variable "'+ne+'". Make sure "'+ne+'" has been bound in an enclosing "let" expression before using it.',1)},Ac.prototype.evaluate=function(k){return this.boundExpression.evaluate(k)},Ac.prototype.eachChild=function(){},Ac.prototype.outputDefined=function(){return!1},Ac.prototype.serialize=function(){return["var",this.name]};var nl=function(k,V,ne,xe,Ie){V===void 0&&(V=[]),xe===void 0&&(xe=new Is),Ie===void 0&&(Ie=[]),this.registry=k,this.path=V,this.key=V.map(function(Ve){return"["+Ve+"]"}).join(""),this.scope=xe,this.errors=Ie,this.expectedType=ne};nl.prototype.parse=function(k,V,ne,xe,Ie){return Ie===void 0&&(Ie={}),V?this.concat(V,ne,xe)._parse(k,Ie):this._parse(k,Ie)},nl.prototype._parse=function(k,V){(k===null||typeof k=="string"||typeof k=="boolean"||typeof k=="number")&&(k=["literal",k]);function ne(tr,Cr,Xr){return Xr==="assert"?new Nl(Cr,[tr]):Xr==="coerce"?new ls(Cr,[tr]):tr}if(Array.isArray(k)){if(k.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var xe=k[0];if(typeof xe!="string")return this.error("Expression name must be a string, but found "+typeof xe+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var Ie=this.registry[xe];if(Ie){var Ve=Ie.parse(k,this);if(!Ve)return null;if(this.expectedType){var ht=this.expectedType,Rt=Ve.type;if((ht.kind==="string"||ht.kind==="number"||ht.kind==="boolean"||ht.kind==="object"||ht.kind==="array")&&Rt.kind==="value")Ve=ne(Ve,ht,V.typeAnnotation||"assert");else if((ht.kind==="color"||ht.kind==="formatted"||ht.kind==="resolvedImage")&&(Rt.kind==="value"||Rt.kind==="string"))Ve=ne(Ve,ht,V.typeAnnotation||"coerce");else if(this.checkSubtype(ht,Rt))return null}if(!(Ve instanceof gs)&&Ve.type.kind!=="resolvedImage"&&dc(Ve)){var Ht=new Ss;try{Ve=new gs(Ve.type,Ve.evaluate(Ht))}catch(tr){return this.error(tr.message),null}}return Ve}return this.error('Unknown expression "'+xe+'". If you wanted a literal array, use ["literal", [...]].',0)}else return typeof k>"u"?this.error("'undefined' value invalid. Use null instead."):typeof k=="object"?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error("Expected an array, but found "+typeof k+" instead.")},nl.prototype.concat=function(k,V,ne){var xe=typeof k=="number"?this.path.concat(k):this.path,Ie=ne?this.scope.concat(ne):this.scope;return new nl(this.registry,xe,V||null,Ie,this.errors)},nl.prototype.error=function(k){for(var V=[],ne=arguments.length-1;ne-- >0;)V[ne]=arguments[ne+1];var xe=""+this.key+V.map(function(Ie){return"["+Ie+"]"}).join("");this.errors.push(new ms(xe,k))},nl.prototype.checkSubtype=function(k,V){var ne=Eu(k,V);return ne&&this.error(ne),ne};function dc(C){if(C instanceof Ac)return dc(C.boundExpression);if(C instanceof Qn&&C.name==="error")return!1;if(C instanceof Vu)return!1;if(C instanceof ku)return!1;var k=C instanceof ls||C instanceof Nl,V=!0;return C.eachChild(function(ne){k?V=V&&dc(ne):V=V&&ne instanceof gs}),V?Nf(C)&&Lu(C,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"]):!1}function vu(C,k){for(var V=C.length-1,ne=0,xe=V,Ie=0,Ve,ht;ne<=xe;)if(Ie=Math.floor((ne+xe)/2),Ve=C[Ie],ht=C[Ie+1],Ve<=k){if(Ie===V||kk)xe=Ie-1;else throw new Vs("Input is not a number.");return 0}var bu=function(k,V,ne){this.type=k,this.input=V,this.labels=[],this.outputs=[];for(var xe=0,Ie=ne;xe=ht)return V.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',Ht);var Cr=V.parse(Rt,tr,Ie);if(!Cr)return null;Ie=Ie||Cr.type,xe.push([ht,Cr])}return new bu(Ie,ne,xe)},bu.prototype.evaluate=function(k){var V=this.labels,ne=this.outputs;if(V.length===1)return ne[0].evaluate(k);var xe=this.input.evaluate(k);if(xe<=V[0])return ne[0].evaluate(k);var Ie=V.length;if(xe>=V[Ie-1])return ne[Ie-1].evaluate(k);var Ve=vu(V,xe);return ne[Ve].evaluate(k)},bu.prototype.eachChild=function(k){k(this.input);for(var V=0,ne=this.outputs;V0&&k.push(this.labels[V]),k.push(this.outputs[V].serialize());return k};function Ml(C,k,V){return C*(1-V)+k*V}function Uf(C,k,V){return new Us(Ml(C.r,k.r,V),Ml(C.g,k.g,V),Ml(C.b,k.b,V),Ml(C.a,k.a,V))}function Jf(C,k,V){return C.map(function(ne,xe){return Ml(ne,k[xe],V)})}var Bu=Object.freeze({__proto__:null,number:Ml,color:Uf,array:Jf}),Sc=.95047,vc=1,Lh=1.08883,nf=4/29,df=6/29,Nu=3*df*df,of=df*df*df,tu=Math.PI/180,Xc=180/Math.PI;function uh(C){return C>of?Math.pow(C,1/3):C/Nu+nf}function vf(C){return C>df?C*C*C:Nu*(C-nf)}function ol(C){return 255*(C<=.0031308?12.92*C:1.055*Math.pow(C,1/2.4)-.055)}function mu(C){return C/=255,C<=.04045?C/12.92:Math.pow((C+.055)/1.055,2.4)}function Pu(C){var k=mu(C.r),V=mu(C.g),ne=mu(C.b),xe=uh((.4124564*k+.3575761*V+.1804375*ne)/Sc),Ie=uh((.2126729*k+.7151522*V+.072175*ne)/vc),Ve=uh((.0193339*k+.119192*V+.9503041*ne)/Lh);return{l:116*Ie-16,a:500*(xe-Ie),b:200*(Ie-Ve),alpha:C.a}}function kf(C){var k=(C.l+16)/116,V=isNaN(C.a)?k:k+C.a/500,ne=isNaN(C.b)?k:k-C.b/200;return k=vc*vf(k),V=Sc*vf(V),ne=Lh*vf(ne),new Us(ol(3.2404542*V-1.5371385*k-.4985314*ne),ol(-.969266*V+1.8760108*k+.041556*ne),ol(.0556434*V-.2040259*k+1.0572252*ne),C.alpha)}function hl(C,k,V){return{l:Ml(C.l,k.l,V),a:Ml(C.a,k.a,V),b:Ml(C.b,k.b,V),alpha:Ml(C.alpha,k.alpha,V)}}function sf(C){var k=Pu(C),V=k.l,ne=k.a,xe=k.b,Ie=Math.atan2(xe,ne)*Xc;return{h:Ie<0?Ie+360:Ie,c:Math.sqrt(ne*ne+xe*xe),l:V,alpha:C.a}}function Mc(C){var k=C.h*tu,V=C.c,ne=C.l;return kf({l:ne,a:Math.cos(k)*V,b:Math.sin(k)*V,alpha:C.alpha})}function Hu(C,k,V){var ne=k-C;return C+V*(ne>180||ne<-180?ne-360*Math.round(ne/360):ne)}function mf(C,k,V){return{h:Hu(C.h,k.h,V),c:Ml(C.c,k.c,V),l:Ml(C.l,k.l,V),alpha:Ml(C.alpha,k.alpha,V)}}var Wu={forward:Pu,reverse:kf,interpolate:hl},Zc={forward:sf,reverse:Mc,interpolate:mf},Lf=Object.freeze({__proto__:null,lab:Wu,hcl:Zc}),ru=function(k,V,ne,xe,Ie){this.type=k,this.operator=V,this.interpolation=ne,this.input=xe,this.labels=[],this.outputs=[];for(var Ve=0,ht=Ie;Ve1}))return V.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);xe={name:"cubic-bezier",controlPoints:Rt}}else return V.error("Unknown interpolation type "+String(xe[0]),1,0);if(k.length-1<4)return V.error("Expected at least 4 arguments, but found only "+(k.length-1)+".");if((k.length-1)%2!==0)return V.error("Expected an even number of arguments.");if(Ie=V.parse(Ie,2,Sn),!Ie)return null;var Ht=[],tr=null;ne==="interpolate-hcl"||ne==="interpolate-lab"?tr=As:V.expectedType&&V.expectedType.kind!=="value"&&(tr=V.expectedType);for(var Cr=0;Cr=Xr)return V.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',pa);var Ei=V.parse(qr,ja,tr);if(!Ei)return null;tr=tr||Ei.type,Ht.push([Xr,Ei])}return tr.kind!=="number"&&tr.kind!=="color"&&!(tr.kind==="array"&&tr.itemType.kind==="number"&&typeof tr.N=="number")?V.error("Type "+Ns(tr)+" is not interpolatable."):new ru(tr,ne,xe,Ie,Ht)},ru.prototype.evaluate=function(k){var V=this.labels,ne=this.outputs;if(V.length===1)return ne[0].evaluate(k);var xe=this.input.evaluate(k);if(xe<=V[0])return ne[0].evaluate(k);var Ie=V.length;if(xe>=V[Ie-1])return ne[Ie-1].evaluate(k);var Ve=vu(V,xe),ht=V[Ve],Rt=V[Ve+1],Ht=ru.interpolationFactor(this.interpolation,xe,ht,Rt),tr=ne[Ve].evaluate(k),Cr=ne[Ve+1].evaluate(k);return this.operator==="interpolate"?Bu[this.type.kind.toLowerCase()](tr,Cr,Ht):this.operator==="interpolate-hcl"?Zc.reverse(Zc.interpolate(Zc.forward(tr),Zc.forward(Cr),Ht)):Wu.reverse(Wu.interpolate(Wu.forward(tr),Wu.forward(Cr),Ht))},ru.prototype.eachChild=function(k){k(this.input);for(var V=0,ne=this.outputs;V=ne.length)throw new Vs("Array index out of bounds: "+V+" > "+(ne.length-1)+".");if(V!==Math.floor(V))throw new Vs("Array index must be an integer, but found "+V+" instead.");return ne[V]},mc.prototype.eachChild=function(k){k(this.index),k(this.input)},mc.prototype.outputDefined=function(){return!1},mc.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var jl=function(k,V){this.type=ro,this.needle=k,this.haystack=V};jl.parse=function(k,V){if(k.length!==3)return V.error("Expected 2 arguments, but found "+(k.length-1)+" instead.");var ne=V.parse(k[1],1,$n),xe=V.parse(k[2],2,$n);return!ne||!xe?null:Bc(ne.type,[ro,po,Sn,rl,$n])?new jl(ne,xe):V.error("Expected first argument to be of type boolean, string, number or null, but found "+Ns(ne.type)+" instead")},jl.prototype.evaluate=function(k){var V=this.needle.evaluate(k),ne=this.haystack.evaluate(k);if(!ne)return!1;if(!Cu(V,["boolean","string","number","null"]))throw new Vs("Expected first argument to be of type boolean, string, number or null, but found "+Ns(il(V))+" instead.");if(!Cu(ne,["string","array"]))throw new Vs("Expected second argument to be of type array or string, but found "+Ns(il(ne))+" instead.");return ne.indexOf(V)>=0},jl.prototype.eachChild=function(k){k(this.needle),k(this.haystack)},jl.prototype.outputDefined=function(){return!0},jl.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var gu=function(k,V,ne){this.type=Sn,this.needle=k,this.haystack=V,this.fromIndex=ne};gu.parse=function(k,V){if(k.length<=2||k.length>=5)return V.error("Expected 3 or 4 arguments, but found "+(k.length-1)+" instead.");var ne=V.parse(k[1],1,$n),xe=V.parse(k[2],2,$n);if(!ne||!xe)return null;if(!Bc(ne.type,[ro,po,Sn,rl,$n]))return V.error("Expected first argument to be of type boolean, string, number or null, but found "+Ns(ne.type)+" instead");if(k.length===4){var Ie=V.parse(k[3],3,Sn);return Ie?new gu(ne,xe,Ie):null}else return new gu(ne,xe)},gu.prototype.evaluate=function(k){var V=this.needle.evaluate(k),ne=this.haystack.evaluate(k);if(!Cu(V,["boolean","string","number","null"]))throw new Vs("Expected first argument to be of type boolean, string, number or null, but found "+Ns(il(V))+" instead.");if(!Cu(ne,["string","array"]))throw new Vs("Expected second argument to be of type array or string, but found "+Ns(il(ne))+" instead.");if(this.fromIndex){var xe=this.fromIndex.evaluate(k);return ne.indexOf(V,xe)}return ne.indexOf(V)},gu.prototype.eachChild=function(k){k(this.needle),k(this.haystack),this.fromIndex&&k(this.fromIndex)},gu.prototype.outputDefined=function(){return!1},gu.prototype.serialize=function(){if(this.fromIndex!=null&&this.fromIndex!==void 0){var k=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),k]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var Cc=function(k,V,ne,xe,Ie,Ve){this.inputType=k,this.type=V,this.input=ne,this.cases=xe,this.outputs=Ie,this.otherwise=Ve};Cc.parse=function(k,V){if(k.length<5)return V.error("Expected at least 4 arguments, but found only "+(k.length-1)+".");if(k.length%2!==1)return V.error("Expected an even number of arguments.");var ne,xe;V.expectedType&&V.expectedType.kind!=="value"&&(xe=V.expectedType);for(var Ie={},Ve=[],ht=2;htNumber.MAX_SAFE_INTEGER)return tr.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if(typeof qr=="number"&&Math.floor(qr)!==qr)return tr.error("Numeric branch labels must be integer values.");if(!ne)ne=il(qr);else if(tr.checkSubtype(ne,il(qr)))return null;if(typeof Ie[String(qr)]<"u")return tr.error("Branch labels must be unique.");Ie[String(qr)]=Ve.length}var pa=V.parse(Ht,ht,xe);if(!pa)return null;xe=xe||pa.type,Ve.push(pa)}var ja=V.parse(k[1],1,$n);if(!ja)return null;var Ei=V.parse(k[k.length-1],k.length-1,xe);return!Ei||ja.type.kind!=="value"&&V.concat(1).checkSubtype(ne,ja.type)?null:new Cc(ne,xe,ja,Ie,Ve,Ei)},Cc.prototype.evaluate=function(k){var V=this.input.evaluate(k),ne=il(V)===this.inputType&&this.outputs[this.cases[V]]||this.otherwise;return ne.evaluate(k)},Cc.prototype.eachChild=function(k){k(this.input),this.outputs.forEach(k),k(this.otherwise)},Cc.prototype.outputDefined=function(){return this.outputs.every(function(k){return k.outputDefined()})&&this.otherwise.outputDefined()},Cc.prototype.serialize=function(){for(var k=this,V=["match",this.input.serialize()],ne=Object.keys(this.cases).sort(),xe=[],Ie={},Ve=0,ht=ne;Ve=5)return V.error("Expected 3 or 4 arguments, but found "+(k.length-1)+" instead.");var ne=V.parse(k[1],1,$n),xe=V.parse(k[2],2,Sn);if(!ne||!xe)return null;if(!Bc(ne.type,[zl($n),po,$n]))return V.error("Expected first argument to be of type array or string, but found "+Ns(ne.type)+" instead");if(k.length===4){var Ie=V.parse(k[3],3,Sn);return Ie?new sc(ne.type,ne,xe,Ie):null}else return new sc(ne.type,ne,xe)},sc.prototype.evaluate=function(k){var V=this.input.evaluate(k),ne=this.beginIndex.evaluate(k);if(!Cu(V,["string","array"]))throw new Vs("Expected first argument to be of type array or string, but found "+Ns(il(V))+" instead.");if(this.endIndex){var xe=this.endIndex.evaluate(k);return V.slice(ne,xe)}return V.slice(ne)},sc.prototype.eachChild=function(k){k(this.input),k(this.beginIndex),this.endIndex&&k(this.endIndex)},sc.prototype.outputDefined=function(){return!1},sc.prototype.serialize=function(){if(this.endIndex!=null&&this.endIndex!==void 0){var k=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),k]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};function kc(C,k){return C==="=="||C==="!="?k.kind==="boolean"||k.kind==="string"||k.kind==="number"||k.kind==="null"||k.kind==="value":k.kind==="string"||k.kind==="number"||k.kind==="value"}function er(C,k,V){return k===V}function yr(C,k,V){return k!==V}function na(C,k,V){return kV}function La(C,k,V){return k<=V}function hi(C,k,V){return k>=V}function Pi(C,k,V,ne){return ne.compare(k,V)===0}function Zi(C,k,V,ne){return!Pi(C,k,V,ne)}function tn(C,k,V,ne){return ne.compare(k,V)<0}function dn(C,k,V,ne){return ne.compare(k,V)>0}function Ri(C,k,V,ne){return ne.compare(k,V)<=0}function Fi(C,k,V,ne){return ne.compare(k,V)>=0}function qi(C,k,V){var ne=C!=="=="&&C!=="!=";return function(){function xe(Ie,Ve,ht){this.type=ro,this.lhs=Ie,this.rhs=Ve,this.collator=ht,this.hasUntypedArgument=Ie.type.kind==="value"||Ve.type.kind==="value"}return xe.parse=function(Ve,ht){if(Ve.length!==3&&Ve.length!==4)return ht.error("Expected two or three arguments.");var Rt=Ve[0],Ht=ht.parse(Ve[1],1,$n);if(!Ht)return null;if(!kc(Rt,Ht.type))return ht.concat(1).error('"'+Rt+`" comparisons are not supported for type '`+Ns(Ht.type)+"'.");var tr=ht.parse(Ve[2],2,$n);if(!tr)return null;if(!kc(Rt,tr.type))return ht.concat(2).error('"'+Rt+`" comparisons are not supported for type '`+Ns(tr.type)+"'.");if(Ht.type.kind!==tr.type.kind&&Ht.type.kind!=="value"&&tr.type.kind!=="value")return ht.error("Cannot compare types '"+Ns(Ht.type)+"' and '"+Ns(tr.type)+"'.");ne&&(Ht.type.kind==="value"&&tr.type.kind!=="value"?Ht=new Nl(tr.type,[Ht]):Ht.type.kind!=="value"&&tr.type.kind==="value"&&(tr=new Nl(Ht.type,[tr])));var Cr=null;if(Ve.length===4){if(Ht.type.kind!=="string"&&tr.type.kind!=="string"&&Ht.type.kind!=="value"&&tr.type.kind!=="value")return ht.error("Cannot use collator to compare non-string types.");if(Cr=ht.parse(Ve[3],3,au),!Cr)return null}return new xe(Ht,tr,Cr)},xe.prototype.evaluate=function(Ve){var ht=this.lhs.evaluate(Ve),Rt=this.rhs.evaluate(Ve);if(ne&&this.hasUntypedArgument){var Ht=il(ht),tr=il(Rt);if(Ht.kind!==tr.kind||!(Ht.kind==="string"||Ht.kind==="number"))throw new Vs('Expected arguments for "'+C+'" to be (string, string) or (number, number), but found ('+Ht.kind+", "+tr.kind+") instead.")}if(this.collator&&!ne&&this.hasUntypedArgument){var Cr=il(ht),Xr=il(Rt);if(Cr.kind!=="string"||Xr.kind!=="string")return k(Ve,ht,Rt)}return this.collator?V(Ve,ht,Rt,this.collator.evaluate(Ve)):k(Ve,ht,Rt)},xe.prototype.eachChild=function(Ve){Ve(this.lhs),Ve(this.rhs),this.collator&&Ve(this.collator)},xe.prototype.outputDefined=function(){return!0},xe.prototype.serialize=function(){var Ve=[C];return this.eachChild(function(ht){Ve.push(ht.serialize())}),Ve},xe}()}var _i=qi("==",er,Pi),Mn=qi("!=",yr,Zi),Kn=qi("<",na,tn),ao=qi(">",$r,dn),Jn=qi("<=",La,Ri),co=qi(">=",hi,Fi),wn=function(k,V,ne,xe,Ie){this.type=po,this.number=k,this.locale=V,this.currency=ne,this.minFractionDigits=xe,this.maxFractionDigits=Ie};wn.parse=function(k,V){if(k.length!==3)return V.error("Expected two arguments.");var ne=V.parse(k[1],1,Sn);if(!ne)return null;var xe=k[2];if(typeof xe!="object"||Array.isArray(xe))return V.error("NumberFormat options argument must be an object.");var Ie=null;if(xe.locale&&(Ie=V.parse(xe.locale,1,po),!Ie))return null;var Ve=null;if(xe.currency&&(Ve=V.parse(xe.currency,1,po),!Ve))return null;var ht=null;if(xe["min-fraction-digits"]&&(ht=V.parse(xe["min-fraction-digits"],1,Sn),!ht))return null;var Rt=null;return xe["max-fraction-digits"]&&(Rt=V.parse(xe["max-fraction-digits"],1,Sn),!Rt)?null:new wn(ne,Ie,Ve,ht,Rt)},wn.prototype.evaluate=function(k){return new Intl.NumberFormat(this.locale?this.locale.evaluate(k):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(k):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(k):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(k):void 0}).format(this.number.evaluate(k))},wn.prototype.eachChild=function(k){k(this.number),this.locale&&k(this.locale),this.currency&&k(this.currency),this.minFractionDigits&&k(this.minFractionDigits),this.maxFractionDigits&&k(this.maxFractionDigits)},wn.prototype.outputDefined=function(){return!1},wn.prototype.serialize=function(){var k={};return this.locale&&(k.locale=this.locale.serialize()),this.currency&&(k.currency=this.currency.serialize()),this.minFractionDigits&&(k["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(k["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),k]};var un=function(k){this.type=Sn,this.input=k};un.parse=function(k,V){if(k.length!==2)return V.error("Expected 1 argument, but found "+(k.length-1)+" instead.");var ne=V.parse(k[1],1);return ne?ne.type.kind!=="array"&&ne.type.kind!=="string"&&ne.type.kind!=="value"?V.error("Expected argument of type string or array, but found "+Ns(ne.type)+" instead."):new un(ne):null},un.prototype.evaluate=function(k){var V=this.input.evaluate(k);if(typeof V=="string")return V.length;if(Array.isArray(V))return V.length;throw new Vs("Expected value to be of type string or array, but found "+Ns(il(V))+" instead.")},un.prototype.eachChild=function(k){k(this.input)},un.prototype.outputDefined=function(){return!1},un.prototype.serialize=function(){var k=["length"];return this.eachChild(function(V){k.push(V.serialize())}),k};var _o={"==":_i,"!=":Mn,">":ao,"<":Kn,">=":co,"<=":Jn,array:Nl,at:mc,boolean:Nl,case:Yc,coalesce:Xu,collator:Vu,format:qu,image:cl,in:jl,"index-of":gu,interpolate:ru,"interpolate-hcl":ru,"interpolate-lab":ru,length:un,let:Ec,literal:gs,match:Cc,number:Nl,"number-format":wn,object:Nl,slice:sc,step:bu,string:Nl,"to-boolean":ls,"to-color":ls,"to-number":ls,"to-string":ls,var:Ac,within:ku};function Qo(C,k){var V=k[0],ne=k[1],xe=k[2],Ie=k[3];V=V.evaluate(C),ne=ne.evaluate(C),xe=xe.evaluate(C);var Ve=Ie?Ie.evaluate(C):1,ht=ic(V,ne,xe,Ve);if(ht)throw new Vs(ht);return new Us(V/255*Ve,ne/255*Ve,xe/255*Ve,Ve)}function xs(C,k){return C in k}function Qs(C,k){var V=k[C];return typeof V>"u"?null:V}function Rs(C,k,V,ne){for(;V<=ne;){var xe=V+ne>>1;if(k[xe]===C)return!0;k[xe]>C?ne=xe-1:V=xe+1}return!1}function Ks(C){return{type:C}}Qn.register(_o,{error:[zs,[po],function(C,k){var V=k[0];throw new Vs(V.evaluate(C))}],typeof:[po,[$n],function(C,k){var V=k[0];return Ns(il(V.evaluate(C)))}],"to-rgba":[zl(Sn,4),[As],function(C,k){var V=k[0];return V.evaluate(C).toArray()}],rgb:[As,[Sn,Sn,Sn],Qo],rgba:[As,[Sn,Sn,Sn,Sn],Qo],has:{type:ro,overloads:[[[po],function(C,k){var V=k[0];return xs(V.evaluate(C),C.properties())}],[[po,al],function(C,k){var V=k[0],ne=k[1];return xs(V.evaluate(C),ne.evaluate(C))}]]},get:{type:$n,overloads:[[[po],function(C,k){var V=k[0];return Qs(V.evaluate(C),C.properties())}],[[po,al],function(C,k){var V=k[0],ne=k[1];return Qs(V.evaluate(C),ne.evaluate(C))}]]},"feature-state":[$n,[po],function(C,k){var V=k[0];return Qs(V.evaluate(C),C.featureState||{})}],properties:[al,[],function(C){return C.properties()}],"geometry-type":[po,[],function(C){return C.geometryType()}],id:[$n,[],function(C){return C.id()}],zoom:[Sn,[],function(C){return C.globals.zoom}],"heatmap-density":[Sn,[],function(C){return C.globals.heatmapDensity||0}],"line-progress":[Sn,[],function(C){return C.globals.lineProgress||0}],accumulated:[$n,[],function(C){return C.globals.accumulated===void 0?null:C.globals.accumulated}],"+":[Sn,Ks(Sn),function(C,k){for(var V=0,ne=0,xe=k;ne":[ro,[po,$n],function(C,k){var V=k[0],ne=k[1],xe=C.properties()[V.value],Ie=ne.value;return typeof xe==typeof Ie&&xe>Ie}],"filter-id->":[ro,[$n],function(C,k){var V=k[0],ne=C.id(),xe=V.value;return typeof ne==typeof xe&&ne>xe}],"filter-<=":[ro,[po,$n],function(C,k){var V=k[0],ne=k[1],xe=C.properties()[V.value],Ie=ne.value;return typeof xe==typeof Ie&&xe<=Ie}],"filter-id-<=":[ro,[$n],function(C,k){var V=k[0],ne=C.id(),xe=V.value;return typeof ne==typeof xe&&ne<=xe}],"filter->=":[ro,[po,$n],function(C,k){var V=k[0],ne=k[1],xe=C.properties()[V.value],Ie=ne.value;return typeof xe==typeof Ie&&xe>=Ie}],"filter-id->=":[ro,[$n],function(C,k){var V=k[0],ne=C.id(),xe=V.value;return typeof ne==typeof xe&&ne>=xe}],"filter-has":[ro,[$n],function(C,k){var V=k[0];return V.value in C.properties()}],"filter-has-id":[ro,[],function(C){return C.id()!==null&&C.id()!==void 0}],"filter-type-in":[ro,[zl(po)],function(C,k){var V=k[0];return V.value.indexOf(C.geometryType())>=0}],"filter-id-in":[ro,[zl($n)],function(C,k){var V=k[0];return V.value.indexOf(C.id())>=0}],"filter-in-small":[ro,[po,zl($n)],function(C,k){var V=k[0],ne=k[1];return ne.value.indexOf(C.properties()[V.value])>=0}],"filter-in-large":[ro,[po,zl($n)],function(C,k){var V=k[0],ne=k[1];return Rs(C.properties()[V.value],ne.value,0,ne.value.length-1)}],all:{type:ro,overloads:[[[ro,ro],function(C,k){var V=k[0],ne=k[1];return V.evaluate(C)&&ne.evaluate(C)}],[Ks(ro),function(C,k){for(var V=0,ne=k;V-1}function Un(C){return!!C.expression&&C.expression.interpolated}function Io(C){return C instanceof Number?"number":C instanceof String?"string":C instanceof Boolean?"boolean":Array.isArray(C)?"array":C===null?"null":typeof C}function Xs(C){return typeof C=="object"&&C!==null&&!Array.isArray(C)}function Ls(C){return C}function ou(C,k){var V=k.type==="color",ne=C.stops&&typeof C.stops[0][0]=="object",xe=ne||C.property!==void 0,Ie=ne||!xe,Ve=C.type||(Un(k)?"exponential":"interval");if(V&&(C=Bs({},C),C.stops&&(C.stops=C.stops.map(function(Nn){return[Nn[0],Us.parse(Nn[1])]})),C.default?C.default=Us.parse(C.default):C.default=Us.parse(k.default)),C.colorSpace&&C.colorSpace!=="rgb"&&!Lf[C.colorSpace])throw new Error("Unknown color space: "+C.colorSpace);var ht,Rt,Ht;if(Ve==="exponential")ht=yu;else if(Ve==="interval")ht=Lc;else if(Ve==="categorical"){ht=Zu,Rt=Object.create(null);for(var tr=0,Cr=C.stops;tr=C.stops[ne-1][0])return C.stops[ne-1][1];var xe=vu(C.stops.map(function(Ie){return Ie[0]}),V);return C.stops[xe][1]}function yu(C,k,V){var ne=C.base!==void 0?C.base:1;if(Io(V)!=="number")return Iu(C.default,k.default);var xe=C.stops.length;if(xe===1||V<=C.stops[0][0])return C.stops[0][1];if(V>=C.stops[xe-1][0])return C.stops[xe-1][1];var Ie=vu(C.stops.map(function(Cr){return Cr[0]}),V),Ve=wu(V,ne,C.stops[Ie][0],C.stops[Ie+1][0]),ht=C.stops[Ie][1],Rt=C.stops[Ie+1][1],Ht=Bu[k.type]||Ls;if(C.colorSpace&&C.colorSpace!=="rgb"){var tr=Lf[C.colorSpace];Ht=function(Cr,Xr){return tr.reverse(tr.interpolate(tr.forward(Cr),tr.forward(Xr),Ve))}}return typeof ht.evaluate=="function"?{evaluate:function(){for(var Xr=[],qr=arguments.length;qr--;)Xr[qr]=arguments[qr];var pa=ht.evaluate.apply(void 0,Xr),ja=Rt.evaluate.apply(void 0,Xr);if(!(pa===void 0||ja===void 0))return Ht(pa,ja,Ve)}}:Ht(ht,Rt,Ve)}function Pc(C,k,V){return k.type==="color"?V=Us.parse(V):k.type==="formatted"?V=nu.fromString(V.toString()):k.type==="resolvedImage"?V=Ll.fromString(V.toString()):Io(V)!==k.type&&(k.type!=="enum"||!k.values[V])&&(V=void 0),Iu(V,C.default,k.default)}function wu(C,k,V,ne){var xe=ne-V,Ie=C-V;return xe===0?0:k===1?Ie/xe:(Math.pow(k,Ie)-1)/(Math.pow(k,xe)-1)}var gc=function(k,V){this.expression=k,this._warningHistory={},this._evaluator=new Ss,this._defaultValue=V?Se(V):null,this._enumValues=V&&V.type==="enum"?V.values:null};gc.prototype.evaluateWithoutErrorHandling=function(k,V,ne,xe,Ie,Ve){return this._evaluator.globals=k,this._evaluator.feature=V,this._evaluator.featureState=ne,this._evaluator.canonical=xe,this._evaluator.availableImages=Ie||null,this._evaluator.formattedSection=Ve,this.expression.evaluate(this._evaluator)},gc.prototype.evaluate=function(k,V,ne,xe,Ie,Ve){this._evaluator.globals=k,this._evaluator.feature=V||null,this._evaluator.featureState=ne||null,this._evaluator.canonical=xe,this._evaluator.availableImages=Ie||null,this._evaluator.formattedSection=Ve||null;try{var ht=this.expression.evaluate(this._evaluator);if(ht==null||typeof ht=="number"&&ht!==ht)return this._defaultValue;if(this._enumValues&&!(ht in this._enumValues))throw new Vs("Expected value to be one of "+Object.keys(this._enumValues).map(function(Rt){return JSON.stringify(Rt)}).join(", ")+", but found "+JSON.stringify(ht)+" instead.");return ht}catch(Rt){return this._warningHistory[Rt.message]||(this._warningHistory[Rt.message]=!0,typeof console<"u"&&console.warn(Rt.message)),this._defaultValue}};function fo(C){return Array.isArray(C)&&C.length>0&&typeof C[0]=="string"&&C[0]in _o}function zo(C,k){var V=new nl(_o,[],k?we(k):void 0),ne=V.parse(C,void 0,void 0,void 0,k&&k.type==="string"?{typeAnnotation:"coerce"}:void 0);return ne?ys(new gc(ne,k)):Fl(V.errors)}var Ic=function(k,V){this.kind=k,this._styleExpression=V,this.isStateDependent=k!=="constant"&&!ml(V.expression)};Ic.prototype.evaluateWithoutErrorHandling=function(k,V,ne,xe,Ie,Ve){return this._styleExpression.evaluateWithoutErrorHandling(k,V,ne,xe,Ie,Ve)},Ic.prototype.evaluate=function(k,V,ne,xe,Ie,Ve){return this._styleExpression.evaluate(k,V,ne,xe,Ie,Ve)};var lc=function(k,V,ne,xe){this.kind=k,this.zoomStops=ne,this._styleExpression=V,this.isStateDependent=k!=="camera"&&!ml(V.expression),this.interpolationType=xe};lc.prototype.evaluateWithoutErrorHandling=function(k,V,ne,xe,Ie,Ve){return this._styleExpression.evaluateWithoutErrorHandling(k,V,ne,xe,Ie,Ve)},lc.prototype.evaluate=function(k,V,ne,xe,Ie,Ve){return this._styleExpression.evaluate(k,V,ne,xe,Ie,Ve)},lc.prototype.interpolationFactor=function(k,V,ne){return this.interpolationType?ru.interpolationFactor(this.interpolationType,k,V,ne):0};function Yu(C,k){if(C=zo(C,k),C.result==="error")return C;var V=C.value.expression,ne=Nf(V);if(!ne&&!yl(k))return Fl([new ms("","data expressions not supported")]);var xe=Lu(V,["zoom"]);if(!xe&&!sl(k))return Fl([new ms("","zoom expressions not supported")]);var Ie=ae(V);if(!Ie&&!xe)return Fl([new ms("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(Ie instanceof ms)return Fl([Ie]);if(Ie instanceof ru&&!Un(k))return Fl([new ms("",'"interpolate" expressions cannot be used with this property')]);if(!Ie)return ys(ne?new Ic("constant",C.value):new Ic("source",C.value));var Ve=Ie instanceof ru?Ie.interpolation:void 0;return ys(ne?new lc("camera",C.value,Ie.labels,Ve):new lc("composite",C.value,Ie.labels,Ve))}var Ne=function(k,V){this._parameters=k,this._specification=V,Bs(this,ou(this._parameters,this._specification))};Ne.deserialize=function(k){return new Ne(k._parameters,k._specification)},Ne.serialize=function(k){return{_parameters:k._parameters,_specification:k._specification}};function R(C,k){if(Xs(C))return new Ne(C,k);if(fo(C)){var V=Yu(C,k);if(V.result==="error")throw new Error(V.value.map(function(xe){return xe.key+": "+xe.message}).join(", "));return V.value}else{var ne=C;return typeof C=="string"&&k.type==="color"&&(ne=Us.parse(C)),{kind:"constant",evaluate:function(){return ne}}}}function ae(C){var k=null;if(C instanceof Ec)k=ae(C.result);else if(C instanceof Xu)for(var V=0,ne=C.args;Vne.maximum?[new Cn(k,V,V+" is greater than the maximum value "+ne.maximum)]:[]}function Bt(C){var k=C.valueSpec,V=uo(C.value.type),ne,xe={},Ie,Ve,ht=V!=="categorical"&&C.value.property===void 0,Rt=!ht,Ht=Io(C.value.stops)==="array"&&Io(C.value.stops[0])==="array"&&Io(C.value.stops[0][0])==="object",tr=Oe({key:C.key,value:C.value,valueSpec:C.styleSpec.function,style:C.style,styleSpec:C.styleSpec,objectElementValidators:{stops:Cr,default:pa}});return V==="identity"&&ht&&tr.push(new Cn(C.key,C.value,'missing required property "property"')),V!=="identity"&&!C.value.stops&&tr.push(new Cn(C.key,C.value,'missing required property "stops"')),V==="exponential"&&C.valueSpec.expression&&!Un(C.valueSpec)&&tr.push(new Cn(C.key,C.value,"exponential functions not supported")),C.styleSpec.$version>=8&&(Rt&&!yl(C.valueSpec)?tr.push(new Cn(C.key,C.value,"property functions not supported")):ht&&!sl(C.valueSpec)&&tr.push(new Cn(C.key,C.value,"zoom functions not supported"))),(V==="categorical"||Ht)&&C.value.property===void 0&&tr.push(new Cn(C.key,C.value,'"property" property is required')),tr;function Cr(ja){if(V==="identity")return[new Cn(ja.key,ja.value,'identity function may not have a "stops" property')];var Ei=[],li=ja.value;return Ei=Ei.concat(pt({key:ja.key,value:li,valueSpec:ja.valueSpec,style:ja.style,styleSpec:ja.styleSpec,arrayElementValidator:Xr})),Io(li)==="array"&&li.length===0&&Ei.push(new Cn(ja.key,li,"array must have at least one stop")),Ei}function Xr(ja){var Ei=[],li=ja.value,en=ja.key;if(Io(li)!=="array")return[new Cn(en,li,"array expected, "+Io(li)+" found")];if(li.length!==2)return[new Cn(en,li,"array length 2 expected, length "+li.length+" found")];if(Ht){if(Io(li[0])!=="object")return[new Cn(en,li,"object expected, "+Io(li[0])+" found")];if(li[0].zoom===void 0)return[new Cn(en,li,"object stop key must have zoom")];if(li[0].value===void 0)return[new Cn(en,li,"object stop key must have value")];if(Ve&&Ve>uo(li[0].zoom))return[new Cn(en,li[0].zoom,"stop zoom values must appear in ascending order")];uo(li[0].zoom)!==Ve&&(Ve=uo(li[0].zoom),Ie=void 0,xe={}),Ei=Ei.concat(Oe({key:en+"[0]",value:li[0],valueSpec:{zoom:{}},style:ja.style,styleSpec:ja.styleSpec,objectElementValidators:{zoom:At,value:qr}}))}else Ei=Ei.concat(qr({key:en+"[0]",value:li[0],valueSpec:{},style:ja.style,styleSpec:ja.styleSpec},li));return fo($s(li[1]))?Ei.concat([new Cn(en+"[1]",li[1],"expressions are not allowed in function stops.")]):Ei.concat(So({key:en+"[1]",value:li[1],valueSpec:k,style:ja.style,styleSpec:ja.styleSpec}))}function qr(ja,Ei){var li=Io(ja.value),en=uo(ja.value),Ni=ja.value!==null?ja.value:Ei;if(!ne)ne=li;else if(li!==ne)return[new Cn(ja.key,Ni,li+" stop domain type must match previous stop domain type "+ne)];if(li!=="number"&&li!=="string"&&li!=="boolean")return[new Cn(ja.key,Ni,"stop domain value must be a number, string, or boolean")];if(li!=="number"&&V!=="categorical"){var Qi="number expected, "+li+" found";return yl(k)&&V===void 0&&(Qi+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Cn(ja.key,Ni,Qi)]}return V==="categorical"&&li==="number"&&(!isFinite(en)||Math.floor(en)!==en)?[new Cn(ja.key,Ni,"integer expected, found "+en)]:V!=="categorical"&&li==="number"&&Ie!==void 0&&en=2&&C[1]!=="$id"&&C[1]!=="$type";case"in":return C.length>=3&&(typeof C[1]!="string"||Array.isArray(C[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return C.length!==3||Array.isArray(C[1])||Array.isArray(C[2]);case"any":case"all":for(var k=0,V=C.slice(1);kk?1:0}function dt(C){if(!Array.isArray(C))return!1;if(C[0]==="within")return!0;for(var k=1;k"||k==="<="||k===">="?wt(C[1],C[2],k):k==="any"?Dt(C.slice(1)):k==="all"?["all"].concat(C.slice(1).map(Ct)):k==="none"?["all"].concat(C.slice(1).map(Ct).map(Er)):k==="in"?ur(C[1],C.slice(2)):k==="!in"?Er(ur(C[1],C.slice(2))):k==="has"?mr(C[1]):k==="!has"?Er(mr(C[1])):k==="within"?C:!0;return V}function wt(C,k,V){switch(C){case"$type":return["filter-type-"+V,k];case"$id":return["filter-id-"+V,k];default:return["filter-"+V,C,k]}}function Dt(C){return["any"].concat(C.map(Ct))}function ur(C,k){if(k.length===0)return!1;switch(C){case"$type":return["filter-type-in",["literal",k]];case"$id":return["filter-id-in",["literal",k]];default:return k.length>200&&!k.some(function(V){return typeof V!=typeof k[0]})?["filter-in-large",C,["literal",k.sort(ut)]]:["filter-in-small",C,["literal",k]]}}function mr(C){switch(C){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",C]}}function Er(C){return["!",C]}function Br(C){return sa($s(C.value))?$t(Bs({},C,{expressionContext:"filter",valueSpec:{value:"boolean"}})):Qr(C)}function Qr(C){var k=C.value,V=C.key;if(Io(k)!=="array")return[new Cn(V,k,"array expected, "+Io(k)+" found")];var ne=C.styleSpec,xe,Ie=[];if(k.length<1)return[new Cn(V,k,"filter array must have at least 1 element")];switch(Ie=Ie.concat(Yr({key:V+"[0]",value:k[0],valueSpec:ne.filter_operator,style:C.style,styleSpec:C.styleSpec})),uo(k[0])){case"<":case"<=":case">":case">=":k.length>=2&&uo(k[1])==="$type"&&Ie.push(new Cn(V,k,'"$type" cannot be use with operator "'+k[0]+'"'));case"==":case"!=":k.length!==3&&Ie.push(new Cn(V,k,'filter array for operator "'+k[0]+'" must have 3 elements'));case"in":case"!in":k.length>=2&&(xe=Io(k[1]),xe!=="string"&&Ie.push(new Cn(V+"[1]",k[1],"string expected, "+xe+" found")));for(var Ve=2;Ve=tr[qr+0]&&ne>=tr[qr+1])?(Ve[Xr]=!0,Ie.push(Ht[Xr])):Ve[Xr]=!1}}},su.prototype._forEachCell=function(C,k,V,ne,xe,Ie,Ve,ht){for(var Rt=this._convertToCellCoord(C),Ht=this._convertToCellCoord(k),tr=this._convertToCellCoord(V),Cr=this._convertToCellCoord(ne),Xr=Rt;Xr<=tr;Xr++)for(var qr=Ht;qr<=Cr;qr++){var pa=this.d*qr+Xr;if(!(ht&&!ht(this._convertFromCellCoord(Xr),this._convertFromCellCoord(qr),this._convertFromCellCoord(Xr+1),this._convertFromCellCoord(qr+1)))&&xe.call(this,C,k,V,ne,pa,Ie,Ve,ht))return}},su.prototype._convertFromCellCoord=function(C){return(C-this.padding)/this.scale},su.prototype._convertToCellCoord=function(C){return Math.max(0,Math.min(this.d-1,Math.floor(C*this.scale)+this.padding))},su.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var C=this.cells,k=wl+this.cells.length+1+1,V=0,ne=0;ne=0)){var Cr=C[tr];Ht[tr]=Vl[Rt].shallow.indexOf(tr)>=0?Cr:_t(Cr,k)}C instanceof Error&&(Ht.message=C.message)}if(Ht.$name)throw new Error("$name property is reserved for worker serialization logic.");return Rt!=="Object"&&(Ht.$name=Rt),Ht}throw new Error("can't serialize object of type "+typeof C)}function St(C){if(C==null||typeof C=="boolean"||typeof C=="number"||typeof C=="string"||C instanceof Boolean||C instanceof Number||C instanceof String||C instanceof Date||C instanceof RegExp||et(C)||vt(C)||ArrayBuffer.isView(C)||C instanceof uc)return C;if(Array.isArray(C))return C.map(St);if(typeof C=="object"){var k=C.$name||"Object",V=Vl[k],ne=V.klass;if(!ne)throw new Error("can't deserialize unregistered class "+k);if(ne.deserialize)return ne.deserialize(C);for(var xe=Object.create(ne.prototype),Ie=0,Ve=Object.keys(C);Ie=0?Rt:St(Rt)}}return xe}throw new Error("can't deserialize object of type "+typeof C)}var ar=function(){this.first=!0};ar.prototype.update=function(k,V){var ne=Math.floor(k);return this.first?(this.first=!1,this.lastIntegerZoom=ne,this.lastIntegerZoomTime=0,this.lastZoom=k,this.lastFloorZoom=ne,!0):(this.lastFloorZoom>ne?(this.lastIntegerZoom=ne+1,this.lastIntegerZoomTime=V):this.lastFloorZoom=128&&C<=255},Arabic:function(C){return C>=1536&&C<=1791},"Arabic Supplement":function(C){return C>=1872&&C<=1919},"Arabic Extended-A":function(C){return C>=2208&&C<=2303},"Hangul Jamo":function(C){return C>=4352&&C<=4607},"Unified Canadian Aboriginal Syllabics":function(C){return C>=5120&&C<=5759},Khmer:function(C){return C>=6016&&C<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(C){return C>=6320&&C<=6399},"General Punctuation":function(C){return C>=8192&&C<=8303},"Letterlike Symbols":function(C){return C>=8448&&C<=8527},"Number Forms":function(C){return C>=8528&&C<=8591},"Miscellaneous Technical":function(C){return C>=8960&&C<=9215},"Control Pictures":function(C){return C>=9216&&C<=9279},"Optical Character Recognition":function(C){return C>=9280&&C<=9311},"Enclosed Alphanumerics":function(C){return C>=9312&&C<=9471},"Geometric Shapes":function(C){return C>=9632&&C<=9727},"Miscellaneous Symbols":function(C){return C>=9728&&C<=9983},"Miscellaneous Symbols and Arrows":function(C){return C>=11008&&C<=11263},"CJK Radicals Supplement":function(C){return C>=11904&&C<=12031},"Kangxi Radicals":function(C){return C>=12032&&C<=12255},"Ideographic Description Characters":function(C){return C>=12272&&C<=12287},"CJK Symbols and Punctuation":function(C){return C>=12288&&C<=12351},Hiragana:function(C){return C>=12352&&C<=12447},Katakana:function(C){return C>=12448&&C<=12543},Bopomofo:function(C){return C>=12544&&C<=12591},"Hangul Compatibility Jamo":function(C){return C>=12592&&C<=12687},Kanbun:function(C){return C>=12688&&C<=12703},"Bopomofo Extended":function(C){return C>=12704&&C<=12735},"CJK Strokes":function(C){return C>=12736&&C<=12783},"Katakana Phonetic Extensions":function(C){return C>=12784&&C<=12799},"Enclosed CJK Letters and Months":function(C){return C>=12800&&C<=13055},"CJK Compatibility":function(C){return C>=13056&&C<=13311},"CJK Unified Ideographs Extension A":function(C){return C>=13312&&C<=19903},"Yijing Hexagram Symbols":function(C){return C>=19904&&C<=19967},"CJK Unified Ideographs":function(C){return C>=19968&&C<=40959},"Yi Syllables":function(C){return C>=40960&&C<=42127},"Yi Radicals":function(C){return C>=42128&&C<=42191},"Hangul Jamo Extended-A":function(C){return C>=43360&&C<=43391},"Hangul Syllables":function(C){return C>=44032&&C<=55215},"Hangul Jamo Extended-B":function(C){return C>=55216&&C<=55295},"Private Use Area":function(C){return C>=57344&&C<=63743},"CJK Compatibility Ideographs":function(C){return C>=63744&&C<=64255},"Arabic Presentation Forms-A":function(C){return C>=64336&&C<=65023},"Vertical Forms":function(C){return C>=65040&&C<=65055},"CJK Compatibility Forms":function(C){return C>=65072&&C<=65103},"Small Form Variants":function(C){return C>=65104&&C<=65135},"Arabic Presentation Forms-B":function(C){return C>=65136&&C<=65279},"Halfwidth and Fullwidth Forms":function(C){return C>=65280&&C<=65519}};function gr(C){for(var k=0,V=C;k=65097&&C<=65103)||zt["CJK Compatibility Ideographs"](C)||zt["CJK Compatibility"](C)||zt["CJK Radicals Supplement"](C)||zt["CJK Strokes"](C)||zt["CJK Symbols and Punctuation"](C)&&!(C>=12296&&C<=12305)&&!(C>=12308&&C<=12319)&&C!==12336||zt["CJK Unified Ideographs Extension A"](C)||zt["CJK Unified Ideographs"](C)||zt["Enclosed CJK Letters and Months"](C)||zt["Hangul Compatibility Jamo"](C)||zt["Hangul Jamo Extended-A"](C)||zt["Hangul Jamo Extended-B"](C)||zt["Hangul Jamo"](C)||zt["Hangul Syllables"](C)||zt.Hiragana(C)||zt["Ideographic Description Characters"](C)||zt.Kanbun(C)||zt["Kangxi Radicals"](C)||zt["Katakana Phonetic Extensions"](C)||zt.Katakana(C)&&C!==12540||zt["Halfwidth and Fullwidth Forms"](C)&&C!==65288&&C!==65289&&C!==65293&&!(C>=65306&&C<=65310)&&C!==65339&&C!==65341&&C!==65343&&!(C>=65371&&C<=65503)&&C!==65507&&!(C>=65512&&C<=65519)||zt["Small Form Variants"](C)&&!(C>=65112&&C<=65118)&&!(C>=65123&&C<=65126)||zt["Unified Canadian Aboriginal Syllabics"](C)||zt["Unified Canadian Aboriginal Syllabics Extended"](C)||zt["Vertical Forms"](C)||zt["Yijing Hexagram Symbols"](C)||zt["Yi Syllables"](C)||zt["Yi Radicals"](C))}function ri(C){return!!(zt["Latin-1 Supplement"](C)&&(C===167||C===169||C===174||C===177||C===188||C===189||C===190||C===215||C===247)||zt["General Punctuation"](C)&&(C===8214||C===8224||C===8225||C===8240||C===8241||C===8251||C===8252||C===8258||C===8263||C===8264||C===8265||C===8273)||zt["Letterlike Symbols"](C)||zt["Number Forms"](C)||zt["Miscellaneous Technical"](C)&&(C>=8960&&C<=8967||C>=8972&&C<=8991||C>=8996&&C<=9e3||C===9003||C>=9085&&C<=9114||C>=9150&&C<=9165||C===9167||C>=9169&&C<=9179||C>=9186&&C<=9215)||zt["Control Pictures"](C)&&C!==9251||zt["Optical Character Recognition"](C)||zt["Enclosed Alphanumerics"](C)||zt["Geometric Shapes"](C)||zt["Miscellaneous Symbols"](C)&&!(C>=9754&&C<=9759)||zt["Miscellaneous Symbols and Arrows"](C)&&(C>=11026&&C<=11055||C>=11088&&C<=11097||C>=11192&&C<=11243)||zt["CJK Symbols and Punctuation"](C)||zt.Katakana(C)||zt["Private Use Area"](C)||zt["CJK Compatibility Forms"](C)||zt["Small Form Variants"](C)||zt["Halfwidth and Fullwidth Forms"](C)||C===8734||C===8756||C===8757||C>=9984&&C<=10087||C>=10102&&C<=10131||C===65532||C===65533)}function ni(C){return!(ya(C)||ri(C))}function Ma(C){return zt.Arabic(C)||zt["Arabic Supplement"](C)||zt["Arabic Extended-A"](C)||zt["Arabic Presentation Forms-A"](C)||zt["Arabic Presentation Forms-B"](C)}function Na(C){return C>=1424&&C<=2303||zt["Arabic Presentation Forms-A"](C)||zt["Arabic Presentation Forms-B"](C)}function Ka(C,k){return!(!k&&Na(C)||C>=2304&&C<=3583||C>=3840&&C<=4255||zt.Khmer(C))}function vi(C){for(var k=0,V=C;k-1&&(an=Pa.error),sn&&sn(C)};function Zn(){eo.fire(new Gr("pluginStateChange",{pluginStatus:an,pluginURL:vn}))}var eo=new Ur,$o=function(){return an},io=function(C){return C({pluginStatus:an,pluginURL:vn}),eo.on("pluginStateChange",C),C},Zo=function(C,k,V){if(V===void 0&&(V=!1),an===Pa.deferred||an===Pa.loading||an===Pa.loaded)throw new Error("setRTLTextPlugin cannot be called multiple times.");vn=be.resolveURL(C),an=Pa.deferred,sn=k,Zn(),V||ul()},ul=function(){if(an!==Pa.deferred||!vn)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");an=Pa.loading,Zn(),vn&&ma({url:vn},function(C){C?Pn(C):(an=Pa.loaded,Zn())})},el={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return an===Pa.loaded||el.applyArabicShaping!=null},isLoading:function(){return an===Pa.loading},setState:function(k){an=k.pluginStatus,vn=k.pluginURL},isParsed:function(){return el.applyArabicShaping!=null&&el.processBidirectionalText!=null&&el.processStyledBidirectionalText!=null},getPluginURL:function(){return vn}},_l=function(){!el.isLoading()&&!el.isLoaded()&&$o()==="deferred"&&ul()},gn=function(k,V){this.zoom=k,V?(this.now=V.now,this.fadeDuration=V.fadeDuration,this.zoomHistory=V.zoomHistory,this.transition=V.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new ar,this.transition={})};gn.prototype.isSupportedScript=function(k){return ui(k,el.isLoaded())},gn.prototype.crossFadingFactor=function(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)},gn.prototype.getCrossfadeParameters=function(){var k=this.zoom,V=k-Math.floor(k),ne=this.crossFadingFactor();return k>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:V+(1-V)*ne}:{fromScale:.5,toScale:1,t:1-(1-ne)*V}};var vo=function(k,V){this.property=k,this.value=V,this.expression=R(V===void 0?k.specification.default:V,k.specification)};vo.prototype.isDataDriven=function(){return this.expression.kind==="source"||this.expression.kind==="composite"},vo.prototype.possiblyEvaluate=function(k,V,ne){return this.property.possiblyEvaluate(this,k,V,ne)};var cs=function(k){this.property=k,this.value=new vo(k,void 0)};cs.prototype.transitioned=function(k,V){return new Tl(this.property,this.value,V,y({},k.transition,this.transition),k.now)},cs.prototype.untransitioned=function(){return new Tl(this.property,this.value,null,{},0)};var ps=function(k){this._properties=k,this._values=Object.create(k.defaultTransitionablePropertyValues)};ps.prototype.getValue=function(k){return O(this._values[k].value.value)},ps.prototype.setValue=function(k,V){this._values.hasOwnProperty(k)||(this._values[k]=new cs(this._values[k].property)),this._values[k].value=new vo(this._values[k].property,V===null?void 0:O(V))},ps.prototype.getTransition=function(k){return O(this._values[k].transition)},ps.prototype.setTransition=function(k,V){this._values.hasOwnProperty(k)||(this._values[k]=new cs(this._values[k].property)),this._values[k].transition=O(V)||void 0},ps.prototype.serialize=function(){for(var k={},V=0,ne=Object.keys(this._values);Vthis.end)return this.prior=null,Ie;if(this.value.isDataDriven())return this.prior=null,Ie;if(xeVe.zoomHistory.lastIntegerZoom?{from:ne,to:xe}:{from:Ie,to:xe}},k.prototype.interpolate=function(ne){return ne},k}(Yt),ua=function(k){this.specification=k};ua.prototype.possiblyEvaluate=function(k,V,ne,xe){if(k.value!==void 0)if(k.expression.kind==="constant"){var Ie=k.expression.evaluate(V,null,{},ne,xe);return this._calculate(Ie,Ie,Ie,V)}else return this._calculate(k.expression.evaluate(new gn(Math.floor(V.zoom-1),V)),k.expression.evaluate(new gn(Math.floor(V.zoom),V)),k.expression.evaluate(new gn(Math.floor(V.zoom+1),V)),V)},ua.prototype._calculate=function(k,V,ne,xe){var Ie=xe.zoom;return Ie>xe.zoomHistory.lastIntegerZoom?{from:k,to:V}:{from:ne,to:V}},ua.prototype.interpolate=function(k){return k};var Aa=function(k){this.specification=k};Aa.prototype.possiblyEvaluate=function(k,V,ne,xe){return!!k.expression.evaluate(V,null,{},ne,xe)},Aa.prototype.interpolate=function(){return!1};var xa=function(k){this.properties=k,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(var V in k){var ne=k[V];ne.specification.overridable&&this.overridableProperties.push(V);var xe=this.defaultPropertyValues[V]=new vo(ne,void 0),Ie=this.defaultTransitionablePropertyValues[V]=new cs(ne);this.defaultTransitioningPropertyValues[V]=Ie.untransitioned(),this.defaultPossiblyEvaluatedValues[V]=xe.possiblyEvaluate({})}};de("DataDrivenProperty",Yt),de("DataConstantProperty",nt),de("CrossFadedDataDrivenProperty",cr),de("CrossFadedProperty",ua),de("ColorRampProperty",Aa);var wa="-transition",Ja=function(C){function k(V,ne){if(C.call(this),this.id=V.id,this.type=V.type,this._featureFilter={filter:function(){return!0},needGeometry:!1},V.type!=="custom"&&(V=V,this.metadata=V.metadata,this.minzoom=V.minzoom,this.maxzoom=V.maxzoom,V.type!=="background"&&(this.source=V.source,this.sourceLayer=V["source-layer"],this.filter=V.filter),ne.layout&&(this._unevaluatedLayout=new Tu(ne.layout)),ne.paint)){this._transitionablePaint=new ps(ne.paint);for(var xe in V.paint)this.setPaintProperty(xe,V.paint[xe],{validate:!1});for(var Ie in V.layout)this.setLayoutProperty(Ie,V.layout[Ie],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new yc(ne.paint)}}return C&&(k.__proto__=C),k.prototype=Object.create(C&&C.prototype),k.prototype.constructor=k,k.prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},k.prototype.getLayoutProperty=function(ne){return ne==="visibility"?this.visibility:this._unevaluatedLayout.getValue(ne)},k.prototype.setLayoutProperty=function(ne,xe,Ie){if(Ie===void 0&&(Ie={}),xe!=null){var Ve="layers."+this.id+".layout."+ne;if(this._validate($l,Ve,ne,xe,Ie))return}if(ne==="visibility"){this.visibility=xe;return}this._unevaluatedLayout.setValue(ne,xe)},k.prototype.getPaintProperty=function(ne){return z(ne,wa)?this._transitionablePaint.getTransition(ne.slice(0,-wa.length)):this._transitionablePaint.getValue(ne)},k.prototype.setPaintProperty=function(ne,xe,Ie){if(Ie===void 0&&(Ie={}),xe!=null){var Ve="layers."+this.id+".paint."+ne;if(this._validate(Pl,Ve,ne,xe,Ie))return!1}if(z(ne,wa))return this._transitionablePaint.setTransition(ne.slice(0,-wa.length),xe||void 0),!1;var ht=this._transitionablePaint._values[ne],Rt=ht.property.specification["property-type"]==="cross-faded-data-driven",Ht=ht.value.isDataDriven(),tr=ht.value;this._transitionablePaint.setValue(ne,xe),this._handleSpecialPaintPropertyUpdate(ne);var Cr=this._transitionablePaint._values[ne].value,Xr=Cr.isDataDriven();return Xr||Ht||Rt||this._handleOverridablePaintPropertyUpdate(ne,tr,Cr)},k.prototype._handleSpecialPaintPropertyUpdate=function(ne){},k.prototype._handleOverridablePaintPropertyUpdate=function(ne,xe,Ie){return!1},k.prototype.isHidden=function(ne){return this.minzoom&&ne=this.maxzoom?!0:this.visibility==="none"},k.prototype.updateTransitions=function(ne){this._transitioningPaint=this._transitionablePaint.transitioned(ne,this._transitioningPaint)},k.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},k.prototype.recalculate=function(ne,xe){ne.getCrossfadeParameters&&(this._crossfadeParameters=ne.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(ne,void 0,xe)),this.paint=this._transitioningPaint.possiblyEvaluate(ne,void 0,xe)},k.prototype.serialize=function(){var ne={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(ne.layout=ne.layout||{},ne.layout.visibility=this.visibility),B(ne,function(xe,Ie){return xe!==void 0&&!(Ie==="layout"&&!Object.keys(xe).length)&&!(Ie==="paint"&&!Object.keys(xe).length)})},k.prototype._validate=function(ne,xe,Ie,Ve,ht){return ht===void 0&&(ht={}),ht&&ht.validate===!1?!1:Ru(this,ne.call(es,{key:xe,layerType:this.type,objectKey:Ie,value:Ve,styleSpec:Ui,style:{glyphs:!0,sprite:!0}}))},k.prototype.is3D=function(){return!1},k.prototype.isTileClipped=function(){return!1},k.prototype.hasOffscreenPass=function(){return!1},k.prototype.resize=function(){},k.prototype.isStateDependent=function(){for(var ne in this.paint._values){var xe=this.paint.get(ne);if(!(!(xe instanceof Il)||!yl(xe.property.specification))&&(xe.value.kind==="source"||xe.value.kind==="composite")&&xe.value.isStateDependent)return!0}return!1},k}(Ur),Ai={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},bi=function(k,V){this._structArray=k,this._pos1=V*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8},fi=128,yn=5,Oi=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};Oi.serialize=function(k,V){return k._trim(),V&&(k.isTransferred=!0,V.push(k.arrayBuffer)),{length:k.length,arrayBuffer:k.arrayBuffer}},Oi.deserialize=function(k){var V=Object.create(this.prototype);return V.arrayBuffer=k.arrayBuffer,V.length=k.length,V.capacity=k.arrayBuffer.byteLength/V.bytesPerElement,V._refreshViews(),V},Oi.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},Oi.prototype.clear=function(){this.length=0},Oi.prototype.resize=function(k){this.reserve(k),this.length=k},Oi.prototype.reserve=function(k){if(k>this.capacity){this.capacity=Math.max(k,Math.floor(this.capacity*yn),fi),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var V=this.uint8;this._refreshViews(),V&&this.uint8.set(V)}},Oi.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};function ki(C,k){k===void 0&&(k=1);var V=0,ne=0,xe=C.map(function(Ve){var ht=qa(Ve.type),Rt=V=ea(V,Math.max(k,ht)),Ht=Ve.components||1;return ne=Math.max(ne,ht),V+=ht*Ht,{name:Ve.name,type:Ve.type,components:Ht,offset:Rt}}),Ie=ea(V,Math.max(ne,k));return{members:xe,size:Ie,alignment:k}}function qa(C){return Ai[C].BYTES_PER_ELEMENT}function ea(C,k){return Math.ceil(C/k)*k}var Ea=function(C){function k(){C.apply(this,arguments)}return C&&(k.__proto__=C),k.prototype=Object.create(C&&C.prototype),k.prototype.constructor=k,k.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},k.prototype.emplaceBack=function(ne,xe){var Ie=this.length;return this.resize(Ie+1),this.emplace(Ie,ne,xe)},k.prototype.emplace=function(ne,xe,Ie){var Ve=ne*2;return this.int16[Ve+0]=xe,this.int16[Ve+1]=Ie,ne},k}(Oi);Ea.prototype.bytesPerElement=4,de("StructArrayLayout2i4",Ea);var ii=function(C){function k(){C.apply(this,arguments)}return C&&(k.__proto__=C),k.prototype=Object.create(C&&C.prototype),k.prototype.constructor=k,k.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},k.prototype.emplaceBack=function(ne,xe,Ie,Ve){var ht=this.length;return this.resize(ht+1),this.emplace(ht,ne,xe,Ie,Ve)},k.prototype.emplace=function(ne,xe,Ie,Ve,ht){var Rt=ne*4;return this.int16[Rt+0]=xe,this.int16[Rt+1]=Ie,this.int16[Rt+2]=Ve,this.int16[Rt+3]=ht,ne},k}(Oi);ii.prototype.bytesPerElement=8,de("StructArrayLayout4i8",ii);var gi=function(C){function k(){C.apply(this,arguments)}return C&&(k.__proto__=C),k.prototype=Object.create(C&&C.prototype),k.prototype.constructor=k,k.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},k.prototype.emplaceBack=function(ne,xe,Ie,Ve,ht,Rt){var Ht=this.length;return this.resize(Ht+1),this.emplace(Ht,ne,xe,Ie,Ve,ht,Rt)},k.prototype.emplace=function(ne,xe,Ie,Ve,ht,Rt,Ht){var tr=ne*6;return this.int16[tr+0]=xe,this.int16[tr+1]=Ie,this.int16[tr+2]=Ve,this.int16[tr+3]=ht,this.int16[tr+4]=Rt,this.int16[tr+5]=Ht,ne},k}(Oi);gi.prototype.bytesPerElement=12,de("StructArrayLayout2i4i12",gi);var Wa=function(C){function k(){C.apply(this,arguments)}return C&&(k.__proto__=C),k.prototype=Object.create(C&&C.prototype),k.prototype.constructor=k,k.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},k.prototype.emplaceBack=function(ne,xe,Ie,Ve,ht,Rt){var Ht=this.length;return this.resize(Ht+1),this.emplace(Ht,ne,xe,Ie,Ve,ht,Rt)},k.prototype.emplace=function(ne,xe,Ie,Ve,ht,Rt,Ht){var tr=ne*4,Cr=ne*8;return this.int16[tr+0]=xe,this.int16[tr+1]=Ie,this.uint8[Cr+4]=Ve,this.uint8[Cr+5]=ht,this.uint8[Cr+6]=Rt,this.uint8[Cr+7]=Ht,ne},k}(Oi);Wa.prototype.bytesPerElement=8,de("StructArrayLayout2i4ub8",Wa);var ji=function(C){function k(){C.apply(this,arguments)}return C&&(k.__proto__=C),k.prototype=Object.create(C&&C.prototype),k.prototype.constructor=k,k.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},k.prototype.emplaceBack=function(ne,xe){var Ie=this.length;return this.resize(Ie+1),this.emplace(Ie,ne,xe)},k.prototype.emplace=function(ne,xe,Ie){var Ve=ne*2;return this.float32[Ve+0]=xe,this.float32[Ve+1]=Ie,ne},k}(Oi);ji.prototype.bytesPerElement=8,de("StructArrayLayout2f8",ji);var Ii=function(C){function k(){C.apply(this,arguments)}return C&&(k.__proto__=C),k.prototype=Object.create(C&&C.prototype),k.prototype.constructor=k,k.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},k.prototype.emplaceBack=function(ne,xe,Ie,Ve,ht,Rt,Ht,tr,Cr,Xr){var qr=this.length;return this.resize(qr+1),this.emplace(qr,ne,xe,Ie,Ve,ht,Rt,Ht,tr,Cr,Xr)},k.prototype.emplace=function(ne,xe,Ie,Ve,ht,Rt,Ht,tr,Cr,Xr,qr){var pa=ne*10;return this.uint16[pa+0]=xe,this.uint16[pa+1]=Ie,this.uint16[pa+2]=Ve,this.uint16[pa+3]=ht,this.uint16[pa+4]=Rt,this.uint16[pa+5]=Ht,this.uint16[pa+6]=tr,this.uint16[pa+7]=Cr,this.uint16[pa+8]=Xr,this.uint16[pa+9]=qr,ne},k}(Oi);Ii.prototype.bytesPerElement=20,de("StructArrayLayout10ui20",Ii);var hn=function(C){function k(){C.apply(this,arguments)}return C&&(k.__proto__=C),k.prototype=Object.create(C&&C.prototype),k.prototype.constructor=k,k.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},k.prototype.emplaceBack=function(ne,xe,Ie,Ve,ht,Rt,Ht,tr,Cr,Xr,qr,pa){var ja=this.length;return this.resize(ja+1),this.emplace(ja,ne,xe,Ie,Ve,ht,Rt,Ht,tr,Cr,Xr,qr,pa)},k.prototype.emplace=function(ne,xe,Ie,Ve,ht,Rt,Ht,tr,Cr,Xr,qr,pa,ja){var Ei=ne*12;return this.int16[Ei+0]=xe,this.int16[Ei+1]=Ie,this.int16[Ei+2]=Ve,this.int16[Ei+3]=ht,this.uint16[Ei+4]=Rt,this.uint16[Ei+5]=Ht,this.uint16[Ei+6]=tr,this.uint16[Ei+7]=Cr,this.int16[Ei+8]=Xr,this.int16[Ei+9]=qr,this.int16[Ei+10]=pa,this.int16[Ei+11]=ja,ne},k}(Oi);hn.prototype.bytesPerElement=24,de("StructArrayLayout4i4ui4i24",hn);var Za=function(C){function k(){C.apply(this,arguments)}return C&&(k.__proto__=C),k.prototype=Object.create(C&&C.prototype),k.prototype.constructor=k,k.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},k.prototype.emplaceBack=function(ne,xe,Ie){var Ve=this.length;return this.resize(Ve+1),this.emplace(Ve,ne,xe,Ie)},k.prototype.emplace=function(ne,xe,Ie,Ve){var ht=ne*3;return this.float32[ht+0]=xe,this.float32[ht+1]=Ie,this.float32[ht+2]=Ve,ne},k}(Oi);Za.prototype.bytesPerElement=12,de("StructArrayLayout3f12",Za);var Va=function(C){function k(){C.apply(this,arguments)}return C&&(k.__proto__=C),k.prototype=Object.create(C&&C.prototype),k.prototype.constructor=k,k.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},k.prototype.emplaceBack=function(ne){var xe=this.length;return this.resize(xe+1),this.emplace(xe,ne)},k.prototype.emplace=function(ne,xe){var Ie=ne*1;return this.uint32[Ie+0]=xe,ne},k}(Oi);Va.prototype.bytesPerElement=4,de("StructArrayLayout1ul4",Va);var $i=function(C){function k(){C.apply(this,arguments)}return C&&(k.__proto__=C),k.prototype=Object.create(C&&C.prototype),k.prototype.constructor=k,k.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},k.prototype.emplaceBack=function(ne,xe,Ie,Ve,ht,Rt,Ht,tr,Cr){var Xr=this.length;return this.resize(Xr+1),this.emplace(Xr,ne,xe,Ie,Ve,ht,Rt,Ht,tr,Cr)},k.prototype.emplace=function(ne,xe,Ie,Ve,ht,Rt,Ht,tr,Cr,Xr){var qr=ne*10,pa=ne*5;return this.int16[qr+0]=xe,this.int16[qr+1]=Ie,this.int16[qr+2]=Ve,this.int16[qr+3]=ht,this.int16[qr+4]=Rt,this.int16[qr+5]=Ht,this.uint32[pa+3]=tr,this.uint16[qr+8]=Cr,this.uint16[qr+9]=Xr,ne},k}(Oi);$i.prototype.bytesPerElement=20,de("StructArrayLayout6i1ul2ui20",$i);var zi=function(C){function k(){C.apply(this,arguments)}return C&&(k.__proto__=C),k.prototype=Object.create(C&&C.prototype),k.prototype.constructor=k,k.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},k.prototype.emplaceBack=function(ne,xe,Ie,Ve,ht,Rt){var Ht=this.length;return this.resize(Ht+1),this.emplace(Ht,ne,xe,Ie,Ve,ht,Rt)},k.prototype.emplace=function(ne,xe,Ie,Ve,ht,Rt,Ht){var tr=ne*6;return this.int16[tr+0]=xe,this.int16[tr+1]=Ie,this.int16[tr+2]=Ve,this.int16[tr+3]=ht,this.int16[tr+4]=Rt,this.int16[tr+5]=Ht,ne},k}(Oi);zi.prototype.bytesPerElement=12,de("StructArrayLayout2i2i2i12",zi);var Si=function(C){function k(){C.apply(this,arguments)}return C&&(k.__proto__=C),k.prototype=Object.create(C&&C.prototype),k.prototype.constructor=k,k.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},k.prototype.emplaceBack=function(ne,xe,Ie,Ve,ht){var Rt=this.length;return this.resize(Rt+1),this.emplace(Rt,ne,xe,Ie,Ve,ht)},k.prototype.emplace=function(ne,xe,Ie,Ve,ht,Rt){var Ht=ne*4,tr=ne*8;return this.float32[Ht+0]=xe,this.float32[Ht+1]=Ie,this.float32[Ht+2]=Ve,this.int16[tr+6]=ht,this.int16[tr+7]=Rt,ne},k}(Oi);Si.prototype.bytesPerElement=16,de("StructArrayLayout2f1f2i16",Si);var Ti=function(C){function k(){C.apply(this,arguments)}return C&&(k.__proto__=C),k.prototype=Object.create(C&&C.prototype),k.prototype.constructor=k,k.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},k.prototype.emplaceBack=function(ne,xe,Ie,Ve){var ht=this.length;return this.resize(ht+1),this.emplace(ht,ne,xe,Ie,Ve)},k.prototype.emplace=function(ne,xe,Ie,Ve,ht){var Rt=ne*12,Ht=ne*3;return this.uint8[Rt+0]=xe,this.uint8[Rt+1]=Ie,this.float32[Ht+1]=Ve,this.float32[Ht+2]=ht,ne},k}(Oi);Ti.prototype.bytesPerElement=12,de("StructArrayLayout2ub2f12",Ti);var Ki=function(C){function k(){C.apply(this,arguments)}return C&&(k.__proto__=C),k.prototype=Object.create(C&&C.prototype),k.prototype.constructor=k,k.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},k.prototype.emplaceBack=function(ne,xe,Ie){var Ve=this.length;return this.resize(Ve+1),this.emplace(Ve,ne,xe,Ie)},k.prototype.emplace=function(ne,xe,Ie,Ve){var ht=ne*3;return this.uint16[ht+0]=xe,this.uint16[ht+1]=Ie,this.uint16[ht+2]=Ve,ne},k}(Oi);Ki.prototype.bytesPerElement=6,de("StructArrayLayout3ui6",Ki);var mn=function(C){function k(){C.apply(this,arguments)}return C&&(k.__proto__=C),k.prototype=Object.create(C&&C.prototype),k.prototype.constructor=k,k.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},k.prototype.emplaceBack=function(ne,xe,Ie,Ve,ht,Rt,Ht,tr,Cr,Xr,qr,pa,ja,Ei,li,en,Ni){var Qi=this.length;return this.resize(Qi+1),this.emplace(Qi,ne,xe,Ie,Ve,ht,Rt,Ht,tr,Cr,Xr,qr,pa,ja,Ei,li,en,Ni)},k.prototype.emplace=function(ne,xe,Ie,Ve,ht,Rt,Ht,tr,Cr,Xr,qr,pa,ja,Ei,li,en,Ni,Qi){var ln=ne*24,xn=ne*12,qn=ne*48;return this.int16[ln+0]=xe,this.int16[ln+1]=Ie,this.uint16[ln+2]=Ve,this.uint16[ln+3]=ht,this.uint32[xn+2]=Rt,this.uint32[xn+3]=Ht,this.uint32[xn+4]=tr,this.uint16[ln+10]=Cr,this.uint16[ln+11]=Xr,this.uint16[ln+12]=qr,this.float32[xn+7]=pa,this.float32[xn+8]=ja,this.uint8[qn+36]=Ei,this.uint8[qn+37]=li,this.uint8[qn+38]=en,this.uint32[xn+10]=Ni,this.int16[ln+22]=Qi,ne},k}(Oi);mn.prototype.bytesPerElement=48,de("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",mn);var In=function(C){function k(){C.apply(this,arguments)}return C&&(k.__proto__=C),k.prototype=Object.create(C&&C.prototype),k.prototype.constructor=k,k.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},k.prototype.emplaceBack=function(ne,xe,Ie,Ve,ht,Rt,Ht,tr,Cr,Xr,qr,pa,ja,Ei,li,en,Ni,Qi,ln,xn,qn,Nn,Mo,no,yo,Ms,Eo,Ro){var Zs=this.length;return this.resize(Zs+1),this.emplace(Zs,ne,xe,Ie,Ve,ht,Rt,Ht,tr,Cr,Xr,qr,pa,ja,Ei,li,en,Ni,Qi,ln,xn,qn,Nn,Mo,no,yo,Ms,Eo,Ro)},k.prototype.emplace=function(ne,xe,Ie,Ve,ht,Rt,Ht,tr,Cr,Xr,qr,pa,ja,Ei,li,en,Ni,Qi,ln,xn,qn,Nn,Mo,no,yo,Ms,Eo,Ro,Zs){var _s=ne*34,Wl=ne*17;return this.int16[_s+0]=xe,this.int16[_s+1]=Ie,this.int16[_s+2]=Ve,this.int16[_s+3]=ht,this.int16[_s+4]=Rt,this.int16[_s+5]=Ht,this.int16[_s+6]=tr,this.int16[_s+7]=Cr,this.uint16[_s+8]=Xr,this.uint16[_s+9]=qr,this.uint16[_s+10]=pa,this.uint16[_s+11]=ja,this.uint16[_s+12]=Ei,this.uint16[_s+13]=li,this.uint16[_s+14]=en,this.uint16[_s+15]=Ni,this.uint16[_s+16]=Qi,this.uint16[_s+17]=ln,this.uint16[_s+18]=xn,this.uint16[_s+19]=qn,this.uint16[_s+20]=Nn,this.uint16[_s+21]=Mo,this.uint16[_s+22]=no,this.uint32[Wl+12]=yo,this.float32[Wl+13]=Ms,this.float32[Wl+14]=Eo,this.float32[Wl+15]=Ro,this.float32[Wl+16]=Zs,ne},k}(Oi);In.prototype.bytesPerElement=68,de("StructArrayLayout8i15ui1ul4f68",In);var Di=function(C){function k(){C.apply(this,arguments)}return C&&(k.__proto__=C),k.prototype=Object.create(C&&C.prototype),k.prototype.constructor=k,k.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},k.prototype.emplaceBack=function(ne){var xe=this.length;return this.resize(xe+1),this.emplace(xe,ne)},k.prototype.emplace=function(ne,xe){var Ie=ne*1;return this.float32[Ie+0]=xe,ne},k}(Oi);Di.prototype.bytesPerElement=4,de("StructArrayLayout1f4",Di);var nn=function(C){function k(){C.apply(this,arguments)}return C&&(k.__proto__=C),k.prototype=Object.create(C&&C.prototype),k.prototype.constructor=k,k.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},k.prototype.emplaceBack=function(ne,xe,Ie){var Ve=this.length;return this.resize(Ve+1),this.emplace(Ve,ne,xe,Ie)},k.prototype.emplace=function(ne,xe,Ie,Ve){var ht=ne*3;return this.int16[ht+0]=xe,this.int16[ht+1]=Ie,this.int16[ht+2]=Ve,ne},k}(Oi);nn.prototype.bytesPerElement=6,de("StructArrayLayout3i6",nn);var En=function(C){function k(){C.apply(this,arguments)}return C&&(k.__proto__=C),k.prototype=Object.create(C&&C.prototype),k.prototype.constructor=k,k.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},k.prototype.emplaceBack=function(ne,xe,Ie){var Ve=this.length;return this.resize(Ve+1),this.emplace(Ve,ne,xe,Ie)},k.prototype.emplace=function(ne,xe,Ie,Ve){var ht=ne*2,Rt=ne*4;return this.uint32[ht+0]=xe,this.uint16[Rt+2]=Ie,this.uint16[Rt+3]=Ve,ne},k}(Oi);En.prototype.bytesPerElement=8,de("StructArrayLayout1ul2ui8",En);var Rn=function(C){function k(){C.apply(this,arguments)}return C&&(k.__proto__=C),k.prototype=Object.create(C&&C.prototype),k.prototype.constructor=k,k.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},k.prototype.emplaceBack=function(ne,xe){var Ie=this.length;return this.resize(Ie+1),this.emplace(Ie,ne,xe)},k.prototype.emplace=function(ne,xe,Ie){var Ve=ne*2;return this.uint16[Ve+0]=xe,this.uint16[Ve+1]=Ie,ne},k}(Oi);Rn.prototype.bytesPerElement=4,de("StructArrayLayout2ui4",Rn);var Gn=function(C){function k(){C.apply(this,arguments)}return C&&(k.__proto__=C),k.prototype=Object.create(C&&C.prototype),k.prototype.constructor=k,k.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},k.prototype.emplaceBack=function(ne){var xe=this.length;return this.resize(xe+1),this.emplace(xe,ne)},k.prototype.emplace=function(ne,xe){var Ie=ne*1;return this.uint16[Ie+0]=xe,ne},k}(Oi);Gn.prototype.bytesPerElement=2,de("StructArrayLayout1ui2",Gn);var Ps=function(C){function k(){C.apply(this,arguments)}return C&&(k.__proto__=C),k.prototype=Object.create(C&&C.prototype),k.prototype.constructor=k,k.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},k.prototype.emplaceBack=function(ne,xe,Ie,Ve){var ht=this.length;return this.resize(ht+1),this.emplace(ht,ne,xe,Ie,Ve)},k.prototype.emplace=function(ne,xe,Ie,Ve,ht){var Rt=ne*4;return this.float32[Rt+0]=xe,this.float32[Rt+1]=Ie,this.float32[Rt+2]=Ve,this.float32[Rt+3]=ht,ne},k}(Oi);Ps.prototype.bytesPerElement=16,de("StructArrayLayout4f16",Ps);var xl=function(C){function k(){C.apply(this,arguments)}C&&(k.__proto__=C),k.prototype=Object.create(C&&C.prototype),k.prototype.constructor=k;var V={anchorPointX:{configurable:!0},anchorPointY:{configurable:!0},x1:{configurable:!0},y1:{configurable:!0},x2:{configurable:!0},y2:{configurable:!0},featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0},anchorPoint:{configurable:!0}};return V.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},V.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},V.x1.get=function(){return this._structArray.int16[this._pos2+2]},V.y1.get=function(){return this._structArray.int16[this._pos2+3]},V.x2.get=function(){return this._structArray.int16[this._pos2+4]},V.y2.get=function(){return this._structArray.int16[this._pos2+5]},V.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},V.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},V.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},V.anchorPoint.get=function(){return new i(this.anchorPointX,this.anchorPointY)},Object.defineProperties(k.prototype,V),k}(bi);xl.prototype.size=20;var ho=function(C){function k(){C.apply(this,arguments)}return C&&(k.__proto__=C),k.prototype=Object.create(C&&C.prototype),k.prototype.constructor=k,k.prototype.get=function(ne){return new xl(this,ne)},k}($i);de("CollisionBoxArray",ho);var Hl=function(C){function k(){C.apply(this,arguments)}C&&(k.__proto__=C),k.prototype=Object.create(C&&C.prototype),k.prototype.constructor=k;var V={anchorX:{configurable:!0},anchorY:{configurable:!0},glyphStartIndex:{configurable:!0},numGlyphs:{configurable:!0},vertexStartIndex:{configurable:!0},lineStartIndex:{configurable:!0},lineLength:{configurable:!0},segment:{configurable:!0},lowerSize:{configurable:!0},upperSize:{configurable:!0},lineOffsetX:{configurable:!0},lineOffsetY:{configurable:!0},writingMode:{configurable:!0},placedOrientation:{configurable:!0},hidden:{configurable:!0},crossTileID:{configurable:!0},associatedIconIndex:{configurable:!0}};return V.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},V.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},V.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},V.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},V.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},V.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},V.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},V.segment.get=function(){return this._structArray.uint16[this._pos2+10]},V.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},V.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},V.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},V.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},V.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},V.placedOrientation.get=function(){return this._structArray.uint8[this._pos1+37]},V.placedOrientation.set=function(ne){this._structArray.uint8[this._pos1+37]=ne},V.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},V.hidden.set=function(ne){this._structArray.uint8[this._pos1+38]=ne},V.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},V.crossTileID.set=function(ne){this._structArray.uint32[this._pos4+10]=ne},V.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},Object.defineProperties(k.prototype,V),k}(bi);Hl.prototype.size=48;var fs=function(C){function k(){C.apply(this,arguments)}return C&&(k.__proto__=C),k.prototype=Object.create(C&&C.prototype),k.prototype.constructor=k,k.prototype.get=function(ne){return new Hl(this,ne)},k}(mn);de("PlacedSymbolArray",fs);var Al=function(C){function k(){C.apply(this,arguments)}C&&(k.__proto__=C),k.prototype=Object.create(C&&C.prototype),k.prototype.constructor=k;var V={anchorX:{configurable:!0},anchorY:{configurable:!0},rightJustifiedTextSymbolIndex:{configurable:!0},centerJustifiedTextSymbolIndex:{configurable:!0},leftJustifiedTextSymbolIndex:{configurable:!0},verticalPlacedTextSymbolIndex:{configurable:!0},placedIconSymbolIndex:{configurable:!0},verticalPlacedIconSymbolIndex:{configurable:!0},key:{configurable:!0},textBoxStartIndex:{configurable:!0},textBoxEndIndex:{configurable:!0},verticalTextBoxStartIndex:{configurable:!0},verticalTextBoxEndIndex:{configurable:!0},iconBoxStartIndex:{configurable:!0},iconBoxEndIndex:{configurable:!0},verticalIconBoxStartIndex:{configurable:!0},verticalIconBoxEndIndex:{configurable:!0},featureIndex:{configurable:!0},numHorizontalGlyphVertices:{configurable:!0},numVerticalGlyphVertices:{configurable:!0},numIconVertices:{configurable:!0},numVerticalIconVertices:{configurable:!0},useRuntimeCollisionCircles:{configurable:!0},crossTileID:{configurable:!0},textBoxScale:{configurable:!0},textOffset0:{configurable:!0},textOffset1:{configurable:!0},collisionCircleDiameter:{configurable:!0}};return V.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},V.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},V.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},V.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},V.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},V.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},V.placedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+6]},V.verticalPlacedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+7]},V.key.get=function(){return this._structArray.uint16[this._pos2+8]},V.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},V.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},V.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},V.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},V.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+13]},V.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+14]},V.verticalIconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+15]},V.verticalIconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+16]},V.featureIndex.get=function(){return this._structArray.uint16[this._pos2+17]},V.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+18]},V.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+19]},V.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+20]},V.numVerticalIconVertices.get=function(){return this._structArray.uint16[this._pos2+21]},V.useRuntimeCollisionCircles.get=function(){return this._structArray.uint16[this._pos2+22]},V.crossTileID.get=function(){return this._structArray.uint32[this._pos4+12]},V.crossTileID.set=function(ne){this._structArray.uint32[this._pos4+12]=ne},V.textBoxScale.get=function(){return this._structArray.float32[this._pos4+13]},V.textOffset0.get=function(){return this._structArray.float32[this._pos4+14]},V.textOffset1.get=function(){return this._structArray.float32[this._pos4+15]},V.collisionCircleDiameter.get=function(){return this._structArray.float32[this._pos4+16]},Object.defineProperties(k.prototype,V),k}(bi);Al.prototype.size=68;var El=function(C){function k(){C.apply(this,arguments)}return C&&(k.__proto__=C),k.prototype=Object.create(C&&C.prototype),k.prototype.constructor=k,k.prototype.get=function(ne){return new Al(this,ne)},k}(In);de("SymbolInstanceArray",El);var Ql=function(C){function k(){C.apply(this,arguments)}return C&&(k.__proto__=C),k.prototype=Object.create(C&&C.prototype),k.prototype.constructor=k,k.prototype.getoffsetX=function(ne){return this.float32[ne*1+0]},k}(Di);de("GlyphOffsetArray",Ql);var Fs=function(C){function k(){C.apply(this,arguments)}return C&&(k.__proto__=C),k.prototype=Object.create(C&&C.prototype),k.prototype.constructor=k,k.prototype.getx=function(ne){return this.int16[ne*3+0]},k.prototype.gety=function(ne){return this.int16[ne*3+1]},k.prototype.gettileUnitDistanceFromAnchor=function(ne){return this.int16[ne*3+2]},k}(nn);de("SymbolLineVertexArray",Fs);var pl=function(C){function k(){C.apply(this,arguments)}C&&(k.__proto__=C),k.prototype=Object.create(C&&C.prototype),k.prototype.constructor=k;var V={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return V.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},V.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},V.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},Object.defineProperties(k.prototype,V),k}(bi);pl.prototype.size=8;var bl=function(C){function k(){C.apply(this,arguments)}return C&&(k.__proto__=C),k.prototype=Object.create(C&&C.prototype),k.prototype.constructor=k,k.prototype.get=function(ne){return new pl(this,ne)},k}(En);de("FeatureIndexArray",bl);var Hn=ki([{name:"a_pos",components:2,type:"Int16"}],4),Cl=Hn.members,Lo=function(k){k===void 0&&(k=[]),this.segments=k};Lo.prototype.prepareSegment=function(k,V,ne,xe){var Ie=this.segments[this.segments.length-1];return k>Lo.MAX_VERTEX_ARRAY_LENGTH&&U("Max vertices per segment is "+Lo.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+k),(!Ie||Ie.vertexLength+k>Lo.MAX_VERTEX_ARRAY_LENGTH||Ie.sortKey!==xe)&&(Ie={vertexOffset:V.length,primitiveOffset:ne.length,vertexLength:0,primitiveLength:0},xe!==void 0&&(Ie.sortKey=xe),this.segments.push(Ie)),Ie},Lo.prototype.get=function(){return this.segments},Lo.prototype.destroy=function(){for(var k=0,V=this.segments;k>>16)*Rt&65535)<<16)&4294967295,tr=tr<<15|tr>>>17,tr=(tr&65535)*Ht+(((tr>>>16)*Ht&65535)<<16)&4294967295,Ve^=tr,Ve=Ve<<13|Ve>>>19,ht=(Ve&65535)*5+(((Ve>>>16)*5&65535)<<16)&4294967295,Ve=(ht&65535)+27492+(((ht>>>16)+58964&65535)<<16);switch(tr=0,xe){case 3:tr^=(V.charCodeAt(Cr+2)&255)<<16;case 2:tr^=(V.charCodeAt(Cr+1)&255)<<8;case 1:tr^=V.charCodeAt(Cr)&255,tr=(tr&65535)*Rt+(((tr>>>16)*Rt&65535)<<16)&4294967295,tr=tr<<15|tr>>>17,tr=(tr&65535)*Ht+(((tr>>>16)*Ht&65535)<<16)&4294967295,Ve^=tr}return Ve^=V.length,Ve^=Ve>>>16,Ve=(Ve&65535)*2246822507+(((Ve>>>16)*2246822507&65535)<<16)&4294967295,Ve^=Ve>>>13,Ve=(Ve&65535)*3266489909+(((Ve>>>16)*3266489909&65535)<<16)&4294967295,Ve^=Ve>>>16,Ve>>>0}C.exports=k}),te=t(function(C){function k(V,ne){for(var xe=V.length,Ie=ne^xe,Ve=0,ht;xe>=4;)ht=V.charCodeAt(Ve)&255|(V.charCodeAt(++Ve)&255)<<8|(V.charCodeAt(++Ve)&255)<<16|(V.charCodeAt(++Ve)&255)<<24,ht=(ht&65535)*1540483477+(((ht>>>16)*1540483477&65535)<<16),ht^=ht>>>24,ht=(ht&65535)*1540483477+(((ht>>>16)*1540483477&65535)<<16),Ie=(Ie&65535)*1540483477+(((Ie>>>16)*1540483477&65535)<<16)^ht,xe-=4,++Ve;switch(xe){case 3:Ie^=(V.charCodeAt(Ve+2)&255)<<16;case 2:Ie^=(V.charCodeAt(Ve+1)&255)<<8;case 1:Ie^=V.charCodeAt(Ve)&255,Ie=(Ie&65535)*1540483477+(((Ie>>>16)*1540483477&65535)<<16)}return Ie^=Ie>>>13,Ie=(Ie&65535)*1540483477+(((Ie>>>16)*1540483477&65535)<<16),Ie^=Ie>>>15,Ie>>>0}C.exports=k}),me=ye,Ge=ye,Le=te;me.murmur3=Ge,me.murmur2=Le;var $e=function(){this.ids=[],this.positions=[],this.indexed=!1};$e.prototype.add=function(k,V,ne,xe){this.ids.push(jt(k)),this.positions.push(V,ne,xe)},$e.prototype.getPositions=function(k){for(var V=jt(k),ne=0,xe=this.ids.length-1;ne>1;this.ids[Ie]>=V?xe=Ie:ne=Ie+1}for(var Ve=[];this.ids[ne]===V;){var ht=this.positions[3*ne],Rt=this.positions[3*ne+1],Ht=this.positions[3*ne+2];Ve.push({index:ht,start:Rt,end:Ht}),ne++}return Ve},$e.serialize=function(k,V){var ne=new Float64Array(k.ids),xe=new Uint32Array(k.positions);return _r(ne,xe,0,ne.length-1),V&&V.push(ne.buffer,xe.buffer),{ids:ne,positions:xe}},$e.deserialize=function(k){var V=new $e;return V.ids=k.ids,V.positions=k.positions,V.indexed=!0,V};var mt=Math.pow(2,53)-1;function jt(C){var k=+C;return!isNaN(k)&&k<=mt?k:me(String(C))}function _r(C,k,V,ne){for(;V>1],Ie=V-1,Ve=ne+1;;){do Ie++;while(C[Ie]xe);if(Ie>=Ve)break;Fr(C,Ie,Ve),Fr(k,3*Ie,3*Ve),Fr(k,3*Ie+1,3*Ve+1),Fr(k,3*Ie+2,3*Ve+2)}Ve-VVe.x+1||RtVe.y+1)&&U("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return V}function xo(C,k){return{type:C.type,id:C.id,properties:C.properties,geometry:k?cn(C):[]}}function jo(C,k,V,ne,xe){C.emplaceBack(k*2+(ne+1)/2,V*2+(xe+1)/2)}var ks=function(k){this.zoom=k.zoom,this.overscaling=k.overscaling,this.layers=k.layers,this.layerIds=this.layers.map(function(V){return V.id}),this.index=k.index,this.hasPattern=!1,this.layoutVertexArray=new Ea,this.indexArray=new Ki,this.segments=new Lo,this.programConfigurations=new Xa(k.layers,k.zoom),this.stateDependentLayerIds=this.layers.filter(function(V){return V.isStateDependent()}).map(function(V){return V.id})};ks.prototype.populate=function(k,V,ne){var xe=this.layers[0],Ie=[],Ve=null;xe.type==="circle"&&(Ve=xe.layout.get("circle-sort-key"));for(var ht=0,Rt=k;ht=pi||Xr<0||Xr>=pi)){var qr=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,k.sortKey),pa=qr.vertexLength;jo(this.layoutVertexArray,Cr,Xr,-1,-1),jo(this.layoutVertexArray,Cr,Xr,1,-1),jo(this.layoutVertexArray,Cr,Xr,1,1),jo(this.layoutVertexArray,Cr,Xr,-1,1),this.indexArray.emplaceBack(pa,pa+1,pa+2),this.indexArray.emplaceBack(pa,pa+3,pa+2),qr.vertexLength+=4,qr.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,k,ne,{},xe)},de("CircleBucket",ks,{omit:["layers"]});function Fo(C,k){for(var V=0;V=3){for(var Ie=0;Ie1){if(Ep(C,k))return!0;for(var ne=0;ne1?C.distSqr(V):C.distSqr(V.sub(k)._mult(xe)._add(k))}function td(C,k){for(var V=!1,ne,xe,Ie,Ve=0;Vek.y!=Ie.y>k.y&&k.x<(Ie.x-xe.x)*(k.y-xe.y)/(Ie.y-xe.y)+xe.x&&(V=!V)}return V}function Ih(C,k){for(var V=!1,ne=0,xe=C.length-1;nek.y!=Ve.y>k.y&&k.x<(Ve.x-Ie.x)*(k.y-Ie.y)/(Ve.y-Ie.y)+Ie.x&&(V=!V)}return V}function rd(C,k,V,ne,xe){for(var Ie=0,Ve=C;Ie=ht.x&&xe>=ht.y)return!0}var Rt=[new i(k,V),new i(k,xe),new i(ne,xe),new i(ne,V)];if(C.length>2)for(var Ht=0,tr=Rt;Htxe.x&&k.x>xe.x||C.yxe.y&&k.y>xe.y)return!1;var Ie=W(C,k,V[0]);return Ie!==W(C,k,V[1])||Ie!==W(C,k,V[2])||Ie!==W(C,k,V[3])}function Rh(C,k,V){var ne=k.paint.get(C).value;return ne.kind==="constant"?ne.value:V.programConfigurations.get(k.id).getMaxValue(C)}function Cp(C){return Math.sqrt(C[0]*C[0]+C[1]*C[1])}function Vp(C,k,V,ne,xe){if(!k[0]&&!k[1])return C;var Ie=i.convert(k)._mult(xe);V==="viewport"&&Ie._rotate(-ne);for(var Ve=[],ht=0;ht0&&(Ie=1/Math.sqrt(Ie)),C[0]=k[0]*Ie,C[1]=k[1]*Ie,C[2]=k[2]*Ie,C}function UT(C,k){return C[0]*k[0]+C[1]*k[1]+C[2]*k[2]}function jT(C,k,V){var ne=k[0],xe=k[1],Ie=k[2],Ve=V[0],ht=V[1],Rt=V[2];return C[0]=xe*Rt-Ie*ht,C[1]=Ie*Ve-ne*Rt,C[2]=ne*ht-xe*Ve,C}function qT(C,k,V){var ne=k[0],xe=k[1],Ie=k[2];return C[0]=ne*V[0]+xe*V[3]+Ie*V[6],C[1]=ne*V[1]+xe*V[4]+Ie*V[7],C[2]=ne*V[2]+xe*V[5]+Ie*V[8],C}var VT=lv,dC=function(){var C=sv();return function(k,V,ne,xe,Ie,Ve){var ht,Rt;for(V||(V=3),ne||(ne=0),xe?Rt=Math.min(xe*V+ne,k.length):Rt=k.length,ht=ne;htC.width||xe.height>C.height||V.x>C.width-xe.width||V.y>C.height-xe.height)throw new RangeError("out of range source coordinates for image copy");if(xe.width>k.width||xe.height>k.height||ne.x>k.width-xe.width||ne.y>k.height-xe.height)throw new RangeError("out of range destination coordinates for image copy");for(var Ve=C.data,ht=k.data,Rt=0;Rt80*V){ht=Ht=C[0],Rt=tr=C[1];for(var pa=V;paHt&&(Ht=Cr),Xr>tr&&(tr=Xr);qr=Math.max(Ht-ht,tr-Rt),qr=qr!==0?1/qr:0}return S0(Ie,Ve,V,ht,Rt,qr),Ve}function Sg(C,k,V,ne,xe){var Ie,Ve;if(xe===U1(C,k,V,ne)>0)for(Ie=k;Ie=k;Ie-=ne)Ve=Nx(Ie,C[Ie],C[Ie+1],Ve);return Ve&&E0(Ve,Ve.next)&&(L0(Ve),Ve=Ve.next),Ve}function uv(C,k){if(!C)return C;k||(k=C);var V=C,ne;do if(ne=!1,!V.steiner&&(E0(V,V.next)||lf(V.prev,V,V.next)===0)){if(L0(V),V=k=V.prev,V===V.next)break;ne=!0}else V=V.next;while(ne||V!==k);return k}function S0(C,k,V,ne,xe,Ie,Ve){if(C){!Ve&&Ie&&Mg(C,ne,xe,Ie);for(var ht=C,Rt,Ht;C.prev!==C.next;){if(Rt=C.prev,Ht=C.next,Ie?Fx(C,ne,xe,Ie):zx(C)){k.push(Rt.i/V),k.push(C.i/V),k.push(Ht.i/V),L0(C),C=Ht.next,ht=Ht.next;continue}if(C=Ht,C===ht){Ve?Ve===1?(C=M0(uv(C),k,V),S0(C,k,V,ne,xe,Ie,2)):Ve===2&&yd(C,k,V,ne,xe,Ie):S0(uv(C),k,V,ne,xe,Ie,1);break}}}}function zx(C){var k=C.prev,V=C,ne=C.next;if(lf(k,V,ne)>=0)return!1;for(var xe=C.next.next;xe!==C.prev;){if(fv(k.x,k.y,V.x,V.y,ne.x,ne.y,xe.x,xe.y)&&lf(xe.prev,xe,xe.next)>=0)return!1;xe=xe.next}return!0}function Fx(C,k,V,ne){var xe=C.prev,Ie=C,Ve=C.next;if(lf(xe,Ie,Ve)>=0)return!1;for(var ht=xe.xIe.x?xe.x>Ve.x?xe.x:Ve.x:Ie.x>Ve.x?Ie.x:Ve.x,tr=xe.y>Ie.y?xe.y>Ve.y?xe.y:Ve.y:Ie.y>Ve.y?Ie.y:Ve.y,Cr=F1(ht,Rt,k,V,ne),Xr=F1(Ht,tr,k,V,ne),qr=C.prevZ,pa=C.nextZ;qr&&qr.z>=Cr&&pa&&pa.z<=Xr;){if(qr!==C.prev&&qr!==C.next&&fv(xe.x,xe.y,Ie.x,Ie.y,Ve.x,Ve.y,qr.x,qr.y)&&lf(qr.prev,qr,qr.next)>=0||(qr=qr.prevZ,pa!==C.prev&&pa!==C.next&&fv(xe.x,xe.y,Ie.x,Ie.y,Ve.x,Ve.y,pa.x,pa.y)&&lf(pa.prev,pa,pa.next)>=0))return!1;pa=pa.nextZ}for(;qr&&qr.z>=Cr;){if(qr!==C.prev&&qr!==C.next&&fv(xe.x,xe.y,Ie.x,Ie.y,Ve.x,Ve.y,qr.x,qr.y)&&lf(qr.prev,qr,qr.next)>=0)return!1;qr=qr.prevZ}for(;pa&&pa.z<=Xr;){if(pa!==C.prev&&pa!==C.next&&fv(xe.x,xe.y,Ie.x,Ie.y,Ve.x,Ve.y,pa.x,pa.y)&&lf(pa.prev,pa,pa.next)>=0)return!1;pa=pa.nextZ}return!0}function M0(C,k,V){var ne=C;do{var xe=ne.prev,Ie=ne.next.next;!E0(xe,Ie)&&Eg(xe,ne,ne.next,Ie)&&k0(xe,Ie)&&k0(Ie,xe)&&(k.push(xe.i/V),k.push(ne.i/V),k.push(Ie.i/V),L0(ne),L0(ne.next),ne=C=Ie),ne=ne.next}while(ne!==C);return uv(ne)}function yd(C,k,V,ne,xe,Ie){var Ve=C;do{for(var ht=Ve.next.next;ht!==Ve.prev;){if(Ve.i!==ht.i&&um(Ve,ht)){var Rt=B1(Ve,ht);Ve=uv(Ve,Ve.next),Rt=uv(Rt,Rt.next),S0(Ve,k,V,ne,xe,Ie),S0(Rt,k,V,ne,xe,Ie);return}ht=ht.next}Ve=Ve.next}while(Ve!==C)}function cv(C,k,V,ne){var xe=[],Ie,Ve,ht,Rt,Ht;for(Ie=0,Ve=k.length;Ie=V.next.y&&V.next.y!==V.y){var ht=V.x+(xe-V.y)*(V.next.x-V.x)/(V.next.y-V.y);if(ht<=ne&&ht>Ie){if(Ie=ht,ht===ne){if(xe===V.y)return V;if(xe===V.next.y)return V.next}Ve=V.x=V.x&&V.x>=Ht&&ne!==V.x&&fv(xeVe.x||V.x===Ve.x&&$T(Ve,V)))&&(Ve=V,Cr=Xr)),V=V.next;while(V!==Rt);return Ve}function $T(C,k){return lf(C.prev,C,k.prev)<0&&lf(k.next,C,C.next)<0}function Mg(C,k,V,ne){var xe=C;do xe.z===null&&(xe.z=F1(xe.x,xe.y,k,V,ne)),xe.prevZ=xe.prev,xe.nextZ=xe.next,xe=xe.next;while(xe!==C);xe.prevZ.nextZ=null,xe.prevZ=null,z1(xe)}function z1(C){var k,V,ne,xe,Ie,Ve,ht,Rt,Ht=1;do{for(V=C,C=null,Ie=null,Ve=0;V;){for(Ve++,ne=V,ht=0,k=0;k0||Rt>0&≠)ht!==0&&(Rt===0||!ne||V.z<=ne.z)?(xe=V,V=V.nextZ,ht--):(xe=ne,ne=ne.nextZ,Rt--),Ie?Ie.nextZ=xe:C=xe,xe.prevZ=Ie,Ie=xe;V=ne}Ie.nextZ=null,Ht*=2}while(Ve>1);return C}function F1(C,k,V,ne,xe){return C=32767*(C-V)*xe,k=32767*(k-ne)*xe,C=(C|C<<8)&16711935,C=(C|C<<4)&252645135,C=(C|C<<2)&858993459,C=(C|C<<1)&1431655765,k=(k|k<<8)&16711935,k=(k|k<<4)&252645135,k=(k|k<<2)&858993459,k=(k|k<<1)&1431655765,C|k<<1}function O1(C){var k=C,V=C;do(k.x=0&&(C-Ve)*(ne-ht)-(V-Ve)*(k-ht)>=0&&(V-Ve)*(Ie-ht)-(xe-Ve)*(ne-ht)>=0}function um(C,k){return C.next.i!==k.i&&C.prev.i!==k.i&&!Bx(C,k)&&(k0(C,k)&&k0(k,C)&&QT(C,k)&&(lf(C.prev,C,k.prev)||lf(C,k.prev,k))||E0(C,k)&&lf(C.prev,C,C.next)>0&&lf(k.prev,k,k.next)>0)}function lf(C,k,V){return(k.y-C.y)*(V.x-k.x)-(k.x-C.x)*(V.y-k.y)}function E0(C,k){return C.x===k.x&&C.y===k.y}function Eg(C,k,V,ne){var xe=Dv(lf(C,k,V)),Ie=Dv(lf(C,k,ne)),Ve=Dv(lf(V,ne,C)),ht=Dv(lf(V,ne,k));return!!(xe!==Ie&&Ve!==ht||xe===0&&C0(C,V,k)||Ie===0&&C0(C,ne,k)||Ve===0&&C0(V,C,ne)||ht===0&&C0(V,k,ne))}function C0(C,k,V){return k.x<=Math.max(C.x,V.x)&&k.x>=Math.min(C.x,V.x)&&k.y<=Math.max(C.y,V.y)&&k.y>=Math.min(C.y,V.y)}function Dv(C){return C>0?1:C<0?-1:0}function Bx(C,k){var V=C;do{if(V.i!==C.i&&V.next.i!==C.i&&V.i!==k.i&&V.next.i!==k.i&&Eg(V,V.next,C,k))return!0;V=V.next}while(V!==C);return!1}function k0(C,k){return lf(C.prev,C,C.next)<0?lf(C,k,C.next)>=0&&lf(C,C.prev,k)>=0:lf(C,k,C.prev)<0||lf(C,C.next,k)<0}function QT(C,k){var V=C,ne=!1,xe=(C.x+k.x)/2,Ie=(C.y+k.y)/2;do V.y>Ie!=V.next.y>Ie&&V.next.y!==V.y&&xe<(V.next.x-V.x)*(Ie-V.y)/(V.next.y-V.y)+V.x&&(ne=!ne),V=V.next;while(V!==C);return ne}function B1(C,k){var V=new N1(C.i,C.x,C.y),ne=new N1(k.i,k.x,k.y),xe=C.next,Ie=k.prev;return C.next=k,k.prev=C,V.next=xe,xe.prev=V,ne.next=V,V.prev=ne,Ie.next=ne,ne.prev=Ie,ne}function Nx(C,k,V,ne){var xe=new N1(C,k,V);return ne?(xe.next=ne.next,xe.prev=ne,ne.next.prev=xe,ne.next=xe):(xe.prev=xe,xe.next=xe),xe}function L0(C){C.next.prev=C.prev,C.prev.next=C.next,C.prevZ&&(C.prevZ.nextZ=C.nextZ),C.nextZ&&(C.nextZ.prevZ=C.prevZ)}function N1(C,k,V){this.i=C,this.x=k,this.y=V,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}lm.deviation=function(C,k,V,ne){var xe=k&&k.length,Ie=xe?k[0]*V:C.length,Ve=Math.abs(U1(C,0,Ie,V));if(xe)for(var ht=0,Rt=k.length;ht0&&(ne+=C[xe-1].length,V.holes.push(ne))}return V},Ag.default=Dx;function j1(C,k,V,ne,xe){Hd(C,k,V||0,ne||C.length-1,xe||Ux)}function Hd(C,k,V,ne,xe){for(;ne>V;){if(ne-V>600){var Ie=ne-V+1,Ve=k-V+1,ht=Math.log(Ie),Rt=.5*Math.exp(2*ht/3),Ht=.5*Math.sqrt(ht*Rt*(Ie-Rt)/Ie)*(Ve-Ie/2<0?-1:1),tr=Math.max(V,Math.floor(k-Ve*Rt/Ie+Ht)),Cr=Math.min(ne,Math.floor(k+(Ie-Ve)*Rt/Ie+Ht));Hd(C,k,tr,Cr,xe)}var Xr=C[k],qr=V,pa=ne;for(cm(C,V,k),xe(C[ne],Xr)>0&&cm(C,V,ne);qr0;)pa--}xe(C[V],Xr)===0?cm(C,V,pa):(pa++,cm(C,pa,ne)),pa<=k&&(V=pa+1),k<=pa&&(ne=pa-1)}}function cm(C,k,V){var ne=C[k];C[k]=C[V],C[V]=ne}function Ux(C,k){return Ck?1:0}function Cg(C,k){var V=C.length;if(V<=1)return[C];for(var ne=[],xe,Ie,Ve=0;Ve1)for(var Rt=0;Rt>3}if(ne--,V===1||V===2)xe+=C.readSVarint(),Ie+=C.readSVarint(),V===1&&(ht&&Ve.push(ht),ht=[]),ht.push(new i(xe,Ie));else if(V===7)ht&&ht.push(ht[0].clone());else throw new Error("unknown command "+V)}return ht&&Ve.push(ht),Ve},zv.prototype.bbox=function(){var C=this._pbf;C.pos=this._geometry;for(var k=C.readVarint()+C.pos,V=1,ne=0,xe=0,Ie=0,Ve=1/0,ht=-1/0,Rt=1/0,Ht=-1/0;C.pos>3}if(ne--,V===1||V===2)xe+=C.readSVarint(),Ie+=C.readSVarint(),xeht&&(ht=xe),IeHt&&(Ht=Ie);else if(V!==7)throw new Error("unknown command "+V)}return[Ve,Rt,ht,Ht]},zv.prototype.toGeoJSON=function(C,k,V){var ne=this.extent*Math.pow(2,V),xe=this.extent*C,Ie=this.extent*k,Ve=this.loadGeometry(),ht=zv.types[this.type],Rt,Ht;function tr(qr){for(var pa=0;pa>3;k=ne===1?C.readString():ne===2?C.readFloat():ne===3?C.readDouble():ne===4?C.readVarint64():ne===5?C.readVarint():ne===6?C.readSVarint():ne===7?C.readBoolean():null}return k}G1.prototype.feature=function(C){if(C<0||C>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[C];var k=this._pbf.readVarint()+this._pbf.pos;return new V1(this._pbf,k,this.extent,this._keys,this._values)};var Kx=tA;function tA(C,k){this.layers=C.readFields(rA,{},k)}function rA(C,k,V){if(C===3){var ne=new Wd(V,V.readVarint()+V.pos);ne.length&&(k[ne.name]=ne)}}var Jx=Kx,fm=V1,$x=Wd,Xd={VectorTile:Jx,VectorTileFeature:fm,VectorTileLayer:$x},Qx=Xd.VectorTileFeature.types,Lg=500,hm=Math.pow(2,13);function hv(C,k,V,ne,xe,Ie,Ve,ht){C.emplaceBack(k,V,Math.floor(ne*hm)*2+Ve,xe*hm*2,Ie*hm*2,Math.round(ht))}var fd=function(k){this.zoom=k.zoom,this.overscaling=k.overscaling,this.layers=k.layers,this.layerIds=this.layers.map(function(V){return V.id}),this.index=k.index,this.hasPattern=!1,this.layoutVertexArray=new gi,this.indexArray=new Ki,this.programConfigurations=new Xa(k.layers,k.zoom),this.segments=new Lo,this.stateDependentLayerIds=this.layers.filter(function(V){return V.isStateDependent()}).map(function(V){return V.id})};fd.prototype.populate=function(k,V,ne){this.features=[],this.hasPattern=kg("fill-extrusion",this.layers,V);for(var xe=0,Ie=k;xe=1){var Qi=Ei[en-1];if(!aA(Ni,Qi)){qr.vertexLength+4>Lo.MAX_VERTEX_ARRAY_LENGTH&&(qr=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var ln=Ni.sub(Qi)._perp()._unit(),xn=Qi.dist(Ni);li+xn>32768&&(li=0),hv(this.layoutVertexArray,Ni.x,Ni.y,ln.x,ln.y,0,0,li),hv(this.layoutVertexArray,Ni.x,Ni.y,ln.x,ln.y,0,1,li),li+=xn,hv(this.layoutVertexArray,Qi.x,Qi.y,ln.x,ln.y,0,0,li),hv(this.layoutVertexArray,Qi.x,Qi.y,ln.x,ln.y,0,1,li);var qn=qr.vertexLength;this.indexArray.emplaceBack(qn,qn+2,qn+1),this.indexArray.emplaceBack(qn+1,qn+2,qn+3),qr.vertexLength+=4,qr.primitiveLength+=2}}}}if(qr.vertexLength+Ht>Lo.MAX_VERTEX_ARRAY_LENGTH&&(qr=this.segments.prepareSegment(Ht,this.layoutVertexArray,this.indexArray)),Qx[k.type]==="Polygon"){for(var Nn=[],Mo=[],no=qr.vertexLength,yo=0,Ms=Rt;yopi)||C.y===k.y&&(C.y<0||C.y>pi)}function iA(C){return C.every(function(k){return k.x<0})||C.every(function(k){return k.x>pi})||C.every(function(k){return k.y<0})||C.every(function(k){return k.y>pi})}var pm=new xa({"fill-extrusion-opacity":new nt(Ui["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Yt(Ui["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new nt(Ui["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new nt(Ui["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new cr(Ui["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Yt(Ui["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Yt(Ui["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new nt(Ui["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])}),xh={paint:pm},pv=function(C){function k(V){C.call(this,V,xh)}return C&&(k.__proto__=C),k.prototype=Object.create(C&&C.prototype),k.prototype.constructor=k,k.prototype.createBucket=function(ne){return new fd(ne)},k.prototype.queryRadius=function(){return Cp(this.paint.get("fill-extrusion-translate"))},k.prototype.is3D=function(){return!0},k.prototype.queryIntersectsFeature=function(ne,xe,Ie,Ve,ht,Rt,Ht,tr){var Cr=Vp(ne,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),Rt.angle,Ht),Xr=this.paint.get("fill-extrusion-height").evaluate(xe,Ie),qr=this.paint.get("fill-extrusion-base").evaluate(xe,Ie),pa=nA(Cr,tr,Rt,0),ja=W1(Ve,qr,Xr,tr),Ei=ja[0],li=ja[1];return eb(Ei,li,pa)},k}(Ja);function Fv(C,k){return C.x*k.x+C.y*k.y}function H1(C,k){if(C.length===1){for(var V=0,ne=k[V++],xe;!xe||ne.equals(xe);)if(xe=k[V++],!xe)return 1/0;for(;V=2&&k[Ht-1].equals(k[Ht-2]);)Ht--;for(var tr=0;tr0;if(Nn&&en>tr){var no=qr.dist(pa);if(no>2*Cr){var yo=qr.sub(qr.sub(pa)._mult(Cr/no)._round());this.updateDistance(pa,yo),this.addCurrentVertex(yo,Ei,0,0,Xr),pa=yo}}var Ms=pa&&ja,Eo=Ms?ne:Rt?"butt":xe;if(Ms&&Eo==="round"&&(xnIe&&(Eo="bevel"),Eo==="bevel"&&(xn>2&&(Eo="flipbevel"),xn100)Ni=li.mult(-1);else{var Ro=xn*Ei.add(li).mag()/Ei.sub(li).mag();Ni._perp()._mult(Ro*(Mo?-1:1))}this.addCurrentVertex(qr,Ni,0,0,Xr),this.addCurrentVertex(qr,Ni.mult(-1),0,0,Xr)}else if(Eo==="bevel"||Eo==="fakeround"){var Zs=-Math.sqrt(xn*xn-1),_s=Mo?Zs:0,Wl=Mo?0:Zs;if(pa&&this.addCurrentVertex(qr,Ei,_s,Wl,Xr),Eo==="fakeround")for(var zu=Math.round(qn*180/Math.PI/Z1),Xl=1;Xl2*Cr){var Wf=qr.add(ja.sub(qr)._mult(Cr/dh)._round());this.updateDistance(qr,Wf),this.addCurrentVertex(Wf,li,0,0,Xr),qr=Wf}}}}},Vf.prototype.addCurrentVertex=function(k,V,ne,xe,Ie,Ve){Ve===void 0&&(Ve=!1);var ht=V.x+V.y*ne,Rt=V.y-V.x*ne,Ht=-V.x+V.y*xe,tr=-V.y-V.x*xe;this.addHalfVertex(k,ht,Rt,Ve,!1,ne,Ie),this.addHalfVertex(k,Ht,tr,Ve,!0,-xe,Ie),this.distance>z0/2&&this.totalDistance===0&&(this.distance=0,this.addCurrentVertex(k,V,ne,xe,Ie,Ve))},Vf.prototype.addHalfVertex=function(k,V,ne,xe,Ie,Ve,ht){var Rt=k.x,Ht=k.y,tr=this.lineClips?this.scaledDistance*(z0-1):this.scaledDistance,Cr=tr*Ig;if(this.layoutVertexArray.emplaceBack((Rt<<1)+(xe?1:0),(Ht<<1)+(Ie?1:0),Math.round(Pg*V)+128,Math.round(Pg*ne)+128,(Ve===0?0:Ve<0?-1:1)+1|(Cr&63)<<2,Cr>>6),this.lineClips){var Xr=this.scaledDistance-this.lineClips.start,qr=this.lineClips.end-this.lineClips.start,pa=Xr/qr;this.layoutVertexArray2.emplaceBack(pa,this.lineClipsArray.length)}var ja=ht.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,ja),ht.primitiveLength++),Ie?this.e2=ja:this.e1=ja},Vf.prototype.updateScaledDistance=function(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance},Vf.prototype.updateDistance=function(k,V){this.distance+=k.dist(V),this.updateScaledDistance()},de("LineBucket",Vf,{omit:["layers","patternFeatures"]});var Y1=new xa({"line-cap":new nt(Ui.layout_line["line-cap"]),"line-join":new Yt(Ui.layout_line["line-join"]),"line-miter-limit":new nt(Ui.layout_line["line-miter-limit"]),"line-round-limit":new nt(Ui.layout_line["line-round-limit"]),"line-sort-key":new Yt(Ui.layout_line["line-sort-key"])}),K1=new xa({"line-opacity":new Yt(Ui.paint_line["line-opacity"]),"line-color":new Yt(Ui.paint_line["line-color"]),"line-translate":new nt(Ui.paint_line["line-translate"]),"line-translate-anchor":new nt(Ui.paint_line["line-translate-anchor"]),"line-width":new Yt(Ui.paint_line["line-width"]),"line-gap-width":new Yt(Ui.paint_line["line-gap-width"]),"line-offset":new Yt(Ui.paint_line["line-offset"]),"line-blur":new Yt(Ui.paint_line["line-blur"]),"line-dasharray":new ua(Ui.paint_line["line-dasharray"]),"line-pattern":new cr(Ui.paint_line["line-pattern"]),"line-gradient":new Aa(Ui.paint_line["line-gradient"])}),Rg={paint:K1,layout:Y1},sA=function(C){function k(){C.apply(this,arguments)}return C&&(k.__proto__=C),k.prototype=Object.create(C&&C.prototype),k.prototype.constructor=k,k.prototype.possiblyEvaluate=function(ne,xe){return xe=new gn(Math.floor(xe.zoom),{now:xe.now,fadeDuration:xe.fadeDuration,zoomHistory:xe.zoomHistory,transition:xe.transition}),C.prototype.possiblyEvaluate.call(this,ne,xe)},k.prototype.evaluate=function(ne,xe,Ie,Ve){return xe=y({},xe,{zoom:Math.floor(xe.zoom)}),C.prototype.evaluate.call(this,ne,xe,Ie,Ve)},k}(Yt),H=new sA(Rg.paint.properties["line-width"].specification);H.useIntegerZoom=!0;var D=function(C){function k(V){C.call(this,V,Rg),this.gradientVersion=0}return C&&(k.__proto__=C),k.prototype=Object.create(C&&C.prototype),k.prototype.constructor=k,k.prototype._handleSpecialPaintPropertyUpdate=function(ne){if(ne==="line-gradient"){var xe=this._transitionablePaint._values["line-gradient"].value.expression;this.stepInterpolant=xe._styleExpression.expression instanceof bu,this.gradientVersion=(this.gradientVersion+1)%f}},k.prototype.gradientExpression=function(){return this._transitionablePaint._values["line-gradient"].value.expression},k.prototype.recalculate=function(ne,xe){C.prototype.recalculate.call(this,ne,xe),this.paint._values["line-floorwidth"]=H.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,ne)},k.prototype.createBucket=function(ne){return new Vf(ne)},k.prototype.queryRadius=function(ne){var xe=ne,Ie=K(Rh("line-width",this,xe),Rh("line-gap-width",this,xe)),Ve=Rh("line-offset",this,xe);return Ie/2+Math.abs(Ve)+Cp(this.paint.get("line-translate"))},k.prototype.queryIntersectsFeature=function(ne,xe,Ie,Ve,ht,Rt,Ht){var tr=Vp(ne,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),Rt.angle,Ht),Cr=Ht/2*K(this.paint.get("line-width").evaluate(xe,Ie),this.paint.get("line-gap-width").evaluate(xe,Ie)),Xr=this.paint.get("line-offset").evaluate(xe,Ie);return Xr&&(Ve=pe(Ve,Xr*Ht)),pu(tr,Ve,Cr)},k.prototype.isTileClipped=function(){return!0},k}(Ja);function K(C,k){return k>0?k+2*C:C}function pe(C,k){for(var V=[],ne=new i(0,0),xe=0;xe":"\uFE40","?":"\uFE16","@":"\uFF20","[":"\uFE47","\\":"\uFF3C","]":"\uFE48","^":"\uFF3E",_:"\uFE33","`":"\uFF40","{":"\uFE37","|":"\u2015","}":"\uFE38","~":"\uFF5E","\xA2":"\uFFE0","\xA3":"\uFFE1","\xA5":"\uFFE5","\xA6":"\uFFE4","\xAC":"\uFFE2","\xAF":"\uFFE3","\u2013":"\uFE32","\u2014":"\uFE31","\u2018":"\uFE43","\u2019":"\uFE44","\u201C":"\uFE41","\u201D":"\uFE42","\u2026":"\uFE19","\u2027":"\u30FB","\u20A9":"\uFFE6","\u3001":"\uFE11","\u3002":"\uFE12","\u3008":"\uFE3F","\u3009":"\uFE40","\u300A":"\uFE3D","\u300B":"\uFE3E","\u300C":"\uFE41","\u300D":"\uFE42","\u300E":"\uFE43","\u300F":"\uFE44","\u3010":"\uFE3B","\u3011":"\uFE3C","\u3014":"\uFE39","\u3015":"\uFE3A","\u3016":"\uFE17","\u3017":"\uFE18","\uFF01":"\uFE15","\uFF08":"\uFE35","\uFF09":"\uFE36","\uFF0C":"\uFE10","\uFF0D":"\uFE32","\uFF0E":"\u30FB","\uFF1A":"\uFE13","\uFF1B":"\uFE14","\uFF1C":"\uFE3F","\uFF1E":"\uFE40","\uFF1F":"\uFE16","\uFF3B":"\uFE47","\uFF3D":"\uFE48","\uFF3F":"\uFE33","\uFF5B":"\uFE37","\uFF5C":"\u2015","\uFF5D":"\uFE38","\uFF5F":"\uFE35","\uFF60":"\uFE36","\uFF61":"\uFE12","\uFF62":"\uFE41","\uFF63":"\uFE42"};function Hi(C){for(var k="",V=0;V>1,tr=-7,Cr=V?xe-1:0,Xr=V?-1:1,qr=C[k+Cr];for(Cr+=Xr,Ie=qr&(1<<-tr)-1,qr>>=-tr,tr+=ht;tr>0;Ie=Ie*256+C[k+Cr],Cr+=Xr,tr-=8);for(Ve=Ie&(1<<-tr)-1,Ie>>=-tr,tr+=ne;tr>0;Ve=Ve*256+C[k+Cr],Cr+=Xr,tr-=8);if(Ie===0)Ie=1-Ht;else{if(Ie===Rt)return Ve?NaN:(qr?-1:1)*(1/0);Ve=Ve+Math.pow(2,ne),Ie=Ie-Ht}return(qr?-1:1)*Ve*Math.pow(2,Ie-ne)},ko=function(C,k,V,ne,xe,Ie){var Ve,ht,Rt,Ht=Ie*8-xe-1,tr=(1<>1,Xr=xe===23?Math.pow(2,-24)-Math.pow(2,-77):0,qr=ne?0:Ie-1,pa=ne?1:-1,ja=k<0||k===0&&1/k<0?1:0;for(k=Math.abs(k),isNaN(k)||k===1/0?(ht=isNaN(k)?1:0,Ve=tr):(Ve=Math.floor(Math.log(k)/Math.LN2),k*(Rt=Math.pow(2,-Ve))<1&&(Ve--,Rt*=2),Ve+Cr>=1?k+=Xr/Rt:k+=Xr*Math.pow(2,1-Cr),k*Rt>=2&&(Ve++,Rt/=2),Ve+Cr>=tr?(ht=0,Ve=tr):Ve+Cr>=1?(ht=(k*Rt-1)*Math.pow(2,xe),Ve=Ve+Cr):(ht=k*Math.pow(2,Cr-1)*Math.pow(2,xe),Ve=0));xe>=8;C[V+qr]=ht&255,qr+=pa,ht/=256,xe-=8);for(Ve=Ve<0;C[V+qr]=Ve&255,qr+=pa,Ve/=256,Ht-=8);C[V+qr-pa]|=ja*128},vs={read:jn,write:ko},go=Dn;function Dn(C){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(C)?C:new Uint8Array(C||0),this.pos=0,this.type=0,this.length=this.buf.length}Dn.Varint=0,Dn.Fixed64=1,Dn.Bytes=2,Dn.Fixed32=5;var is=65536*65536,Vo=1/is,Bo=12,_n=typeof TextDecoder>"u"?null:new TextDecoder("utf8");Dn.prototype={destroy:function(){this.buf=null},readFields:function(C,k,V){for(V=V||this.length;this.pos>3,Ie=this.pos;this.type=ne&7,C(xe,k,this),this.pos===Ie&&this.skip(ne)}return k},readMessage:function(C,k){return this.readFields(C,k,this.readVarint()+this.pos)},readFixed32:function(){var C=fh(this.buf,this.pos);return this.pos+=4,C},readSFixed32:function(){var C=Ip(this.buf,this.pos);return this.pos+=4,C},readFixed64:function(){var C=fh(this.buf,this.pos)+fh(this.buf,this.pos+4)*is;return this.pos+=8,C},readSFixed64:function(){var C=fh(this.buf,this.pos)+Ip(this.buf,this.pos+4)*is;return this.pos+=8,C},readFloat:function(){var C=vs.read(this.buf,this.pos,!0,23,4);return this.pos+=4,C},readDouble:function(){var C=vs.read(this.buf,this.pos,!0,52,8);return this.pos+=8,C},readVarint:function(C){var k=this.buf,V,ne;return ne=k[this.pos++],V=ne&127,ne<128||(ne=k[this.pos++],V|=(ne&127)<<7,ne<128)||(ne=k[this.pos++],V|=(ne&127)<<14,ne<128)||(ne=k[this.pos++],V|=(ne&127)<<21,ne<128)?V:(ne=k[this.pos],V|=(ne&15)<<28,us(V,C,this))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var C=this.readVarint();return C%2===1?(C+1)/-2:C/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var C=this.readVarint()+this.pos,k=this.pos;return this.pos=C,C-k>=Bo&&_n?uu(this.buf,k,C):pp(this.buf,k,C)},readBytes:function(){var C=this.readVarint()+this.pos,k=this.buf.subarray(this.pos,C);return this.pos=C,k},readPackedVarint:function(C,k){if(this.type!==Dn.Bytes)return C.push(this.readVarint(k));var V=No(this);for(C=C||[];this.pos127;);else if(k===Dn.Bytes)this.pos=this.readVarint()+this.pos;else if(k===Dn.Fixed32)this.pos+=4;else if(k===Dn.Fixed64)this.pos+=8;else throw new Error("Unimplemented type: "+k)},writeTag:function(C,k){this.writeVarint(C<<3|k)},realloc:function(C){for(var k=this.length||16;k268435455||C<0){Ku(C,this);return}this.realloc(4),this.buf[this.pos++]=C&127|(C>127?128:0),!(C<=127)&&(this.buf[this.pos++]=(C>>>=7)&127|(C>127?128:0),!(C<=127)&&(this.buf[this.pos++]=(C>>>=7)&127|(C>127?128:0),!(C<=127)&&(this.buf[this.pos++]=C>>>7&127)))},writeSVarint:function(C){this.writeVarint(C<0?-C*2-1:C*2)},writeBoolean:function(C){this.writeVarint(!!C)},writeString:function(C){C=String(C),this.realloc(C.length*4),this.pos++;var k=this.pos;this.pos=fc(this.buf,C,this.pos);var V=this.pos-k;V>=128&&Hp(k,V,this),this.pos=k-1,this.writeVarint(V),this.pos+=V},writeFloat:function(C){this.realloc(4),vs.write(this.buf,C,this.pos,!0,23,4),this.pos+=4},writeDouble:function(C){this.realloc(8),vs.write(this.buf,C,this.pos,!0,52,8),this.pos+=8},writeBytes:function(C){var k=C.length;this.writeVarint(k),this.realloc(k);for(var V=0;V=128&&Hp(V,ne,this),this.pos=V-1,this.writeVarint(ne),this.pos+=ne},writeMessage:function(C,k,V){this.writeTag(C,Dn.Bytes),this.writeRawMessage(k,V)},writePackedVarint:function(C,k){k.length&&this.writeMessage(C,bh,k)},writePackedSVarint:function(C,k){k.length&&this.writeMessage(C,eh,k)},writePackedBoolean:function(C,k){k.length&&this.writeMessage(C,Qh,k)},writePackedFloat:function(C,k){k.length&&this.writeMessage(C,Jh,k)},writePackedDouble:function(C,k){k.length&&this.writeMessage(C,$h,k)},writePackedFixed32:function(C,k){k.length&&this.writeMessage(C,uf,k)},writePackedSFixed32:function(C,k){k.length&&this.writeMessage(C,th,k)},writePackedFixed64:function(C,k){k.length&&this.writeMessage(C,Fh,k)},writePackedSFixed64:function(C,k){k.length&&this.writeMessage(C,wh,k)},writeBytesField:function(C,k){this.writeTag(C,Dn.Bytes),this.writeBytes(k)},writeFixed32Field:function(C,k){this.writeTag(C,Dn.Fixed32),this.writeFixed32(k)},writeSFixed32Field:function(C,k){this.writeTag(C,Dn.Fixed32),this.writeSFixed32(k)},writeFixed64Field:function(C,k){this.writeTag(C,Dn.Fixed64),this.writeFixed64(k)},writeSFixed64Field:function(C,k){this.writeTag(C,Dn.Fixed64),this.writeSFixed64(k)},writeVarintField:function(C,k){this.writeTag(C,Dn.Varint),this.writeVarint(k)},writeSVarintField:function(C,k){this.writeTag(C,Dn.Varint),this.writeSVarint(k)},writeStringField:function(C,k){this.writeTag(C,Dn.Bytes),this.writeString(k)},writeFloatField:function(C,k){this.writeTag(C,Dn.Fixed32),this.writeFloat(k)},writeDoubleField:function(C,k){this.writeTag(C,Dn.Fixed64),this.writeDouble(k)},writeBooleanField:function(C,k){this.writeVarintField(C,!!k)}};function us(C,k,V){var ne=V.buf,xe,Ie;if(Ie=ne[V.pos++],xe=(Ie&112)>>4,Ie<128||(Ie=ne[V.pos++],xe|=(Ie&127)<<3,Ie<128)||(Ie=ne[V.pos++],xe|=(Ie&127)<<10,Ie<128)||(Ie=ne[V.pos++],xe|=(Ie&127)<<17,Ie<128)||(Ie=ne[V.pos++],xe|=(Ie&127)<<24,Ie<128)||(Ie=ne[V.pos++],xe|=(Ie&1)<<31,Ie<128))return Es(C,xe,k);throw new Error("Expected varint not more than 10 bytes")}function No(C){return C.type===Dn.Bytes?C.readVarint()+C.pos:C.pos+1}function Es(C,k,V){return V?k*4294967296+(C>>>0):(k>>>0)*4294967296+(C>>>0)}function Ku(C,k){var V,ne;if(C>=0?(V=C%4294967296|0,ne=C/4294967296|0):(V=~(-C%4294967296),ne=~(-C/4294967296),V^4294967295?V=V+1|0:(V=0,ne=ne+1|0)),C>=18446744073709552e3||C<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");k.realloc(10),Uu(V,ne,k),Qf(ne,k)}function Uu(C,k,V){V.buf[V.pos++]=C&127|128,C>>>=7,V.buf[V.pos++]=C&127|128,C>>>=7,V.buf[V.pos++]=C&127|128,C>>>=7,V.buf[V.pos++]=C&127|128,C>>>=7,V.buf[V.pos]=C&127}function Qf(C,k){var V=(C&7)<<4;k.buf[k.pos++]|=V|((C>>>=3)?128:0),C&&(k.buf[k.pos++]=C&127|((C>>>=7)?128:0),C&&(k.buf[k.pos++]=C&127|((C>>>=7)?128:0),C&&(k.buf[k.pos++]=C&127|((C>>>=7)?128:0),C&&(k.buf[k.pos++]=C&127|((C>>>=7)?128:0),C&&(k.buf[k.pos++]=C&127)))))}function Hp(C,k,V){var ne=k<=16383?1:k<=2097151?2:k<=268435455?3:Math.floor(Math.log(k)/(Math.LN2*7));V.realloc(ne);for(var xe=V.pos-1;xe>=C;xe--)V.buf[xe+ne]=V.buf[xe]}function bh(C,k){for(var V=0;V>>8,C[V+2]=k>>>16,C[V+3]=k>>>24}function Ip(C,k){return(C[k]|C[k+1]<<8|C[k+2]<<16)+(C[k+3]<<24)}function pp(C,k,V){for(var ne="",xe=k;xe239?4:Ie>223?3:Ie>191?2:1;if(xe+ht>V)break;var Rt,Ht,tr;ht===1?Ie<128&&(Ve=Ie):ht===2?(Rt=C[xe+1],(Rt&192)===128&&(Ve=(Ie&31)<<6|Rt&63,Ve<=127&&(Ve=null))):ht===3?(Rt=C[xe+1],Ht=C[xe+2],(Rt&192)===128&&(Ht&192)===128&&(Ve=(Ie&15)<<12|(Rt&63)<<6|Ht&63,(Ve<=2047||Ve>=55296&&Ve<=57343)&&(Ve=null))):ht===4&&(Rt=C[xe+1],Ht=C[xe+2],tr=C[xe+3],(Rt&192)===128&&(Ht&192)===128&&(tr&192)===128&&(Ve=(Ie&15)<<18|(Rt&63)<<12|(Ht&63)<<6|tr&63,(Ve<=65535||Ve>=1114112)&&(Ve=null))),Ve===null?(Ve=65533,ht=1):Ve>65535&&(Ve-=65536,ne+=String.fromCharCode(Ve>>>10&1023|55296),Ve=56320|Ve&1023),ne+=String.fromCharCode(Ve),xe+=ht}return ne}function uu(C,k,V){return _n.decode(C.subarray(k,V))}function fc(C,k,V){for(var ne=0,xe,Ie;ne55295&&xe<57344)if(Ie)if(xe<56320){C[V++]=239,C[V++]=191,C[V++]=189,Ie=xe;continue}else xe=Ie-55296<<10|xe-56320|65536,Ie=null;else{xe>56319||ne+1===k.length?(C[V++]=239,C[V++]=191,C[V++]=189):Ie=xe;continue}else Ie&&(C[V++]=239,C[V++]=191,C[V++]=189,Ie=null);xe<128?C[V++]=xe:(xe<2048?C[V++]=xe>>6|192:(xe<65536?C[V++]=xe>>12|224:(C[V++]=xe>>18|240,C[V++]=xe>>12&63|128),C[V++]=xe>>6&63|128),C[V++]=xe&63|128)}return V}var Ju=3;function Rp(C,k,V){C===1&&V.readMessage(Kc,k)}function Kc(C,k,V){if(C===3){var ne=V.readMessage(dm,{}),xe=ne.id,Ie=ne.bitmap,Ve=ne.width,ht=ne.height,Rt=ne.left,Ht=ne.top,tr=ne.advance;k.push({id:xe,bitmap:new Pp({width:Ve+2*Ju,height:ht+2*Ju},Ie),metrics:{width:Ve,height:ht,left:Rt,top:Ht,advance:tr}})}}function dm(C,k,V){C===1?k.id=V.readVarint():C===2?k.bitmap=V.readBytes():C===3?k.width=V.readVarint():C===4?k.height=V.readVarint():C===5?k.left=V.readSVarint():C===6?k.top=V.readSVarint():C===7&&(k.advance=V.readVarint())}function _d(C){return new go(C).readFields(Rp,[])}var hd=Ju;function Wp(C){for(var k=0,V=0,ne=0,xe=C;ne=0;qr--){var pa=ht[qr];if(!(Xr.w>pa.w||Xr.h>pa.h)){if(Xr.x=pa.x,Xr.y=pa.y,Ht=Math.max(Ht,Xr.y+Xr.h),Rt=Math.max(Rt,Xr.x+Xr.w),Xr.w===pa.w&&Xr.h===pa.h){var ja=ht.pop();qr=0&&xe>=k&&bd[this.text.charCodeAt(xe)];xe--)ne--;this.text=this.text.substring(k,ne),this.sectionIndex=this.sectionIndex.slice(k,ne)},hh.prototype.substring=function(k,V){var ne=new hh;return ne.text=this.text.substring(k,V),ne.sectionIndex=this.sectionIndex.slice(k,V),ne.sections=this.sections,ne},hh.prototype.toString=function(){return this.text},hh.prototype.getMaxScale=function(){var k=this;return this.sectionIndex.reduce(function(V,ne){return Math.max(V,k.sections[ne].scale)},0)},hh.prototype.addTextSection=function(k,V){this.text+=k.text,this.sections.push(Ov.forText(k.scale,k.fontStack||V));for(var ne=this.sections.length-1,xe=0;xe=xd?null:++this.imageSectionID:(this.imageSectionID=Dg,this.imageSectionID)};function lA(C,k){for(var V=[],ne=C.text,xe=0,Ie=0,Ve=k;Ie=0,tr=0,Cr=0;Cr0&&Wf>Mo&&(Mo=Wf)}else{var Zl=V[yo.fontStack],Ol=Zl&&Zl[Eo];if(Ol&&Ol.rect)_s=Ol.rect,Zs=Ol.metrics;else{var $u=k[yo.fontStack],hc=$u&&$u[Eo];if(!hc)continue;Zs=hc.metrics}Ro=(ln-yo.scale)*rn}Xl?(C.verticalizable=!0,Nn.push({glyph:Eo,imageName:Wl,x:Xr,y:qr+Ro,vertical:Xl,scale:yo.scale,fontStack:yo.fontStack,sectionIndex:Ms,metrics:Zs,rect:_s}),Xr+=zu*yo.scale+Ht):(Nn.push({glyph:Eo,imageName:Wl,x:Xr,y:qr+Ro,vertical:Xl,scale:yo.scale,fontStack:yo.fontStack,sectionIndex:Ms,metrics:Zs,rect:_s}),Xr+=Zs.advance*yo.scale+Ht)}if(Nn.length!==0){var tp=Xr-Ht;pa=Math.max(tp,pa),hA(Nn,0,Nn.length-1,Ei,Mo)}Xr=0;var rp=Ie*ln+Mo;qn.lineOffset=Math.max(Mo,xn),qr+=rp,ja=Math.max(rp,ja),++li}var vh=qr-vm,mp=$1(Ve),gp=mp.horizontalAlign,rh=mp.verticalAlign;Oh(C.positionedLines,Ei,gp,rh,pa,ja,Ie,vh,xe.length),C.top+=-rh*vh,C.bottom=C.top+vh,C.left+=-gp*pa,C.right=C.left+pa}function hA(C,k,V,ne,xe){if(!(!ne&&!xe))for(var Ie=C[V],Ve=Ie.metrics.advance*Ie.scale,ht=(C[V].x+Ve)*ne,Rt=k;Rt<=V;Rt++)C[Rt].x-=ht,C[Rt].y+=xe}function Oh(C,k,V,ne,xe,Ie,Ve,ht,Rt){var Ht=(k-V)*xe,tr=0;Ie!==Ve?tr=-ht*ne-vm:tr=(-ne*Rt+.5)*Ve;for(var Cr=0,Xr=C;Cr-V/2;){if(Ve--,Ve<0)return!1;ht-=C[Ve].dist(Ie),Ie=C[Ve]}ht+=C[Ve].dist(C[Ve+1]),Ve++;for(var Rt=[],Ht=0;htne;)Ht-=Rt.shift().angleDelta;if(Ht>xe)return!1;Ve++,ht+=Cr.dist(Xr)}return!0}function _C(C){for(var k=0,V=0;VHt){var pa=(Ht-Rt)/qr,ja=Ml(Cr.x,Xr.x,pa),Ei=Ml(Cr.y,Xr.y,pa),li=new ep(ja,Ei,Xr.angleTo(Cr),tr);return li._round(),!Ve||yC(C,li,ht,Ve,k)?li:void 0}Rt+=qr}}function yW(C,k,V,ne,xe,Ie,Ve,ht,Rt){var Ht=xC(ne,Ie,Ve),tr=bC(ne,xe),Cr=tr*Ve,Xr=C[0].x===0||C[0].x===Rt||C[0].y===0||C[0].y===Rt;k-Cr=0&&Qi=0&&ln=0&&Xr+Ht<=tr){var xn=new ep(Qi,ln,en,pa);xn._round(),(!ne||yC(C,xn,Ie,ne,xe))&&qr.push(xn)}}Cr+=li}return!ht&&!qr.length&&!Ve&&(qr=wC(C,Cr/2,V,ne,xe,Ie,Ve,!0,Rt)),qr}function TC(C,k,V,ne,xe){for(var Ie=[],Ve=0;Ve=ne&&Cr.x>=ne)&&(tr.x>=ne?tr=new i(ne,tr.y+(Cr.y-tr.y)*((ne-tr.x)/(Cr.x-tr.x)))._round():Cr.x>=ne&&(Cr=new i(ne,tr.y+(Cr.y-tr.y)*((ne-tr.x)/(Cr.x-tr.x)))._round()),!(tr.y>=xe&&Cr.y>=xe)&&(tr.y>=xe?tr=new i(tr.x+(Cr.x-tr.x)*((xe-tr.y)/(Cr.y-tr.y)),xe)._round():Cr.y>=xe&&(Cr=new i(tr.x+(Cr.x-tr.x)*((xe-tr.y)/(Cr.y-tr.y)),xe)._round()),(!Rt||!tr.equals(Rt[Rt.length-1]))&&(Rt=[tr],Ie.push(Rt)),Rt.push(Cr)))))}return Ie}var Og=Rc;function AC(C,k,V,ne){var xe=[],Ie=C.image,Ve=Ie.pixelRatio,ht=Ie.paddedRect.w-2*Og,Rt=Ie.paddedRect.h-2*Og,Ht=C.right-C.left,tr=C.bottom-C.top,Cr=Ie.stretchX||[[0,ht]],Xr=Ie.stretchY||[[0,Rt]],qr=function(Zl,Ol){return Zl+Ol[1]-Ol[0]},pa=Cr.reduce(qr,0),ja=Xr.reduce(qr,0),Ei=ht-pa,li=Rt-ja,en=0,Ni=pa,Qi=0,ln=ja,xn=0,qn=Ei,Nn=0,Mo=li;if(Ie.content&&ne){var no=Ie.content;en=lb(Cr,0,no[0]),Qi=lb(Xr,0,no[1]),Ni=lb(Cr,no[0],no[2]),ln=lb(Xr,no[1],no[3]),xn=no[0]-en,Nn=no[1]-Qi,qn=no[2]-no[0]-Ni,Mo=no[3]-no[1]-ln}var yo=function(Zl,Ol,$u,hc){var cf=ub(Zl.stretch-en,Ni,Ht,C.left),yf=cb(Zl.fixed-xn,qn,Zl.stretch,pa),dh=ub(Ol.stretch-Qi,ln,tr,C.top),Wf=cb(Ol.fixed-Nn,Mo,Ol.stretch,ja),tp=ub($u.stretch-en,Ni,Ht,C.left),rp=cb($u.fixed-xn,qn,$u.stretch,pa),vh=ub(hc.stretch-Qi,ln,tr,C.top),mp=cb(hc.fixed-Nn,Mo,hc.stretch,ja),gp=new i(cf,dh),rh=new i(tp,dh),yp=new i(tp,vh),od=new i(cf,vh),Uv=new i(yf/Ve,Wf/Ve),ym=new i(rp/Ve,mp/Ve),_m=k*Math.PI/180;if(_m){var xm=Math.sin(_m),Hg=Math.cos(_m),wd=[Hg,-xm,xm,Hg];gp._matMult(wd),rh._matMult(wd),od._matMult(wd),yp._matMult(wd)}var mb=Zl.stretch+Zl.fixed,xA=$u.stretch+$u.fixed,gb=Ol.stretch+Ol.fixed,bA=hc.stretch+hc.fixed,pd={x:Ie.paddedRect.x+Og+mb,y:Ie.paddedRect.y+Og+gb,w:xA-mb,h:bA-gb},Wg=qn/Ve/Ht,yb=Mo/Ve/tr;return{tl:gp,tr:rh,bl:od,br:yp,tex:pd,writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:Uv,pixelOffsetBR:ym,minFontScaleX:Wg,minFontScaleY:yb,isSDF:V}};if(!ne||!Ie.stretchX&&!Ie.stretchY)xe.push(yo({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:ht+1},{fixed:0,stretch:Rt+1}));else for(var Ms=SC(Cr,Ei,pa),Eo=SC(Xr,li,ja),Ro=0;Ro0&&(pa=Math.max(10,pa),this.circleDiameter=pa)}else{var ja=Ve.top*ht-Rt,Ei=Ve.bottom*ht+Rt,li=Ve.left*ht-Rt,en=Ve.right*ht+Rt,Ni=Ve.collisionPadding;if(Ni&&(li-=Ni[0]*ht,ja-=Ni[1]*ht,en+=Ni[2]*ht,Ei+=Ni[3]*ht),tr){var Qi=new i(li,ja),ln=new i(en,ja),xn=new i(li,Ei),qn=new i(en,Ei),Nn=tr*Math.PI/180;Qi._rotate(Nn),ln._rotate(Nn),xn._rotate(Nn),qn._rotate(Nn),li=Math.min(Qi.x,ln.x,xn.x,qn.x),en=Math.max(Qi.x,ln.x,xn.x,qn.x),ja=Math.min(Qi.y,ln.y,xn.y,qn.y),Ei=Math.max(Qi.y,ln.y,xn.y,qn.y)}k.emplaceBack(V.x,V.y,li,ja,en,Ei,ne,xe,Ie)}this.boxEndIndex=k.length},Bg=function(k,V){if(k===void 0&&(k=[]),V===void 0&&(V=xW),this.data=k,this.length=this.data.length,this.compare=V,this.length>0)for(var ne=(this.length>>1)-1;ne>=0;ne--)this._down(ne)};Bg.prototype.push=function(k){this.data.push(k),this.length++,this._up(this.length-1)},Bg.prototype.pop=function(){if(this.length!==0){var k=this.data[0],V=this.data.pop();return this.length--,this.length>0&&(this.data[0]=V,this._down(0)),k}},Bg.prototype.peek=function(){return this.data[0]},Bg.prototype._up=function(k){for(var V=this,ne=V.data,xe=V.compare,Ie=ne[k];k>0;){var Ve=k-1>>1,ht=ne[Ve];if(xe(Ie,ht)>=0)break;ne[k]=ht,k=Ve}ne[k]=Ie},Bg.prototype._down=function(k){for(var V=this,ne=V.data,xe=V.compare,Ie=this.length>>1,Ve=ne[k];k=0)break;ne[k]=Rt,k=ht}ne[k]=Ve};function xW(C,k){return Ck?1:0}function bW(C,k,V){k===void 0&&(k=1),V===void 0&&(V=!1);for(var ne=1/0,xe=1/0,Ie=-1/0,Ve=-1/0,ht=C[0],Rt=0;RtIe)&&(Ie=Ht.x),(!Rt||Ht.y>Ve)&&(Ve=Ht.y)}var tr=Ie-ne,Cr=Ve-xe,Xr=Math.min(tr,Cr),qr=Xr/2,pa=new Bg([],wW);if(Xr===0)return new i(ne,xe);for(var ja=ne;jali.d||!li.d)&&(li=Ni,V&&console.log("found best %d after %d probes",Math.round(1e4*Ni.d)/1e4,en)),!(Ni.max-li.d<=k)&&(qr=Ni.h/2,pa.push(new Ng(Ni.p.x-qr,Ni.p.y-qr,qr,C)),pa.push(new Ng(Ni.p.x+qr,Ni.p.y-qr,qr,C)),pa.push(new Ng(Ni.p.x-qr,Ni.p.y+qr,qr,C)),pa.push(new Ng(Ni.p.x+qr,Ni.p.y+qr,qr,C)),en+=4)}return V&&(console.log("num probes: "+en),console.log("best distance: "+li.d)),li.p}function wW(C,k){return k.max-C.max}function Ng(C,k,V,ne){this.p=new i(C,k),this.h=V,this.d=TW(this.p,ne),this.max=this.d+this.h*Math.SQRT2}function TW(C,k){for(var V=!1,ne=1/0,xe=0;xeC.y!=tr.y>C.y&&C.x<(tr.x-Ht.x)*(C.y-Ht.y)/(tr.y-Ht.y)+Ht.x&&(V=!V),ne=Math.min(ne,qd(C,Ht,tr))}return(V?1:-1)*Math.sqrt(ne)}function AW(C){for(var k=0,V=0,ne=0,xe=C[0],Ie=0,Ve=xe.length,ht=Ve-1;Ie=pi||wd.y<0||wd.y>=pi||EW(C,wd,Hg,V,ne,xe,Eo,C.layers[0],C.collisionBoxArray,k.index,k.sourceLayerIndex,C.index,li,ln,Nn,Rt,Ni,xn,Mo,qr,k,Ie,Ht,tr,Ve)};if(no==="line")for(var Zs=0,_s=TC(k.geometry,0,0,pi,pi);Zs<_s.length;Zs+=1)for(var Wl=_s[Zs],zu=yW(Wl,Qi,qn,V.vertical||pa,ne,ja,en,C.overscaling,pi),Xl=0,Zl=zu;Xl1){var dh=gW(yf,qn,V.vertical||pa,ne,ja,en);dh&&Ro(yf,dh)}}else if(k.type==="Polygon")for(var Wf=0,tp=Cg(k.geometry,0);Wfmm&&U(C.layerIds[0]+': Value for "text-size" is >= '+Q1+'. Reduce your "text-size".')):Ei.kind==="composite"&&(li=[Bh*qr.compositeTextSizes[0].evaluate(Ve,{},pa),Bh*qr.compositeTextSizes[1].evaluate(Ve,{},pa)],(li[0]>mm||li[1]>mm)&&U(C.layerIds[0]+': Value for "text-size" is >= '+Q1+'. Reduce your "text-size".')),C.addSymbols(C.text,ja,li,ht,Ie,Ve,Ht,k,Rt.lineStartIndex,Rt.lineLength,Xr,pa);for(var en=0,Ni=tr;enmm&&U(C.layerIds[0]+': Value for "icon-size" is >= '+Q1+'. Reduce your "icon-size".')):gp.kind==="composite"&&(rh=[Bh*ln.compositeIconSizes[0].evaluate(Qi,{},qn),Bh*ln.compositeIconSizes[1].evaluate(Qi,{},qn)],(rh[0]>mm||rh[1]>mm)&&U(C.layerIds[0]+': Value for "icon-size" is >= '+Q1+'. Reduce your "icon-size".')),C.addSymbols(C.icon,vh,rh,Ni,en,Qi,!1,k,no.lineStartIndex,no.lineLength,-1,qn),Xl=C.icon.placedSymbolArray.length-1,mp&&(_s=mp.length*4,C.addSymbols(C.icon,mp,rh,Ni,en,Qi,dp.vertical,k,no.lineStartIndex,no.lineLength,-1,qn),Zl=C.icon.placedSymbolArray.length-1)}for(var yp in ne.horizontal){var od=ne.horizontal[yp];if(!yo){$u=me(od.text);var Uv=ht.layout.get("text-rotate").evaluate(Qi,{},qn);yo=new fb(Rt,k,Ht,tr,Cr,od,Xr,qr,pa,Uv)}var ym=od.positionedLines.length===1;if(Wl+=EC(C,k,od,Ie,ht,pa,Qi,ja,no,ne.vertical?dp.horizontal:dp.horizontalOnly,ym?Object.keys(ne.horizontal):[yp],Ol,Xl,ln,qn),ym)break}ne.vertical&&(zu+=EC(C,k,ne.vertical,Ie,ht,pa,Qi,ja,no,dp.vertical,["vertical"],Ol,Zl,ln,qn));var _m=yo?yo.boxStartIndex:C.collisionBoxArray.length,xm=yo?yo.boxEndIndex:C.collisionBoxArray.length,Hg=Eo?Eo.boxStartIndex:C.collisionBoxArray.length,wd=Eo?Eo.boxEndIndex:C.collisionBoxArray.length,mb=Ms?Ms.boxStartIndex:C.collisionBoxArray.length,xA=Ms?Ms.boxEndIndex:C.collisionBoxArray.length,gb=Ro?Ro.boxStartIndex:C.collisionBoxArray.length,bA=Ro?Ro.boxEndIndex:C.collisionBoxArray.length,pd=-1,Wg=function(r_,GC){return r_&&r_.circleDiameter?Math.max(r_.circleDiameter,GC):GC};pd=Wg(yo,pd),pd=Wg(Eo,pd),pd=Wg(Ms,pd),pd=Wg(Ro,pd);var yb=pd>-1?1:0;yb&&(pd*=Nn/rn),C.glyphOffsetArray.length>=Du.MAX_GLYPHS&&U("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),Qi.sortKey!==void 0&&C.addToSortKeyRanges(C.symbolInstances.length,Qi.sortKey),C.symbolInstances.emplaceBack(k.x,k.y,Ol.right>=0?Ol.right:-1,Ol.center>=0?Ol.center:-1,Ol.left>=0?Ol.left:-1,Ol.vertical||-1,Xl,Zl,$u,_m,xm,Hg,wd,mb,xA,gb,bA,Ht,Wl,zu,Zs,_s,yb,0,Xr,hc,cf,pd)}function CW(C,k,V,ne){var xe=C.compareText;if(!(k in xe))xe[k]=[];else for(var Ie=xe[k],Ve=Ie.length-1;Ve>=0;Ve--)if(ne.dist(Ie[Ve])0)&&(Ve.value.kind!=="constant"||Ve.value.value.length>0),tr=Rt.value.kind!=="constant"||!!Rt.value.value||Object.keys(Rt.parameters).length>0,Cr=Ie.get("symbol-sort-key");if(this.features=[],!(!Ht&&!tr)){for(var Xr=V.iconDependencies,qr=V.glyphDependencies,pa=V.availableImages,ja=new gn(this.zoom),Ei=0,li=k;Ei=0;for(var zu=0,Xl=Mo.sections;zu=0;Rt--)Ve[Rt]={x:V[Rt].x,y:V[Rt].y,tileUnitDistanceFromAnchor:Ie},Rt>0&&(Ie+=V[Rt-1].dist(V[Rt]));for(var Ht=0;Ht0},Du.prototype.hasIconData=function(){return this.icon.segments.get().length>0},Du.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},Du.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},Du.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},Du.prototype.addIndicesForPlacedSymbol=function(k,V){for(var ne=k.placedSymbolArray.get(V),xe=ne.vertexStartIndex+ne.numGlyphs*4,Ie=ne.vertexStartIndex;Ie1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(k),this.sortedAngle=k,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(var ne=0,xe=this.symbolInstanceIndexes;ne=0&&Ht.indexOf(ht)===Rt&&V.addIndicesForPlacedSymbol(V.text,ht)}),Ve.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,Ve.verticalPlacedTextSymbolIndex),Ve.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,Ve.placedIconSymbolIndex),Ve.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,Ve.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},de("SymbolBucket",Du,{omit:["layers","collisionBoxArray","features","compareText"]}),Du.MAX_GLYPHS=65535,Du.addDynamicAttributes=vA;function IW(C,k){return k.replace(/{([^{}]+)}/g,function(V,ne){return ne in C?String(C[ne]):""})}var RW=new xa({"symbol-placement":new nt(Ui.layout_symbol["symbol-placement"]),"symbol-spacing":new nt(Ui.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new nt(Ui.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Yt(Ui.layout_symbol["symbol-sort-key"]),"symbol-z-order":new nt(Ui.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new nt(Ui.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new nt(Ui.layout_symbol["icon-ignore-placement"]),"icon-optional":new nt(Ui.layout_symbol["icon-optional"]),"icon-rotation-alignment":new nt(Ui.layout_symbol["icon-rotation-alignment"]),"icon-size":new Yt(Ui.layout_symbol["icon-size"]),"icon-text-fit":new nt(Ui.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new nt(Ui.layout_symbol["icon-text-fit-padding"]),"icon-image":new Yt(Ui.layout_symbol["icon-image"]),"icon-rotate":new Yt(Ui.layout_symbol["icon-rotate"]),"icon-padding":new nt(Ui.layout_symbol["icon-padding"]),"icon-keep-upright":new nt(Ui.layout_symbol["icon-keep-upright"]),"icon-offset":new Yt(Ui.layout_symbol["icon-offset"]),"icon-anchor":new Yt(Ui.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new nt(Ui.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new nt(Ui.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new nt(Ui.layout_symbol["text-rotation-alignment"]),"text-field":new Yt(Ui.layout_symbol["text-field"]),"text-font":new Yt(Ui.layout_symbol["text-font"]),"text-size":new Yt(Ui.layout_symbol["text-size"]),"text-max-width":new Yt(Ui.layout_symbol["text-max-width"]),"text-line-height":new nt(Ui.layout_symbol["text-line-height"]),"text-letter-spacing":new Yt(Ui.layout_symbol["text-letter-spacing"]),"text-justify":new Yt(Ui.layout_symbol["text-justify"]),"text-radial-offset":new Yt(Ui.layout_symbol["text-radial-offset"]),"text-variable-anchor":new nt(Ui.layout_symbol["text-variable-anchor"]),"text-anchor":new Yt(Ui.layout_symbol["text-anchor"]),"text-max-angle":new nt(Ui.layout_symbol["text-max-angle"]),"text-writing-mode":new nt(Ui.layout_symbol["text-writing-mode"]),"text-rotate":new Yt(Ui.layout_symbol["text-rotate"]),"text-padding":new nt(Ui.layout_symbol["text-padding"]),"text-keep-upright":new nt(Ui.layout_symbol["text-keep-upright"]),"text-transform":new Yt(Ui.layout_symbol["text-transform"]),"text-offset":new Yt(Ui.layout_symbol["text-offset"]),"text-allow-overlap":new nt(Ui.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new nt(Ui.layout_symbol["text-ignore-placement"]),"text-optional":new nt(Ui.layout_symbol["text-optional"])}),DW=new xa({"icon-opacity":new Yt(Ui.paint_symbol["icon-opacity"]),"icon-color":new Yt(Ui.paint_symbol["icon-color"]),"icon-halo-color":new Yt(Ui.paint_symbol["icon-halo-color"]),"icon-halo-width":new Yt(Ui.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Yt(Ui.paint_symbol["icon-halo-blur"]),"icon-translate":new nt(Ui.paint_symbol["icon-translate"]),"icon-translate-anchor":new nt(Ui.paint_symbol["icon-translate-anchor"]),"text-opacity":new Yt(Ui.paint_symbol["text-opacity"]),"text-color":new Yt(Ui.paint_symbol["text-color"],{runtimeType:As,getOverride:function(C){return C.textColor},hasOverride:function(C){return!!C.textColor}}),"text-halo-color":new Yt(Ui.paint_symbol["text-halo-color"]),"text-halo-width":new Yt(Ui.paint_symbol["text-halo-width"]),"text-halo-blur":new Yt(Ui.paint_symbol["text-halo-blur"]),"text-translate":new nt(Ui.paint_symbol["text-translate"]),"text-translate-anchor":new nt(Ui.paint_symbol["text-translate-anchor"])}),mA={paint:DW,layout:RW},qg=function(k){this.type=k.property.overrides?k.property.overrides.runtimeType:rl,this.defaultValue=k};qg.prototype.evaluate=function(k){if(k.formattedSection){var V=this.defaultValue.property.overrides;if(V&&V.hasOverride(k.formattedSection))return V.getOverride(k.formattedSection)}return k.feature&&k.featureState?this.defaultValue.evaluate(k.feature,k.featureState):this.defaultValue.property.specification.default},qg.prototype.eachChild=function(k){if(!this.defaultValue.isConstant()){var V=this.defaultValue.value;k(V._styleExpression.expression)}},qg.prototype.outputDefined=function(){return!1},qg.prototype.serialize=function(){return null},de("FormatSectionOverride",qg,{omit:["defaultValue"]});var zW=function(C){function k(V){C.call(this,V,mA)}return C&&(k.__proto__=C),k.prototype=Object.create(C&&C.prototype),k.prototype.constructor=k,k.prototype.recalculate=function(ne,xe){if(C.prototype.recalculate.call(this,ne,xe),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout.get("symbol-placement")!=="point"?this.layout._values["icon-rotation-alignment"]="map":this.layout._values["icon-rotation-alignment"]="viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout.get("symbol-placement")!=="point"?this.layout._values["text-rotation-alignment"]="map":this.layout._values["text-rotation-alignment"]="viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),this.layout.get("symbol-placement")==="point"){var Ie=this.layout.get("text-writing-mode");if(Ie){for(var Ve=[],ht=0,Rt=Ie;ht",targetMapId:xe,sourceMapId:Ve.mapId})}}},Vg.prototype.receive=function(k){var V=k.data,ne=V.id;if(ne&&!(V.targetMapId&&this.mapId!==V.targetMapId))if(V.type===""){delete this.tasks[ne];var xe=this.cancelCallbacks[ne];delete this.cancelCallbacks[ne],xe&&xe()}else le()||V.mustQueue?(this.tasks[ne]=V,this.taskQueue.push(ne),this.invoker.trigger()):this.processTask(ne,V)},Vg.prototype.process=function(){if(this.taskQueue.length){var k=this.taskQueue.shift(),V=this.tasks[k];delete this.tasks[k],this.taskQueue.length&&this.invoker.trigger(),V&&this.processTask(k,V)}},Vg.prototype.processTask=function(k,V){var ne=this;if(V.type===""){var xe=this.callbacks[k];delete this.callbacks[k],xe&&(V.error?xe(St(V.error)):xe(null,St(V.data)))}else{var Ie=!1,Ve=$(this.globalScope)?void 0:[],ht=V.hasCallback?function(Xr,qr){Ie=!0,delete ne.cancelCallbacks[k],ne.target.postMessage({id:k,type:"",sourceMapId:ne.mapId,error:Xr?_t(Xr):null,data:_t(qr,Ve)},Ve)}:function(Xr){Ie=!0},Rt=null,Ht=St(V.data);if(this.parent[V.type])Rt=this.parent[V.type](V.sourceMapId,Ht,ht);else if(this.parent.getWorkerSource){var tr=V.type.split("."),Cr=this.parent.getWorkerSource(V.sourceMapId,tr[0],Ht.source);Rt=Cr[tr[1]](Ht,ht)}else ht(new Error("Could not find function "+V.type));!Ie&&Rt&&Rt.cancel&&(this.cancelCallbacks[k]=Rt.cancel)}},Vg.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};function WW(C,k,V){k=Math.pow(2,V)-k-1;var ne=RC(C*256,k*256,V),xe=RC((C+1)*256,(k+1)*256,V);return ne[0]+","+ne[1]+","+xe[0]+","+xe[1]}function RC(C,k,V){var ne=2*Math.PI*6378137/256/Math.pow(2,V),xe=C*ne-2*Math.PI*6378137/2,Ie=k*ne-2*Math.PI*6378137/2;return[xe,Ie]}var Gf=function(k,V){k&&(V?this.setSouthWest(k).setNorthEast(V):k.length===4?this.setSouthWest([k[0],k[1]]).setNorthEast([k[2],k[3]]):this.setSouthWest(k[0]).setNorthEast(k[1]))};Gf.prototype.setNorthEast=function(k){return this._ne=k instanceof Dc?new Dc(k.lng,k.lat):Dc.convert(k),this},Gf.prototype.setSouthWest=function(k){return this._sw=k instanceof Dc?new Dc(k.lng,k.lat):Dc.convert(k),this},Gf.prototype.extend=function(k){var V=this._sw,ne=this._ne,xe,Ie;if(k instanceof Dc)xe=k,Ie=k;else if(k instanceof Gf){if(xe=k._sw,Ie=k._ne,!xe||!Ie)return this}else{if(Array.isArray(k))if(k.length===4||k.every(Array.isArray)){var Ve=k;return this.extend(Gf.convert(Ve))}else{var ht=k;return this.extend(Dc.convert(ht))}return this}return!V&&!ne?(this._sw=new Dc(xe.lng,xe.lat),this._ne=new Dc(Ie.lng,Ie.lat)):(V.lng=Math.min(xe.lng,V.lng),V.lat=Math.min(xe.lat,V.lat),ne.lng=Math.max(Ie.lng,ne.lng),ne.lat=Math.max(Ie.lat,ne.lat)),this},Gf.prototype.getCenter=function(){return new Dc((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},Gf.prototype.getSouthWest=function(){return this._sw},Gf.prototype.getNorthEast=function(){return this._ne},Gf.prototype.getNorthWest=function(){return new Dc(this.getWest(),this.getNorth())},Gf.prototype.getSouthEast=function(){return new Dc(this.getEast(),this.getSouth())},Gf.prototype.getWest=function(){return this._sw.lng},Gf.prototype.getSouth=function(){return this._sw.lat},Gf.prototype.getEast=function(){return this._ne.lng},Gf.prototype.getNorth=function(){return this._ne.lat},Gf.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},Gf.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},Gf.prototype.isEmpty=function(){return!(this._sw&&this._ne)},Gf.prototype.contains=function(k){var V=Dc.convert(k),ne=V.lng,xe=V.lat,Ie=this._sw.lat<=xe&&xe<=this._ne.lat,Ve=this._sw.lng<=ne&&ne<=this._ne.lng;return this._sw.lng>this._ne.lng&&(Ve=this._sw.lng>=ne&&ne>=this._ne.lng),Ie&&Ve},Gf.convert=function(k){return!k||k instanceof Gf?k:new Gf(k)};var DC=63710088e-1,Dc=function(k,V){if(isNaN(k)||isNaN(V))throw new Error("Invalid LngLat object: ("+k+", "+V+")");if(this.lng=+k,this.lat=+V,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};Dc.prototype.wrap=function(){return new Dc(_(this.lng,-180,180),this.lat)},Dc.prototype.toArray=function(){return[this.lng,this.lat]},Dc.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},Dc.prototype.distanceTo=function(k){var V=Math.PI/180,ne=this.lat*V,xe=k.lat*V,Ie=Math.sin(ne)*Math.sin(xe)+Math.cos(ne)*Math.cos(xe)*Math.cos((k.lng-this.lng)*V),Ve=DC*Math.acos(Math.min(Ie,1));return Ve},Dc.prototype.toBounds=function(k){k===void 0&&(k=0);var V=40075017,ne=360*k/V,xe=ne/Math.cos(Math.PI/180*this.lat);return new Gf(new Dc(this.lng-xe,this.lat-ne),new Dc(this.lng+xe,this.lat+ne))},Dc.convert=function(k){if(k instanceof Dc)return k;if(Array.isArray(k)&&(k.length===2||k.length===3))return new Dc(Number(k[0]),Number(k[1]));if(!Array.isArray(k)&&typeof k=="object"&&k!==null)return new Dc(Number("lng"in k?k.lng:k.lon),Number(k.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]")};var zC=2*Math.PI*DC;function FC(C){return zC*Math.cos(C*Math.PI/180)}function OC(C){return(180+C)/360}function BC(C){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+C*Math.PI/360)))/360}function NC(C,k){return C/FC(k)}function XW(C){return C*360-180}function yA(C){var k=180-C*360;return 360/Math.PI*Math.atan(Math.exp(k*Math.PI/180))-90}function ZW(C,k){return C*FC(yA(k))}function YW(C){return 1/Math.cos(C*Math.PI/180)}var B0=function(k,V,ne){ne===void 0&&(ne=0),this.x=+k,this.y=+V,this.z=+ne};B0.fromLngLat=function(k,V){V===void 0&&(V=0);var ne=Dc.convert(k);return new B0(OC(ne.lng),BC(ne.lat),NC(V,ne.lat))},B0.prototype.toLngLat=function(){return new Dc(XW(this.x),yA(this.y))},B0.prototype.toAltitude=function(){return ZW(this.z,this.y)},B0.prototype.meterInMercatorCoordinateUnits=function(){return 1/zC*YW(yA(this.y))};var N0=function(k,V,ne){this.z=k,this.x=V,this.y=ne,this.key=t_(0,k,k,V,ne)};N0.prototype.equals=function(k){return this.z===k.z&&this.x===k.x&&this.y===k.y},N0.prototype.url=function(k,V){var ne=WW(this.x,this.y,this.z),xe=KW(this.z,this.x,this.y);return k[(this.x+this.y)%k.length].replace("{prefix}",(this.x%16).toString(16)+(this.y%16).toString(16)).replace("{z}",String(this.z)).replace("{x}",String(this.x)).replace("{y}",String(V==="tms"?Math.pow(2,this.z)-this.y-1:this.y)).replace("{quadkey}",xe).replace("{bbox-epsg-3857}",ne)},N0.prototype.getTilePoint=function(k){var V=Math.pow(2,this.z);return new i((k.x*V-this.x)*pi,(k.y*V-this.y)*pi)},N0.prototype.toString=function(){return this.z+"/"+this.x+"/"+this.y};var UC=function(k,V){this.wrap=k,this.canonical=V,this.key=t_(k,V.z,V.z,V.x,V.y)},Hf=function(k,V,ne,xe,Ie){this.overscaledZ=k,this.wrap=V,this.canonical=new N0(ne,+xe,+Ie),this.key=t_(V,k,ne,xe,Ie)};Hf.prototype.equals=function(k){return this.overscaledZ===k.overscaledZ&&this.wrap===k.wrap&&this.canonical.equals(k.canonical)},Hf.prototype.scaledTo=function(k){var V=this.canonical.z-k;return k>this.canonical.z?new Hf(k,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Hf(k,this.wrap,k,this.canonical.x>>V,this.canonical.y>>V)},Hf.prototype.calculateScaledKey=function(k,V){var ne=this.canonical.z-k;return k>this.canonical.z?t_(this.wrap*+V,k,this.canonical.z,this.canonical.x,this.canonical.y):t_(this.wrap*+V,k,k,this.canonical.x>>ne,this.canonical.y>>ne)},Hf.prototype.isChildOf=function(k){if(k.wrap!==this.wrap)return!1;var V=this.canonical.z-k.canonical.z;return k.overscaledZ===0||k.overscaledZ>V&&k.canonical.y===this.canonical.y>>V},Hf.prototype.children=function(k){if(this.overscaledZ>=k)return[new Hf(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var V=this.canonical.z+1,ne=this.canonical.x*2,xe=this.canonical.y*2;return[new Hf(V,this.wrap,V,ne,xe),new Hf(V,this.wrap,V,ne+1,xe),new Hf(V,this.wrap,V,ne,xe+1),new Hf(V,this.wrap,V,ne+1,xe+1)]},Hf.prototype.isLessThan=function(k){return this.wrapk.wrap?!1:this.overscaledZk.overscaledZ?!1:this.canonical.xk.canonical.x?!1:this.canonical.y0;Ie--)xe=1<=this.dim+1||V<-1||V>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(V+1)*this.stride+(k+1)},Bv.prototype._unpackMapbox=function(k,V,ne){return(k*256*256+V*256+ne)/10-1e4},Bv.prototype._unpackTerrarium=function(k,V,ne){return k*256+V+ne/256-32768},Bv.prototype.getPixels=function(){return new $f({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},Bv.prototype.backfillBorder=function(k,V,ne){if(this.dim!==k.dim)throw new Error("dem dimension mismatch");var xe=V*this.dim,Ie=V*this.dim+this.dim,Ve=ne*this.dim,ht=ne*this.dim+this.dim;switch(V){case-1:xe=Ie-1;break;case 1:Ie=xe+1;break}switch(ne){case-1:Ve=ht-1;break;case 1:ht=Ve+1;break}for(var Rt=-V*this.dim,Ht=-ne*this.dim,tr=Ve;tr=0&&Cr[3]>=0&&Rt.insert(ht,Cr[0],Cr[1],Cr[2],Cr[3])}},Nv.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new Xd.VectorTile(new go(this.rawTileData)).layers,this.sourceLayerCoder=new db(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},Nv.prototype.query=function(k,V,ne,xe){var Ie=this;this.loadVTLayers();for(var Ve=k.params||{},ht=pi/k.tileSize/k.scale,Rt=Je(Ve.filter),Ht=k.queryGeometry,tr=k.queryPadding*ht,Cr=qC(Ht),Xr=this.grid.query(Cr.minX-tr,Cr.minY-tr,Cr.maxX+tr,Cr.maxY+tr),qr=qC(k.cameraQueryGeometry),pa=this.grid3D.query(qr.minX-tr,qr.minY-tr,qr.maxX+tr,qr.maxY+tr,function(xn,qn,Nn,Mo){return rd(k.cameraQueryGeometry,xn-tr,qn-tr,Nn+tr,Mo+tr)}),ja=0,Ei=pa;jaxe)Ie=!1;else if(!V)Ie=!0;else if(this.expirationTime=aa.maxzoom)&&aa.visibility!=="none"){c(Ur,this.zoom,Wt);var da=Ha[aa.id]=aa.createBucket({index:Ia.bucketLayerIDs.length,layers:Ur,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:ct,sourceID:this.source});da.populate(Nr,$a,this.tileID.canonical),Ia.bucketLayerIDs.push(Ur.map(function(ha){return ha.id}))}}}}var fa,It,dr,kr,ia=e.mapObject($a.glyphDependencies,function(ha){return Object.keys(ha).map(Number)});Object.keys(ia).length?Pr.send("getGlyphs",{uid:this.uid,stacks:ia},function(ha,Da){fa||(fa=ha,It=Da,Ya.call(ma))}):It={};var Ca=Object.keys($a.iconDependencies);Ca.length?Pr.send("getImages",{icons:Ca,source:this.source,tileID:this.tileID,type:"icons"},function(ha,Da){fa||(fa=ha,dr=Da,Ya.call(ma))}):dr={};var Fa=Object.keys($a.patternDependencies);Fa.length?Pr.send("getImages",{icons:Fa,source:this.source,tileID:this.tileID,type:"patterns"},function(ha,Da){fa||(fa=ha,kr=Da,Ya.call(ma))}):kr={},Ya.call(this);function Ya(){if(fa)return ta(fa);if(It&&dr&&kr){var ha=new n(It),Da=new e.ImageAtlas(dr,kr);for(var Xi in Ha){var Li=Ha[Xi];Li instanceof e.SymbolBucket?(c(Li.layers,this.zoom,Wt),e.performSymbolLayout(Li,It,ha.positions,dr,Da.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):Li.hasPattern&&(Li instanceof e.LineBucket||Li instanceof e.FillBucket||Li instanceof e.FillExtrusionBucket)&&(c(Li.layers,this.zoom,Wt),Li.addFeatures($a,this.tileID.canonical,Da.patternPositions))}this.status="done",ta(null,{buckets:e.values(Ha).filter(function(fn){return!fn.isEmpty()}),featureIndex:Ia,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:ha.image,imageAtlas:Da,glyphMap:this.returnDependencies?It:null,iconMap:this.returnDependencies?dr:null,glyphPositions:this.returnDependencies?ha.positions:null})}}};function c(Jt,Nt,Kt){for(var Wt=new e.EvaluationParameters(Nt),Pr=0,ta=Jt;Pr=0!=!!Nt&&Jt.reverse()}var E=e.vectorTile.VectorTileFeature.prototype.toGeoJSON,y=function(Nt){this._feature=Nt,this.extent=e.EXTENT,this.type=Nt.type,this.properties=Nt.tags,"id"in Nt&&!isNaN(Nt.id)&&(this.id=parseInt(Nt.id,10))};y.prototype.loadGeometry=function(){if(this._feature.type===1){for(var Nt=[],Kt=0,Wt=this._feature.geometry;Kt"u"&&(Wt.push(ra),Ia=Wt.length-1,ta[ra]=Ia),Nt.writeVarint(Ia);var Ha=Kt.properties[ra],$a=typeof Ha;$a!=="string"&&$a!=="boolean"&&$a!=="number"&&(Ha=JSON.stringify(Ha));var ai=$a+":"+Ha,mi=ma[ai];typeof mi>"u"&&(Pr.push(Ha),mi=Pr.length-1,ma[ai]=mi),Nt.writeVarint(mi)}}function Q(Jt,Nt){return(Nt<<3)+(Jt&7)}function ue(Jt){return Jt<<1^Jt>>31}function le(Jt,Nt){for(var Kt=Jt.loadGeometry(),Wt=Jt.type,Pr=0,ta=0,ma=Kt.length,ra=0;ra>1;$(Jt,Nt,ma,Wt,Pr,ta%2),G(Jt,Nt,Kt,Wt,ma-1,ta+1),G(Jt,Nt,Kt,ma+1,Pr,ta+1)}}function $(Jt,Nt,Kt,Wt,Pr,ta){for(;Pr>Wt;){if(Pr-Wt>600){var ma=Pr-Wt+1,ra=Kt-Wt+1,Ia=Math.log(ma),Ha=.5*Math.exp(2*Ia/3),$a=.5*Math.sqrt(Ia*Ha*(ma-Ha)/ma)*(ra-ma/2<0?-1:1),ai=Math.max(Wt,Math.floor(Kt-ra*Ha/ma+$a)),mi=Math.min(Pr,Math.floor(Kt+(ma-ra)*Ha/ma+$a));$(Jt,Nt,Kt,ai,mi,ta)}var xt=Nt[2*Kt+ta],ct=Wt,Nr=Pr;for(J(Jt,Nt,Wt,Kt),Nt[2*Pr+ta]>xt&&J(Jt,Nt,Wt,Pr);ctxt;)Nr--}Nt[2*Wt+ta]===xt?J(Jt,Nt,Wt,Nr):(Nr++,J(Jt,Nt,Nr,Pr)),Nr<=Kt&&(Wt=Nr+1),Kt<=Nr&&(Pr=Nr-1)}}function J(Jt,Nt,Kt,Wt){X(Jt,Kt,Wt),X(Nt,2*Kt,2*Wt),X(Nt,2*Kt+1,2*Wt+1)}function X(Jt,Nt,Kt){var Wt=Jt[Nt];Jt[Nt]=Jt[Kt],Jt[Kt]=Wt}function oe(Jt,Nt,Kt,Wt,Pr,ta,ma){for(var ra=[0,Jt.length-1,0],Ia=[],Ha,$a;ra.length;){var ai=ra.pop(),mi=ra.pop(),xt=ra.pop();if(mi-xt<=ma){for(var ct=xt;ct<=mi;ct++)Ha=Nt[2*ct],$a=Nt[2*ct+1],Ha>=Kt&&Ha<=Pr&&$a>=Wt&&$a<=ta&&Ia.push(Jt[ct]);continue}var Nr=Math.floor((xt+mi)/2);Ha=Nt[2*Nr],$a=Nt[2*Nr+1],Ha>=Kt&&Ha<=Pr&&$a>=Wt&&$a<=ta&&Ia.push(Jt[Nr]);var Or=(ai+1)%2;(ai===0?Kt<=Ha:Wt<=$a)&&(ra.push(xt),ra.push(Nr-1),ra.push(Or)),(ai===0?Pr>=Ha:ta>=$a)&&(ra.push(Nr+1),ra.push(mi),ra.push(Or))}return Ia}function ie(Jt,Nt,Kt,Wt,Pr,ta){for(var ma=[0,Jt.length-1,0],ra=[],Ia=Pr*Pr;ma.length;){var Ha=ma.pop(),$a=ma.pop(),ai=ma.pop();if($a-ai<=ta){for(var mi=ai;mi<=$a;mi++)j(Nt[2*mi],Nt[2*mi+1],Kt,Wt)<=Ia&&ra.push(Jt[mi]);continue}var xt=Math.floor((ai+$a)/2),ct=Nt[2*xt],Nr=Nt[2*xt+1];j(ct,Nr,Kt,Wt)<=Ia&&ra.push(Jt[xt]);var Or=(Ha+1)%2;(Ha===0?Kt-Pr<=ct:Wt-Pr<=Nr)&&(ma.push(ai),ma.push(xt-1),ma.push(Or)),(Ha===0?Kt+Pr>=ct:Wt+Pr>=Nr)&&(ma.push(xt+1),ma.push($a),ma.push(Or))}return ra}function j(Jt,Nt,Kt,Wt){var Pr=Jt-Kt,ta=Nt-Wt;return Pr*Pr+ta*ta}var ee=function(Jt){return Jt[0]},re=function(Jt){return Jt[1]},ce=function(Nt,Kt,Wt,Pr,ta){Kt===void 0&&(Kt=ee),Wt===void 0&&(Wt=re),Pr===void 0&&(Pr=64),ta===void 0&&(ta=Float64Array),this.nodeSize=Pr,this.points=Nt;for(var ma=Nt.length<65536?Uint16Array:Uint32Array,ra=this.ids=new ma(Nt.length),Ia=this.coords=new ta(Nt.length*2),Ha=0;Ha=Pr;$a--){var ai=+Date.now();Ia=this._cluster(Ia,$a),this.trees[$a]=new ce(Ia,fe,Fe,ma,Float32Array),Wt&&console.log("z%d: %d clusters in %dms",$a,Ia.length,+Date.now()-ai)}return Wt&&console.timeEnd("total time"),this},Ae.prototype.getClusters=function(Nt,Kt){var Wt=((Nt[0]+180)%360+360)%360-180,Pr=Math.max(-90,Math.min(90,Nt[1])),ta=Nt[2]===180?180:((Nt[2]+180)%360+360)%360-180,ma=Math.max(-90,Math.min(90,Nt[3]));if(Nt[2]-Nt[0]>=360)Wt=-180,ta=180;else if(Wt>ta){var ra=this.getClusters([Wt,Pr,180,ma],Kt),Ia=this.getClusters([-180,Pr,ta,ma],Kt);return ra.concat(Ia)}for(var Ha=this.trees[this._limitZoom(Kt)],$a=Ha.range(ot(Wt),tt(ma),ot(ta),tt(Pr)),ai=[],mi=0,xt=$a;miKt&&(Nr+=Gr.numPoints||1)}if(Nr>=Ia){for(var Kr=ai.x*ct,Ur=ai.y*ct,aa=ra&&ct>1?this._map(ai,!0):null,da=($a<<5)+(Kt+1)+this.points.length,fa=0,It=xt;fa1)for(var Ca=0,Fa=xt;Ca>5},Ae.prototype._getOriginZoom=function(Nt){return(Nt-this.points.length)%32},Ae.prototype._map=function(Nt,Kt){if(Nt.numPoints)return Kt?_e({},Nt.properties):Nt.properties;var Wt=this.points[Nt.index].properties,Pr=this.options.map(Wt);return Kt&&Pr===Wt?_e({},Pr):Pr};function ze(Jt,Nt,Kt,Wt,Pr){return{x:Jt,y:Nt,zoom:1/0,id:Kt,parentId:-1,numPoints:Wt,properties:Pr}}function Re(Jt,Nt){var Kt=Jt.geometry.coordinates,Wt=Kt[0],Pr=Kt[1];return{x:ot(Wt),y:tt(Pr),zoom:1/0,index:Nt,parentId:-1}}function Xe(Jt){return{type:"Feature",id:Jt.id,properties:it(Jt),geometry:{type:"Point",coordinates:[lt(Jt.x),Ee(Jt.y)]}}}function it(Jt){var Nt=Jt.numPoints,Kt=Nt>=1e4?Math.round(Nt/1e3)+"k":Nt>=1e3?Math.round(Nt/100)/10+"k":Nt;return _e(_e({},Jt.properties),{cluster:!0,cluster_id:Jt.id,point_count:Nt,point_count_abbreviated:Kt})}function ot(Jt){return Jt/360+.5}function tt(Jt){var Nt=Math.sin(Jt*Math.PI/180),Kt=.5-.25*Math.log((1+Nt)/(1-Nt))/Math.PI;return Kt<0?0:Kt>1?1:Kt}function lt(Jt){return(Jt-.5)*360}function Ee(Jt){var Nt=(180-Jt*360)*Math.PI/180;return 360*Math.atan(Math.exp(Nt))/Math.PI-90}function _e(Jt,Nt){for(var Kt in Nt)Jt[Kt]=Nt[Kt];return Jt}function fe(Jt){return Jt.x}function Fe(Jt){return Jt.y}function rt(Jt,Nt,Kt,Wt){for(var Pr=Wt,ta=Kt-Nt>>1,ma=Kt-Nt,ra,Ia=Jt[Nt],Ha=Jt[Nt+1],$a=Jt[Kt],ai=Jt[Kt+1],mi=Nt+3;miPr)ra=mi,Pr=xt;else if(xt===Pr){var ct=Math.abs(mi-ta);ctWt&&(ra-Nt>3&&rt(Jt,Nt,ra,Wt),Jt[ra+2]=Pr,Kt-ra>3&&rt(Jt,ra,Kt,Wt))}function st(Jt,Nt,Kt,Wt,Pr,ta){var ma=Pr-Kt,ra=ta-Wt;if(ma!==0||ra!==0){var Ia=((Jt-Kt)*ma+(Nt-Wt)*ra)/(ma*ma+ra*ra);Ia>1?(Kt=Pr,Wt=ta):Ia>0&&(Kt+=ma*Ia,Wt+=ra*Ia)}return ma=Jt-Kt,ra=Nt-Wt,ma*ma+ra*ra}function Qe(Jt,Nt,Kt,Wt){var Pr={id:typeof Jt>"u"?null:Jt,type:Nt,geometry:Kt,tags:Wt,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return Lt(Pr),Pr}function Lt(Jt){var Nt=Jt.geometry,Kt=Jt.type;if(Kt==="Point"||Kt==="MultiPoint"||Kt==="LineString")kt(Jt,Nt);else if(Kt==="Polygon"||Kt==="MultiLineString")for(var Wt=0;Wt0&&(Wt?ma+=(Pr*Ha-Ia*ta)/2:ma+=Math.sqrt(Math.pow(Ia-Pr,2)+Math.pow(Ha-ta,2))),Pr=Ia,ta=Ha}var $a=Nt.length-3;Nt[2]=1,rt(Nt,0,$a,Kt),Nt[$a+2]=1,Nt.size=Math.abs(ma),Nt.start=0,Nt.end=Nt.size}function jr(Jt,Nt,Kt,Wt){for(var Pr=0;Pr1?1:Kt}function bt(Jt,Nt,Kt,Wt,Pr,ta,ma,ra){if(Kt/=Nt,Wt/=Nt,ta>=Kt&&ma=Wt)return null;for(var Ia=[],Ha=0;Ha=Kt&&ct=Wt)continue;var Nr=[];if(mi==="Point"||mi==="MultiPoint")Be(ai,Nr,Kt,Wt,Pr);else if(mi==="LineString")Ke(ai,Nr,Kt,Wt,Pr,!1,ra.lineMetrics);else if(mi==="MultiLineString")Me(ai,Nr,Kt,Wt,Pr,!1);else if(mi==="Polygon")Me(ai,Nr,Kt,Wt,Pr,!0);else if(mi==="MultiPolygon")for(var Or=0;Or=Kt&&ma<=Wt&&(Nt.push(Jt[ta]),Nt.push(Jt[ta+1]),Nt.push(Jt[ta+2]))}}function Ke(Jt,Nt,Kt,Wt,Pr,ta,ma){for(var ra=Ue(Jt),Ia=Pr===0?Ce:Te,Ha=Jt.start,$a,ai,mi=0;miKt&&(ai=Ia(ra,xt,ct,Or,Rr,Kt),ma&&(ra.start=Ha+$a*ai)):Lr>Wt?Gr=Kt&&(ai=Ia(ra,xt,ct,Or,Rr,Kt),Kr=!0),Gr>Wt&&Lr<=Wt&&(ai=Ia(ra,xt,ct,Or,Rr,Wt),Kr=!0),!ta&&Kr&&(ma&&(ra.end=Ha+$a*ai),Nt.push(ra),ra=Ue(Jt)),ma&&(Ha+=$a)}var Ur=Jt.length-3;xt=Jt[Ur],ct=Jt[Ur+1],Nr=Jt[Ur+2],Lr=Pr===0?xt:ct,Lr>=Kt&&Lr<=Wt&&qe(ra,xt,ct,Nr),Ur=ra.length-3,ta&&Ur>=3&&(ra[Ur]!==ra[0]||ra[Ur+1]!==ra[1])&&qe(ra,ra[0],ra[1],ra[2]),ra.length&&Nt.push(ra)}function Ue(Jt){var Nt=[];return Nt.size=Jt.size,Nt.start=Jt.start,Nt.end=Jt.end,Nt}function Me(Jt,Nt,Kt,Wt,Pr,ta){for(var ma=0;mama.maxX&&(ma.maxX=$a),ai>ma.maxY&&(ma.maxY=ai)}return ma}function rr(Jt,Nt,Kt,Wt){var Pr=Nt.geometry,ta=Nt.type,ma=[];if(ta==="Point"||ta==="MultiPoint")for(var ra=0;ra0&&Nt.size<(Pr?ma:Wt)){Kt.numPoints+=Nt.length/3;return}for(var ra=[],Ia=0;Iama)&&(Kt.numSimplified++,ra.push(Nt[Ia]),ra.push(Nt[Ia+1])),Kt.numPoints++;Pr&&Tr(ra,ta),Jt.push(ra)}function Tr(Jt,Nt){for(var Kt=0,Wt=0,Pr=Jt.length,ta=Pr-2;Wt0===Nt)for(Wt=0,Pr=Jt.length;Wt24)throw new Error("maxZoom should be in the 0-24 range");if(Nt.promoteId&&Nt.generateId)throw new Error("promoteId and generateId cannot be used together.");var Wt=Vt(Jt,Nt);this.tiles={},this.tileCoords=[],Kt&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",Nt.indexMaxZoom,Nt.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),Wt=Pe(Wt,Nt),Wt.length&&this.splitTile(Wt,0,0,0),Kt&&(Wt.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}Ua.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},Ua.prototype.splitTile=function(Jt,Nt,Kt,Wt,Pr,ta,ma){for(var ra=[Jt,Nt,Kt,Wt],Ia=this.options,Ha=Ia.debug;ra.length;){Wt=ra.pop(),Kt=ra.pop(),Nt=ra.pop(),Jt=ra.pop();var $a=1<1&&console.time("creation"),mi=this.tiles[ai]=Gt(Jt,Nt,Kt,Wt,Ia),this.tileCoords.push({z:Nt,x:Kt,y:Wt}),Ha)){Ha>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",Nt,Kt,Wt,mi.numFeatures,mi.numPoints,mi.numSimplified),console.timeEnd("creation"));var xt="z"+Nt;this.stats[xt]=(this.stats[xt]||0)+1,this.total++}if(mi.source=Jt,Pr){if(Nt===Ia.maxZoom||Nt===Pr)continue;var ct=1<1&&console.time("clipping");var Nr=.5*Ia.buffer/Ia.extent,Or=.5-Nr,Rr=.5+Nr,Lr=1+Nr,Gr,Kr,Ur,aa,da,fa;Gr=Kr=Ur=aa=null,da=bt(Jt,$a,Kt-Nr,Kt+Rr,0,mi.minX,mi.maxX,Ia),fa=bt(Jt,$a,Kt+Or,Kt+Lr,0,mi.minX,mi.maxX,Ia),Jt=null,da&&(Gr=bt(da,$a,Wt-Nr,Wt+Rr,1,mi.minY,mi.maxY,Ia),Kr=bt(da,$a,Wt+Or,Wt+Lr,1,mi.minY,mi.maxY,Ia),da=null),fa&&(Ur=bt(fa,$a,Wt-Nr,Wt+Rr,1,mi.minY,mi.maxY,Ia),aa=bt(fa,$a,Wt+Or,Wt+Lr,1,mi.minY,mi.maxY,Ia),fa=null),Ha>1&&console.timeEnd("clipping"),ra.push(Gr||[],Nt+1,Kt*2,Wt*2),ra.push(Kr||[],Nt+1,Kt*2,Wt*2+1),ra.push(Ur||[],Nt+1,Kt*2+1,Wt*2),ra.push(aa||[],Nt+1,Kt*2+1,Wt*2+1)}}},Ua.prototype.getTile=function(Jt,Nt,Kt){var Wt=this.options,Pr=Wt.extent,ta=Wt.debug;if(Jt<0||Jt>24)return null;var ma=1<1&&console.log("drilling down to z%d-%d-%d",Jt,Nt,Kt);for(var Ia=Jt,Ha=Nt,$a=Kt,ai;!ai&&Ia>0;)Ia--,Ha=Math.floor(Ha/2),$a=Math.floor($a/2),ai=this.tiles[Ba(Ia,Ha,$a)];return!ai||!ai.source?null:(ta>1&&console.log("found parent tile z%d-%d-%d",Ia,Ha,$a),ta>1&&console.time("drilling down"),this.splitTile(ai.source,Ia,Ha,$a,Jt,Nt,Kt),ta>1&&console.timeEnd("drilling down"),this.tiles[ra]?Tt(this.tiles[ra],Pr):null)};function Ba(Jt,Nt,Kt){return((1<=0?0:ve.button},r.remove=function(ve){ve.parentNode&&ve.parentNode.removeChild(ve)};function v(ve,Y,ye){var te,me,Ge,Le=e.browser.devicePixelRatio>1?"@2x":"",$e=e.getJSON(Y.transformRequest(Y.normalizeSpriteURL(ve,Le,".json"),e.ResourceType.SpriteJSON),function(_r,Fr){$e=null,Ge||(Ge=_r,te=Fr,jt())}),mt=e.getImage(Y.transformRequest(Y.normalizeSpriteURL(ve,Le,".png"),e.ResourceType.SpriteImage),function(_r,Fr){mt=null,Ge||(Ge=_r,me=Fr,jt())});function jt(){if(Ge)ye(Ge);else if(te&&me){var _r=e.browser.getImageData(me),Fr={};for(var hr in te){var gt=te[hr],Et=gt.width,Ft=gt.height,ir=gt.x,fr=gt.y,sr=gt.sdf,pr=gt.pixelRatio,lr=gt.stretchX,Xt=gt.stretchY,or=gt.content,qt=new e.RGBAImage({width:Et,height:Ft});e.RGBAImage.copy(_r,qt,{x:ir,y:fr},{x:0,y:0},{width:Et,height:Ft}),Fr[hr]={data:qt,pixelRatio:pr,sdf:sr,stretchX:lr,stretchY:Xt,content:or}}ye(null,Fr)}}return{cancel:function(){$e&&($e.cancel(),$e=null),mt&&(mt.cancel(),mt=null)}}}function T(ve){var Y=ve.userImage;if(Y&&Y.render){var ye=Y.render();if(ye)return ve.data.replace(new Uint8Array(Y.data.buffer)),!0}return!1}var l=1,_=function(ve){function Y(){ve.call(this),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new e.RGBAImage({width:1,height:1}),this.dirty=!0}return ve&&(Y.__proto__=ve),Y.prototype=Object.create(ve&&ve.prototype),Y.prototype.constructor=Y,Y.prototype.isLoaded=function(){return this.loaded},Y.prototype.setLoaded=function(te){if(this.loaded!==te&&(this.loaded=te,te)){for(var me=0,Ge=this.requestors;me=0?1.2:1))}b.prototype.draw=function(ve){this.ctx.clearRect(0,0,this.size,this.size),this.ctx.fillText(ve,this.buffer,this.middle);for(var Y=this.ctx.getImageData(0,0,this.size,this.size),ye=new Uint8ClampedArray(this.size*this.size),te=0;te65535){_r(new Error("glyphs > 65535 not supported"));return}if(gt.ranges[Ft]){_r(null,{stack:Fr,id:hr,glyph:Et});return}var ir=gt.requests[Ft];ir||(ir=gt.requests[Ft]=[],m.loadGlyphRange(Fr,Ft,te.url,te.requestManager,function(fr,sr){if(sr){for(var pr in sr)te._doesCharSupportLocalGlyph(+pr)||(gt.glyphs[+pr]=sr[+pr]);gt.ranges[Ft]=!0}for(var lr=0,Xt=ir;lr1&&(jt=Y[++mt]);var Fr=Math.abs(_r-jt.left),hr=Math.abs(_r-jt.right),gt=Math.min(Fr,hr),Et=void 0,Ft=Ge/te*(me+1);if(jt.isDash){var ir=me-Math.abs(Ft);Et=Math.sqrt(gt*gt+ir*ir)}else Et=me-Math.sqrt(gt*gt+Ft*Ft);this.data[$e+_r]=Math.max(0,Math.min(255,Et+128))}},F.prototype.addRegularDash=function(Y){for(var ye=Y.length-1;ye>=0;--ye){var te=Y[ye],me=Y[ye+1];te.zeroLength?Y.splice(ye,1):me&&me.isDash===te.isDash&&(me.left=te.left,Y.splice(ye,1))}var Ge=Y[0],Le=Y[Y.length-1];Ge.isDash===Le.isDash&&(Ge.left=Le.left-this.width,Le.right=Ge.right+this.width);for(var $e=this.width*this.nextRow,mt=0,jt=Y[mt],_r=0;_r1&&(jt=Y[++mt]);var Fr=Math.abs(_r-jt.left),hr=Math.abs(_r-jt.right),gt=Math.min(Fr,hr),Et=jt.isDash?gt:-gt;this.data[$e+_r]=Math.max(0,Math.min(255,Et+128))}},F.prototype.addDash=function(Y,ye){var te=ye?7:0,me=2*te+1;if(this.nextRow+me>this.height)return e.warnOnce("LineAtlas out of space"),null;for(var Ge=0,Le=0;Le=te.minX&&Y.x=te.minY&&Y.y0&&(_r[new e.OverscaledTileID(te.overscaledZ,$e,me.z,Le,me.y-1).key]={backfilled:!1},_r[new e.OverscaledTileID(te.overscaledZ,te.wrap,me.z,me.x,me.y-1).key]={backfilled:!1},_r[new e.OverscaledTileID(te.overscaledZ,jt,me.z,mt,me.y-1).key]={backfilled:!1}),me.y+10&&(Ge.resourceTiming=te._resourceTiming,te._resourceTiming=[]),te.fire(new e.Event("data",Ge))})},Y.prototype.onAdd=function(te){this.map=te,this.load()},Y.prototype.setData=function(te){var me=this;return this._data=te,this.fire(new e.Event("dataloading",{dataType:"source"})),this._updateWorkerData(function(Ge){if(Ge){me.fire(new e.ErrorEvent(Ge));return}var Le={dataType:"source",sourceDataType:"content"};me._collectResourceTiming&&me._resourceTiming&&me._resourceTiming.length>0&&(Le.resourceTiming=me._resourceTiming,me._resourceTiming=[]),me.fire(new e.Event("data",Le))}),this},Y.prototype.getClusterExpansionZoom=function(te,me){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:te,source:this.id},me),this},Y.prototype.getClusterChildren=function(te,me){return this.actor.send("geojson.getClusterChildren",{clusterId:te,source:this.id},me),this},Y.prototype.getClusterLeaves=function(te,me,Ge,Le){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:te,limit:me,offset:Ge},Le),this},Y.prototype._updateWorkerData=function(te){var me=this;this._loaded=!1;var Ge=e.extend({},this.workerOptions),Le=this._data;typeof Le=="string"?(Ge.request=this.map._requestManager.transformRequest(e.browser.resolveURL(Le),e.ResourceType.Source),Ge.request.collectResourceTiming=this._collectResourceTiming):Ge.data=JSON.stringify(Le),this.actor.send(this.type+".loadData",Ge,function($e,mt){me._removed||mt&&mt.abandoned||(me._loaded=!0,mt&&mt.resourceTiming&&mt.resourceTiming[me.id]&&(me._resourceTiming=mt.resourceTiming[me.id].slice(0)),me.actor.send(me.type+".coalesce",{source:Ge.source},null),te($e))})},Y.prototype.loaded=function(){return this._loaded},Y.prototype.loadTile=function(te,me){var Ge=this,Le=te.actor?"reloadTile":"loadTile";te.actor=this.actor;var $e={type:this.type,uid:te.uid,tileID:te.tileID,zoom:te.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:e.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};te.request=this.actor.send(Le,$e,function(mt,jt){return delete te.request,te.unloadVectorData(),te.aborted?me(null):mt?me(mt):(te.loadVectorData(jt,Ge.map.painter,Le==="reloadTile"),me(null))})},Y.prototype.abortTile=function(te){te.request&&(te.request.cancel(),delete te.request),te.aborted=!0},Y.prototype.unloadTile=function(te){te.unloadVectorData(),this.actor.send("removeTile",{uid:te.uid,type:this.type,source:this.id})},Y.prototype.onRemove=function(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})},Y.prototype.serialize=function(){return e.extend({},this._options,{type:this.type,data:this._data})},Y.prototype.hasTransition=function(){return!1},Y}(e.Evented),ue=e.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),le=function(ve){function Y(ye,te,me,Ge){ve.call(this),this.id=ye,this.dispatcher=me,this.coordinates=te.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(Ge),this.options=te}return ve&&(Y.__proto__=ve),Y.prototype=Object.create(ve&&ve.prototype),Y.prototype.constructor=Y,Y.prototype.load=function(te,me){var Ge=this;this._loaded=!1,this.fire(new e.Event("dataloading",{dataType:"source"})),this.url=this.options.url,e.getImage(this.map._requestManager.transformRequest(this.url,e.ResourceType.Image),function(Le,$e){Ge._loaded=!0,Le?Ge.fire(new e.ErrorEvent(Le)):$e&&(Ge.image=$e,te&&(Ge.coordinates=te),me&&me(),Ge._finishLoading())})},Y.prototype.loaded=function(){return this._loaded},Y.prototype.updateImage=function(te){var me=this;return!this.image||!te.url?this:(this.options.url=te.url,this.load(te.coordinates,function(){me.texture=null}),this)},Y.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new e.Event("data",{dataType:"source",sourceDataType:"metadata"})))},Y.prototype.onAdd=function(te){this.map=te,this.load()},Y.prototype.setCoordinates=function(te){var me=this;this.coordinates=te;var Ge=te.map(e.MercatorCoordinate.fromLngLat);this.tileID=he(Ge),this.minzoom=this.maxzoom=this.tileID.z;var Le=Ge.map(function($e){return me.tileID.getTilePoint($e)._round()});return this._boundsArray=new e.StructArrayLayout4i8,this._boundsArray.emplaceBack(Le[0].x,Le[0].y,0,0),this._boundsArray.emplaceBack(Le[1].x,Le[1].y,e.EXTENT,0),this._boundsArray.emplaceBack(Le[3].x,Le[3].y,0,e.EXTENT),this._boundsArray.emplaceBack(Le[2].x,Le[2].y,e.EXTENT,e.EXTENT),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new e.Event("data",{dataType:"source",sourceDataType:"content"})),this},Y.prototype.prepare=function(){if(!(Object.keys(this.tiles).length===0||!this.image)){var te=this.map.painter.context,me=te.gl;this.boundsBuffer||(this.boundsBuffer=te.createVertexBuffer(this._boundsArray,ue.members)),this.boundsSegments||(this.boundsSegments=e.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new e.Texture(te,this.image,me.RGBA),this.texture.bind(me.LINEAR,me.CLAMP_TO_EDGE));for(var Ge in this.tiles){var Le=this.tiles[Ge];Le.state!=="loaded"&&(Le.state="loaded",Le.texture=this.texture)}}},Y.prototype.loadTile=function(te,me){this.tileID&&this.tileID.equals(te.tileID.canonical)?(this.tiles[String(te.tileID.wrap)]=te,te.buckets={},me(null)):(te.state="errored",me(null))},Y.prototype.serialize=function(){return{type:"image",url:this.options.url,coordinates:this.coordinates}},Y.prototype.hasTransition=function(){return!1},Y}(e.Evented);function he(ve){for(var Y=1/0,ye=1/0,te=-1/0,me=-1/0,Ge=0,Le=ve;Geme.end(0)?this.fire(new e.ErrorEvent(new e.ValidationError("sources."+this.id,null,"Playback for this video can be set only between the "+me.start(0)+" and "+me.end(0)+"-second mark."))):this.video.currentTime=te}},Y.prototype.getVideo=function(){return this.video},Y.prototype.onAdd=function(te){this.map||(this.map=te,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},Y.prototype.prepare=function(){if(!(Object.keys(this.tiles).length===0||this.video.readyState<2)){var te=this.map.painter.context,me=te.gl;this.boundsBuffer||(this.boundsBuffer=te.createVertexBuffer(this._boundsArray,ue.members)),this.boundsSegments||(this.boundsSegments=e.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(me.LINEAR,me.CLAMP_TO_EDGE),me.texSubImage2D(me.TEXTURE_2D,0,0,0,me.RGBA,me.UNSIGNED_BYTE,this.video)):(this.texture=new e.Texture(te,this.video,me.RGBA),this.texture.bind(me.LINEAR,me.CLAMP_TO_EDGE));for(var Ge in this.tiles){var Le=this.tiles[Ge];Le.state!=="loaded"&&(Le.state="loaded",Le.texture=this.texture)}}},Y.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},Y.prototype.hasTransition=function(){return this.video&&!this.video.paused},Y}(le),$=function(ve){function Y(ye,te,me,Ge){ve.call(this,ye,te,me,Ge),te.coordinates?(!Array.isArray(te.coordinates)||te.coordinates.length!==4||te.coordinates.some(function(Le){return!Array.isArray(Le)||Le.length!==2||Le.some(function($e){return typeof $e!="number"})}))&&this.fire(new e.ErrorEvent(new e.ValidationError("sources."+ye,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new e.ErrorEvent(new e.ValidationError("sources."+ye,null,'missing required property "coordinates"'))),te.animate&&typeof te.animate!="boolean"&&this.fire(new e.ErrorEvent(new e.ValidationError("sources."+ye,null,'optional "animate" property must be a boolean value'))),te.canvas?typeof te.canvas!="string"&&!(te.canvas instanceof e.window.HTMLCanvasElement)&&this.fire(new e.ErrorEvent(new e.ValidationError("sources."+ye,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new e.ErrorEvent(new e.ValidationError("sources."+ye,null,'missing required property "canvas"'))),this.options=te,this.animate=te.animate!==void 0?te.animate:!0}return ve&&(Y.__proto__=ve),Y.prototype=Object.create(ve&&ve.prototype),Y.prototype.constructor=Y,Y.prototype.load=function(){if(this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof e.window.HTMLCanvasElement?this.options.canvas:e.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()){this.fire(new e.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero.")));return}this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading()},Y.prototype.getCanvas=function(){return this.canvas},Y.prototype.onAdd=function(te){this.map=te,this.load(),this.canvas&&this.animate&&this.play()},Y.prototype.onRemove=function(){this.pause()},Y.prototype.prepare=function(){var te=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,te=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,te=!0),!this._hasInvalidDimensions()&&Object.keys(this.tiles).length!==0){var me=this.map.painter.context,Ge=me.gl;this.boundsBuffer||(this.boundsBuffer=me.createVertexBuffer(this._boundsArray,ue.members)),this.boundsSegments||(this.boundsSegments=e.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(te||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new e.Texture(me,this.canvas,Ge.RGBA,{premultiply:!0});for(var Le in this.tiles){var $e=this.tiles[Le];$e.state!=="loaded"&&($e.state="loaded",$e.texture=this.texture)}}},Y.prototype.serialize=function(){return{type:"canvas",coordinates:this.coordinates}},Y.prototype.hasTransition=function(){return this._playing},Y.prototype._hasInvalidDimensions=function(){for(var te=0,me=[this.canvas.width,this.canvas.height];tethis.max){var $e=this._getAndRemoveByKey(this.order[0]);$e&&this.onRemove($e)}return this},Re.prototype.has=function(Y){return Y.wrapped().key in this.data},Re.prototype.getAndRemove=function(Y){return this.has(Y)?this._getAndRemoveByKey(Y.wrapped().key):null},Re.prototype._getAndRemoveByKey=function(Y){var ye=this.data[Y].shift();return ye.timeout&&clearTimeout(ye.timeout),this.data[Y].length===0&&delete this.data[Y],this.order.splice(this.order.indexOf(Y),1),ye.value},Re.prototype.getByKey=function(Y){var ye=this.data[Y];return ye?ye[0].value:null},Re.prototype.get=function(Y){if(!this.has(Y))return null;var ye=this.data[Y.wrapped().key][0];return ye.value},Re.prototype.remove=function(Y,ye){if(!this.has(Y))return this;var te=Y.wrapped().key,me=ye===void 0?0:this.data[te].indexOf(ye),Ge=this.data[te][me];return this.data[te].splice(me,1),Ge.timeout&&clearTimeout(Ge.timeout),this.data[te].length===0&&delete this.data[te],this.onRemove(Ge.value),this.order.splice(this.order.indexOf(te),1),this},Re.prototype.setMaxSize=function(Y){for(this.max=Y;this.order.length>this.max;){var ye=this._getAndRemoveByKey(this.order[0]);ye&&this.onRemove(ye)}return this},Re.prototype.filter=function(Y){var ye=[];for(var te in this.data)for(var me=0,Ge=this.data[te];me1||(Math.abs(Fr)>1&&(Math.abs(Fr+gt)===1?Fr+=gt:Math.abs(Fr-gt)===1&&(Fr-=gt)),!(!_r.dem||!jt.dem)&&(jt.dem.backfillBorder(_r.dem,Fr,hr),jt.neighboringTiles&&jt.neighboringTiles[Et]&&(jt.neighboringTiles[Et].backfilled=!0)))}},Y.prototype.getTile=function(te){return this.getTileByID(te.key)},Y.prototype.getTileByID=function(te){return this._tiles[te]},Y.prototype._retainLoadedChildren=function(te,me,Ge,Le){for(var $e in this._tiles){var mt=this._tiles[$e];if(!(Le[$e]||!mt.hasData()||mt.tileID.overscaledZ<=me||mt.tileID.overscaledZ>Ge)){for(var jt=mt.tileID;mt&&mt.tileID.overscaledZ>me+1;){var _r=mt.tileID.scaledTo(mt.tileID.overscaledZ-1);mt=this._tiles[_r.key],mt&&mt.hasData()&&(jt=_r)}for(var Fr=jt;Fr.overscaledZ>me;)if(Fr=Fr.scaledTo(Fr.overscaledZ-1),te[Fr.key]){Le[jt.key]=jt;break}}}},Y.prototype.findLoadedParent=function(te,me){if(te.key in this._loadedParentTiles){var Ge=this._loadedParentTiles[te.key];return Ge&&Ge.tileID.overscaledZ>=me?Ge:null}for(var Le=te.overscaledZ-1;Le>=me;Le--){var $e=te.scaledTo(Le),mt=this._getLoadedTile($e);if(mt)return mt}},Y.prototype._getLoadedTile=function(te){var me=this._tiles[te.key];if(me&&me.hasData())return me;var Ge=this._cache.getByKey(te.wrapped().key);return Ge},Y.prototype.updateCacheSize=function(te){var me=Math.ceil(te.width/this._source.tileSize)+1,Ge=Math.ceil(te.height/this._source.tileSize)+1,Le=me*Ge,$e=5,mt=Math.floor(Le*$e),jt=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,mt):mt;this._cache.setMaxSize(jt)},Y.prototype.handleWrapJump=function(te){var me=this._prevLng===void 0?te:this._prevLng,Ge=te-me,Le=Ge/360,$e=Math.round(Le);if(this._prevLng=te,$e){var mt={};for(var jt in this._tiles){var _r=this._tiles[jt];_r.tileID=_r.tileID.unwrapTo(_r.tileID.wrap+$e),mt[_r.tileID.key]=_r}this._tiles=mt;for(var Fr in this._timers)clearTimeout(this._timers[Fr]),delete this._timers[Fr];for(var hr in this._tiles){var gt=this._tiles[hr];this._setTileReloadTimer(hr,gt)}}},Y.prototype.update=function(te){var me=this;if(this.transform=te,!(!this._sourceLoaded||this._paused)){this.updateCacheSize(te),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={};var Ge;this.used?this._source.tileID?Ge=te.getVisibleUnwrappedCoordinates(this._source.tileID).map(function(ba){return new e.OverscaledTileID(ba.canonical.z,ba.wrap,ba.canonical.z,ba.canonical.x,ba.canonical.y)}):(Ge=te.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(Ge=Ge.filter(function(ba){return me._source.hasTile(ba)}))):Ge=[];var Le=te.coveringZoomLevel(this._source),$e=Math.max(Le-Y.maxOverzooming,this._source.minzoom),mt=Math.max(Le+Y.maxUnderzooming,this._source.minzoom),jt=this._updateRetainedTiles(Ge,Le);if(Ia(this._source.type)){for(var _r={},Fr={},hr=Object.keys(jt),gt=0,Et=hr;gtthis._source.maxzoom){var sr=ir.children(this._source.maxzoom)[0],pr=this.getTile(sr);if(pr&&pr.hasData()){Ge[sr.key]=sr;continue}}else{var lr=ir.children(this._source.maxzoom);if(Ge[lr[0].key]&&Ge[lr[1].key]&&Ge[lr[2].key]&&Ge[lr[3].key])continue}for(var Xt=fr.wasRequested(),or=ir.overscaledZ-1;or>=$e;--or){var qt=ir.scaledTo(or);if(Le[qt.key]||(Le[qt.key]=!0,fr=this.getTile(qt),!fr&&Xt&&(fr=this._addTile(qt)),fr&&(Ge[qt.key]=qt,Xt=fr.wasRequested(),fr.hasData())))break}}}return Ge},Y.prototype._updateLoadedParentTileCache=function(){this._loadedParentTiles={};for(var te in this._tiles){for(var me=[],Ge=void 0,Le=this._tiles[te].tileID;Le.overscaledZ>0;){if(Le.key in this._loadedParentTiles){Ge=this._loadedParentTiles[Le.key];break}me.push(Le.key);var $e=Le.scaledTo(Le.overscaledZ-1);if(Ge=this._getLoadedTile($e),Ge)break;Le=$e}for(var mt=0,jt=me;mt0)&&(me.hasData()&&me.state!=="reloading"?this._cache.add(me.tileID,me,me.getExpiryTimeout()):(me.aborted=!0,this._abortTile(me),this._unloadTile(me))))},Y.prototype.clearTiles=function(){this._shouldReloadOnResume=!1,this._paused=!1;for(var te in this._tiles)this._removeTile(te);this._cache.reset()},Y.prototype.tilesIn=function(te,me,Ge){var Le=this,$e=[],mt=this.transform;if(!mt)return $e;for(var jt=Ge?mt.getCameraQueryGeometry(te):te,_r=te.map(function(or){return mt.pointCoordinate(or)}),Fr=jt.map(function(or){return mt.pointCoordinate(or)}),hr=this.getIds(),gt=1/0,Et=1/0,Ft=-1/0,ir=-1/0,fr=0,sr=Fr;fr=0&&yi[1].y+ba>=0){var Xa=_r.map(function(Ji){return Dr.getTilePoint(Ji)}),si=Fr.map(function(Ji){return Dr.getTilePoint(Ji)});$e.push({tile:qt,tileID:Dr,queryGeometry:Xa,cameraQueryGeometry:si,scale:Jr})}}},Xt=0;Xt=e.browser.now())return!0}return!1},Y.prototype.setFeatureState=function(te,me,Ge){te=te||"_geojsonTileLayer",this._state.updateState(te,me,Ge)},Y.prototype.removeFeatureState=function(te,me,Ge){te=te||"_geojsonTileLayer",this._state.removeFeatureState(te,me,Ge)},Y.prototype.getFeatureState=function(te,me){return te=te||"_geojsonTileLayer",this._state.getState(te,me)},Y.prototype.setDependencies=function(te,me,Ge){var Le=this._tiles[te];Le&&Le.setDependencies(me,Ge)},Y.prototype.reloadTilesForDependencies=function(te,me){for(var Ge in this._tiles){var Le=this._tiles[Ge];Le.hasDependency(te,me)&&this._reloadTile(Ge,"reloading")}this._cache.filter(function($e){return!$e.hasDependency(te,me)})},Y}(e.Evented);ma.maxOverzooming=10,ma.maxUnderzooming=3;function ra(ve,Y){var ye=Math.abs(ve.wrap*2)-+(ve.wrap<0),te=Math.abs(Y.wrap*2)-+(Y.wrap<0);return ve.overscaledZ-Y.overscaledZ||te-ye||Y.canonical.y-ve.canonical.y||Y.canonical.x-ve.canonical.x}function Ia(ve){return ve==="raster"||ve==="image"||ve==="video"}function Ha(){return new e.window.Worker(Lo.workerUrl)}var $a="mapboxgl_preloaded_worker_pool",ai=function(){this.active={}};ai.prototype.acquire=function(Y){if(!this.workers)for(this.workers=[];this.workers.length0?(me-Le)/$e:0;return this.points[Ge].mult(1-mt).add(this.points[ye].mult(mt))};var ha=function(Y,ye,te){var me=this.boxCells=[],Ge=this.circleCells=[];this.xCellCount=Math.ceil(Y/te),this.yCellCount=Math.ceil(ye/te);for(var Le=0;Lethis.width||me<0||ye>this.height)return Ge?!1:[];var $e=[];if(Y<=0&&ye<=0&&this.width<=te&&this.height<=me){if(Ge)return!0;for(var mt=0;mt0:$e}},ha.prototype._queryCircle=function(Y,ye,te,me,Ge){var Le=Y-te,$e=Y+te,mt=ye-te,jt=ye+te;if($e<0||Le>this.width||jt<0||mt>this.height)return me?!1:[];var _r=[],Fr={hitTest:me,circle:{x:Y,y:ye,radius:te},seenUids:{box:{},circle:{}}};return this._forEachCell(Le,mt,$e,jt,this._queryCellCircle,_r,Fr,Ge),me?_r.length>0:_r},ha.prototype.query=function(Y,ye,te,me,Ge){return this._query(Y,ye,te,me,!1,Ge)},ha.prototype.hitTest=function(Y,ye,te,me,Ge){return this._query(Y,ye,te,me,!0,Ge)},ha.prototype.hitTestCircle=function(Y,ye,te,me){return this._queryCircle(Y,ye,te,!0,me)},ha.prototype._queryCell=function(Y,ye,te,me,Ge,Le,$e,mt){var jt=$e.seenUids,_r=this.boxCells[Ge];if(_r!==null)for(var Fr=this.bboxes,hr=0,gt=_r;hr=Fr[Ft+0]&&me>=Fr[Ft+1]&&(!mt||mt(this.boxKeys[Et]))){if($e.hitTest)return Le.push(!0),!0;Le.push({key:this.boxKeys[Et],x1:Fr[Ft],y1:Fr[Ft+1],x2:Fr[Ft+2],y2:Fr[Ft+3]})}}}var ir=this.circleCells[Ge];if(ir!==null)for(var fr=this.circles,sr=0,pr=ir;sr$e*$e+mt*mt},ha.prototype._circleAndRectCollide=function(Y,ye,te,me,Ge,Le,$e){var mt=(Le-me)/2,jt=Math.abs(Y-(me+mt));if(jt>mt+te)return!1;var _r=($e-Ge)/2,Fr=Math.abs(ye-(Ge+_r));if(Fr>_r+te)return!1;if(jt<=mt||Fr<=_r)return!0;var hr=jt-mt,gt=Fr-_r;return hr*hr+gt*gt<=te*te};function Da(ve,Y,ye,te,me){var Ge=e.create();return Y?(e.scale(Ge,Ge,[1/me,1/me,1]),ye||e.rotateZ(Ge,Ge,te.angle)):e.multiply(Ge,te.labelPlaneMatrix,ve),Ge}function Xi(ve,Y,ye,te,me){if(Y){var Ge=e.clone(ve);return e.scale(Ge,Ge,[me,me,1]),ye||e.rotateZ(Ge,Ge,-te.angle),Ge}else return te.glCoordMatrix}function Li(ve,Y){var ye=[ve.x,ve.y,0,1];Ts(ye,ye,Y);var te=ye[3];return{point:new e.Point(ye[0]/te,ye[1]/te),signedDistanceFromCamera:te}}function fn(ve,Y){return .5+.5*(ve/Y)}function An(ve,Y){var ye=ve[0]/ve[3],te=ve[1]/ve[3],me=ye>=-Y[0]&&ye<=Y[0]&&te>=-Y[1]&&te<=Y[1];return me}function kn(ve,Y,ye,te,me,Ge,Le,$e){var mt=te?ve.textSizeData:ve.iconSizeData,jt=e.evaluateSizeForZoom(mt,ye.transform.zoom),_r=[256/ye.width*2+1,256/ye.height*2+1],Fr=te?ve.text.dynamicLayoutVertexArray:ve.icon.dynamicLayoutVertexArray;Fr.clear();for(var hr=ve.lineVertexArray,gt=te?ve.text.placedSymbolArray:ve.icon.placedSymbolArray,Et=ye.transform.width/ye.transform.height,Ft=!1,ir=0;irGe)return{useVertical:!0}}return(ve===e.WritingMode.vertical?Y.yye.x)?{needsFlipping:!0}:null}function to(ve,Y,ye,te,me,Ge,Le,$e,mt,jt,_r,Fr,hr,gt){var Et=Y/24,Ft=ve.lineOffsetX*Et,ir=ve.lineOffsetY*Et,fr;if(ve.numGlyphs>1){var sr=ve.glyphStartIndex+ve.numGlyphs,pr=ve.lineStartIndex,lr=ve.lineStartIndex+ve.lineLength,Xt=zn(Et,$e,Ft,ir,ye,_r,Fr,ve,mt,Ge,hr);if(!Xt)return{notEnoughRoom:!0};var or=Li(Xt.first.point,Le).point,qt=Li(Xt.last.point,Le).point;if(te&&!ye){var Dr=Xn(ve.writingMode,or,qt,gt);if(Dr)return Dr}fr=[Xt.first];for(var Jr=ve.glyphStartIndex+1;Jr0?si.point:mo(Fr,Xa,ba,1,me),Bi=Xn(ve.writingMode,ba,Ji,gt);if(Bi)return Bi}var pi=pn(Et*$e.getoffsetX(ve.glyphStartIndex),Ft,ir,ye,_r,Fr,ve.segment,ve.lineStartIndex,ve.lineStartIndex+ve.lineLength,mt,Ge,hr);if(!pi)return{notEnoughRoom:!0};fr=[pi]}for(var wi=0,Mi=fr;wi0?1:-1,Et=0;te&&(gt*=-1,Et=Math.PI),gt<0&&(Et+=Math.PI);for(var Ft=gt>0?$e+Le:$e+Le+1,ir=me,fr=me,sr=0,pr=0,lr=Math.abs(hr),Xt=[];sr+pr<=lr;){if(Ft+=gt,Ft<$e||Ft>=mt)return null;if(fr=ir,Xt.push(ir),ir=Fr[Ft],ir===void 0){var or=new e.Point(jt.getx(Ft),jt.gety(Ft)),qt=Li(or,_r);if(qt.signedDistanceFromCamera>0)ir=Fr[Ft]=qt.point;else{var Dr=Ft-gt,Jr=sr===0?Ge:new e.Point(jt.getx(Dr),jt.gety(Dr));ir=mo(Jr,or,fr,lr-sr+1,_r)}}sr+=pr,pr=fr.dist(ir)}var ba=(lr-sr)/pr,yi=ir.sub(fr),Xa=yi.mult(ba)._add(fr);Xa._add(yi._unit()._perp()._mult(ye*gt));var si=Et+Math.atan2(ir.y-fr.y,ir.x-fr.x);return Xt.push(Xa),{point:Xa,angle:si,path:Xt}}var Jo=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function Xo(ve,Y){for(var ye=0;ye=1;Vi--)Mi.push(pi.path[Vi]);for(var cn=1;cn0){for(var Fo=Mi[0].clone(),bs=Mi[0].clone(),Hs=1;Hs=si.x&&bs.x<=Ji.x&&Fo.y>=si.y&&bs.y<=Ji.y?ks=[Mi]:bs.xJi.x||bs.yJi.y?ks=[]:ks=e.clipLine([Mi],si.x,si.y,Ji.x,Ji.y)}for(var pu=0,Mp=ks;pu=this.screenRightBoundary||methis.screenBottomBoundary},so.prototype.isInsideGrid=function(Y,ye,te,me){return te>=0&&Y=0&&ye0){var lr;return this.prevPlacement&&this.prevPlacement.variableOffsets[hr.crossTileID]&&this.prevPlacement.placements[hr.crossTileID]&&this.prevPlacement.placements[hr.crossTileID].text&&(lr=this.prevPlacement.variableOffsets[hr.crossTileID].anchor),this.variableOffsets[hr.crossTileID]={textOffset:ir,width:te,height:me,anchor:Y,textBoxScale:Ge,prevAnchor:lr},this.markUsedJustification(gt,Y,hr,Et),gt.allowVerticalPlacement&&(this.markUsedOrientation(gt,Et,hr),this.placedOrientations[hr.crossTileID]=Et),{shift:fr,placedGlyphBoxes:sr}}},Yo.prototype.placeLayerBucketPart=function(Y,ye,te){var me=this,Ge=Y.parameters,Le=Ge.bucket,$e=Ge.layout,mt=Ge.posMatrix,jt=Ge.textLabelPlaneMatrix,_r=Ge.labelToScreenMatrix,Fr=Ge.textPixelRatio,hr=Ge.holdingForFade,gt=Ge.collisionBoxArray,Et=Ge.partiallyEvaluatedTextSize,Ft=Ge.collisionGroup,ir=$e.get("text-optional"),fr=$e.get("icon-optional"),sr=$e.get("text-allow-overlap"),pr=$e.get("icon-allow-overlap"),lr=$e.get("text-rotation-alignment")==="map",Xt=$e.get("text-pitch-alignment")==="map",or=$e.get("icon-text-fit")!=="none",qt=$e.get("symbol-z-order")==="viewport-y",Dr=sr&&(pr||!Le.hasIconData()||fr),Jr=pr&&(sr||!Le.hasTextData()||ir);!Le.collisionArrays&>&&Le.deserializeCollisionBoxes(gt);var ba=function(pi,wi){if(!ye[pi.crossTileID]){if(hr){me.placements[pi.crossTileID]=new Oo(!1,!1,!1);return}var Mi=!1,Vi=!1,cn=!0,xo=null,jo={box:null,offscreen:null},ks={box:null,offscreen:null},Fo=null,bs=null,Hs=null,pu=0,Mp=0,Ep=0;wi.textFeatureIndex?pu=wi.textFeatureIndex:pi.useRuntimeCollisionCircles&&(pu=pi.featureIndex),wi.verticalTextFeatureIndex&&(Mp=wi.verticalTextFeatureIndex);var Ph=wi.textBox;if(Ph){var qp=function(cc){var lu=e.WritingMode.horizontal;if(Le.allowVerticalPlacement&&!cc&&me.prevPlacement){var Dh=me.prevPlacement.placedOrientations[pi.crossTileID];Dh&&(me.placedOrientations[pi.crossTileID]=Dh,lu=Dh,me.markUsedOrientation(Le,lu,pi))}return lu},qd=function(cc,lu){if(Le.allowVerticalPlacement&&pi.numVerticalGlyphVertices>0&&wi.verticalTextBox)for(var Dh=0,Iv=Le.writingModes;Dh0&&(Kh=Kh.filter(function(cc){return cc!==Rh.anchor}),Kh.unshift(Rh.anchor))}var Cp=function(cc,lu,Dh){for(var Iv=cc.x2-cc.x1,om=cc.y2-cc.y1,Au=pi.textBoxScale,x0=or&&!pr?lu:null,sv={box:[],offscreen:!1},_g=sr?Kh.length*2:Kh.length,Lp=0;Lp<_g;++Lp){var lv=Kh[Lp%Kh.length],xg=Lp>=Kh.length,b0=me.attemptAnchorPlacement(lv,cc,Iv,om,Au,lr,Xt,Fr,mt,Ft,xg,pi,Le,Dh,x0);if(b0&&(sv=b0.placedGlyphBoxes,sv&&sv.box&&sv.box.length)){Mi=!0,xo=b0.shift;break}}return sv},Vp=function(){return Cp(Ph,wi.iconBox,e.WritingMode.horizontal)},kp=function(){var cc=wi.verticalTextBox,lu=jo&&jo.box&&jo.box.length;return Le.allowVerticalPlacement&&!lu&&pi.numVerticalGlyphVertices>0&&cc?Cp(cc,wi.verticalIconBox,e.WritingMode.vertical):{box:null,offscreen:null}};qd(Vp,kp),jo&&(Mi=jo.box,cn=jo.offscreen);var kv=qp(jo&&jo.box);if(!Mi&&me.prevPlacement){var Vd=me.prevPlacement.variableOffsets[pi.crossTileID];Vd&&(me.variableOffsets[pi.crossTileID]=Vd,me.markUsedJustification(Le,Vd.anchor,pi,kv))}}else{var td=function(cc,lu){var Dh=me.collisionIndex.placeCollisionBox(cc,sr,Fr,mt,Ft.predicate);return Dh&&Dh.box&&Dh.box.length&&(me.markUsedOrientation(Le,lu,pi),me.placedOrientations[pi.crossTileID]=lu),Dh},Ih=function(){return td(Ph,e.WritingMode.horizontal)},rd=function(){var cc=wi.verticalTextBox;return Le.allowVerticalPlacement&&pi.numVerticalGlyphVertices>0&&cc?td(cc,e.WritingMode.vertical):{box:null,offscreen:null}};qd(Ih,rd),qp(jo&&jo.box&&jo.box.length)}}if(Fo=jo,Mi=Fo&&Fo.box&&Fo.box.length>0,cn=Fo&&Fo.offscreen,pi.useRuntimeCollisionCircles){var qf=Le.text.placedSymbolArray.get(pi.centerJustifiedTextSymbolIndex),Gd=e.evaluateSizeForFeature(Le.textSizeData,Et,qf),Lv=$e.get("text-padding"),ch=pi.collisionCircleDiameter;bs=me.collisionIndex.placeCollisionCircles(sr,qf,Le.lineVertexArray,Le.glyphOffsetArray,Gd,mt,jt,_r,te,Xt,Ft.predicate,ch,Lv),Mi=sr||bs.circles.length>0&&!bs.collisionDetected,cn=cn&&bs.offscreen}if(wi.iconFeatureIndex&&(Ep=wi.iconFeatureIndex),wi.iconBox){var iv=function(cc){var lu=or&&xo?Os(cc,xo.x,xo.y,lr,Xt,me.transform.angle):cc;return me.collisionIndex.placeCollisionBox(lu,pr,Fr,mt,Ft.predicate)};ks&&ks.box&&ks.box.length&&wi.verticalIconBox?(Hs=iv(wi.verticalIconBox),Vi=Hs.box.length>0):(Hs=iv(wi.iconBox),Vi=Hs.box.length>0),cn=cn&&Hs.offscreen}var im=ir||pi.numHorizontalGlyphVertices===0&&pi.numVerticalGlyphVertices===0,nm=fr||pi.numIconVertices===0;if(!im&&!nm?Vi=Mi=Vi&&Mi:nm?im||(Vi=Vi&&Mi):Mi=Vi&&Mi,Mi&&Fo&&Fo.box&&(ks&&ks.box&&Mp?me.collisionIndex.insertCollisionBox(Fo.box,$e.get("text-ignore-placement"),Le.bucketInstanceId,Mp,Ft.ID):me.collisionIndex.insertCollisionBox(Fo.box,$e.get("text-ignore-placement"),Le.bucketInstanceId,pu,Ft.ID)),Vi&&Hs&&me.collisionIndex.insertCollisionBox(Hs.box,$e.get("icon-ignore-placement"),Le.bucketInstanceId,Ep,Ft.ID),bs&&(Mi&&me.collisionIndex.insertCollisionCircles(bs.circles,$e.get("text-ignore-placement"),Le.bucketInstanceId,pu,Ft.ID),te)){var Pv=Le.bucketInstanceId,nv=me.collisionCircleArrays[Pv];nv===void 0&&(nv=me.collisionCircleArrays[Pv]=new lo);for(var ov=0;ov=0;--Xa){var si=yi[Xa];ba(Le.symbolInstances.get(si),Le.collisionArrays[si])}else for(var Ji=Y.symbolInstanceStart;Ji=0&&(Le>=0&&_r!==Le?Y.text.placedSymbolArray.get(_r).crossTileID=0:Y.text.placedSymbolArray.get(_r).crossTileID=te.crossTileID)}},Yo.prototype.markUsedOrientation=function(Y,ye,te){for(var me=ye===e.WritingMode.horizontal||ye===e.WritingMode.horizontalOnly?ye:0,Ge=ye===e.WritingMode.vertical?ye:0,Le=[te.leftJustifiedTextSymbolIndex,te.centerJustifiedTextSymbolIndex,te.rightJustifiedTextSymbolIndex],$e=0,mt=Le;$e0||Xt>0,ba=pr.numIconVertices>0,yi=me.placedOrientations[pr.crossTileID],Xa=yi===e.WritingMode.vertical,si=yi===e.WritingMode.horizontal||yi===e.WritingMode.horizontalOnly;if(Jr){var Ji=rl(Dr.text),Bi=Xa?Sn:Ji;Et(Y.text,lr,Bi);var pi=si?Sn:Ji;Et(Y.text,Xt,pi);var wi=Dr.text.isHidden();[pr.rightJustifiedTextSymbolIndex,pr.centerJustifiedTextSymbolIndex,pr.leftJustifiedTextSymbolIndex].forEach(function(Ep){Ep>=0&&(Y.text.placedSymbolArray.get(Ep).hidden=wi||Xa?1:0)}),pr.verticalPlacedTextSymbolIndex>=0&&(Y.text.placedSymbolArray.get(pr.verticalPlacedTextSymbolIndex).hidden=wi||si?1:0);var Mi=me.variableOffsets[pr.crossTileID];Mi&&me.markUsedJustification(Y,Mi.anchor,pr,yi);var Vi=me.placedOrientations[pr.crossTileID];Vi&&(me.markUsedJustification(Y,"left",pr,Vi),me.markUsedOrientation(Y,Vi,pr))}if(ba){var cn=rl(Dr.icon),xo=!(hr&&pr.verticalPlacedIconSymbolIndex&&Xa);if(pr.placedIconSymbolIndex>=0){var jo=xo?cn:Sn;Et(Y.icon,pr.numIconVertices,jo),Y.icon.placedSymbolArray.get(pr.placedIconSymbolIndex).hidden=Dr.icon.isHidden()}if(pr.verticalPlacedIconSymbolIndex>=0){var ks=xo?Sn:cn;Et(Y.icon,pr.numVerticalIconVertices,ks),Y.icon.placedSymbolArray.get(pr.verticalPlacedIconSymbolIndex).hidden=Dr.icon.isHidden()}}if(Y.hasIconCollisionBoxData()||Y.hasTextCollisionBoxData()){var Fo=Y.collisionArrays[sr];if(Fo){var bs=new e.Point(0,0);if(Fo.textBox||Fo.verticalTextBox){var Hs=!0;if(jt){var pu=me.variableOffsets[or];pu?(bs=Ys(pu.anchor,pu.width,pu.height,pu.textOffset,pu.textBoxScale),_r&&bs._rotate(Fr?me.transform.angle:-me.transform.angle)):Hs=!1}Fo.textBox&&Ui(Y.textCollisionBox.collisionVertexArray,Dr.text.placed,!Hs||Xa,bs.x,bs.y),Fo.verticalTextBox&&Ui(Y.textCollisionBox.collisionVertexArray,Dr.text.placed,!Hs||si,bs.x,bs.y)}var Mp=!!(!si&&Fo.verticalIconBox);Fo.iconBox&&Ui(Y.iconCollisionBox.collisionVertexArray,Dr.icon.placed,Mp,hr?bs.x:0,hr?bs.y:0),Fo.verticalIconBox&&Ui(Y.iconCollisionBox.collisionVertexArray,Dr.icon.placed,!Mp,hr?bs.x:0,hr?bs.y:0)}}},ir=0;irY},Yo.prototype.setStale=function(){this.stale=!0};function Ui(ve,Y,ye,te,me){ve.emplaceBack(Y?1:0,ye?1:0,te||0,me||0),ve.emplaceBack(Y?1:0,ye?1:0,te||0,me||0),ve.emplaceBack(Y?1:0,ye?1:0,te||0,me||0),ve.emplaceBack(Y?1:0,ye?1:0,te||0,me||0)}var Cn=Math.pow(2,25),tl=Math.pow(2,24),Bs=Math.pow(2,17),uo=Math.pow(2,16),$s=Math.pow(2,9),ms=Math.pow(2,8),Is=Math.pow(2,1);function rl(ve){if(ve.opacity===0&&!ve.placed)return 0;if(ve.opacity===1&&ve.placed)return 4294967295;var Y=ve.placed?1:0,ye=Math.floor(ve.opacity*127);return ye*Cn+Y*tl+ye*Bs+Y*uo+ye*$s+Y*ms+ye*Is+Y}var Sn=0,po=function(Y){this._sortAcrossTiles=Y.layout.get("symbol-z-order")!=="viewport-y"&&Y.layout.get("symbol-sort-key").constantOr(1)!==void 0,this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]};po.prototype.continuePlacement=function(Y,ye,te,me,Ge){for(var Le=this._bucketParts;this._currentTileIndex2};this._currentPlacementIndex>=0;){var $e=Y[this._currentPlacementIndex],mt=ye[$e],jt=this.placement.collisionIndex.transform.zoom;if(mt.type==="symbol"&&(!mt.minzoom||mt.minzoom<=jt)&&(!mt.maxzoom||mt.maxzoom>jt)){this._inProgressLayer||(this._inProgressLayer=new po(mt));var _r=this._inProgressLayer.continuePlacement(te[mt.source],this.placement,this._showCollisionBoxes,mt,Le);if(_r)return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},ro.prototype.commit=function(Y){return this.placement.commit(Y),this.placement};var As=512/e.EXTENT/2,al=function(Y,ye,te){this.tileID=Y,this.indexedSymbolInstances={},this.bucketInstanceId=te;for(var me=0;meY.overscaledZ)for(var jt in mt){var _r=mt[jt];_r.tileID.isChildOf(Y)&&_r.findMatches(ye.symbolInstances,Y,Le)}else{var Fr=Y.scaledTo(Number($e)),hr=mt[Fr.key];hr&&hr.findMatches(ye.symbolInstances,Y,Le)}}for(var gt=0;gt0)throw new Error("Unimplemented: "+Le.map(function($e){return $e.command}).join(", ")+".");return Ge.forEach(function($e){$e.command!=="setTransition"&&me[$e.command].apply(me,$e.args)}),this.stylesheet=te,!0},Y.prototype.addImage=function(te,me){if(this.getImage(te))return this.fire(new e.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(te,me),this._afterImageUpdated(te)},Y.prototype.updateImage=function(te,me){this.imageManager.updateImage(te,me)},Y.prototype.getImage=function(te){return this.imageManager.getImage(te)},Y.prototype.removeImage=function(te){if(!this.getImage(te))return this.fire(new e.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(te),this._afterImageUpdated(te)},Y.prototype._afterImageUpdated=function(te){this._availableImages=this.imageManager.listImages(),this._changedImages[te]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new e.Event("data",{dataType:"style"}))},Y.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},Y.prototype.addSource=function(te,me,Ge){var Le=this;if(Ge===void 0&&(Ge={}),this._checkLoaded(),this.sourceCaches[te]!==void 0)throw new Error("There is already a source with this ID");if(!me.type)throw new Error("The type property must be defined, but only the following properties were given: "+Object.keys(me).join(", ")+".");var $e=["vector","raster","geojson","video","image"],mt=$e.indexOf(me.type)>=0;if(!(mt&&this._validate(e.validateStyle.source,"sources."+te,me,null,Ge))){this.map&&this.map._collectResourceTiming&&(me.collectResourceTiming=!0);var jt=this.sourceCaches[te]=new ma(te,me,this.dispatcher);jt.style=this,jt.setEventedParent(this,function(){return{isSourceLoaded:Le.loaded(),source:jt.serialize(),sourceId:te}}),jt.onAdd(this.map),this._changed=!0}},Y.prototype.removeSource=function(te){if(this._checkLoaded(),this.sourceCaches[te]===void 0)throw new Error("There is no source with this ID");for(var me in this._layers)if(this._layers[me].source===te)return this.fire(new e.ErrorEvent(new Error('Source "'+te+'" cannot be removed while layer "'+me+'" is using it.')));var Ge=this.sourceCaches[te];delete this.sourceCaches[te],delete this._updatedSources[te],Ge.fire(new e.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:te})),Ge.setEventedParent(null),Ge.clearTiles(),Ge.onRemove&&Ge.onRemove(this.map),this._changed=!0},Y.prototype.setGeoJSONSourceData=function(te,me){this._checkLoaded();var Ge=this.sourceCaches[te].getSource();Ge.setData(me),this._changed=!0},Y.prototype.getSource=function(te){return this.sourceCaches[te]&&this.sourceCaches[te].getSource()},Y.prototype.addLayer=function(te,me,Ge){Ge===void 0&&(Ge={}),this._checkLoaded();var Le=te.id;if(this.getLayer(Le)){this.fire(new e.ErrorEvent(new Error('Layer with id "'+Le+'" already exists on this map')));return}var $e;if(te.type==="custom"){if(fl(this,e.validateCustomStyleLayer(te)))return;$e=e.createStyleLayer(te)}else{if(typeof te.source=="object"&&(this.addSource(Le,te.source),te=e.clone$1(te),te=e.extend(te,{source:Le})),this._validate(e.validateStyle.layer,"layers."+Le,te,{arrayIndex:-1},Ge))return;$e=e.createStyleLayer(te),this._validateLayer($e),$e.setEventedParent(this,{layer:{id:Le}}),this._serializedLayers[$e.id]=$e.serialize()}var mt=me?this._order.indexOf(me):this._order.length;if(me&&mt===-1){this.fire(new e.ErrorEvent(new Error('Layer with id "'+me+'" does not exist on this map.')));return}if(this._order.splice(mt,0,Le),this._layerOrderChanged=!0,this._layers[Le]=$e,this._removedLayers[Le]&&$e.source&&$e.type!=="custom"){var jt=this._removedLayers[Le];delete this._removedLayers[Le],jt.type!==$e.type?this._updatedSources[$e.source]="clear":(this._updatedSources[$e.source]="reload",this.sourceCaches[$e.source].pause())}this._updateLayer($e),$e.onAdd&&$e.onAdd(this.map)},Y.prototype.moveLayer=function(te,me){this._checkLoaded(),this._changed=!0;var Ge=this._layers[te];if(!Ge){this.fire(new e.ErrorEvent(new Error("The layer '"+te+"' does not exist in the map's style and cannot be moved.")));return}if(te!==me){var Le=this._order.indexOf(te);this._order.splice(Le,1);var $e=me?this._order.indexOf(me):this._order.length;if(me&&$e===-1){this.fire(new e.ErrorEvent(new Error('Layer with id "'+me+'" does not exist on this map.')));return}this._order.splice($e,0,te),this._layerOrderChanged=!0}},Y.prototype.removeLayer=function(te){this._checkLoaded();var me=this._layers[te];if(!me){this.fire(new e.ErrorEvent(new Error("The layer '"+te+"' does not exist in the map's style and cannot be removed.")));return}me.setEventedParent(null);var Ge=this._order.indexOf(te);this._order.splice(Ge,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[te]=me,delete this._layers[te],delete this._serializedLayers[te],delete this._updatedLayers[te],delete this._updatedPaintProps[te],me.onRemove&&me.onRemove(this.map)},Y.prototype.getLayer=function(te){return this._layers[te]},Y.prototype.hasLayer=function(te){return te in this._layers},Y.prototype.setLayerZoomRange=function(te,me,Ge){this._checkLoaded();var Le=this.getLayer(te);if(!Le){this.fire(new e.ErrorEvent(new Error("The layer '"+te+"' does not exist in the map's style and cannot have zoom extent.")));return}Le.minzoom===me&&Le.maxzoom===Ge||(me!=null&&(Le.minzoom=me),Ge!=null&&(Le.maxzoom=Ge),this._updateLayer(Le))},Y.prototype.setFilter=function(te,me,Ge){Ge===void 0&&(Ge={}),this._checkLoaded();var Le=this.getLayer(te);if(!Le){this.fire(new e.ErrorEvent(new Error("The layer '"+te+"' does not exist in the map's style and cannot be filtered.")));return}if(!e.deepEqual(Le.filter,me)){if(me==null){Le.filter=void 0,this._updateLayer(Le);return}this._validate(e.validateStyle.filter,"layers."+Le.id+".filter",me,null,Ge)||(Le.filter=e.clone$1(me),this._updateLayer(Le))}},Y.prototype.getFilter=function(te){return e.clone$1(this.getLayer(te).filter)},Y.prototype.setLayoutProperty=function(te,me,Ge,Le){Le===void 0&&(Le={}),this._checkLoaded();var $e=this.getLayer(te);if(!$e){this.fire(new e.ErrorEvent(new Error("The layer '"+te+"' does not exist in the map's style and cannot be styled.")));return}e.deepEqual($e.getLayoutProperty(me),Ge)||($e.setLayoutProperty(me,Ge,Le),this._updateLayer($e))},Y.prototype.getLayoutProperty=function(te,me){var Ge=this.getLayer(te);if(!Ge){this.fire(new e.ErrorEvent(new Error("The layer '"+te+"' does not exist in the map's style.")));return}return Ge.getLayoutProperty(me)},Y.prototype.setPaintProperty=function(te,me,Ge,Le){Le===void 0&&(Le={}),this._checkLoaded();var $e=this.getLayer(te);if(!$e){this.fire(new e.ErrorEvent(new Error("The layer '"+te+"' does not exist in the map's style and cannot be styled.")));return}if(!e.deepEqual($e.getPaintProperty(me),Ge)){var mt=$e.setPaintProperty(me,Ge,Le);mt&&this._updateLayer($e),this._changed=!0,this._updatedPaintProps[te]=!0}},Y.prototype.getPaintProperty=function(te,me){return this.getLayer(te).getPaintProperty(me)},Y.prototype.setFeatureState=function(te,me){this._checkLoaded();var Ge=te.source,Le=te.sourceLayer,$e=this.sourceCaches[Ge];if($e===void 0){this.fire(new e.ErrorEvent(new Error("The source '"+Ge+"' does not exist in the map's style.")));return}var mt=$e.getSource().type;if(mt==="geojson"&&Le){this.fire(new e.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter.")));return}if(mt==="vector"&&!Le){this.fire(new e.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));return}te.id===void 0&&this.fire(new e.ErrorEvent(new Error("The feature id parameter must be provided."))),$e.setFeatureState(Le,te.id,me)},Y.prototype.removeFeatureState=function(te,me){this._checkLoaded();var Ge=te.source,Le=this.sourceCaches[Ge];if(Le===void 0){this.fire(new e.ErrorEvent(new Error("The source '"+Ge+"' does not exist in the map's style.")));return}var $e=Le.getSource().type,mt=$e==="vector"?te.sourceLayer:void 0;if($e==="vector"&&!mt){this.fire(new e.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));return}if(me&&typeof te.id!="string"&&typeof te.id!="number"){this.fire(new e.ErrorEvent(new Error("A feature id is required to remove its specific state property.")));return}Le.removeFeatureState(mt,te.id,me)},Y.prototype.getFeatureState=function(te){this._checkLoaded();var me=te.source,Ge=te.sourceLayer,Le=this.sourceCaches[me];if(Le===void 0){this.fire(new e.ErrorEvent(new Error("The source '"+me+"' does not exist in the map's style.")));return}var $e=Le.getSource().type;if($e==="vector"&&!Ge){this.fire(new e.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));return}return te.id===void 0&&this.fire(new e.ErrorEvent(new Error("The feature id parameter must be provided."))),Le.getFeatureState(Ge,te.id)},Y.prototype.getTransition=function(){return e.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},Y.prototype.serialize=function(){return e.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:e.mapObject(this.sourceCaches,function(te){return te.serialize()}),layers:this._serializeLayers(this._order)},function(te){return te!==void 0})},Y.prototype._updateLayer=function(te){this._updatedLayers[te.id]=!0,te.source&&!this._updatedSources[te.source]&&this.sourceCaches[te.source].getSource().type!=="raster"&&(this._updatedSources[te.source]="reload",this.sourceCaches[te.source].pause()),this._changed=!0},Y.prototype._flattenAndSortRenderedFeatures=function(te){for(var me=this,Ge=function(si){return me._layers[si].type==="fill-extrusion"},Le={},$e=[],mt=this._order.length-1;mt>=0;mt--){var jt=this._order[mt];if(Ge(jt)){Le[jt]=mt;for(var _r=0,Fr=te;_r=0;sr--){var pr=this._order[sr];if(Ge(pr))for(var lr=$e.length-1;lr>=0;lr--){var Xt=$e[lr].feature;if(Le[Xt.layer.id] 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}`,Kl=`uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting; #pragma mapbox: define lowp float base #pragma mapbox: define lowp float height #pragma mapbox: define lowp vec4 pattern_from #pragma mapbox: define lowp vec4 pattern_to #pragma mapbox: define lowp float pixel_ratio_from #pragma mapbox: define lowp float pixel_ratio_to void main() { #pragma mapbox: initialize lowp float base #pragma mapbox: initialize lowp float height #pragma mapbox: initialize mediump vec4 pattern_from #pragma mapbox: initialize mediump vec4 pattern_to #pragma mapbox: initialize lowp float pixel_ratio_from #pragma mapbox: initialize lowp float pixel_ratio_to vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,Yf=`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting; #pragma mapbox: define lowp float base #pragma mapbox: define lowp float height #pragma mapbox: define lowp vec4 pattern_from #pragma mapbox: define lowp vec4 pattern_to #pragma mapbox: define lowp float pixel_ratio_from #pragma mapbox: define lowp float pixel_ratio_to void main() { #pragma mapbox: initialize lowp float base #pragma mapbox: initialize lowp float height #pragma mapbox: initialize mediump vec4 pattern_from #pragma mapbox: initialize mediump vec4 pattern_to #pragma mapbox: initialize lowp float pixel_ratio_from #pragma mapbox: initialize lowp float pixel_ratio_to vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0 ? a_pos : vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}`,zf=`#ifdef GL_ES precision highp float; #endif uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0); #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,af="uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}",Nc=`uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent; #define PI 3.141592653589793 void main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,Ff="uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}",Of=`uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale; #pragma mapbox: define highp vec4 color #pragma mapbox: define lowp float blur #pragma mapbox: define lowp float opacity void main() { #pragma mapbox: initialize highp vec4 color #pragma mapbox: initialize lowp float blur #pragma mapbox: initialize lowp float opacity float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity); #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,Gu=` #define scale 0.015873016 attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar; #pragma mapbox: define highp vec4 color #pragma mapbox: define lowp float blur #pragma mapbox: define lowp float opacity #pragma mapbox: define mediump float gapwidth #pragma mapbox: define lowp float offset #pragma mapbox: define mediump float width void main() { #pragma mapbox: initialize highp vec4 color #pragma mapbox: initialize lowp float blur #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize mediump float gapwidth #pragma mapbox: initialize lowp float offset #pragma mapbox: initialize mediump float width float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}`,Ef=`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv; #pragma mapbox: define lowp float blur #pragma mapbox: define lowp float opacity void main() { #pragma mapbox: initialize lowp float blur #pragma mapbox: initialize lowp float opacity float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,v_uv);gl_FragColor=color*(alpha*opacity); #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,oc=` #define scale 0.015873016 attribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv; #pragma mapbox: define lowp float blur #pragma mapbox: define lowp float opacity #pragma mapbox: define mediump float gapwidth #pragma mapbox: define lowp float offset #pragma mapbox: define mediump float width void main() { #pragma mapbox: initialize lowp float blur #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize mediump float gapwidth #pragma mapbox: initialize lowp float offset #pragma mapbox: initialize mediump float width float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}`,Hc=`uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width; #pragma mapbox: define lowp vec4 pattern_from #pragma mapbox: define lowp vec4 pattern_to #pragma mapbox: define lowp float pixel_ratio_from #pragma mapbox: define lowp float pixel_ratio_to #pragma mapbox: define lowp float blur #pragma mapbox: define lowp float opacity void main() { #pragma mapbox: initialize mediump vec4 pattern_from #pragma mapbox: initialize mediump vec4 pattern_to #pragma mapbox: initialize lowp float pixel_ratio_from #pragma mapbox: initialize lowp float pixel_ratio_to #pragma mapbox: initialize lowp float blur #pragma mapbox: initialize lowp float opacity vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,Jl=` #define scale 0.015873016 #define LINE_DISTANCE_SCALE 2.0 attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width; #pragma mapbox: define lowp float blur #pragma mapbox: define lowp float opacity #pragma mapbox: define lowp float offset #pragma mapbox: define mediump float gapwidth #pragma mapbox: define mediump float width #pragma mapbox: define lowp float floorwidth #pragma mapbox: define lowp vec4 pattern_from #pragma mapbox: define lowp vec4 pattern_to #pragma mapbox: define lowp float pixel_ratio_from #pragma mapbox: define lowp float pixel_ratio_to void main() { #pragma mapbox: initialize lowp float blur #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize lowp float offset #pragma mapbox: initialize mediump float gapwidth #pragma mapbox: initialize mediump float width #pragma mapbox: initialize lowp float floorwidth #pragma mapbox: initialize mediump vec4 pattern_from #pragma mapbox: initialize mediump vec4 pattern_to #pragma mapbox: initialize lowp float pixel_ratio_from #pragma mapbox: initialize lowp float pixel_ratio_to float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}`,Uc=`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale; #pragma mapbox: define highp vec4 color #pragma mapbox: define lowp float blur #pragma mapbox: define lowp float opacity #pragma mapbox: define mediump float width #pragma mapbox: define lowp float floorwidth void main() { #pragma mapbox: initialize highp vec4 color #pragma mapbox: initialize lowp float blur #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize mediump float width #pragma mapbox: initialize lowp float floorwidth float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity); #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,Tc=` #define scale 0.015873016 #define LINE_DISTANCE_SCALE 2.0 attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale; #pragma mapbox: define highp vec4 color #pragma mapbox: define lowp float blur #pragma mapbox: define lowp float opacity #pragma mapbox: define mediump float gapwidth #pragma mapbox: define lowp float offset #pragma mapbox: define mediump float width #pragma mapbox: define lowp float floorwidth void main() { #pragma mapbox: initialize highp vec4 color #pragma mapbox: initialize lowp float blur #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize mediump float gapwidth #pragma mapbox: initialize lowp float offset #pragma mapbox: initialize mediump float width #pragma mapbox: initialize lowp float floorwidth float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}`,Gs=`uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a); #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,Cf="uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}",lh=`uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity; #pragma mapbox: define lowp float opacity void main() { #pragma mapbox: initialize lowp float opacity lowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,Bf=`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;varying vec2 v_tex;varying float v_fade_opacity; #pragma mapbox: define lowp float opacity void main() { #pragma mapbox: initialize lowp float opacity vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? camera_to_anchor_distance/u_camera_to_center_distance : u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0),0.0,1.0);v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;v_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));}`,Wc=`#define SDF_PX 8.0 uniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1; #pragma mapbox: define highp vec4 fill_color #pragma mapbox: define highp vec4 halo_color #pragma mapbox: define lowp float opacity #pragma mapbox: define lowp float halo_width #pragma mapbox: define lowp float halo_blur void main() { #pragma mapbox: initialize highp vec4 fill_color #pragma mapbox: initialize highp vec4 halo_color #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize lowp float halo_width #pragma mapbox: initialize lowp float halo_blur float EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity); #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,Kf=`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;varying vec2 v_data0;varying vec3 v_data1; #pragma mapbox: define highp vec4 fill_color #pragma mapbox: define highp vec4 halo_color #pragma mapbox: define lowp float opacity #pragma mapbox: define lowp float halo_width #pragma mapbox: define lowp float halo_blur void main() { #pragma mapbox: initialize highp vec4 fill_color #pragma mapbox: initialize highp vec4 halo_color #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize lowp float halo_width #pragma mapbox: initialize lowp float halo_blur vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? camera_to_anchor_distance/u_camera_to_center_distance : u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}`,ku=`#define SDF_PX 8.0 #define SDF 1.0 #define ICON 0.0 uniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1; #pragma mapbox: define highp vec4 fill_color #pragma mapbox: define highp vec4 halo_color #pragma mapbox: define lowp float opacity #pragma mapbox: define lowp float halo_width #pragma mapbox: define lowp float halo_blur void main() { #pragma mapbox: initialize highp vec4 fill_color #pragma mapbox: initialize highp vec4 halo_color #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize lowp float halo_width #pragma mapbox: initialize lowp float halo_blur float fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif return;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity); #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,Nf=`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;varying vec4 v_data0;varying vec4 v_data1; #pragma mapbox: define highp vec4 fill_color #pragma mapbox: define highp vec4 halo_color #pragma mapbox: define lowp float opacity #pragma mapbox: define lowp float halo_width #pragma mapbox: define lowp float halo_blur void main() { #pragma mapbox: initialize highp vec4 fill_color #pragma mapbox: initialize highp vec4 halo_color #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize lowp float halo_width #pragma mapbox: initialize lowp float halo_blur vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? camera_to_anchor_distance/u_camera_to_center_distance : u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}`,ml=hl(Bc,Cu),Lu=hl(Af,pf),Ac=hl(Us,Vc),nl=hl(Sf,nu),dc=hl(Ll,ic),vu=hl(Ou,il),bu=hl(vl,gs),Ml=hl(Vs,nc),Uf=hl(Nl,qu),Jf=hl(cl,yh),Bu=hl(ls,_h),Sc=hl(Ss,Qn),vc=hl(Gc,Vu),Lh=hl(Ul,Mf),nf=hl(wc,rf),df=hl(Kl,Yf),Nu=hl(zf,af),of=hl(Nc,Ff),tu=hl(Of,Gu),Xc=hl(Ef,oc),uh=hl(Hc,Jl),vf=hl(Uc,Tc),ol=hl(Gs,Cf),mu=hl(lh,Bf),Pu=hl(Wc,Kf),kf=hl(ku,Nf);function hl(ve,Y){var ye=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,te=Y.match(/attribute ([\w]+) ([\w]+)/g),me=ve.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),Ge=Y.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),Le=Ge?Ge.concat(me):me,$e={};return ve=ve.replace(ye,function(mt,jt,_r,Fr,hr){return $e[hr]=!0,jt==="define"?` #ifndef HAS_UNIFORM_u_`+hr+` varying `+_r+" "+Fr+" "+hr+`; #else uniform `+_r+" "+Fr+" u_"+hr+`; #endif `:` #ifdef HAS_UNIFORM_u_`+hr+` `+_r+" "+Fr+" "+hr+" = u_"+hr+`; #endif `}),Y=Y.replace(ye,function(mt,jt,_r,Fr,hr){var gt=Fr==="float"?"vec2":"vec4",Et=hr.match(/color/)?"color":gt;return $e[hr]?jt==="define"?` #ifndef HAS_UNIFORM_u_`+hr+` uniform lowp float u_`+hr+`_t; attribute `+_r+" "+gt+" a_"+hr+`; varying `+_r+" "+Fr+" "+hr+`; #else uniform `+_r+" "+Fr+" u_"+hr+`; #endif `:Et==="vec4"?` #ifndef HAS_UNIFORM_u_`+hr+` `+hr+" = a_"+hr+`; #else `+_r+" "+Fr+" "+hr+" = u_"+hr+`; #endif `:` #ifndef HAS_UNIFORM_u_`+hr+` `+hr+" = unpack_mix_"+Et+"(a_"+hr+", u_"+hr+`_t); #else `+_r+" "+Fr+" "+hr+" = u_"+hr+`; #endif `:jt==="define"?` #ifndef HAS_UNIFORM_u_`+hr+` uniform lowp float u_`+hr+`_t; attribute `+_r+" "+gt+" a_"+hr+`; #else uniform `+_r+" "+Fr+" u_"+hr+`; #endif `:Et==="vec4"?` #ifndef HAS_UNIFORM_u_`+hr+` `+_r+" "+Fr+" "+hr+" = a_"+hr+`; #else `+_r+" "+Fr+" "+hr+" = u_"+hr+`; #endif `:` #ifndef HAS_UNIFORM_u_`+hr+` `+_r+" "+Fr+" "+hr+" = unpack_mix_"+Et+"(a_"+hr+", u_"+hr+`_t); #else `+_r+" "+Fr+" "+hr+" = u_"+hr+`; #endif `}),{fragmentSource:ve,vertexSource:Y,staticAttributes:te,staticUniforms:Le}}var sf=Object.freeze({__proto__:null,prelude:ml,background:Lu,backgroundPattern:Ac,circle:nl,clippingMask:dc,heatmap:vu,heatmapTexture:bu,collisionBox:Ml,collisionCircle:Uf,debug:Jf,fill:Bu,fillOutline:Sc,fillOutlinePattern:vc,fillPattern:Lh,fillExtrusion:nf,fillExtrusionPattern:df,hillshadePrepare:Nu,hillshade:of,line:tu,lineGradient:Xc,linePattern:uh,lineSDF:vf,raster:ol,symbolIcon:mu,symbolSDF:Pu,symbolTextAndIcon:kf}),Mc=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null};Mc.prototype.bind=function(Y,ye,te,me,Ge,Le,$e,mt){this.context=Y;for(var jt=this.boundPaintVertexBuffers.length!==me.length,_r=0;!jt&&_r>16,$e>>16],u_pixel_coord_lower:[Le&65535,$e&65535]}}function Zc(ve,Y,ye,te){var me=ye.imageManager.getPattern(ve.from.toString()),Ge=ye.imageManager.getPattern(ve.to.toString()),Le=ye.imageManager.getPixelSize(),$e=Le.width,mt=Le.height,jt=Math.pow(2,te.tileID.overscaledZ),_r=te.tileSize*Math.pow(2,ye.transform.tileZoom)/jt,Fr=_r*(te.tileID.canonical.x+te.tileID.wrap*jt),hr=_r*te.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:me.tl,u_pattern_br_a:me.br,u_pattern_tl_b:Ge.tl,u_pattern_br_b:Ge.br,u_texsize:[$e,mt],u_mix:Y.t,u_pattern_size_a:me.displaySize,u_pattern_size_b:Ge.displaySize,u_scale_a:Y.fromScale,u_scale_b:Y.toScale,u_tile_units_to_pixels:1/Vn(te,1,ye.transform.tileZoom),u_pixel_coord_upper:[Fr>>16,hr>>16],u_pixel_coord_lower:[Fr&65535,hr&65535]}}var Lf=function(ve,Y){return{u_matrix:new e.UniformMatrix4f(ve,Y.u_matrix),u_lightpos:new e.Uniform3f(ve,Y.u_lightpos),u_lightintensity:new e.Uniform1f(ve,Y.u_lightintensity),u_lightcolor:new e.Uniform3f(ve,Y.u_lightcolor),u_vertical_gradient:new e.Uniform1f(ve,Y.u_vertical_gradient),u_opacity:new e.Uniform1f(ve,Y.u_opacity)}},ru=function(ve,Y){return{u_matrix:new e.UniformMatrix4f(ve,Y.u_matrix),u_lightpos:new e.Uniform3f(ve,Y.u_lightpos),u_lightintensity:new e.Uniform1f(ve,Y.u_lightintensity),u_lightcolor:new e.Uniform3f(ve,Y.u_lightcolor),u_vertical_gradient:new e.Uniform1f(ve,Y.u_vertical_gradient),u_height_factor:new e.Uniform1f(ve,Y.u_height_factor),u_image:new e.Uniform1i(ve,Y.u_image),u_texsize:new e.Uniform2f(ve,Y.u_texsize),u_pixel_coord_upper:new e.Uniform2f(ve,Y.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(ve,Y.u_pixel_coord_lower),u_scale:new e.Uniform3f(ve,Y.u_scale),u_fade:new e.Uniform1f(ve,Y.u_fade),u_opacity:new e.Uniform1f(ve,Y.u_opacity)}},jf=function(ve,Y,ye,te){var me=Y.style.light,Ge=me.properties.get("position"),Le=[Ge.x,Ge.y,Ge.z],$e=e.create$1();me.properties.get("anchor")==="viewport"&&e.fromRotation($e,-Y.transform.angle),e.transformMat3(Le,Le,$e);var mt=me.properties.get("color");return{u_matrix:ve,u_lightpos:Le,u_lightintensity:me.properties.get("intensity"),u_lightcolor:[mt.r,mt.g,mt.b],u_vertical_gradient:+ye,u_opacity:te}},Xu=function(ve,Y,ye,te,me,Ge,Le){return e.extend(jf(ve,Y,ye,te),Wu(Ge,Y,Le),{u_height_factor:-Math.pow(2,me.overscaledZ)/Le.tileSize/8})},Ec=function(ve,Y){return{u_matrix:new e.UniformMatrix4f(ve,Y.u_matrix)}},mc=function(ve,Y){return{u_matrix:new e.UniformMatrix4f(ve,Y.u_matrix),u_image:new e.Uniform1i(ve,Y.u_image),u_texsize:new e.Uniform2f(ve,Y.u_texsize),u_pixel_coord_upper:new e.Uniform2f(ve,Y.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(ve,Y.u_pixel_coord_lower),u_scale:new e.Uniform3f(ve,Y.u_scale),u_fade:new e.Uniform1f(ve,Y.u_fade)}},jl=function(ve,Y){return{u_matrix:new e.UniformMatrix4f(ve,Y.u_matrix),u_world:new e.Uniform2f(ve,Y.u_world)}},gu=function(ve,Y){return{u_matrix:new e.UniformMatrix4f(ve,Y.u_matrix),u_world:new e.Uniform2f(ve,Y.u_world),u_image:new e.Uniform1i(ve,Y.u_image),u_texsize:new e.Uniform2f(ve,Y.u_texsize),u_pixel_coord_upper:new e.Uniform2f(ve,Y.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(ve,Y.u_pixel_coord_lower),u_scale:new e.Uniform3f(ve,Y.u_scale),u_fade:new e.Uniform1f(ve,Y.u_fade)}},Cc=function(ve){return{u_matrix:ve}},Yc=function(ve,Y,ye,te){return e.extend(Cc(ve),Wu(ye,Y,te))},sc=function(ve,Y){return{u_matrix:ve,u_world:Y}},kc=function(ve,Y,ye,te,me){return e.extend(Yc(ve,Y,ye,te),{u_world:me})},er=function(ve,Y){return{u_camera_to_center_distance:new e.Uniform1f(ve,Y.u_camera_to_center_distance),u_scale_with_map:new e.Uniform1i(ve,Y.u_scale_with_map),u_pitch_with_map:new e.Uniform1i(ve,Y.u_pitch_with_map),u_extrude_scale:new e.Uniform2f(ve,Y.u_extrude_scale),u_device_pixel_ratio:new e.Uniform1f(ve,Y.u_device_pixel_ratio),u_matrix:new e.UniformMatrix4f(ve,Y.u_matrix)}},yr=function(ve,Y,ye,te){var me=ve.transform,Ge,Le;if(te.paint.get("circle-pitch-alignment")==="map"){var $e=Vn(ye,1,me.zoom);Ge=!0,Le=[$e,$e]}else Ge=!1,Le=me.pixelsToGLUnits;return{u_camera_to_center_distance:me.cameraToCenterDistance,u_scale_with_map:+(te.paint.get("circle-pitch-scale")==="map"),u_matrix:ve.translatePosMatrix(Y.posMatrix,ye,te.paint.get("circle-translate"),te.paint.get("circle-translate-anchor")),u_pitch_with_map:+Ge,u_device_pixel_ratio:e.browser.devicePixelRatio,u_extrude_scale:Le}},na=function(ve,Y){return{u_matrix:new e.UniformMatrix4f(ve,Y.u_matrix),u_camera_to_center_distance:new e.Uniform1f(ve,Y.u_camera_to_center_distance),u_pixels_to_tile_units:new e.Uniform1f(ve,Y.u_pixels_to_tile_units),u_extrude_scale:new e.Uniform2f(ve,Y.u_extrude_scale),u_overscale_factor:new e.Uniform1f(ve,Y.u_overscale_factor)}},$r=function(ve,Y){return{u_matrix:new e.UniformMatrix4f(ve,Y.u_matrix),u_inv_matrix:new e.UniformMatrix4f(ve,Y.u_inv_matrix),u_camera_to_center_distance:new e.Uniform1f(ve,Y.u_camera_to_center_distance),u_viewport_size:new e.Uniform2f(ve,Y.u_viewport_size)}},La=function(ve,Y,ye){var te=Vn(ye,1,Y.zoom),me=Math.pow(2,Y.zoom-ye.tileID.overscaledZ),Ge=ye.tileID.overscaleFactor();return{u_matrix:ve,u_camera_to_center_distance:Y.cameraToCenterDistance,u_pixels_to_tile_units:te,u_extrude_scale:[Y.pixelsToGLUnits[0]/(te*me),Y.pixelsToGLUnits[1]/(te*me)],u_overscale_factor:Ge}},hi=function(ve,Y,ye){return{u_matrix:ve,u_inv_matrix:Y,u_camera_to_center_distance:ye.cameraToCenterDistance,u_viewport_size:[ye.width,ye.height]}},Pi=function(ve,Y){return{u_color:new e.UniformColor(ve,Y.u_color),u_matrix:new e.UniformMatrix4f(ve,Y.u_matrix),u_overlay:new e.Uniform1i(ve,Y.u_overlay),u_overlay_scale:new e.Uniform1f(ve,Y.u_overlay_scale)}},Zi=function(ve,Y,ye){return ye===void 0&&(ye=1),{u_matrix:ve,u_color:Y,u_overlay:0,u_overlay_scale:ye}},tn=function(ve,Y){return{u_matrix:new e.UniformMatrix4f(ve,Y.u_matrix)}},dn=function(ve){return{u_matrix:ve}},Ri=function(ve,Y){return{u_extrude_scale:new e.Uniform1f(ve,Y.u_extrude_scale),u_intensity:new e.Uniform1f(ve,Y.u_intensity),u_matrix:new e.UniformMatrix4f(ve,Y.u_matrix)}},Fi=function(ve,Y){return{u_matrix:new e.UniformMatrix4f(ve,Y.u_matrix),u_world:new e.Uniform2f(ve,Y.u_world),u_image:new e.Uniform1i(ve,Y.u_image),u_color_ramp:new e.Uniform1i(ve,Y.u_color_ramp),u_opacity:new e.Uniform1f(ve,Y.u_opacity)}},qi=function(ve,Y,ye,te){return{u_matrix:ve,u_extrude_scale:Vn(Y,1,ye),u_intensity:te}},_i=function(ve,Y,ye,te){var me=e.create();e.ortho(me,0,ve.width,ve.height,0,0,1);var Ge=ve.context.gl;return{u_matrix:me,u_world:[Ge.drawingBufferWidth,Ge.drawingBufferHeight],u_image:ye,u_color_ramp:te,u_opacity:Y.paint.get("heatmap-opacity")}},Mn=function(ve,Y){return{u_matrix:new e.UniformMatrix4f(ve,Y.u_matrix),u_image:new e.Uniform1i(ve,Y.u_image),u_latrange:new e.Uniform2f(ve,Y.u_latrange),u_light:new e.Uniform2f(ve,Y.u_light),u_shadow:new e.UniformColor(ve,Y.u_shadow),u_highlight:new e.UniformColor(ve,Y.u_highlight),u_accent:new e.UniformColor(ve,Y.u_accent)}},Kn=function(ve,Y){return{u_matrix:new e.UniformMatrix4f(ve,Y.u_matrix),u_image:new e.Uniform1i(ve,Y.u_image),u_dimension:new e.Uniform2f(ve,Y.u_dimension),u_zoom:new e.Uniform1f(ve,Y.u_zoom),u_unpack:new e.Uniform4f(ve,Y.u_unpack)}},ao=function(ve,Y,ye){var te=ye.paint.get("hillshade-shadow-color"),me=ye.paint.get("hillshade-highlight-color"),Ge=ye.paint.get("hillshade-accent-color"),Le=ye.paint.get("hillshade-illumination-direction")*(Math.PI/180);ye.paint.get("hillshade-illumination-anchor")==="viewport"&&(Le-=ve.transform.angle);var $e=!ve.options.moving;return{u_matrix:ve.transform.calculatePosMatrix(Y.tileID.toUnwrapped(),$e),u_image:0,u_latrange:co(ve,Y.tileID),u_light:[ye.paint.get("hillshade-exaggeration"),Le],u_shadow:te,u_highlight:me,u_accent:Ge}},Jn=function(ve,Y){var ye=Y.stride,te=e.create();return e.ortho(te,0,e.EXTENT,-e.EXTENT,0,0,1),e.translate(te,te,[0,-e.EXTENT,0]),{u_matrix:te,u_image:1,u_dimension:[ye,ye],u_zoom:ve.overscaledZ,u_unpack:Y.getUnpackVector()}};function co(ve,Y){var ye=Math.pow(2,Y.canonical.z),te=Y.canonical.y;return[new e.MercatorCoordinate(0,te/ye).toLngLat().lat,new e.MercatorCoordinate(0,(te+1)/ye).toLngLat().lat]}var wn=function(ve,Y){return{u_matrix:new e.UniformMatrix4f(ve,Y.u_matrix),u_ratio:new e.Uniform1f(ve,Y.u_ratio),u_device_pixel_ratio:new e.Uniform1f(ve,Y.u_device_pixel_ratio),u_units_to_pixels:new e.Uniform2f(ve,Y.u_units_to_pixels)}},un=function(ve,Y){return{u_matrix:new e.UniformMatrix4f(ve,Y.u_matrix),u_ratio:new e.Uniform1f(ve,Y.u_ratio),u_device_pixel_ratio:new e.Uniform1f(ve,Y.u_device_pixel_ratio),u_units_to_pixels:new e.Uniform2f(ve,Y.u_units_to_pixels),u_image:new e.Uniform1i(ve,Y.u_image),u_image_height:new e.Uniform1f(ve,Y.u_image_height)}},_o=function(ve,Y){return{u_matrix:new e.UniformMatrix4f(ve,Y.u_matrix),u_texsize:new e.Uniform2f(ve,Y.u_texsize),u_ratio:new e.Uniform1f(ve,Y.u_ratio),u_device_pixel_ratio:new e.Uniform1f(ve,Y.u_device_pixel_ratio),u_image:new e.Uniform1i(ve,Y.u_image),u_units_to_pixels:new e.Uniform2f(ve,Y.u_units_to_pixels),u_scale:new e.Uniform3f(ve,Y.u_scale),u_fade:new e.Uniform1f(ve,Y.u_fade)}},Qo=function(ve,Y){return{u_matrix:new e.UniformMatrix4f(ve,Y.u_matrix),u_ratio:new e.Uniform1f(ve,Y.u_ratio),u_device_pixel_ratio:new e.Uniform1f(ve,Y.u_device_pixel_ratio),u_units_to_pixels:new e.Uniform2f(ve,Y.u_units_to_pixels),u_patternscale_a:new e.Uniform2f(ve,Y.u_patternscale_a),u_patternscale_b:new e.Uniform2f(ve,Y.u_patternscale_b),u_sdfgamma:new e.Uniform1f(ve,Y.u_sdfgamma),u_image:new e.Uniform1i(ve,Y.u_image),u_tex_y_a:new e.Uniform1f(ve,Y.u_tex_y_a),u_tex_y_b:new e.Uniform1f(ve,Y.u_tex_y_b),u_mix:new e.Uniform1f(ve,Y.u_mix)}},xs=function(ve,Y,ye){var te=ve.transform;return{u_matrix:Fl(ve,Y,ye),u_ratio:1/Vn(Y,1,te.zoom),u_device_pixel_ratio:e.browser.devicePixelRatio,u_units_to_pixels:[1/te.pixelsToGLUnits[0],1/te.pixelsToGLUnits[1]]}},Qs=function(ve,Y,ye,te){return e.extend(xs(ve,Y,ye),{u_image:0,u_image_height:te})},Rs=function(ve,Y,ye,te){var me=ve.transform,Ge=ys(Y,me);return{u_matrix:Fl(ve,Y,ye),u_texsize:Y.imageAtlasTexture.size,u_ratio:1/Vn(Y,1,me.zoom),u_device_pixel_ratio:e.browser.devicePixelRatio,u_image:0,u_scale:[Ge,te.fromScale,te.toScale],u_fade:te.t,u_units_to_pixels:[1/me.pixelsToGLUnits[0],1/me.pixelsToGLUnits[1]]}},Ks=function(ve,Y,ye,te,me){var Ge=ve.transform,Le=ve.lineAtlas,$e=ys(Y,Ge),mt=ye.layout.get("line-cap")==="round",jt=Le.getDash(te.from,mt),_r=Le.getDash(te.to,mt),Fr=jt.width*me.fromScale,hr=_r.width*me.toScale;return e.extend(xs(ve,Y,ye),{u_patternscale_a:[$e/Fr,-jt.height/2],u_patternscale_b:[$e/hr,-_r.height/2],u_sdfgamma:Le.width/(Math.min(Fr,hr)*256*e.browser.devicePixelRatio)/2,u_image:0,u_tex_y_a:jt.y,u_tex_y_b:_r.y,u_mix:me.t})};function ys(ve,Y){return 1/Vn(ve,1,Y.tileZoom)}function Fl(ve,Y,ye){return ve.translatePosMatrix(Y.tileID.posMatrix,Y,ye.paint.get("line-translate"),ye.paint.get("line-translate-anchor"))}var yl=function(ve,Y){return{u_matrix:new e.UniformMatrix4f(ve,Y.u_matrix),u_tl_parent:new e.Uniform2f(ve,Y.u_tl_parent),u_scale_parent:new e.Uniform1f(ve,Y.u_scale_parent),u_buffer_scale:new e.Uniform1f(ve,Y.u_buffer_scale),u_fade_t:new e.Uniform1f(ve,Y.u_fade_t),u_opacity:new e.Uniform1f(ve,Y.u_opacity),u_image0:new e.Uniform1i(ve,Y.u_image0),u_image1:new e.Uniform1i(ve,Y.u_image1),u_brightness_low:new e.Uniform1f(ve,Y.u_brightness_low),u_brightness_high:new e.Uniform1f(ve,Y.u_brightness_high),u_saturation_factor:new e.Uniform1f(ve,Y.u_saturation_factor),u_contrast_factor:new e.Uniform1f(ve,Y.u_contrast_factor),u_spin_weights:new e.Uniform3f(ve,Y.u_spin_weights)}},sl=function(ve,Y,ye,te,me){return{u_matrix:ve,u_tl_parent:Y,u_scale_parent:ye,u_buffer_scale:1,u_fade_t:te.mix,u_opacity:te.opacity*me.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:me.paint.get("raster-brightness-min"),u_brightness_high:me.paint.get("raster-brightness-max"),u_saturation_factor:Xs(me.paint.get("raster-saturation")),u_contrast_factor:Io(me.paint.get("raster-contrast")),u_spin_weights:Un(me.paint.get("raster-hue-rotate"))}};function Un(ve){ve*=Math.PI/180;var Y=Math.sin(ve),ye=Math.cos(ve);return[(2*ye+1)/3,(-Math.sqrt(3)*Y-ye+1)/3,(Math.sqrt(3)*Y-ye+1)/3]}function Io(ve){return ve>0?1/(1-ve):1+ve}function Xs(ve){return ve>0?1-1/(1.001-ve):-ve}var Ls=function(ve,Y){return{u_is_size_zoom_constant:new e.Uniform1i(ve,Y.u_is_size_zoom_constant),u_is_size_feature_constant:new e.Uniform1i(ve,Y.u_is_size_feature_constant),u_size_t:new e.Uniform1f(ve,Y.u_size_t),u_size:new e.Uniform1f(ve,Y.u_size),u_camera_to_center_distance:new e.Uniform1f(ve,Y.u_camera_to_center_distance),u_pitch:new e.Uniform1f(ve,Y.u_pitch),u_rotate_symbol:new e.Uniform1i(ve,Y.u_rotate_symbol),u_aspect_ratio:new e.Uniform1f(ve,Y.u_aspect_ratio),u_fade_change:new e.Uniform1f(ve,Y.u_fade_change),u_matrix:new e.UniformMatrix4f(ve,Y.u_matrix),u_label_plane_matrix:new e.UniformMatrix4f(ve,Y.u_label_plane_matrix),u_coord_matrix:new e.UniformMatrix4f(ve,Y.u_coord_matrix),u_is_text:new e.Uniform1i(ve,Y.u_is_text),u_pitch_with_map:new e.Uniform1i(ve,Y.u_pitch_with_map),u_texsize:new e.Uniform2f(ve,Y.u_texsize),u_texture:new e.Uniform1i(ve,Y.u_texture)}},ou=function(ve,Y){return{u_is_size_zoom_constant:new e.Uniform1i(ve,Y.u_is_size_zoom_constant),u_is_size_feature_constant:new e.Uniform1i(ve,Y.u_is_size_feature_constant),u_size_t:new e.Uniform1f(ve,Y.u_size_t),u_size:new e.Uniform1f(ve,Y.u_size),u_camera_to_center_distance:new e.Uniform1f(ve,Y.u_camera_to_center_distance),u_pitch:new e.Uniform1f(ve,Y.u_pitch),u_rotate_symbol:new e.Uniform1i(ve,Y.u_rotate_symbol),u_aspect_ratio:new e.Uniform1f(ve,Y.u_aspect_ratio),u_fade_change:new e.Uniform1f(ve,Y.u_fade_change),u_matrix:new e.UniformMatrix4f(ve,Y.u_matrix),u_label_plane_matrix:new e.UniformMatrix4f(ve,Y.u_label_plane_matrix),u_coord_matrix:new e.UniformMatrix4f(ve,Y.u_coord_matrix),u_is_text:new e.Uniform1i(ve,Y.u_is_text),u_pitch_with_map:new e.Uniform1i(ve,Y.u_pitch_with_map),u_texsize:new e.Uniform2f(ve,Y.u_texsize),u_texture:new e.Uniform1i(ve,Y.u_texture),u_gamma_scale:new e.Uniform1f(ve,Y.u_gamma_scale),u_device_pixel_ratio:new e.Uniform1f(ve,Y.u_device_pixel_ratio),u_is_halo:new e.Uniform1i(ve,Y.u_is_halo)}},Iu=function(ve,Y){return{u_is_size_zoom_constant:new e.Uniform1i(ve,Y.u_is_size_zoom_constant),u_is_size_feature_constant:new e.Uniform1i(ve,Y.u_is_size_feature_constant),u_size_t:new e.Uniform1f(ve,Y.u_size_t),u_size:new e.Uniform1f(ve,Y.u_size),u_camera_to_center_distance:new e.Uniform1f(ve,Y.u_camera_to_center_distance),u_pitch:new e.Uniform1f(ve,Y.u_pitch),u_rotate_symbol:new e.Uniform1i(ve,Y.u_rotate_symbol),u_aspect_ratio:new e.Uniform1f(ve,Y.u_aspect_ratio),u_fade_change:new e.Uniform1f(ve,Y.u_fade_change),u_matrix:new e.UniformMatrix4f(ve,Y.u_matrix),u_label_plane_matrix:new e.UniformMatrix4f(ve,Y.u_label_plane_matrix),u_coord_matrix:new e.UniformMatrix4f(ve,Y.u_coord_matrix),u_is_text:new e.Uniform1i(ve,Y.u_is_text),u_pitch_with_map:new e.Uniform1i(ve,Y.u_pitch_with_map),u_texsize:new e.Uniform2f(ve,Y.u_texsize),u_texsize_icon:new e.Uniform2f(ve,Y.u_texsize_icon),u_texture:new e.Uniform1i(ve,Y.u_texture),u_texture_icon:new e.Uniform1i(ve,Y.u_texture_icon),u_gamma_scale:new e.Uniform1f(ve,Y.u_gamma_scale),u_device_pixel_ratio:new e.Uniform1f(ve,Y.u_device_pixel_ratio),u_is_halo:new e.Uniform1i(ve,Y.u_is_halo)}},Zu=function(ve,Y,ye,te,me,Ge,Le,$e,mt,jt){var _r=me.transform;return{u_is_size_zoom_constant:+(ve==="constant"||ve==="source"),u_is_size_feature_constant:+(ve==="constant"||ve==="camera"),u_size_t:Y?Y.uSizeT:0,u_size:Y?Y.uSize:0,u_camera_to_center_distance:_r.cameraToCenterDistance,u_pitch:_r.pitch/360*2*Math.PI,u_rotate_symbol:+ye,u_aspect_ratio:_r.width/_r.height,u_fade_change:me.options.fadeDuration?me.symbolFadeChange:1,u_matrix:Ge,u_label_plane_matrix:Le,u_coord_matrix:$e,u_is_text:+mt,u_pitch_with_map:+te,u_texsize:jt,u_texture:0}},Lc=function(ve,Y,ye,te,me,Ge,Le,$e,mt,jt,_r){var Fr=me.transform;return e.extend(Zu(ve,Y,ye,te,me,Ge,Le,$e,mt,jt),{u_gamma_scale:te?Math.cos(Fr._pitch)*Fr.cameraToCenterDistance:1,u_device_pixel_ratio:e.browser.devicePixelRatio,u_is_halo:+_r})},yu=function(ve,Y,ye,te,me,Ge,Le,$e,mt,jt){return e.extend(Lc(ve,Y,ye,te,me,Ge,Le,$e,!0,mt,!0),{u_texsize_icon:jt,u_texture_icon:1})},Pc=function(ve,Y){return{u_matrix:new e.UniformMatrix4f(ve,Y.u_matrix),u_opacity:new e.Uniform1f(ve,Y.u_opacity),u_color:new e.UniformColor(ve,Y.u_color)}},wu=function(ve,Y){return{u_matrix:new e.UniformMatrix4f(ve,Y.u_matrix),u_opacity:new e.Uniform1f(ve,Y.u_opacity),u_image:new e.Uniform1i(ve,Y.u_image),u_pattern_tl_a:new e.Uniform2f(ve,Y.u_pattern_tl_a),u_pattern_br_a:new e.Uniform2f(ve,Y.u_pattern_br_a),u_pattern_tl_b:new e.Uniform2f(ve,Y.u_pattern_tl_b),u_pattern_br_b:new e.Uniform2f(ve,Y.u_pattern_br_b),u_texsize:new e.Uniform2f(ve,Y.u_texsize),u_mix:new e.Uniform1f(ve,Y.u_mix),u_pattern_size_a:new e.Uniform2f(ve,Y.u_pattern_size_a),u_pattern_size_b:new e.Uniform2f(ve,Y.u_pattern_size_b),u_scale_a:new e.Uniform1f(ve,Y.u_scale_a),u_scale_b:new e.Uniform1f(ve,Y.u_scale_b),u_pixel_coord_upper:new e.Uniform2f(ve,Y.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(ve,Y.u_pixel_coord_lower),u_tile_units_to_pixels:new e.Uniform1f(ve,Y.u_tile_units_to_pixels)}},gc=function(ve,Y,ye){return{u_matrix:ve,u_opacity:Y,u_color:ye}},fo=function(ve,Y,ye,te,me,Ge){return e.extend(Zc(te,Ge,ye,me),{u_matrix:ve,u_opacity:Y})},zo={fillExtrusion:Lf,fillExtrusionPattern:ru,fill:Ec,fillPattern:mc,fillOutline:jl,fillOutlinePattern:gu,circle:er,collisionBox:na,collisionCircle:$r,debug:Pi,clippingMask:tn,heatmap:Ri,heatmapTexture:Fi,hillshade:Mn,hillshadePrepare:Kn,line:wn,lineGradient:un,linePattern:_o,lineSDF:Qo,raster:yl,symbolIcon:Ls,symbolSDF:ou,symbolTextAndIcon:Iu,background:Pc,backgroundPattern:wu},Ic;function lc(ve,Y,ye,te,me,Ge,Le){for(var $e=ve.context,mt=$e.gl,jt=ve.useProgram("collisionBox"),_r=[],Fr=0,hr=0,gt=0;gt0){var lr=e.create(),Xt=fr;e.mul(lr,ir.placementInvProjMatrix,ve.transform.glCoordMatrix),e.mul(lr,lr,ir.placementViewportMatrix),_r.push({circleArray:pr,circleOffset:hr,transform:Xt,invTransform:lr}),Fr+=pr.length/4,hr=Fr}sr&&jt.draw($e,mt.LINES,Ba.disabled,za.disabled,ve.colorModeForRenderPass(),Pr.disabled,La(fr,ve.transform,Ft),ye.id,sr.layoutVertexBuffer,sr.indexBuffer,sr.segments,null,ve.transform.zoom,null,null,sr.collisionVertexBuffer)}}if(!(!Le||!_r.length)){var or=ve.useProgram("collisionCircle"),qt=new e.StructArrayLayout2f1f2i16;qt.resize(Fr*4),qt._trim();for(var Dr=0,Jr=0,ba=_r;Jr=0&&(Et[ir.associatedIconIndex]={shiftedAnchor:si,angle:Ji})}}if(_r){gt.clear();for(var pi=ve.icon.placedSymbolArray,wi=0;wi0){var Le=e.browser.now(),$e=(Le-ve.timeAdded)/Ge,mt=Y?(Le-Y.timeAdded)/Ge:-1,jt=ye.getSource(),_r=me.coveringZoomLevel({tileSize:jt.tileSize,roundZoom:jt.roundZoom}),Fr=!Y||Math.abs(Y.tileID.overscaledZ-_r)>Math.abs(ve.tileID.overscaledZ-_r),hr=Fr&&ve.refreshedUponExpiration?1:e.clamp(Fr?$e:1-mt,0,1);return ve.refreshedUponExpiration&&$e>=1&&(ve.refreshedUponExpiration=!1),Y?{opacity:1,mix:1-hr}:{opacity:hr,mix:0}}else return{opacity:1,mix:0}}function Er(ve,Y,ye){var te=ye.paint.get("background-color"),me=ye.paint.get("background-opacity");if(me!==0){var Ge=ve.context,Le=Ge.gl,$e=ve.transform,mt=$e.tileSize,jt=ye.paint.get("background-pattern");if(!ve.isPatternMissing(jt)){var _r=!jt&&te.a===1&&me===1&&ve.opaquePassEnabledForLayer()?"opaque":"translucent";if(ve.renderPass===_r){var Fr=za.disabled,hr=ve.depthModeForSublayer(0,_r==="opaque"?Ba.ReadWrite:Ba.ReadOnly),gt=ve.colorModeForRenderPass(),Et=ve.useProgram(jt?"backgroundPattern":"background"),Ft=$e.coveringTiles({tileSize:mt});jt&&(Ge.activeTexture.set(Le.TEXTURE0),ve.imageManager.bind(ve.context));for(var ir=ye.getCrossfadeParameters(),fr=0,sr=Ft;fr "+ye.overscaledZ);var fr=ir+" "+gt+"kb";Ao(ve,fr),Le.draw(te,me.TRIANGLES,$e,mt,Nt.alphaBlended,Pr.disabled,Zi(Ge,e.Color.transparent,Ft),_r,ve.debugBuffer,ve.quadTriangleIndexBuffer,ve.debugSegments)}function Ao(ve,Y){ve.initDebugOverlayCanvas();var ye=ve.debugOverlayCanvas,te=ve.context.gl,me=ve.debugOverlayCanvas.getContext("2d");me.clearRect(0,0,ye.width,ye.height),me.shadowColor="white",me.shadowBlur=2,me.lineWidth=1.5,me.strokeStyle="white",me.textBaseline="top",me.font="bold 36px Open Sans, sans-serif",me.fillText(Y,5,5),me.strokeText(Y,5,5),ve.debugOverlayTexture.update(ye),ve.debugOverlayTexture.bind(te.LINEAR,te.CLAMP_TO_EDGE)}function ss(ve,Y,ye){var te=ve.context,me=ye.implementation;if(ve.renderPass==="offscreen"){var Ge=me.prerender;Ge&&(ve.setCustomLayerDefaults(),te.setColorMode(ve.colorModeForRenderPass()),Ge.call(me,te.gl,ve.transform.customLayerMatrix()),te.setDirty(),ve.setBaseState())}else if(ve.renderPass==="translucent"){ve.setCustomLayerDefaults(),te.setColorMode(ve.colorModeForRenderPass()),te.setStencilMode(za.disabled);var Le=me.renderingMode==="3d"?new Ba(ve.context.gl.LEQUAL,Ba.ReadWrite,ve.depthRangeFor3D):ve.depthModeForSublayer(0,Ba.ReadOnly);te.setDepthMode(Le),me.render(te.gl,ve.transform.customLayerMatrix()),te.setDirty(),ve.setBaseState(),te.bindFramebuffer.set(null)}}var So={symbol:R,circle:Bt,heatmap:$t,line:sa,fill:He,"fill-extrusion":ut,hillshade:Ct,raster:ur,background:Er,debug:Wn,custom:ss},Ko=function(Y,ye){this.context=new ta(Y),this.transform=ye,this._tileTextures={},this.setup(),this.numSublayers=ma.maxUnderzooming+ma.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new au,this.gpuTimers={}};Ko.prototype.resize=function(Y,ye){if(this.width=Y*e.browser.devicePixelRatio,this.height=ye*e.browser.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(var te=0,me=this.style._order;te256&&this.clearStencil(),te.setColorMode(Nt.disabled),te.setDepthMode(Ba.disabled);var Ge=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var Le=0,$e=ye;Le<$e.length;Le+=1){var mt=$e[Le],jt=this._tileClippingMaskIDs[mt.key]=this.nextStencilID++;Ge.draw(te,me.TRIANGLES,Ba.disabled,new za({func:me.ALWAYS,mask:0},jt,255,me.KEEP,me.KEEP,me.REPLACE),Nt.disabled,Pr.disabled,dn(mt.posMatrix),"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}},Ko.prototype.stencilModeFor3D=function(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();var Y=this.nextStencilID++,ye=this.context.gl;return new za({func:ye.NOTEQUAL,mask:255},Y,255,ye.KEEP,ye.KEEP,ye.REPLACE)},Ko.prototype.stencilModeForClipping=function(Y){var ye=this.context.gl;return new za({func:ye.EQUAL,mask:255},this._tileClippingMaskIDs[Y.key],0,ye.KEEP,ye.KEEP,ye.REPLACE)},Ko.prototype.stencilConfigForOverlap=function(Y){var ye,te=this.context.gl,me=Y.sort(function(jt,_r){return _r.overscaledZ-jt.overscaledZ}),Ge=me[me.length-1].overscaledZ,Le=me[0].overscaledZ-Ge+1;if(Le>1){this.currentStencilSource=void 0,this.nextStencilID+Le>256&&this.clearStencil();for(var $e={},mt=0;mt=0;this.currentLayer--){var lr=this.style._layers[me[this.currentLayer]],Xt=Ge[lr.source],or=mt[lr.source];this._renderTileClippingMasks(lr,or),this.renderLayer(this,Xt,lr,or)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer0?ye.pop():null},Ko.prototype.isPatternMissing=function(Y){if(!Y)return!1;if(!Y.from||!Y.to)return!0;var ye=this.imageManager.getPattern(Y.from.toString()),te=this.imageManager.getPattern(Y.to.toString());return!ye||!te},Ko.prototype.useProgram=function(Y,ye){this.cache=this.cache||{};var te=""+Y+(ye?ye.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[te]||(this.cache[te]=new mf(this.context,Y,sf[Y],ye,zo[Y],this._showOverdrawInspector)),this.cache[te]},Ko.prototype.setCustomLayerDefaults=function(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()},Ko.prototype.setBaseState=function(){var Y=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(Y.FUNC_ADD)},Ko.prototype.initDebugOverlayCanvas=function(){if(this.debugOverlayCanvas==null){this.debugOverlayCanvas=e.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512;var Y=this.context.gl;this.debugOverlayTexture=new e.Texture(this.context,this.debugOverlayCanvas,Y.RGBA)}},Ko.prototype.destroy=function(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()};var hs=function(Y,ye){this.points=Y,this.planes=ye};hs.fromInvProjectionMatrix=function(Y,ye,te){var me=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]],Ge=Math.pow(2,te),Le=me.map(function(jt){return e.transformMat4([],jt,Y)}).map(function(jt){return e.scale$1([],jt,1/jt[3]/ye*Ge)}),$e=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]],mt=$e.map(function(jt){var _r=e.sub([],Le[jt[0]],Le[jt[1]]),Fr=e.sub([],Le[jt[2]],Le[jt[1]]),hr=e.normalize([],e.cross([],_r,Fr)),gt=-e.dot(hr,Le[jt[1]]);return hr.concat(gt)});return new hs(Le,mt)};var ll=function(Y,ye){this.min=Y,this.max=ye,this.center=e.scale$2([],e.add([],this.min,this.max),.5)};ll.prototype.quadrant=function(Y){for(var ye=[Y%2===0,Y<2],te=e.clone$2(this.min),me=e.clone$2(this.max),Ge=0;Ge=0;if(Le===0)return 0;Le!==ye.length&&(te=!1)}if(te)return 2;for(var mt=0;mt<3;mt++){for(var jt=Number.MAX_VALUE,_r=-Number.MAX_VALUE,Fr=0;Frthis.max[mt]-this.min[mt])return 0}return 1};var Js=function(Y,ye,te,me){if(Y===void 0&&(Y=0),ye===void 0&&(ye=0),te===void 0&&(te=0),me===void 0&&(me=0),isNaN(Y)||Y<0||isNaN(ye)||ye<0||isNaN(te)||te<0||isNaN(me)||me<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=Y,this.bottom=ye,this.left=te,this.right=me};Js.prototype.interpolate=function(Y,ye,te){return ye.top!=null&&Y.top!=null&&(this.top=e.number(Y.top,ye.top,te)),ye.bottom!=null&&Y.bottom!=null&&(this.bottom=e.number(Y.bottom,ye.bottom,te)),ye.left!=null&&Y.left!=null&&(this.left=e.number(Y.left,ye.left,te)),ye.right!=null&&Y.right!=null&&(this.right=e.number(Y.right,ye.right,te)),this},Js.prototype.getCenter=function(Y,ye){var te=e.clamp((this.left+Y-this.right)/2,0,Y),me=e.clamp((this.top+ye-this.bottom)/2,0,ye);return new e.Point(te,me)},Js.prototype.equals=function(Y){return this.top===Y.top&&this.bottom===Y.bottom&&this.left===Y.left&&this.right===Y.right},Js.prototype.clone=function(){return new Js(this.top,this.bottom,this.left,this.right)},Js.prototype.toJSON=function(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}};var es=function(Y,ye,te,me,Ge){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=Ge===void 0?!0:Ge,this._minZoom=Y||0,this._maxZoom=ye||22,this._minPitch=te??0,this._maxPitch=me??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new e.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new Js,this._posMatrixCache={},this._alignedPosMatrixCache={}},ts={minZoom:{configurable:!0},maxZoom:{configurable:!0},minPitch:{configurable:!0},maxPitch:{configurable:!0},renderWorldCopies:{configurable:!0},worldSize:{configurable:!0},centerOffset:{configurable:!0},size:{configurable:!0},bearing:{configurable:!0},pitch:{configurable:!0},fov:{configurable:!0},zoom:{configurable:!0},center:{configurable:!0},padding:{configurable:!0},centerPoint:{configurable:!0},unmodified:{configurable:!0},point:{configurable:!0}};es.prototype.clone=function(){var Y=new es(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return Y.tileSize=this.tileSize,Y.latRange=this.latRange,Y.width=this.width,Y.height=this.height,Y._center=this._center,Y.zoom=this.zoom,Y.angle=this.angle,Y._fov=this._fov,Y._pitch=this._pitch,Y._unmodified=this._unmodified,Y._edgeInsets=this._edgeInsets.clone(),Y._calcMatrices(),Y},ts.minZoom.get=function(){return this._minZoom},ts.minZoom.set=function(ve){this._minZoom!==ve&&(this._minZoom=ve,this.zoom=Math.max(this.zoom,ve))},ts.maxZoom.get=function(){return this._maxZoom},ts.maxZoom.set=function(ve){this._maxZoom!==ve&&(this._maxZoom=ve,this.zoom=Math.min(this.zoom,ve))},ts.minPitch.get=function(){return this._minPitch},ts.minPitch.set=function(ve){this._minPitch!==ve&&(this._minPitch=ve,this.pitch=Math.max(this.pitch,ve))},ts.maxPitch.get=function(){return this._maxPitch},ts.maxPitch.set=function(ve){this._maxPitch!==ve&&(this._maxPitch=ve,this.pitch=Math.min(this.pitch,ve))},ts.renderWorldCopies.get=function(){return this._renderWorldCopies},ts.renderWorldCopies.set=function(ve){ve===void 0?ve=!0:ve===null&&(ve=!1),this._renderWorldCopies=ve},ts.worldSize.get=function(){return this.tileSize*this.scale},ts.centerOffset.get=function(){return this.centerPoint._sub(this.size._div(2))},ts.size.get=function(){return new e.Point(this.width,this.height)},ts.bearing.get=function(){return-this.angle/Math.PI*180},ts.bearing.set=function(ve){var Y=-e.wrap(ve,-180,180)*Math.PI/180;this.angle!==Y&&(this._unmodified=!1,this.angle=Y,this._calcMatrices(),this.rotationMatrix=e.create$2(),e.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},ts.pitch.get=function(){return this._pitch/Math.PI*180},ts.pitch.set=function(ve){var Y=e.clamp(ve,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==Y&&(this._unmodified=!1,this._pitch=Y,this._calcMatrices())},ts.fov.get=function(){return this._fov/Math.PI*180},ts.fov.set=function(ve){ve=Math.max(.01,Math.min(60,ve)),this._fov!==ve&&(this._unmodified=!1,this._fov=ve/180*Math.PI,this._calcMatrices())},ts.zoom.get=function(){return this._zoom},ts.zoom.set=function(ve){var Y=Math.min(Math.max(ve,this.minZoom),this.maxZoom);this._zoom!==Y&&(this._unmodified=!1,this._zoom=Y,this.scale=this.zoomScale(Y),this.tileZoom=Math.floor(Y),this.zoomFraction=Y-this.tileZoom,this._constrain(),this._calcMatrices())},ts.center.get=function(){return this._center},ts.center.set=function(ve){ve.lat===this._center.lat&&ve.lng===this._center.lng||(this._unmodified=!1,this._center=ve,this._constrain(),this._calcMatrices())},ts.padding.get=function(){return this._edgeInsets.toJSON()},ts.padding.set=function(ve){this._edgeInsets.equals(ve)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,ve,1),this._calcMatrices())},ts.centerPoint.get=function(){return this._edgeInsets.getCenter(this.width,this.height)},es.prototype.isPaddingEqual=function(Y){return this._edgeInsets.equals(Y)},es.prototype.interpolatePadding=function(Y,ye,te){this._unmodified=!1,this._edgeInsets.interpolate(Y,ye,te),this._constrain(),this._calcMatrices()},es.prototype.coveringZoomLevel=function(Y){var ye=(Y.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/Y.tileSize));return Math.max(0,ye)},es.prototype.getVisibleUnwrappedCoordinates=function(Y){var ye=[new e.UnwrappedTileID(0,Y)];if(this._renderWorldCopies)for(var te=this.pointCoordinate(new e.Point(0,0)),me=this.pointCoordinate(new e.Point(this.width,0)),Ge=this.pointCoordinate(new e.Point(this.width,this.height)),Le=this.pointCoordinate(new e.Point(0,this.height)),$e=Math.floor(Math.min(te.x,me.x,Ge.x,Le.x)),mt=Math.floor(Math.max(te.x,me.x,Ge.x,Le.x)),jt=1,_r=$e-jt;_r<=mt+jt;_r++)_r!==0&&ye.push(new e.UnwrappedTileID(_r,Y));return ye},es.prototype.coveringTiles=function(Y){var ye=this.coveringZoomLevel(Y),te=ye;if(Y.minzoom!==void 0&&yeY.maxzoom&&(ye=Y.maxzoom);var me=e.MercatorCoordinate.fromLngLat(this.center),Ge=Math.pow(2,ye),Le=[Ge*me.x,Ge*me.y,0],$e=hs.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,ye),mt=Y.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&(mt=ye);var jt=3,_r=function(Xa){return{aabb:new ll([Xa*Ge,0,0],[(Xa+1)*Ge,Ge,0]),zoom:0,x:0,y:0,wrap:Xa,fullyVisible:!1}},Fr=[],hr=[],gt=ye,Et=Y.reparseOverscaled?te:ye;if(this._renderWorldCopies)for(var Ft=1;Ft<=3;Ft++)Fr.push(_r(-Ft)),Fr.push(_r(Ft));for(Fr.push(_r(0));Fr.length>0;){var ir=Fr.pop(),fr=ir.x,sr=ir.y,pr=ir.fullyVisible;if(!pr){var lr=ir.aabb.intersects($e);if(lr===0)continue;pr=lr===2}var Xt=ir.aabb.distanceX(Le),or=ir.aabb.distanceY(Le),qt=Math.max(Math.abs(Xt),Math.abs(or)),Dr=jt+(1<Dr&&ir.zoom>=mt){hr.push({tileID:new e.OverscaledTileID(ir.zoom===gt?Et:ir.zoom,ir.wrap,ir.zoom,fr,sr),distanceSq:e.sqrLen([Le[0]-.5-fr,Le[1]-.5-sr])});continue}for(var Jr=0;Jr<4;Jr++){var ba=(fr<<1)+Jr%2,yi=(sr<<1)+(Jr>>1);Fr.push({aabb:ir.aabb.quadrant(Jr),zoom:ir.zoom+1,x:ba,y:yi,wrap:ir.wrap,fullyVisible:pr})}}return hr.sort(function(Xa,si){return Xa.distanceSq-si.distanceSq}).map(function(Xa){return Xa.tileID})},es.prototype.resize=function(Y,ye){this.width=Y,this.height=ye,this.pixelsToGLUnits=[2/Y,-2/ye],this._constrain(),this._calcMatrices()},ts.unmodified.get=function(){return this._unmodified},es.prototype.zoomScale=function(Y){return Math.pow(2,Y)},es.prototype.scaleZoom=function(Y){return Math.log(Y)/Math.LN2},es.prototype.project=function(Y){var ye=e.clamp(Y.lat,-this.maxValidLatitude,this.maxValidLatitude);return new e.Point(e.mercatorXfromLng(Y.lng)*this.worldSize,e.mercatorYfromLat(ye)*this.worldSize)},es.prototype.unproject=function(Y){return new e.MercatorCoordinate(Y.x/this.worldSize,Y.y/this.worldSize).toLngLat()},ts.point.get=function(){return this.project(this.center)},es.prototype.setLocationAtPoint=function(Y,ye){var te=this.pointCoordinate(ye),me=this.pointCoordinate(this.centerPoint),Ge=this.locationCoordinate(Y),Le=new e.MercatorCoordinate(Ge.x-(te.x-me.x),Ge.y-(te.y-me.y));this.center=this.coordinateLocation(Le),this._renderWorldCopies&&(this.center=this.center.wrap())},es.prototype.locationPoint=function(Y){return this.coordinatePoint(this.locationCoordinate(Y))},es.prototype.pointLocation=function(Y){return this.coordinateLocation(this.pointCoordinate(Y))},es.prototype.locationCoordinate=function(Y){return e.MercatorCoordinate.fromLngLat(Y)},es.prototype.coordinateLocation=function(Y){return Y.toLngLat()},es.prototype.pointCoordinate=function(Y){var ye=0,te=[Y.x,Y.y,0,1],me=[Y.x,Y.y,1,1];e.transformMat4(te,te,this.pixelMatrixInverse),e.transformMat4(me,me,this.pixelMatrixInverse);var Ge=te[3],Le=me[3],$e=te[0]/Ge,mt=me[0]/Le,jt=te[1]/Ge,_r=me[1]/Le,Fr=te[2]/Ge,hr=me[2]/Le,gt=Fr===hr?0:(ye-Fr)/(hr-Fr);return new e.MercatorCoordinate(e.number($e,mt,gt)/this.worldSize,e.number(jt,_r,gt)/this.worldSize)},es.prototype.coordinatePoint=function(Y){var ye=[Y.x*this.worldSize,Y.y*this.worldSize,0,1];return e.transformMat4(ye,ye,this.pixelMatrix),new e.Point(ye[0]/ye[3],ye[1]/ye[3])},es.prototype.getBounds=function(){return new e.LngLatBounds().extend(this.pointLocation(new e.Point(0,0))).extend(this.pointLocation(new e.Point(this.width,0))).extend(this.pointLocation(new e.Point(this.width,this.height))).extend(this.pointLocation(new e.Point(0,this.height)))},es.prototype.getMaxBounds=function(){return!this.latRange||this.latRange.length!==2||!this.lngRange||this.lngRange.length!==2?null:new e.LngLatBounds([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]])},es.prototype.setMaxBounds=function(Y){Y?(this.lngRange=[Y.getWest(),Y.getEast()],this.latRange=[Y.getSouth(),Y.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])},es.prototype.calculatePosMatrix=function(Y,ye){ye===void 0&&(ye=!1);var te=Y.key,me=ye?this._alignedPosMatrixCache:this._posMatrixCache;if(me[te])return me[te];var Ge=Y.canonical,Le=this.worldSize/this.zoomScale(Ge.z),$e=Ge.x+Math.pow(2,Ge.z)*Y.wrap,mt=e.identity(new Float64Array(16));return e.translate(mt,mt,[$e*Le,Ge.y*Le,0]),e.scale(mt,mt,[Le/e.EXTENT,Le/e.EXTENT,1]),e.multiply(mt,ye?this.alignedProjMatrix:this.projMatrix,mt),me[te]=new Float32Array(mt),me[te]},es.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},es.prototype._constrain=function(){if(!(!this.center||!this.width||!this.height||this._constraining)){this._constraining=!0;var Y=-90,ye=90,te=-180,me=180,Ge,Le,$e,mt,jt=this.size,_r=this._unmodified;if(this.latRange){var Fr=this.latRange;Y=e.mercatorYfromLat(Fr[1])*this.worldSize,ye=e.mercatorYfromLat(Fr[0])*this.worldSize,Ge=ye-Yye&&(mt=ye-ir)}if(this.lngRange){var fr=gt.x,sr=jt.x/2;fr-srme&&($e=me-sr)}($e!==void 0||mt!==void 0)&&(this.center=this.unproject(new e.Point($e!==void 0?$e:gt.x,mt!==void 0?mt:gt.y))),this._unmodified=_r,this._constraining=!1}},es.prototype._calcMatrices=function(){if(this.height){var Y=this._fov/2,ye=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(Y)*this.height;var te=Math.PI/2+this._pitch,me=this._fov*(.5+ye.y/this.height),Ge=Math.sin(me)*this.cameraToCenterDistance/Math.sin(e.clamp(Math.PI-te-me,.01,Math.PI-.01)),Le=this.point,$e=Le.x,mt=Le.y,jt=Math.cos(Math.PI/2-this._pitch)*Ge+this.cameraToCenterDistance,_r=jt*1.01,Fr=this.height/50,hr=new Float64Array(16);e.perspective(hr,this._fov,this.width/this.height,Fr,_r),hr[8]=-ye.x*2/this.width,hr[9]=ye.y*2/this.height,e.scale(hr,hr,[1,-1,1]),e.translate(hr,hr,[0,0,-this.cameraToCenterDistance]),e.rotateX(hr,hr,this._pitch),e.rotateZ(hr,hr,this.angle),e.translate(hr,hr,[-$e,-mt,0]),this.mercatorMatrix=e.scale([],hr,[this.worldSize,this.worldSize,this.worldSize]),e.scale(hr,hr,[1,1,e.mercatorZfromAltitude(1,this.center.lat)*this.worldSize,1]),this.projMatrix=hr,this.invProjMatrix=e.invert([],this.projMatrix);var gt=this.width%2/2,Et=this.height%2/2,Ft=Math.cos(this.angle),ir=Math.sin(this.angle),fr=$e-Math.round($e)+Ft*gt+ir*Et,sr=mt-Math.round(mt)+Ft*Et+ir*gt,pr=new Float64Array(hr);if(e.translate(pr,pr,[fr>.5?fr-1:fr,sr>.5?sr-1:sr,0]),this.alignedProjMatrix=pr,hr=e.create(),e.scale(hr,hr,[this.width/2,-this.height/2,1]),e.translate(hr,hr,[1,-1,0]),this.labelPlaneMatrix=hr,hr=e.create(),e.scale(hr,hr,[1,-1,1]),e.translate(hr,hr,[-1,-1,0]),e.scale(hr,hr,[2/this.width,2/this.height,1]),this.glCoordMatrix=hr,this.pixelMatrix=e.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),hr=e.invert(new Float64Array(16),this.pixelMatrix),!hr)throw new Error("failed to invert matrix");this.pixelMatrixInverse=hr,this._posMatrixCache={},this._alignedPosMatrixCache={}}},es.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var Y=this.pointCoordinate(new e.Point(0,0)),ye=[Y.x*this.worldSize,Y.y*this.worldSize,0,1],te=e.transformMat4(ye,ye,this.pixelMatrix);return te[3]/this.cameraToCenterDistance},es.prototype.getCameraPoint=function(){var Y=this._pitch,ye=Math.tan(Y)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new e.Point(0,ye))},es.prototype.getCameraQueryGeometry=function(Y){var ye=this.getCameraPoint();if(Y.length===1)return[Y[0],ye];for(var te=ye.x,me=ye.y,Ge=ye.x,Le=ye.y,$e=0,mt=Y;$e=3&&!Y.some(function(te){return isNaN(te)})){var ye=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(Y[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+Y[2],+Y[1]],zoom:+Y[0],bearing:ye,pitch:+(Y[4]||0)}),!0}return!1},$l.prototype._updateHashUnthrottled=function(){var Y=e.window.location.href.replace(/(#.+)?$/,this.getHashString());try{e.window.history.replaceState(e.window.history.state,null,Y)}catch{}};var Ru={linearity:.3,easing:e.bezier(0,0,.3,1)},hu=e.extend({deceleration:2500,maxSpeed:1400},Ru),wl=e.extend({deceleration:20,maxSpeed:1400},Ru),su=e.extend({deceleration:1e3,maxSpeed:360},Ru),uc=e.extend({deceleration:1e3,maxSpeed:90},Ru),ql=function(Y){this._map=Y,this.clear()};ql.prototype.clear=function(){this._inertiaBuffer=[]},ql.prototype.record=function(Y){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:e.browser.now(),settings:Y})},ql.prototype._drainInertiaBuffer=function(){for(var Y=this._inertiaBuffer,ye=e.browser.now(),te=160;Y.length>0&&ye-Y[0].time>te;)Y.shift()},ql.prototype._onMoveEnd=function(Y){if(this._drainInertiaBuffer(),!(this._inertiaBuffer.length<2)){for(var ye={zoom:0,bearing:0,pitch:0,pan:new e.Point(0,0),pinchAround:void 0,around:void 0},te=0,me=this._inertiaBuffer;te=this._clickTolerance||this._map.fire(new De(Y.type,this._map,Y))},_t.prototype.dblclick=function(Y){return this._firePreventable(new De(Y.type,this._map,Y))},_t.prototype.mouseover=function(Y){this._map.fire(new De(Y.type,this._map,Y))},_t.prototype.mouseout=function(Y){this._map.fire(new De(Y.type,this._map,Y))},_t.prototype.touchstart=function(Y){return this._firePreventable(new et(Y.type,this._map,Y))},_t.prototype.touchmove=function(Y){this._map.fire(new et(Y.type,this._map,Y))},_t.prototype.touchend=function(Y){this._map.fire(new et(Y.type,this._map,Y))},_t.prototype.touchcancel=function(Y){this._map.fire(new et(Y.type,this._map,Y))},_t.prototype._firePreventable=function(Y){if(this._map.fire(Y),Y.defaultPrevented)return{}},_t.prototype.isEnabled=function(){return!0},_t.prototype.isActive=function(){return!1},_t.prototype.enable=function(){},_t.prototype.disable=function(){};var St=function(Y){this._map=Y};St.prototype.reset=function(){this._delayContextMenu=!1,delete this._contextMenuEvent},St.prototype.mousemove=function(Y){this._map.fire(new De(Y.type,this._map,Y))},St.prototype.mousedown=function(){this._delayContextMenu=!0},St.prototype.mouseup=function(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new De("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)},St.prototype.contextmenu=function(Y){this._delayContextMenu?this._contextMenuEvent=Y:this._map.fire(new De(Y.type,this._map,Y)),this._map.listens("contextmenu")&&Y.preventDefault()},St.prototype.isEnabled=function(){return!0},St.prototype.isActive=function(){return!1},St.prototype.enable=function(){},St.prototype.disable=function(){};var ar=function(Y,ye){this._map=Y,this._el=Y.getCanvasContainer(),this._container=Y.getContainer(),this._clickTolerance=ye.clickTolerance||1};ar.prototype.isEnabled=function(){return!!this._enabled},ar.prototype.isActive=function(){return!!this._active},ar.prototype.enable=function(){this.isEnabled()||(this._enabled=!0)},ar.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},ar.prototype.mousedown=function(Y,ye){this.isEnabled()&&Y.shiftKey&&Y.button===0&&(r.disableDrag(),this._startPos=this._lastPos=ye,this._active=!0)},ar.prototype.mousemoveWindow=function(Y,ye){if(this._active){var te=ye;if(!(this._lastPos.equals(te)||!this._box&&te.dist(this._startPos)this.numTouches)&&(this.aborted=!0),!this.aborted&&(this.startTime===void 0&&(this.startTime=Y.timeStamp),te.length===this.numTouches&&(this.centroid=gr(ye),this.touches=zt(te,ye)))},ya.prototype.touchmove=function(Y,ye,te){if(!(this.aborted||!this.centroid)){var me=zt(te,ye);for(var Ge in this.touches){var Le=this.touches[Ge],$e=me[Ge];(!$e||$e.dist(Le)>Ta)&&(this.aborted=!0)}}},ya.prototype.touchend=function(Y,ye,te){if((!this.centroid||Y.timeStamp-this.startTime>Wr)&&(this.aborted=!0),te.length===0){var me=!this.aborted&&this.centroid;if(this.reset(),me)return me}};var ri=function(Y){this.singleTap=new ya(Y),this.numTaps=Y.numTaps,this.reset()};ri.prototype.reset=function(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()},ri.prototype.touchstart=function(Y,ye,te){this.singleTap.touchstart(Y,ye,te)},ri.prototype.touchmove=function(Y,ye,te){this.singleTap.touchmove(Y,ye,te)},ri.prototype.touchend=function(Y,ye,te){var me=this.singleTap.touchend(Y,ye,te);if(me){var Ge=Y.timeStamp-this.lastTime0&&(this._active=!0);var me=zt(te,ye),Ge=new e.Point(0,0),Le=new e.Point(0,0),$e=0;for(var mt in me){var jt=me[mt],_r=this._touches[mt];_r&&(Ge._add(jt),Le._add(jt.sub(_r)),$e++,me[mt]=jt)}if(this._touches=me,!($eMath.abs(ve.x)}var gn=100,vo=function(ve){function Y(){ve.apply(this,arguments)}return ve&&(Y.__proto__=ve),Y.prototype=Object.create(ve&&ve.prototype),Y.prototype.constructor=Y,Y.prototype.reset=function(){ve.prototype.reset.call(this),this._valid=void 0,delete this._firstMove,delete this._lastPoints},Y.prototype._start=function(te){this._lastPoints=te,_l(te[0].sub(te[1]))&&(this._valid=!1)},Y.prototype._move=function(te,me,Ge){var Le=te[0].sub(this._lastPoints[0]),$e=te[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(Le,$e,Ge.timeStamp),!!this._valid){this._lastPoints=te,this._active=!0;var mt=(Le.y+$e.y)/2,jt=-.5;return{pitchDelta:mt*jt}}},Y.prototype.gestureBeginsVertically=function(te,me,Ge){if(this._valid!==void 0)return this._valid;var Le=2,$e=te.mag()>=Le,mt=me.mag()>=Le;if(!(!$e&&!mt)){if(!$e||!mt)return this._firstMove===void 0&&(this._firstMove=Ge),Ge-this._firstMove0==me.y>0;return _l(te)&&_l(me)&&jt}},Y}(Pn),cs={panStep:100,bearingStep:15,pitchStep:10},ps=function(){var Y=cs;this._panStep=Y.panStep,this._bearingStep=Y.bearingStep,this._pitchStep=Y.pitchStep,this._rotationDisabled=!1};ps.prototype.reset=function(){this._active=!1},ps.prototype.keydown=function(Y){var ye=this;if(!(Y.altKey||Y.ctrlKey||Y.metaKey)){var te=0,me=0,Ge=0,Le=0,$e=0;switch(Y.keyCode){case 61:case 107:case 171:case 187:te=1;break;case 189:case 109:case 173:te=-1;break;case 37:Y.shiftKey?me=-1:(Y.preventDefault(),Le=-1);break;case 39:Y.shiftKey?me=1:(Y.preventDefault(),Le=1);break;case 38:Y.shiftKey?Ge=1:(Y.preventDefault(),$e=-1);break;case 40:Y.shiftKey?Ge=-1:(Y.preventDefault(),$e=1);break;default:return}return this._rotationDisabled&&(me=0,Ge=0),{cameraAnimation:function(mt){var jt=mt.getZoom();mt.easeTo({duration:300,easeId:"keyboardHandler",easing:Tl,zoom:te?Math.round(jt)+te*(Y.shiftKey?2:1):jt,bearing:mt.getBearing()+me*ye._bearingStep,pitch:mt.getPitch()+Ge*ye._pitchStep,offset:[-Le*ye._panStep,-$e*ye._panStep],center:mt.getCenter()},{originalEvent:Y})}}}},ps.prototype.enable=function(){this._enabled=!0},ps.prototype.disable=function(){this._enabled=!1,this.reset()},ps.prototype.isEnabled=function(){return this._enabled},ps.prototype.isActive=function(){return this._active},ps.prototype.disableRotation=function(){this._rotationDisabled=!0},ps.prototype.enableRotation=function(){this._rotationDisabled=!1};function Tl(ve){return ve*(2-ve)}var Gl=4.000244140625,Tu=1/100,Il=1/450,yc=2,nt=function(Y,ye){this._map=Y,this._el=Y.getCanvasContainer(),this._handler=ye,this._delta=0,this._defaultZoomRate=Tu,this._wheelZoomRate=Il,e.bindAll(["_onTimeout"],this)};nt.prototype.setZoomRate=function(Y){this._defaultZoomRate=Y},nt.prototype.setWheelZoomRate=function(Y){this._wheelZoomRate=Y},nt.prototype.isEnabled=function(){return!!this._enabled},nt.prototype.isActive=function(){return!!this._active||this._finishTimeout!==void 0},nt.prototype.isZooming=function(){return!!this._zooming},nt.prototype.enable=function(Y){this.isEnabled()||(this._enabled=!0,this._aroundCenter=Y&&Y.around==="center")},nt.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},nt.prototype.wheel=function(Y){if(this.isEnabled()){var ye=Y.deltaMode===e.window.WheelEvent.DOM_DELTA_LINE?Y.deltaY*40:Y.deltaY,te=e.browser.now(),me=te-(this._lastWheelEventTime||0);this._lastWheelEventTime=te,ye!==0&&ye%Gl===0?this._type="wheel":ye!==0&&Math.abs(ye)<4?this._type="trackpad":me>400?(this._type=null,this._lastValue=ye,this._timeout=setTimeout(this._onTimeout,40,Y)):this._type||(this._type=Math.abs(me*ye)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,ye+=this._lastValue)),Y.shiftKey&&ye&&(ye=ye/4),this._type&&(this._lastWheelEvent=Y,this._delta-=ye,this._active||this._start(Y)),Y.preventDefault()}},nt.prototype._onTimeout=function(Y){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(Y)},nt.prototype._start=function(Y){if(this._delta){this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);var ye=r.mousePos(this._el,Y);this._around=e.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(ye)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}},nt.prototype.renderFrame=function(){var Y=this;if(this._frameId&&(this._frameId=null,!!this.isActive())){var ye=this._map.transform;if(this._delta!==0){var te=this._type==="wheel"&&Math.abs(this._delta)>Gl?this._wheelZoomRate:this._defaultZoomRate,me=yc/(1+Math.exp(-Math.abs(this._delta*te)));this._delta<0&&me!==0&&(me=1/me);var Ge=typeof this._targetZoom=="number"?ye.zoomScale(this._targetZoom):ye.scale;this._targetZoom=Math.min(ye.maxZoom,Math.max(ye.minZoom,ye.scaleZoom(Ge*me))),this._type==="wheel"&&(this._startZoom=ye.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var Le=typeof this._targetZoom=="number"?this._targetZoom:ye.zoom,$e=this._startZoom,mt=this._easing,jt=!1,_r;if(this._type==="wheel"&&$e&&mt){var Fr=Math.min((e.browser.now()-this._lastWheelEventTime)/200,1),hr=mt(Fr);_r=e.number($e,Le,hr),Fr<1?this._frameId||(this._frameId=!0):jt=!0}else _r=Le,jt=!0;return this._active=!0,jt&&(this._active=!1,this._finishTimeout=setTimeout(function(){Y._zooming=!1,Y._handler._triggerRenderFrame(),delete Y._targetZoom,delete Y._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!jt,zoomDelta:_r-ye.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}},nt.prototype._smoothOutEasing=function(Y){var ye=e.ease;if(this._prevEase){var te=this._prevEase,me=(e.browser.now()-te.start)/te.duration,Ge=te.easing(me+.01)-te.easing(me),Le=.27/Math.sqrt(Ge*Ge+1e-4)*.01,$e=Math.sqrt(.27*.27-Le*Le);ye=e.bezier(Le,$e,.25,1)}return this._prevEase={start:e.browser.now(),duration:Y,easing:ye},ye},nt.prototype.reset=function(){this._active=!1};var Yt=function(Y,ye){this._clickZoom=Y,this._tapZoom=ye};Yt.prototype.enable=function(){this._clickZoom.enable(),this._tapZoom.enable()},Yt.prototype.disable=function(){this._clickZoom.disable(),this._tapZoom.disable()},Yt.prototype.isEnabled=function(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()},Yt.prototype.isActive=function(){return this._clickZoom.isActive()||this._tapZoom.isActive()};var cr=function(){this.reset()};cr.prototype.reset=function(){this._active=!1},cr.prototype.dblclick=function(Y,ye){return Y.preventDefault(),{cameraAnimation:function(te){te.easeTo({duration:300,zoom:te.getZoom()+(Y.shiftKey?-1:1),around:te.unproject(ye)},{originalEvent:Y})}}},cr.prototype.enable=function(){this._enabled=!0},cr.prototype.disable=function(){this._enabled=!1,this.reset()},cr.prototype.isEnabled=function(){return this._enabled},cr.prototype.isActive=function(){return this._active};var ua=function(){this._tap=new ri({numTouches:1,numTaps:1}),this.reset()};ua.prototype.reset=function(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()},ua.prototype.touchstart=function(Y,ye,te){this._swipePoint||(this._tapTime&&Y.timeStamp-this._tapTime>Vr&&this.reset(),this._tapTime?te.length>0&&(this._swipePoint=ye[0],this._swipeTouch=te[0].identifier):this._tap.touchstart(Y,ye,te))},ua.prototype.touchmove=function(Y,ye,te){if(!this._tapTime)this._tap.touchmove(Y,ye,te);else if(this._swipePoint){if(te[0].identifier!==this._swipeTouch)return;var me=ye[0],Ge=me.y-this._swipePoint.y;return this._swipePoint=me,Y.preventDefault(),this._active=!0,{zoomDelta:Ge/128}}},ua.prototype.touchend=function(Y,ye,te){if(this._tapTime)this._swipePoint&&te.length===0&&this.reset();else{var me=this._tap.touchend(Y,ye,te);me&&(this._tapTime=Y.timeStamp)}},ua.prototype.touchcancel=function(){this.reset()},ua.prototype.enable=function(){this._enabled=!0},ua.prototype.disable=function(){this._enabled=!1,this.reset()},ua.prototype.isEnabled=function(){return this._enabled},ua.prototype.isActive=function(){return this._active};var Aa=function(Y,ye,te){this._el=Y,this._mousePan=ye,this._touchPan=te};Aa.prototype.enable=function(Y){this._inertiaOptions=Y||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")},Aa.prototype.disable=function(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")},Aa.prototype.isEnabled=function(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()},Aa.prototype.isActive=function(){return this._mousePan.isActive()||this._touchPan.isActive()};var xa=function(Y,ye,te){this._pitchWithRotate=Y.pitchWithRotate,this._mouseRotate=ye,this._mousePitch=te};xa.prototype.enable=function(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()},xa.prototype.disable=function(){this._mouseRotate.disable(),this._mousePitch.disable()},xa.prototype.isEnabled=function(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())},xa.prototype.isActive=function(){return this._mouseRotate.isActive()||this._mousePitch.isActive()};var wa=function(Y,ye,te,me){this._el=Y,this._touchZoom=ye,this._touchRotate=te,this._tapDragZoom=me,this._rotationDisabled=!1,this._enabled=!0};wa.prototype.enable=function(Y){this._touchZoom.enable(Y),this._rotationDisabled||this._touchRotate.enable(Y),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")},wa.prototype.disable=function(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")},wa.prototype.isEnabled=function(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()},wa.prototype.isActive=function(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()},wa.prototype.disableRotation=function(){this._rotationDisabled=!0,this._touchRotate.disable()},wa.prototype.enableRotation=function(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()};var Ja=function(ve){return ve.zoom||ve.drag||ve.pitch||ve.rotate},Ai=function(ve){function Y(){ve.apply(this,arguments)}return ve&&(Y.__proto__=ve),Y.prototype=Object.create(ve&&ve.prototype),Y.prototype.constructor=Y,Y}(e.Event);function bi(ve){return ve.panDelta&&ve.panDelta.mag()||ve.zoomDelta||ve.bearingDelta||ve.pitchDelta}var fi=function(Y,ye){this._map=Y,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new ql(Y),this._bearingSnap=ye.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(ye),e.bindAll(["handleEvent","handleWindowEvent"],this);var te=this._el;this._listeners=[[te,"touchstart",{passive:!0}],[te,"touchmove",{passive:!1}],[te,"touchend",void 0],[te,"touchcancel",void 0],[te,"mousedown",void 0],[te,"mousemove",void 0],[te,"mouseup",void 0],[e.window.document,"mousemove",{capture:!0}],[e.window.document,"mouseup",void 0],[te,"mouseover",void 0],[te,"mouseout",void 0],[te,"dblclick",void 0],[te,"click",void 0],[te,"keydown",{capture:!1}],[te,"keyup",void 0],[te,"wheel",{passive:!1}],[te,"contextmenu",void 0],[e.window,"blur",void 0]];for(var me=0,Ge=this._listeners;me$e?Math.min(2,Xt):Math.max(.5,Xt),Xa=Math.pow(yi,1-Jr),si=Le.unproject(pr.add(lr.mult(Jr*Xa)).mult(ba));Le.setLocationAtPoint(Le.renderWorldCopies?si.wrap():si,ir)}Ge._fireMoveEvents(me)},function(Jr){Ge._afterEase(me,Jr)},te),this},Y.prototype._prepareEase=function(te,me,Ge){Ge===void 0&&(Ge={}),this._moving=!0,!me&&!Ge.moving&&this.fire(new e.Event("movestart",te)),this._zooming&&!Ge.zooming&&this.fire(new e.Event("zoomstart",te)),this._rotating&&!Ge.rotating&&this.fire(new e.Event("rotatestart",te)),this._pitching&&!Ge.pitching&&this.fire(new e.Event("pitchstart",te))},Y.prototype._fireMoveEvents=function(te){this.fire(new e.Event("move",te)),this._zooming&&this.fire(new e.Event("zoom",te)),this._rotating&&this.fire(new e.Event("rotate",te)),this._pitching&&this.fire(new e.Event("pitch",te))},Y.prototype._afterEase=function(te,me){if(!(this._easeId&&me&&this._easeId===me)){delete this._easeId;var Ge=this._zooming,Le=this._rotating,$e=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,Ge&&this.fire(new e.Event("zoomend",te)),Le&&this.fire(new e.Event("rotateend",te)),$e&&this.fire(new e.Event("pitchend",te)),this.fire(new e.Event("moveend",te))}},Y.prototype.flyTo=function(te,me){var Ge=this;if(!te.essential&&e.browser.prefersReducedMotion){var Le=e.pick(te,["center","zoom","bearing","pitch","around"]);return this.jumpTo(Le,me)}this.stop(),te=e.extend({offset:[0,0],speed:1.2,curve:1.42,easing:e.ease},te);var $e=this.transform,mt=this.getZoom(),jt=this.getBearing(),_r=this.getPitch(),Fr=this.getPadding(),hr="zoom"in te?e.clamp(+te.zoom,$e.minZoom,$e.maxZoom):mt,gt="bearing"in te?this._normalizeBearing(te.bearing,jt):jt,Et="pitch"in te?+te.pitch:_r,Ft="padding"in te?te.padding:$e.padding,ir=$e.zoomScale(hr-mt),fr=e.Point.convert(te.offset),sr=$e.centerPoint.add(fr),pr=$e.pointLocation(sr),lr=e.LngLat.convert(te.center||pr);this._normalizeCenter(lr);var Xt=$e.project(pr),or=$e.project(lr).sub(Xt),qt=te.curve,Dr=Math.max($e.width,$e.height),Jr=Dr/ir,ba=or.mag();if("minZoom"in te){var yi=e.clamp(Math.min(te.minZoom,mt,hr),$e.minZoom,$e.maxZoom),Xa=Dr/$e.zoomScale(yi-mt);qt=Math.sqrt(Xa/ba*2)}var si=qt*qt;function Ji(Fo){var bs=(Jr*Jr-Dr*Dr+(Fo?-1:1)*si*si*ba*ba)/(2*(Fo?Jr:Dr)*si*ba);return Math.log(Math.sqrt(bs*bs+1)-bs)}function Bi(Fo){return(Math.exp(Fo)-Math.exp(-Fo))/2}function pi(Fo){return(Math.exp(Fo)+Math.exp(-Fo))/2}function wi(Fo){return Bi(Fo)/pi(Fo)}var Mi=Ji(0),Vi=function(Fo){return pi(Mi)/pi(Mi+qt*Fo)},cn=function(Fo){return Dr*((pi(Mi)*wi(Mi+qt*Fo)-Bi(Mi))/si)/ba},xo=(Ji(1)-Mi)/qt;if(Math.abs(ba)<1e-6||!isFinite(xo)){if(Math.abs(Dr-Jr)<1e-6)return this.easeTo(te,me);var jo=Jrte.maxDuration&&(te.duration=0),this._zooming=!0,this._rotating=jt!==gt,this._pitching=Et!==_r,this._padding=!$e.isPaddingEqual(Ft),this._prepareEase(me,!1),this._ease(function(Fo){var bs=Fo*xo,Hs=1/Vi(bs);$e.zoom=Fo===1?hr:mt+$e.scaleZoom(Hs),Ge._rotating&&($e.bearing=e.number(jt,gt,Fo)),Ge._pitching&&($e.pitch=e.number(_r,Et,Fo)),Ge._padding&&($e.interpolatePadding(Fr,Ft,Fo),sr=$e.centerPoint.add(fr));var pu=Fo===1?lr:$e.unproject(Xt.add(or.mult(cn(bs))).mult(Hs));$e.setLocationAtPoint($e.renderWorldCopies?pu.wrap():pu,sr),Ge._fireMoveEvents(me)},function(){return Ge._afterEase(me)},te),this},Y.prototype.isEasing=function(){return!!this._easeFrameId},Y.prototype.stop=function(){return this._stop()},Y.prototype._stop=function(te,me){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var Ge=this._onEaseEnd;delete this._onEaseEnd,Ge.call(this,me)}if(!te){var Le=this.handlers;Le&&Le.stop(!1)}return this},Y.prototype._ease=function(te,me,Ge){Ge.animate===!1||Ge.duration===0?(te(1),me()):(this._easeStart=e.browser.now(),this._easeOptions=Ge,this._onEaseFrame=te,this._onEaseEnd=me,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},Y.prototype._renderFrameCallback=function(){var te=Math.min((e.browser.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(te)),te<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},Y.prototype._normalizeBearing=function(te,me){te=e.wrap(te,-180,180);var Ge=Math.abs(te-me);return Math.abs(te-360-me)180?-360:Ge<-180?360:0}},Y}(e.Evented),Oi=function(Y){Y===void 0&&(Y={}),this.options=Y,e.bindAll(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)};Oi.prototype.getDefaultPosition=function(){return"bottom-right"},Oi.prototype.onAdd=function(Y){var ye=this.options&&this.options.compact;return this._map=Y,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=r.create("button","mapboxgl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=r.create("div","mapboxgl-ctrl-attrib-inner",this._container),this._innerContainer.setAttribute("role","list"),ye&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),ye===void 0&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container},Oi.prototype.onRemove=function(){r.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0},Oi.prototype._setElementTitle=function(Y,ye){var te=this._map._getUIString("AttributionControl."+ye);Y.title=te,Y.setAttribute("aria-label",te)},Oi.prototype._toggleAttribution=function(){this._container.classList.contains("mapboxgl-compact-show")?(this._container.classList.remove("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","false")):(this._container.classList.add("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","true"))},Oi.prototype._updateEditLink=function(){var Y=this._editLink;Y||(Y=this._editLink=this._container.querySelector(".mapbox-improve-map"));var ye=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||e.config.ACCESS_TOKEN}];if(Y){var te=ye.reduce(function(me,Ge,Le){return Ge.value&&(me+=Ge.key+"="+Ge.value+(Le=0)return!1;return!0});var $e=Y.join(" | ");$e!==this._attribHTML&&(this._attribHTML=$e,Y.length?(this._innerContainer.innerHTML=$e,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}},Oi.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")};var ki=function(){e.bindAll(["_updateLogo"],this),e.bindAll(["_updateCompact"],this)};ki.prototype.onAdd=function(Y){this._map=Y,this._container=r.create("div","mapboxgl-ctrl");var ye=r.create("a","mapboxgl-ctrl-logo");return ye.target="_blank",ye.rel="noopener nofollow",ye.href="https://www.mapbox.com/",ye.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),ye.setAttribute("rel","noopener nofollow"),this._container.appendChild(ye),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container},ki.prototype.onRemove=function(){r.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},ki.prototype.getDefaultPosition=function(){return"bottom-left"},ki.prototype._updateLogo=function(Y){(!Y||Y.sourceDataType==="metadata")&&(this._container.style.display=this._logoRequired()?"block":"none")},ki.prototype._logoRequired=function(){if(this._map.style){var Y=this._map.style.sourceCaches;for(var ye in Y){var te=Y[ye].getSource();if(te.mapbox_logo)return!0}return!1}},ki.prototype._updateCompact=function(){var Y=this._container.children;if(Y.length){var ye=Y[0];this._map.getCanvasContainer().offsetWidth<250?ye.classList.add("mapboxgl-compact"):ye.classList.remove("mapboxgl-compact")}};var qa=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};qa.prototype.add=function(Y){var ye=++this._id,te=this._queue;return te.push({callback:Y,id:ye,cancelled:!1}),ye},qa.prototype.remove=function(Y){for(var ye=this._currentlyRunning,te=ye?this._queue.concat(ye):this._queue,me=0,Ge=te;mete.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(te.minPitch!=null&&te.maxPitch!=null&&te.minPitch>te.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(te.minPitch!=null&&te.minPitchhn)throw new Error("maxPitch must be less than or equal to "+hn);var Ge=new es(te.minZoom,te.maxZoom,te.minPitch,te.maxPitch,te.renderWorldCopies);if(ve.call(this,Ge,te),this._interactive=te.interactive,this._maxTileCacheSize=te.maxTileCacheSize,this._failIfMajorPerformanceCaveat=te.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=te.preserveDrawingBuffer,this._antialias=te.antialias,this._trackResize=te.trackResize,this._bearingSnap=te.bearingSnap,this._refreshExpiredTiles=te.refreshExpiredTiles,this._fadeDuration=te.fadeDuration,this._crossSourceCollisions=te.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=te.collectResourceTiming,this._renderTaskQueue=new qa,this._controls=[],this._mapId=e.uniqueId(),this._locale=e.extend({},ea,te.locale),this._clickTolerance=te.clickTolerance,this._requestManager=new e.RequestManager(te.transformRequest,te.accessToken),typeof te.container=="string"){if(this._container=e.window.document.getElementById(te.container),!this._container)throw new Error("Container '"+te.container+"' not found.")}else if(te.container instanceof ii)this._container=te.container;else throw new Error("Invalid type: 'container' must be a String or HTMLElement.");if(te.maxBounds&&this.setMaxBounds(te.maxBounds),e.bindAll(["_onWindowOnline","_onWindowResize","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),this.painter===void 0)throw new Error("Failed to initialize WebGL.");this.on("move",function(){return me._update(!1)}),this.on("moveend",function(){return me._update(!1)}),this.on("zoom",function(){return me._update(!0)}),typeof e.window<"u"&&(e.window.addEventListener("online",this._onWindowOnline,!1),e.window.addEventListener("resize",this._onWindowResize,!1),e.window.addEventListener("orientationchange",this._onWindowResize,!1)),this.handlers=new fi(this,te);var Le=typeof te.hash=="string"&&te.hash||void 0;this._hash=te.hash&&new $l(Le).addTo(this),(!this._hash||!this._hash._onHashChange())&&(this.jumpTo({center:te.center,zoom:te.zoom,bearing:te.bearing,pitch:te.pitch}),te.bounds&&(this.resize(),this.fitBounds(te.bounds,e.extend({},te.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=te.localIdeographFontFamily,te.style&&this.setStyle(te.style,{localIdeographFontFamily:te.localIdeographFontFamily}),te.attributionControl&&this.addControl(new Oi({customAttribution:te.customAttribution})),this.addControl(new ki,te.logoPosition),this.on("style.load",function(){me.transform.unmodified&&me.jumpTo(me.style.stylesheet)}),this.on("data",function($e){me._update($e.dataType==="style"),me.fire(new e.Event($e.dataType+"data",$e))}),this.on("dataloading",function($e){me.fire(new e.Event($e.dataType+"dataloading",$e))})}ve&&(Y.__proto__=ve),Y.prototype=Object.create(ve&&ve.prototype),Y.prototype.constructor=Y;var ye={showTileBoundaries:{configurable:!0},showPadding:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0},version:{configurable:!0}};return Y.prototype._getMapId=function(){return this._mapId},Y.prototype.addControl=function(me,Ge){if(Ge===void 0&&(me.getDefaultPosition?Ge=me.getDefaultPosition():Ge="top-right"),!me||!me.onAdd)return this.fire(new e.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));var Le=me.onAdd(this);this._controls.push(me);var $e=this._controlPositions[Ge];return Ge.indexOf("bottom")!==-1?$e.insertBefore(Le,$e.firstChild):$e.appendChild(Le),this},Y.prototype.removeControl=function(me){if(!me||!me.onRemove)return this.fire(new e.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));var Ge=this._controls.indexOf(me);return Ge>-1&&this._controls.splice(Ge,1),me.onRemove(this),this},Y.prototype.hasControl=function(me){return this._controls.indexOf(me)>-1},Y.prototype.resize=function(me){var Ge=this._containerDimensions(),Le=Ge[0],$e=Ge[1];this._resizeCanvas(Le,$e),this.transform.resize(Le,$e),this.painter.resize(Le,$e);var mt=!this._moving;return mt&&(this.stop(),this.fire(new e.Event("movestart",me)).fire(new e.Event("move",me))),this.fire(new e.Event("resize",me)),mt&&this.fire(new e.Event("moveend",me)),this},Y.prototype.getBounds=function(){return this.transform.getBounds()},Y.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},Y.prototype.setMaxBounds=function(me){return this.transform.setMaxBounds(e.LngLatBounds.convert(me)),this._update()},Y.prototype.setMinZoom=function(me){if(me=me??Wa,me>=Wa&&me<=this.transform.maxZoom)return this.transform.minZoom=me,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=me,this._update(),this.getZoom()>me&&this.setZoom(me),this;throw new Error("maxZoom must be greater than the current minZoom")},Y.prototype.getMaxZoom=function(){return this.transform.maxZoom},Y.prototype.setMinPitch=function(me){if(me=me??Ii,me=Ii&&me<=this.transform.maxPitch)return this.transform.minPitch=me,this._update(),this.getPitch()hn)throw new Error("maxPitch must be less than or equal to "+hn);if(me>=this.transform.minPitch)return this.transform.maxPitch=me,this._update(),this.getPitch()>me&&this.setPitch(me),this;throw new Error("maxPitch must be greater than the current minPitch")},Y.prototype.getMaxPitch=function(){return this.transform.maxPitch},Y.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},Y.prototype.setRenderWorldCopies=function(me){return this.transform.renderWorldCopies=me,this._update()},Y.prototype.project=function(me){return this.transform.locationPoint(e.LngLat.convert(me))},Y.prototype.unproject=function(me){return this.transform.pointLocation(e.Point.convert(me))},Y.prototype.isMoving=function(){return this._moving||this.handlers.isMoving()},Y.prototype.isZooming=function(){return this._zooming||this.handlers.isZooming()},Y.prototype.isRotating=function(){return this._rotating||this.handlers.isRotating()},Y.prototype._createDelegatedListener=function(me,Ge,Le){var $e=this,mt;if(me==="mouseenter"||me==="mouseover"){var jt=!1,_r=function(ir){var fr=$e.getLayer(Ge)?$e.queryRenderedFeatures(ir.point,{layers:[Ge]}):[];fr.length?jt||(jt=!0,Le.call($e,new De(me,$e,ir.originalEvent,{features:fr}))):jt=!1},Fr=function(){jt=!1};return{layer:Ge,listener:Le,delegates:{mousemove:_r,mouseout:Fr}}}else if(me==="mouseleave"||me==="mouseout"){var hr=!1,gt=function(ir){var fr=$e.getLayer(Ge)?$e.queryRenderedFeatures(ir.point,{layers:[Ge]}):[];fr.length?hr=!0:hr&&(hr=!1,Le.call($e,new De(me,$e,ir.originalEvent)))},Et=function(ir){hr&&(hr=!1,Le.call($e,new De(me,$e,ir.originalEvent)))};return{layer:Ge,listener:Le,delegates:{mousemove:gt,mouseout:Et}}}else{var Ft=function(ir){var fr=$e.getLayer(Ge)?$e.queryRenderedFeatures(ir.point,{layers:[Ge]}):[];fr.length&&(ir.features=fr,Le.call($e,ir),delete ir.features)};return{layer:Ge,listener:Le,delegates:(mt={},mt[me]=Ft,mt)}}},Y.prototype.on=function(me,Ge,Le){if(Le===void 0)return ve.prototype.on.call(this,me,Ge);var $e=this._createDelegatedListener(me,Ge,Le);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[me]=this._delegatedListeners[me]||[],this._delegatedListeners[me].push($e);for(var mt in $e.delegates)this.on(mt,$e.delegates[mt]);return this},Y.prototype.once=function(me,Ge,Le){if(Le===void 0)return ve.prototype.once.call(this,me,Ge);var $e=this._createDelegatedListener(me,Ge,Le);for(var mt in $e.delegates)this.once(mt,$e.delegates[mt]);return this},Y.prototype.off=function(me,Ge,Le){var $e=this;if(Le===void 0)return ve.prototype.off.call(this,me,Ge);var mt=function(jt){for(var _r=jt[me],Fr=0;Fr<_r.length;Fr++){var hr=_r[Fr];if(hr.layer===Ge&&hr.listener===Le){for(var gt in hr.delegates)$e.off(gt,hr.delegates[gt]);return _r.splice(Fr,1),$e}}};return this._delegatedListeners&&this._delegatedListeners[me]&&mt(this._delegatedListeners),this},Y.prototype.queryRenderedFeatures=function(me,Ge){if(!this.style)return[];Ge===void 0&&me!==void 0&&!(me instanceof e.Point)&&!Array.isArray(me)&&(Ge=me,me=void 0),Ge=Ge||{},me=me||[[0,0],[this.transform.width,this.transform.height]];var Le;if(me instanceof e.Point||typeof me[0]=="number")Le=[e.Point.convert(me)];else{var $e=e.Point.convert(me[0]),mt=e.Point.convert(me[1]);Le=[$e,new e.Point(mt.x,$e.y),mt,new e.Point($e.x,mt.y),$e]}return this.style.queryRenderedFeatures(Le,Ge,this.transform)},Y.prototype.querySourceFeatures=function(me,Ge){return this.style.querySourceFeatures(me,Ge)},Y.prototype.setStyle=function(me,Ge){return Ge=e.extend({},{localIdeographFontFamily:this._localIdeographFontFamily},Ge),Ge.diff!==!1&&Ge.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&me?(this._diffStyle(me,Ge),this):(this._localIdeographFontFamily=Ge.localIdeographFontFamily,this._updateStyle(me,Ge))},Y.prototype._getUIString=function(me){var Ge=this._locale[me];if(Ge==null)throw new Error("Missing UI string '"+me+"'");return Ge},Y.prototype._updateStyle=function(me,Ge){if(this.style&&(this.style.setEventedParent(null),this.style._remove()),me)this.style=new iu(this,Ge||{});else return delete this.style,this;return this.style.setEventedParent(this,{style:this.style}),typeof me=="string"?this.style.loadURL(me):this.style.loadJSON(me),this},Y.prototype._lazyInitEmptyStyle=function(){this.style||(this.style=new iu(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())},Y.prototype._diffStyle=function(me,Ge){var Le=this;if(typeof me=="string"){var $e=this._requestManager.normalizeStyleURL(me),mt=this._requestManager.transformRequest($e,e.ResourceType.Style);e.getJSON(mt,function(jt,_r){jt?Le.fire(new e.ErrorEvent(jt)):_r&&Le._updateDiff(_r,Ge)})}else typeof me=="object"&&this._updateDiff(me,Ge)},Y.prototype._updateDiff=function(me,Ge){try{this.style.setState(me)&&this._update(!0)}catch(Le){e.warnOnce("Unable to perform style diff: "+(Le.message||Le.error||Le)+". Rebuilding the style from scratch."),this._updateStyle(me,Ge)}},Y.prototype.getStyle=function(){if(this.style)return this.style.serialize()},Y.prototype.isStyleLoaded=function(){return this.style?this.style.loaded():e.warnOnce("There is no style added to the map.")},Y.prototype.addSource=function(me,Ge){return this._lazyInitEmptyStyle(),this.style.addSource(me,Ge),this._update(!0)},Y.prototype.isSourceLoaded=function(me){var Ge=this.style&&this.style.sourceCaches[me];if(Ge===void 0){this.fire(new e.ErrorEvent(new Error("There is no source with ID '"+me+"'")));return}return Ge.loaded()},Y.prototype.areTilesLoaded=function(){var me=this.style&&this.style.sourceCaches;for(var Ge in me){var Le=me[Ge],$e=Le._tiles;for(var mt in $e){var jt=$e[mt];if(!(jt.state==="loaded"||jt.state==="errored"))return!1}}return!0},Y.prototype.addSourceType=function(me,Ge,Le){return this._lazyInitEmptyStyle(),this.style.addSourceType(me,Ge,Le)},Y.prototype.removeSource=function(me){return this.style.removeSource(me),this._update(!0)},Y.prototype.getSource=function(me){return this.style.getSource(me)},Y.prototype.addImage=function(me,Ge,Le){Le===void 0&&(Le={});var $e=Le.pixelRatio;$e===void 0&&($e=1);var mt=Le.sdf;mt===void 0&&(mt=!1);var jt=Le.stretchX,_r=Le.stretchY,Fr=Le.content;this._lazyInitEmptyStyle();var hr=0;if(Ge instanceof Ea||gi&&Ge instanceof gi){var gt=e.browser.getImageData(Ge),Et=gt.width,Ft=gt.height,ir=gt.data;this.style.addImage(me,{data:new e.RGBAImage({width:Et,height:Ft},ir),pixelRatio:$e,stretchX:jt,stretchY:_r,content:Fr,sdf:mt,version:hr})}else{if(Ge.width===void 0||Ge.height===void 0)return this.fire(new e.ErrorEvent(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));var fr=Ge.width,sr=Ge.height,pr=Ge.data,lr=Ge;this.style.addImage(me,{data:new e.RGBAImage({width:fr,height:sr},new Uint8Array(pr)),pixelRatio:$e,stretchX:jt,stretchY:_r,content:Fr,sdf:mt,version:hr,userImage:lr}),lr.onAdd&&lr.onAdd(this,me)}},Y.prototype.updateImage=function(me,Ge){var Le=this.style.getImage(me);if(!Le)return this.fire(new e.ErrorEvent(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));var $e=Ge instanceof Ea||gi&&Ge instanceof gi?e.browser.getImageData(Ge):Ge,mt=$e.width,jt=$e.height,_r=$e.data;if(mt===void 0||jt===void 0)return this.fire(new e.ErrorEvent(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));if(mt!==Le.data.width||jt!==Le.data.height)return this.fire(new e.ErrorEvent(new Error("The width and height of the updated image must be that same as the previous version of the image")));var Fr=!(Ge instanceof Ea||gi&&Ge instanceof gi);Le.data.replace(_r,Fr),this.style.updateImage(me,Le)},Y.prototype.hasImage=function(me){return me?!!this.style.getImage(me):(this.fire(new e.ErrorEvent(new Error("Missing required image id"))),!1)},Y.prototype.removeImage=function(me){this.style.removeImage(me)},Y.prototype.loadImage=function(me,Ge){e.getImage(this._requestManager.transformRequest(me,e.ResourceType.Image),Ge)},Y.prototype.listImages=function(){return this.style.listImages()},Y.prototype.addLayer=function(me,Ge){return this._lazyInitEmptyStyle(),this.style.addLayer(me,Ge),this._update(!0)},Y.prototype.moveLayer=function(me,Ge){return this.style.moveLayer(me,Ge),this._update(!0)},Y.prototype.removeLayer=function(me){return this.style.removeLayer(me),this._update(!0)},Y.prototype.getLayer=function(me){return this.style.getLayer(me)},Y.prototype.setLayerZoomRange=function(me,Ge,Le){return this.style.setLayerZoomRange(me,Ge,Le),this._update(!0)},Y.prototype.setFilter=function(me,Ge,Le){return Le===void 0&&(Le={}),this.style.setFilter(me,Ge,Le),this._update(!0)},Y.prototype.getFilter=function(me){return this.style.getFilter(me)},Y.prototype.setPaintProperty=function(me,Ge,Le,$e){return $e===void 0&&($e={}),this.style.setPaintProperty(me,Ge,Le,$e),this._update(!0)},Y.prototype.getPaintProperty=function(me,Ge){return this.style.getPaintProperty(me,Ge)},Y.prototype.setLayoutProperty=function(me,Ge,Le,$e){return $e===void 0&&($e={}),this.style.setLayoutProperty(me,Ge,Le,$e),this._update(!0)},Y.prototype.getLayoutProperty=function(me,Ge){return this.style.getLayoutProperty(me,Ge)},Y.prototype.setLight=function(me,Ge){return Ge===void 0&&(Ge={}),this._lazyInitEmptyStyle(),this.style.setLight(me,Ge),this._update(!0)},Y.prototype.getLight=function(){return this.style.getLight()},Y.prototype.setFeatureState=function(me,Ge){return this.style.setFeatureState(me,Ge),this._update()},Y.prototype.removeFeatureState=function(me,Ge){return this.style.removeFeatureState(me,Ge),this._update()},Y.prototype.getFeatureState=function(me){return this.style.getFeatureState(me)},Y.prototype.getContainer=function(){return this._container},Y.prototype.getCanvasContainer=function(){return this._canvasContainer},Y.prototype.getCanvas=function(){return this._canvas},Y.prototype._containerDimensions=function(){var me=0,Ge=0;return this._container&&(me=this._container.clientWidth||400,Ge=this._container.clientHeight||300),[me,Ge]},Y.prototype._detectMissingCSS=function(){var me=e.window.getComputedStyle(this._missingCSSCanary).getPropertyValue("background-color");me!=="rgb(250, 128, 114)"&&e.warnOnce("This page appears to be missing CSS declarations for Mapbox GL JS, which may cause the map to display incorrectly. Please ensure your page includes mapbox-gl.css, as described in https://www.mapbox.com/mapbox-gl-js/api/.")},Y.prototype._setupContainer=function(){var me=this._container;me.classList.add("mapboxgl-map");var Ge=this._missingCSSCanary=r.create("div","mapboxgl-canary",me);Ge.style.visibility="hidden",this._detectMissingCSS();var Le=this._canvasContainer=r.create("div","mapboxgl-canvas-container",me);this._interactive&&Le.classList.add("mapboxgl-interactive"),this._canvas=r.create("canvas","mapboxgl-canvas",Le),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label","Map"),this._canvas.setAttribute("role","region");var $e=this._containerDimensions();this._resizeCanvas($e[0],$e[1]);var mt=this._controlContainer=r.create("div","mapboxgl-control-container",me),jt=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(function(_r){jt[_r]=r.create("div","mapboxgl-ctrl-"+_r,mt)}),this._container.addEventListener("scroll",this._onMapScroll,!1)},Y.prototype._resizeCanvas=function(me,Ge){var Le=e.browser.devicePixelRatio||1;this._canvas.width=Le*me,this._canvas.height=Le*Ge,this._canvas.style.width=me+"px",this._canvas.style.height=Ge+"px"},Y.prototype._setupPainter=function(){var me=e.extend({},t.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),Ge=this._canvas.getContext("webgl",me)||this._canvas.getContext("experimental-webgl",me);if(!Ge){this.fire(new e.ErrorEvent(new Error("Failed to initialize WebGL")));return}this.painter=new Ko(Ge,this.transform),e.webpSupported.testSupport(Ge)},Y.prototype._contextLost=function(me){me.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new e.Event("webglcontextlost",{originalEvent:me}))},Y.prototype._contextRestored=function(me){this._setupPainter(),this.resize(),this._update(),this.fire(new e.Event("webglcontextrestored",{originalEvent:me}))},Y.prototype._onMapScroll=function(me){if(me.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},Y.prototype.loaded=function(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()},Y.prototype._update=function(me){return this.style?(this._styleDirty=this._styleDirty||me,this._sourcesDirty=!0,this.triggerRepaint(),this):this},Y.prototype._requestRenderFrame=function(me){return this._update(),this._renderTaskQueue.add(me)},Y.prototype._cancelRenderFrame=function(me){this._renderTaskQueue.remove(me)},Y.prototype._render=function(me){var Ge=this,Le,$e=0,mt=this.painter.context.extTimerQuery;if(this.listens("gpu-timing-frame")&&(Le=mt.createQueryEXT(),mt.beginQueryEXT(mt.TIME_ELAPSED_EXT,Le),$e=e.browser.now()),this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(me),!this._removed){var jt=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;var _r=this.transform.zoom,Fr=e.browser.now();this.style.zoomHistory.update(_r,Fr);var hr=new e.EvaluationParameters(_r,{now:Fr,fadeDuration:this._fadeDuration,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),gt=hr.crossFadingFactor();(gt!==1||gt!==this._crossFadingFactor)&&(jt=!0,this._crossFadingFactor=gt),this.style.update(hr)}if(this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,this._fadeDuration,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:this._fadeDuration,showPadding:this.showPadding,gpuTiming:!!this.listens("gpu-timing-layer")}),this.fire(new e.Event("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new e.Event("load"))),this.style&&(this.style.hasTransitions()||jt)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),this.listens("gpu-timing-frame")){var Et=e.browser.now()-$e;mt.endQueryEXT(mt.TIME_ELAPSED_EXT,Le),setTimeout(function(){var fr=mt.getQueryObjectEXT(Le,mt.QUERY_RESULT_EXT)/1e6;mt.deleteQueryEXT(Le),Ge.fire(new e.Event("gpu-timing-frame",{cpuTime:Et,gpuTime:fr}))},50)}if(this.listens("gpu-timing-layer")){var Ft=this.painter.collectGpuTimers();setTimeout(function(){var fr=Ge.painter.queryGpuTimers(Ft);Ge.fire(new e.Event("gpu-timing-layer",{layerTimes:fr}))},50)}var ir=this._sourcesDirty||this._styleDirty||this._placementDirty;return ir||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new e.Event("idle")),this._loaded&&!this._fullyLoaded&&!ir&&(this._fullyLoaded=!0),this}},Y.prototype.remove=function(){this._hash&&this._hash.remove();for(var me=0,Ge=this._controls;me180;){var Le=ye.locationPoint(ve);if(Le.x>=0&&Le.y>=0&&Le.x<=ye.width&&Le.y<=ye.height)break;ve.lng>ye.center.lng?ve.lng-=360:ve.lng+=360}return ve}var mn={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function In(ve,Y,ye){var te=ve.classList;for(var me in mn)te.remove("mapboxgl-"+ye+"-anchor-"+me);te.add("mapboxgl-"+ye+"-anchor-"+Y)}var Di=function(ve){function Y(ye,te){if(ve.call(this),(ye instanceof e.window.HTMLElement||te)&&(ye=e.extend({element:ye},te)),e.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress"],this),this._anchor=ye&&ye.anchor||"center",this._color=ye&&ye.color||"#3FB1CE",this._scale=ye&&ye.scale||1,this._draggable=ye&&ye.draggable||!1,this._clickTolerance=ye&&ye.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=ye&&ye.rotation||0,this._rotationAlignment=ye&&ye.rotationAlignment||"auto",this._pitchAlignment=ye&&ye.pitchAlignment&&ye.pitchAlignment!=="auto"?ye.pitchAlignment:this._rotationAlignment,!ye||!ye.element){this._defaultMarker=!0,this._element=r.create("div"),this._element.setAttribute("aria-label","Map marker");var me=r.createNS("http://www.w3.org/2000/svg","svg"),Ge=41,Le=27;me.setAttributeNS(null,"display","block"),me.setAttributeNS(null,"height",Ge+"px"),me.setAttributeNS(null,"width",Le+"px"),me.setAttributeNS(null,"viewBox","0 0 "+Le+" "+Ge);var $e=r.createNS("http://www.w3.org/2000/svg","g");$e.setAttributeNS(null,"stroke","none"),$e.setAttributeNS(null,"stroke-width","1"),$e.setAttributeNS(null,"fill","none"),$e.setAttributeNS(null,"fill-rule","evenodd");var mt=r.createNS("http://www.w3.org/2000/svg","g");mt.setAttributeNS(null,"fill-rule","nonzero");var jt=r.createNS("http://www.w3.org/2000/svg","g");jt.setAttributeNS(null,"transform","translate(3.0, 29.0)"),jt.setAttributeNS(null,"fill","#000000");for(var _r=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}],Fr=0,hr=_r;Fr=me}this._isDragging&&(this._pos=te.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new e.Event("dragstart"))),this.fire(new e.Event("drag")))},Y.prototype._onUp=function(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new e.Event("dragend")),this._state="inactive"},Y.prototype._addDragHandler=function(te){this._element.contains(te.originalEvent.target)&&(te.preventDefault(),this._positionDelta=te.point.sub(this._pos).add(this._offset),this._pointerdownPos=te.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},Y.prototype.setDraggable=function(te){return this._draggable=!!te,this._map&&(te?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this},Y.prototype.isDraggable=function(){return this._draggable},Y.prototype.setRotation=function(te){return this._rotation=te||0,this._update(),this},Y.prototype.getRotation=function(){return this._rotation},Y.prototype.setRotationAlignment=function(te){return this._rotationAlignment=te||"auto",this._update(),this},Y.prototype.getRotationAlignment=function(){return this._rotationAlignment},Y.prototype.setPitchAlignment=function(te){return this._pitchAlignment=te&&te!=="auto"?te:this._rotationAlignment,this._update(),this},Y.prototype.getPitchAlignment=function(){return this._pitchAlignment},Y}(e.Evented),nn={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},En;function Rn(ve){En!==void 0?ve(En):e.window.navigator.permissions!==void 0?e.window.navigator.permissions.query({name:"geolocation"}).then(function(Y){En=Y.state!=="denied",ve(En)}):(En=!!e.window.navigator.geolocation,ve(En))}var Gn=0,Ps=!1,xl=function(ve){function Y(ye){ve.call(this),this.options=e.extend({},nn,ye),e.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this)}return ve&&(Y.__proto__=ve),Y.prototype=Object.create(ve&&ve.prototype),Y.prototype.constructor=Y,Y.prototype.onAdd=function(te){return this._map=te,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),Rn(this._setupUI),this._container},Y.prototype.onRemove=function(){this._geolocationWatchID!==void 0&&(e.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),r.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,Gn=0,Ps=!1},Y.prototype._isOutOfMapMaxBounds=function(te){var me=this._map.getMaxBounds(),Ge=te.coords;return me&&(Ge.longitudeme.getEast()||Ge.latitudeme.getNorth())},Y.prototype._setErrorState=function(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break}},Y.prototype._onSuccess=function(te){if(this._map){if(this._isOutOfMapMaxBounds(te)){this._setErrorState(),this.fire(new e.Event("outofmaxbounds",te)),this._updateMarker(),this._finish();return}if(this.options.trackUserLocation)switch(this._lastKnownPosition=te,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(te),(!this.options.trackUserLocation||this._watchState==="ACTIVE_LOCK")&&this._updateCamera(te),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new e.Event("geolocate",te)),this._finish()}},Y.prototype._updateCamera=function(te){var me=new e.LngLat(te.coords.longitude,te.coords.latitude),Ge=te.coords.accuracy,Le=this._map.getBearing(),$e=e.extend({bearing:Le},this.options.fitBoundsOptions);this._map.fitBounds(me.toBounds(Ge),$e,{geolocateSource:!0})},Y.prototype._updateMarker=function(te){if(te){var me=new e.LngLat(te.coords.longitude,te.coords.latitude);this._accuracyCircleMarker.setLngLat(me).addTo(this._map),this._userLocationDotMarker.setLngLat(me).addTo(this._map),this._accuracy=te.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},Y.prototype._updateCircleRadius=function(){var te=this._map._container.clientHeight/2,me=this._map.unproject([0,te]),Ge=this._map.unproject([1,te]),Le=me.distanceTo(Ge),$e=Math.ceil(2*this._accuracy/Le);this._circleElement.style.width=$e+"px",this._circleElement.style.height=$e+"px"},Y.prototype._onZoom=function(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},Y.prototype._onError=function(te){if(this._map){if(this.options.trackUserLocation)if(te.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;var me=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=me,this._geolocateButton.setAttribute("aria-label",me),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(te.code===3&&Ps)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new e.Event("error",te)),this._finish()}},Y.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},Y.prototype._setupUI=function(te){var me=this;if(this._container.addEventListener("contextmenu",function($e){return $e.preventDefault()}),this._geolocateButton=r.create("button","mapboxgl-ctrl-geolocate",this._container),r.create("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden",!0),this._geolocateButton.type="button",te===!1){e.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");var Ge=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=Ge,this._geolocateButton.setAttribute("aria-label",Ge)}else{var Le=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=Le,this._geolocateButton.setAttribute("aria-label",Le)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=r.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new Di(this._dotElement),this._circleElement=r.create("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Di({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",function($e){var mt=$e.originalEvent&&$e.originalEvent.type==="resize";!$e.geolocateSource&&me._watchState==="ACTIVE_LOCK"&&!mt&&(me._watchState="BACKGROUND",me._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),me._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),me.fire(new e.Event("trackuserlocationend")))})},Y.prototype.trigger=function(){if(!this._setup)return e.warnOnce("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new e.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":Gn--,Ps=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new e.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new e.Event("trackuserlocationstart"));break}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error");break}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),Gn++;var te;Gn>1?(te={maximumAge:6e5,timeout:0},Ps=!0):(te=this.options.positionOptions,Ps=!1),this._geolocationWatchID=e.window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,te)}}else e.window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0},Y.prototype._clearWatch=function(){e.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)},Y}(e.Evented),ho={maxWidth:100,unit:"metric"},Hl=function(Y){this.options=e.extend({},ho,Y),e.bindAll(["_onMove","setUnit"],this)};Hl.prototype.getDefaultPosition=function(){return"bottom-left"},Hl.prototype._onMove=function(){fs(this._map,this._container,this.options)},Hl.prototype.onAdd=function(Y){return this._map=Y,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",Y.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},Hl.prototype.onRemove=function(){r.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},Hl.prototype.setUnit=function(Y){this.options.unit=Y,fs(this._map,this._container,this.options)};function fs(ve,Y,ye){var te=ye&&ye.maxWidth||100,me=ve._container.clientHeight/2,Ge=ve.unproject([0,me]),Le=ve.unproject([te,me]),$e=Ge.distanceTo(Le);if(ye&&ye.unit==="imperial"){var mt=3.2808*$e;if(mt>5280){var jt=mt/5280;Al(Y,te,jt,ve._getUIString("ScaleControl.Miles"))}else Al(Y,te,mt,ve._getUIString("ScaleControl.Feet"))}else if(ye&&ye.unit==="nautical"){var _r=$e/1852;Al(Y,te,_r,ve._getUIString("ScaleControl.NauticalMiles"))}else $e>=1e3?Al(Y,te,$e/1e3,ve._getUIString("ScaleControl.Kilometers")):Al(Y,te,$e,ve._getUIString("ScaleControl.Meters"))}function Al(ve,Y,ye,te){var me=Ql(ye),Ge=me/ye;ve.style.width=Y*Ge+"px",ve.innerHTML=me+" "+te}function El(ve){var Y=Math.pow(10,Math.ceil(-Math.log(ve)/Math.LN10));return Math.round(ve*Y)/Y}function Ql(ve){var Y=Math.pow(10,(""+Math.floor(ve)).length-1),ye=ve/Y;return ye=ye>=10?10:ye>=5?5:ye>=3?3:ye>=2?2:ye>=1?1:El(ye),Y*ye}var Fs=function(Y){this._fullscreen=!1,Y&&Y.container&&(Y.container instanceof e.window.HTMLElement?this._container=Y.container:e.warnOnce("Full screen control 'container' must be a DOM element.")),e.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in e.window.document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in e.window.document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in e.window.document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in e.window.document&&(this._fullscreenchange="MSFullscreenChange")};Fs.prototype.onAdd=function(Y){return this._map=Y,this._container||(this._container=this._map.getContainer()),this._controlContainer=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",e.warnOnce("This device does not support fullscreen mode.")),this._controlContainer},Fs.prototype.onRemove=function(){r.remove(this._controlContainer),this._map=null,e.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},Fs.prototype._checkFullscreenSupport=function(){return!!(e.window.document.fullscreenEnabled||e.window.document.mozFullScreenEnabled||e.window.document.msFullscreenEnabled||e.window.document.webkitFullscreenEnabled)},Fs.prototype._setupUI=function(){var Y=this._fullscreenButton=r.create("button","mapboxgl-ctrl-fullscreen",this._controlContainer);r.create("span","mapboxgl-ctrl-icon",Y).setAttribute("aria-hidden",!0),Y.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),e.window.document.addEventListener(this._fullscreenchange,this._changeIcon)},Fs.prototype._updateTitle=function(){var Y=this._getTitle();this._fullscreenButton.setAttribute("aria-label",Y),this._fullscreenButton.title=Y},Fs.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},Fs.prototype._isFullscreen=function(){return this._fullscreen},Fs.prototype._changeIcon=function(){var Y=e.window.document.fullscreenElement||e.window.document.mozFullScreenElement||e.window.document.webkitFullscreenElement||e.window.document.msFullscreenElement;Y===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())},Fs.prototype._onClickFullscreen=function(){this._isFullscreen()?e.window.document.exitFullscreen?e.window.document.exitFullscreen():e.window.document.mozCancelFullScreen?e.window.document.mozCancelFullScreen():e.window.document.msExitFullscreen?e.window.document.msExitFullscreen():e.window.document.webkitCancelFullScreen&&e.window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()};var pl={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},bl=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", "),Hn=function(ve){function Y(ye){ve.call(this),this.options=e.extend(Object.create(pl),ye),e.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}return ve&&(Y.__proto__=ve),Y.prototype=Object.create(ve&&ve.prototype),Y.prototype.constructor=Y,Y.prototype.addTo=function(te){return this._map&&this.remove(),this._map=te,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")):this._map.on("move",this._update),this.fire(new e.Event("open")),this},Y.prototype.isOpen=function(){return!!this._map},Y.prototype.remove=function(){return this._content&&r.remove(this._content),this._container&&(r.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),delete this._map),this.fire(new e.Event("close")),this},Y.prototype.getLngLat=function(){return this._lngLat},Y.prototype.setLngLat=function(te){return this._lngLat=e.LngLat.convert(te),this._pos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.remove("mapboxgl-track-pointer")),this},Y.prototype.trackPointer=function(){return this._trackPointer=!0,this._pos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")),this},Y.prototype.getElement=function(){return this._container},Y.prototype.setText=function(te){return this.setDOMContent(e.window.document.createTextNode(te))},Y.prototype.setHTML=function(te){var me=e.window.document.createDocumentFragment(),Ge=e.window.document.createElement("body"),Le;for(Ge.innerHTML=te;Le=Ge.firstChild,!!Le;)me.appendChild(Le);return this.setDOMContent(me)},Y.prototype.getMaxWidth=function(){return this._container&&this._container.style.maxWidth},Y.prototype.setMaxWidth=function(te){return this.options.maxWidth=te,this._update(),this},Y.prototype.setDOMContent=function(te){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=r.create("div","mapboxgl-popup-content",this._container);return this._content.appendChild(te),this._createCloseButton(),this._update(),this._focusFirstElement(),this},Y.prototype.addClassName=function(te){this._container&&this._container.classList.add(te)},Y.prototype.removeClassName=function(te){this._container&&this._container.classList.remove(te)},Y.prototype.setOffset=function(te){return this.options.offset=te,this._update(),this},Y.prototype.toggleClassName=function(te){if(this._container)return this._container.classList.toggle(te)},Y.prototype._createCloseButton=function(){this.options.closeButton&&(this._closeButton=r.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))},Y.prototype._onMouseUp=function(te){this._update(te.point)},Y.prototype._onMouseMove=function(te){this._update(te.point)},Y.prototype._onDrag=function(te){this._update(te.point)},Y.prototype._update=function(te){var me=this,Ge=this._lngLat||this._trackPointer;if(!(!this._map||!Ge||!this._content)&&(this._container||(this._container=r.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=r.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach(function(gt){return me._container.classList.add(gt)}),this._trackPointer&&this._container.classList.add("mapboxgl-popup-track-pointer")),this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=Ki(this._lngLat,this._pos,this._map.transform)),!(this._trackPointer&&!te))){var Le=this._pos=this._trackPointer&&te?te:this._map.project(this._lngLat),$e=this.options.anchor,mt=Cl(this.options.offset);if(!$e){var jt=this._container.offsetWidth,_r=this._container.offsetHeight,Fr;Le.y+mt.bottom.y<_r?Fr=["top"]:Le.y>this._map.transform.height-_r?Fr=["bottom"]:Fr=[],Le.xthis._map.transform.width-jt/2&&Fr.push("right"),Fr.length===0?$e="bottom":$e=Fr.join("-")}var hr=Le.add(mt[$e]).round();r.setTransform(this._container,mn[$e]+" translate("+hr.x+"px,"+hr.y+"px)"),In(this._container,$e,"popup")}},Y.prototype._focusFirstElement=function(){if(!(!this.options.focusAfterOpen||!this._container)){var te=this._container.querySelector(bl);te&&te.focus()}},Y.prototype._onClose=function(){this.remove()},Y}(e.Evented);function Cl(ve){if(ve)if(typeof ve=="number"){var Y=Math.round(Math.sqrt(.5*Math.pow(ve,2)));return{center:new e.Point(0,0),top:new e.Point(0,ve),"top-left":new e.Point(Y,Y),"top-right":new e.Point(-Y,Y),bottom:new e.Point(0,-ve),"bottom-left":new e.Point(Y,-Y),"bottom-right":new e.Point(-Y,-Y),left:new e.Point(ve,0),right:new e.Point(-ve,0)}}else if(ve instanceof e.Point||Array.isArray(ve)){var ye=e.Point.convert(ve);return{center:ye,top:ye,"top-left":ye,"top-right":ye,bottom:ye,"bottom-left":ye,"bottom-right":ye,left:ye,right:ye}}else return{center:e.Point.convert(ve.center||[0,0]),top:e.Point.convert(ve.top||[0,0]),"top-left":e.Point.convert(ve["top-left"]||[0,0]),"top-right":e.Point.convert(ve["top-right"]||[0,0]),bottom:e.Point.convert(ve.bottom||[0,0]),"bottom-left":e.Point.convert(ve["bottom-left"]||[0,0]),"bottom-right":e.Point.convert(ve["bottom-right"]||[0,0]),left:e.Point.convert(ve.left||[0,0]),right:e.Point.convert(ve.right||[0,0])};else return Cl(new e.Point(0,0))}var Lo={version:e.version,supported:t,setRTLTextPlugin:e.setRTLTextPlugin,getRTLTextPluginStatus:e.getRTLTextPluginStatus,Map:Va,NavigationControl:Si,GeolocateControl:xl,AttributionControl:Oi,ScaleControl:Hl,FullscreenControl:Fs,Popup:Hn,Marker:Di,Style:iu,LngLat:e.LngLat,LngLatBounds:e.LngLatBounds,Point:e.Point,MercatorCoordinate:e.MercatorCoordinate,Evented:e.Evented,config:e.config,prewarm:Nr,clearPrewarmedResources:Or,get accessToken(){return e.config.ACCESS_TOKEN},set accessToken(ve){e.config.ACCESS_TOKEN=ve},get baseApiUrl(){return e.config.API_URL},set baseApiUrl(ve){e.config.API_URL=ve},get workerCount(){return ai.workerCount},set workerCount(ve){ai.workerCount=ve},get maxParallelImageRequests(){return e.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(ve){e.config.MAX_PARALLEL_IMAGE_REQUESTS=ve},clearStorage:function(Y){e.clearTileCache(Y)},workerUrl:""};return Lo}),A})}}),mV=Ze({"src/plots/mapbox/layers.js"(Z,q){"use strict";var d=ca(),x=fu().sanitizeHTML,A=M6(),M=am();function e(i,n){this.subplot=i,this.uid=i.uid+"-"+n,this.index=n,this.idSource="source-"+this.uid,this.idLayer=M.layoutLayerPrefix+this.uid,this.sourceType=null,this.source=null,this.layerType=null,this.below=null,this.visible=!1}var t=e.prototype;t.update=function(n){this.visible?this.needsNewImage(n)?this.updateImage(n):this.needsNewSource(n)?(this.removeLayer(),this.updateSource(n),this.updateLayer(n)):this.needsNewLayer(n)?this.updateLayer(n):this.updateStyle(n):(this.updateSource(n),this.updateLayer(n)),this.visible=r(n)},t.needsNewImage=function(i){var n=this.subplot.map;return n.getSource(this.idSource)&&this.sourceType==="image"&&i.sourcetype==="image"&&(this.source!==i.source||JSON.stringify(this.coordinates)!==JSON.stringify(i.coordinates))},t.needsNewSource=function(i){return this.sourceType!==i.sourcetype||JSON.stringify(this.source)!==JSON.stringify(i.source)||this.layerType!==i.type},t.needsNewLayer=function(i){return this.layerType!==i.type||this.below!==this.subplot.belowLookup["layout-"+this.index]},t.lookupBelow=function(){return this.subplot.belowLookup["layout-"+this.index]},t.updateImage=function(i){var n=this.subplot.map;n.getSource(this.idSource).updateImage({url:i.source,coordinates:i.coordinates});var s=this.findFollowingMapboxLayerId(this.lookupBelow());s!==null&&this.subplot.map.moveLayer(this.idLayer,s)},t.updateSource=function(i){var n=this.subplot.map;if(n.getSource(this.idSource)&&n.removeSource(this.idSource),this.sourceType=i.sourcetype,this.source=i.source,!!r(i)){var s=a(i);n.addSource(this.idSource,s)}},t.findFollowingMapboxLayerId=function(i){if(i==="traces")for(var n=this.subplot.getMapLayers(),s=0;s0){for(var s=0;s0}function o(i){var n={},s={};switch(i.type){case"circle":d.extendFlat(s,{"circle-radius":i.circle.radius,"circle-color":i.color,"circle-opacity":i.opacity});break;case"line":d.extendFlat(s,{"line-width":i.line.width,"line-color":i.color,"line-opacity":i.opacity,"line-dasharray":i.line.dash});break;case"fill":d.extendFlat(s,{"fill-color":i.color,"fill-outline-color":i.fill.outlinecolor,"fill-opacity":i.opacity});break;case"symbol":var c=i.symbol,f=A(c.textposition,c.iconsize);d.extendFlat(n,{"icon-image":c.icon+"-15","icon-size":c.iconsize/10,"text-field":c.text,"text-size":c.textfont.size,"text-anchor":f.anchor,"text-offset":f.offset,"symbol-placement":c.placement}),d.extendFlat(s,{"icon-color":i.color,"text-color":c.textfont.color,"text-opacity":i.opacity});break;case"raster":d.extendFlat(s,{"raster-fade-duration":0,"raster-opacity":i.opacity});break}return{layout:n,paint:s}}function a(i){var n=i.sourcetype,s=i.source,c={type:n},f;return n==="geojson"?f="data":n==="vector"?f=typeof s=="string"?"url":"tiles":n==="raster"?(f="tiles",c.tileSize=256):n==="image"&&(f="url",c.coordinates=i.coordinates),c[f]=s,i.sourceattribution&&(c.attribution=x(i.sourceattribution)),c}q.exports=function(n,s,c){var f=new e(n,s);return f.update(c),f}}}),gV=Ze({"src/plots/mapbox/mapbox.js"(Z,q){"use strict";var d=E6(),x=ca(),A=v0(),M=oo(),e=Wo(),t=Tp(),r=ef(),o=Jd(),a=o.drawMode,i=o.selectMode,n=Tf().prepSelect,s=Tf().clearOutline,c=Tf().clearSelectionsCache,f=Tf().selectOnClick,g=am(),v=mV();function T(y,b){this.id=b,this.gd=y;var p=y._fullLayout,u=y._context;this.container=p._glcontainer.node(),this.isStatic=u.staticPlot,this.uid=p._uid+"-"+this.id,this.div=null,this.xaxis=null,this.yaxis=null,this.createFramework(p),this.map=null,this.accessToken=null,this.styleObj=null,this.traceHash={},this.layerList=[],this.belowLookup={},this.dragging=!1,this.wheeling=!1}var l=T.prototype;l.plot=function(y,b,p){var u=this,m=b[u.id];u.map&&m.accesstoken!==u.accessToken&&(u.map.remove(),u.map=null,u.styleObj=null,u.traceHash={},u.layerList=[]);var h;u.map?h=new Promise(function(P,L){u.updateMap(y,b,P,L)}):h=new Promise(function(P,L){u.createMap(y,b,P,L)}),p.push(h)},l.createMap=function(y,b,p,u){var m=this,h=b[m.id],P=m.styleObj=w(h.style,b);m.accessToken=h.accesstoken;var L=h.bounds,z=L?[[L.west,L.south],[L.east,L.north]]:null,F=m.map=new d.Map({container:m.div,style:P.style,center:E(h.center),zoom:h.zoom,bearing:h.bearing,pitch:h.pitch,maxBounds:z,interactive:!m.isStatic,preserveDrawingBuffer:m.isStatic,doubleClickZoom:!1,boxZoom:!1,attributionControl:!1}).addControl(new d.AttributionControl({compact:!0}));F._canvas.style.left="0px",F._canvas.style.top="0px",m.rejectOnError(u),m.isStatic||m.initFx(y,b);var B=[];B.push(new Promise(function(O){F.once("load",O)})),B=B.concat(A.fetchTraceGeoData(y)),Promise.all(B).then(function(){m.fillBelowLookup(y,b),m.updateData(y),m.updateLayout(b),m.resolveOnRender(p)}).catch(u)},l.updateMap=function(y,b,p,u){var m=this,h=m.map,P=b[this.id];m.rejectOnError(u);var L=[],z=w(P.style,b);JSON.stringify(m.styleObj)!==JSON.stringify(z)&&(m.styleObj=z,h.setStyle(z.style),m.traceHash={},L.push(new Promise(function(F){h.once("styledata",F)}))),L=L.concat(A.fetchTraceGeoData(y)),Promise.all(L).then(function(){m.fillBelowLookup(y,b),m.updateData(y),m.updateLayout(b),m.resolveOnRender(p)}).catch(u)},l.fillBelowLookup=function(y,b){var p=b[this.id],u=p.layers,m,h,P=this.belowLookup={},L=!1;for(m=0;m1)for(m=0;m-1&&f(z.originalEvent,u,[p.xaxis],[p.yaxis],p.id,L),F.indexOf("event")>-1&&r.click(u,z.originalEvent)}}},l.updateFx=function(y){var b=this,p=b.map,u=b.gd;if(b.isStatic)return;function m(z){var F=b.map.unproject(z);return[F.lng,F.lat]}var h=y.dragmode,P;P=function(z,F){if(F.isRect){var B=z.range={};B[b.id]=[m([F.xmin,F.ymin]),m([F.xmax,F.ymax])]}else{var O=z.lassoPoints={};O[b.id]=F.map(m)}};var L=b.dragOptions;b.dragOptions=x.extendDeep(L||{},{dragmode:y.dragmode,element:b.div,gd:u,plotinfo:{id:b.id,domain:y[b.id].domain,xaxis:b.xaxis,yaxis:b.yaxis,fillRangeItems:P},xaxes:[b.xaxis],yaxes:[b.yaxis],subplot:b.id}),p.off("click",b.onClickInPanHandler),i(h)||a(h)?(p.dragPan.disable(),p.on("zoomstart",b.clearOutline),b.dragOptions.prepFn=function(z,F,B){n(z,F,B,b.dragOptions,h)},t.init(b.dragOptions)):(p.dragPan.enable(),p.off("zoomstart",b.clearOutline),b.div.onmousedown=null,b.div.ontouchstart=null,b.div.removeEventListener("touchstart",b.div._ontouchstart),b.onClickInPanHandler=b.onClickInPanFn(b.dragOptions),p.on("click",b.onClickInPanHandler))},l.updateFramework=function(y){var b=y[this.id].domain,p=y._size,u=this.div.style;u.width=p.w*(b.x[1]-b.x[0])+"px",u.height=p.h*(b.y[1]-b.y[0])+"px",u.left=p.l+b.x[0]*p.w+"px",u.top=p.t+(1-b.y[1])*p.h+"px",this.xaxis._offset=p.l+b.x[0]*p.w,this.xaxis._length=p.w*(b.x[1]-b.x[0]),this.yaxis._offset=p.t+(1-b.y[1])*p.h,this.yaxis._length=p.h*(b.y[1]-b.y[0])},l.updateLayers=function(y){var b=y[this.id],p=b.layers,u=this.layerList,m;if(p.length!==u.length){for(m=0;mB/2){var O=P.split("|").join("
");z.text(O).attr("data-unformatted",O).call(o.convertToTspans,v),F=r.bBox(z.node())}z.attr("transform",x(-3,-F.height+8)),L.insert("rect",".static-attribution").attr({x:-F.width-6,y:-F.height-3,width:F.width+6,height:F.height+3,fill:"rgba(255, 255, 255, 0.75)"});var I=1;F.width+6>B&&(I=B/(F.width+6));var N=[_.l+_.w*E.x[1],_.t+_.h*(1-E.y[0])];L.attr("transform",x(N[0],N[1])+A(I))}};function f(v,T){var l=v._fullLayout,_=v._context;if(_.mapboxAccessToken==="")return"";for(var w=[],S=[],E=!1,y=!1,b=0;b1&&d.warn(n.multipleTokensErrorMsg),w[0]):(S.length&&d.log(["Listed mapbox access token(s)",S.join(","),"but did not use a Mapbox map style, ignoring token(s)."].join(" ")),"")}function g(v){return typeof v=="string"&&(n.styleValuesMapbox.indexOf(v)!==-1||v.indexOf("mapbox://")===0||v.indexOf("stamen")===0)}Z.updateFx=function(v){for(var T=v._fullLayout,l=T._subplots[i],_=0;_=0;o--)t.removeLayer(r[o][1])},e.dispose=function(){var t=this.subplot.map;this._removeLayers(),t.removeSource(this.sourceId)},q.exports=function(r,o){var a=o[0].trace,i=new M(r,a.uid),n=i.sourceId,s=d(o),c=i.below=r.belowLookup["trace-"+a.uid];return r.map.addSource(n,{type:"geojson",data:s.geojson}),i._addLayers(s,c),o[0].trace._glTrace=i,i}}}),TV=Ze({"src/traces/choroplethmapbox/index.js"(Z,q){"use strict";var d=["*choroplethmapbox* trace is deprecated!","Please consider switching to the *choroplethmap* trace type and `map` subplots.","Learn more at: https://plotly.com/python/maplibre-migration/","as well as https://plotly.com/javascript/maplibre-migration/"].join(" ");q.exports={attributes:C6(),supplyDefaults:bV(),colorbar:a0(),calc:lT(),plot:wV(),hoverPoints:cT(),eventData:fT(),selectPoints:hT(),styleOnSelect:function(x,A){if(A){var M=A[0].trace;M._glTrace.updateOnSelect(A)}},getBelow:function(x,A){for(var M=A.getMapLayers(),e=M.length-2;e>=0;e--){var t=M[e].id;if(typeof t=="string"&&t.indexOf("water")===0){for(var r=e+1;r0?+v[f]:0),c.push({type:"Feature",geometry:{type:"Point",coordinates:w},properties:S})}}var y=M.extractOpts(a),b=y.reversescale?M.flipScale(y.colorscale):y.colorscale,p=b[0][1],u=A.opacity(p)<1?p:A.addOpacity(p,0),m=["interpolate",["linear"],["heatmap-density"],0,u];for(f=1;f=0;r--)e.removeLayer(t[r][1])},M.dispose=function(){var e=this.subplot.map;this._removeLayers(),e.removeSource(this.sourceId)},q.exports=function(t,r){var o=r[0].trace,a=new A(t,o.uid),i=a.sourceId,n=d(r),s=a.below=t.belowLookup["trace-"+o.uid];return t.map.addSource(i,{type:"geojson",data:n.geojson}),a._addLayers(n,s),a}}}),kV=Ze({"src/traces/densitymapbox/hover.js"(Z,q){"use strict";var d=Wo(),x=ST().hoverPoints,A=ST().getExtraText;q.exports=function(e,t,r){var o=x(e,t,r);if(o){var a=o[0],i=a.cd,n=i[0].trace,s=i[a.index];if(delete a.color,"z"in s){var c=a.subplot.mockAxis;a.z=s.z,a.zLabel=d.tickText(c,c.c2l(s.z),"hover").text}return a.extraText=A(n,s,i[0].t.labels),[a]}}}}),LV=Ze({"src/traces/densitymapbox/event_data.js"(Z,q){"use strict";q.exports=function(x,A){return x.lon=A.lon,x.lat=A.lat,x.z=A.z,x}}}),PV=Ze({"src/traces/densitymapbox/index.js"(Z,q){"use strict";var d=["*densitymapbox* trace is deprecated!","Please consider switching to the *densitymap* trace type and `map` subplots.","Learn more at: https://plotly.com/python/maplibre-migration/","as well as https://plotly.com/javascript/maplibre-migration/"].join(" ");q.exports={attributes:L6(),supplyDefaults:SV(),colorbar:a0(),formatLabels:S6(),calc:MV(),plot:CV(),hoverPoints:kV(),eventData:LV(),getBelow:function(x,A){for(var M=A.getMapLayers(),e=0;eESRI"},ortoInstaMaps:{type:"raster",tiles:["https://tilemaps.icgc.cat/mapfactory/wmts/orto_8_12/CAT3857/{z}/{x}/{y}.png"],tileSize:256,maxzoom:13},ortoICGC:{type:"raster",tiles:["https://geoserveis.icgc.cat/icc_mapesmultibase/noutm/wmts/orto/GRID3857/{z}/{x}/{y}.jpeg"],tileSize:256,minzoom:13.1,maxzoom:20},openmaptiles:{type:"vector",url:"https://geoserveis.icgc.cat/contextmaps/basemap.json"}},sprite:"https://geoserveis.icgc.cat/contextmaps/sprites/sprite@1",glyphs:"https://geoserveis.icgc.cat/contextmaps/glyphs/{fontstack}/{range}.pbf",layers:[{id:"background",type:"background",paint:{"background-color":"#F4F9F4"}},{id:"ortoEsri",type:"raster",source:"ortoEsri",maxzoom:16,layout:{visibility:"visible"}},{id:"ortoICGC",type:"raster",source:"ortoICGC",minzoom:13.1,maxzoom:19,layout:{visibility:"visible"}},{id:"ortoInstaMaps",type:"raster",source:"ortoInstaMaps",maxzoom:13,layout:{visibility:"visible"}},{id:"waterway_tunnel",type:"line",source:"openmaptiles","source-layer":"waterway",minzoom:14,filter:["all",["in","class","river","stream","canal"],["==","brunnel","tunnel"]],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.3,stops:[[13,.5],[20,6]]},"line-dasharray":[2,4]}},{id:"waterway-other",type:"line",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"waterway",filter:["!in","class","canal","river","stream"],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.3,stops:[[13,.5],[20,2]]}}},{id:"waterway-stream-canal",type:"line",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"waterway",filter:["all",["in","class","canal","stream"],["!=","brunnel","tunnel"]],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.3,stops:[[13,.5],[20,6]]}}},{id:"waterway-river",type:"line",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"waterway",filter:["all",["==","class","river"],["!=","brunnel","tunnel"]],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.2,stops:[[10,.8],[20,4]]},"line-opacity":.5}},{id:"water-offset",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"water",maxzoom:8,filter:["==","$type","Polygon"],layout:{visibility:"visible"},paint:{"fill-opacity":0,"fill-color":"#a0c8f0","fill-translate":{base:1,stops:[[6,[2,0]],[8,[0,0]]]}}},{id:"water",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"water",layout:{visibility:"visible"},paint:{"fill-color":"hsl(210, 67%, 85%)","fill-opacity":0}},{id:"water-pattern",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"water",layout:{visibility:"visible"},paint:{"fill-translate":[0,2.5],"fill-pattern":"wave","fill-opacity":1}},{id:"landcover-ice-shelf",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"landcover",filter:["==","subclass","ice_shelf"],layout:{visibility:"visible"},paint:{"fill-color":"#fff","fill-opacity":{base:1,stops:[[0,.9],[10,.3]]}}},{id:"tunnel-service-track-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","service","track"]],layout:{"line-join":"round"},paint:{"line-color":"#cfcdca","line-dasharray":[.5,.25],"line-width":{base:1.2,stops:[[15,1],[16,4],[20,11]]}}},{id:"tunnel-minor-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","minor"]],layout:{"line-join":"round"},paint:{"line-color":"#cfcdca","line-opacity":{stops:[[12,0],[12.5,1]]},"line-width":{base:1.2,stops:[[12,.5],[13,1],[14,4],[20,15]]}}},{id:"tunnel-secondary-tertiary-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[8,1.5],[20,17]]}}},{id:"tunnel-trunk-primary-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":.7}},{id:"tunnel-motorway-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","motorway"]],layout:{"line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-dasharray":[.5,.25],"line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":.5}},{id:"tunnel-path",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","brunnel","tunnel"],["==","class","path"]]],paint:{"line-color":"#cba","line-dasharray":[1.5,.75],"line-width":{base:1.2,stops:[[15,1.2],[20,4]]}}},{id:"tunnel-service-track",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","service","track"]],layout:{"line-join":"round"},paint:{"line-color":"#fff","line-width":{base:1.2,stops:[[15.5,0],[16,2],[20,7.5]]}}},{id:"tunnel-minor",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","minor_road"]],layout:{"line-join":"round"},paint:{"line-color":"#fff","line-opacity":1,"line-width":{base:1.2,stops:[[13.5,0],[14,2.5],[20,11.5]]}}},{id:"tunnel-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#fff4c6","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,10]]}}},{id:"tunnel-trunk-primary",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"#fff4c6","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"tunnel-motorway",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","motorway"]],layout:{"line-join":"round",visibility:"visible"},paint:{"line-color":"#ffdaa6","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"tunnel-railway",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","rail"]],paint:{"line-color":"#bbb","line-width":{base:1.4,stops:[[14,.4],[15,.75],[20,2]]},"line-dasharray":[2,2]}},{id:"ferry",type:"line",source:"openmaptiles","source-layer":"transportation",filter:["all",["in","class","ferry"]],layout:{"line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(108, 159, 182, 1)","line-width":1.1,"line-dasharray":[2,2]}},{id:"aeroway-taxiway-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:12,filter:["all",["in","class","taxiway"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(153, 153, 153, 1)","line-width":{base:1.5,stops:[[11,2],[17,12]]},"line-opacity":1}},{id:"aeroway-runway-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:12,filter:["all",["in","class","runway"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(153, 153, 153, 1)","line-width":{base:1.5,stops:[[11,5],[17,55]]},"line-opacity":1}},{id:"aeroway-taxiway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:4,filter:["all",["in","class","taxiway"],["==","$type","LineString"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(255, 255, 255, 1)","line-width":{base:1.5,stops:[[11,1],[17,10]]},"line-opacity":{base:1,stops:[[11,0],[12,1]]}}},{id:"aeroway-runway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:4,filter:["all",["in","class","runway"],["==","$type","LineString"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(255, 255, 255, 1)","line-width":{base:1.5,stops:[[11,4],[17,50]]},"line-opacity":{base:1,stops:[[11,0],[12,1]]}}},{id:"highway-motorway-link-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:12,filter:["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway_link"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"highway-link-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"highway-minor-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!=","brunnel","tunnel"],["in","class","minor","service","track"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#cfcdca","line-opacity":{stops:[[12,0],[12.5,0]]},"line-width":{base:1.2,stops:[[12,.5],[13,1],[14,4],[20,15]]}}},{id:"highway-secondary-tertiary-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":.5,"line-width":{base:1.2,stops:[[8,1.5],[20,17]]}}},{id:"highway-primary-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:5,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","primary"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":{stops:[[7,0],[8,.6]]},"line-width":{base:1.2,stops:[[7,0],[8,.6],[9,1.5],[20,22]]}}},{id:"highway-trunk-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:5,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","trunk"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":{stops:[[5,0],[6,.5]]},"line-width":{base:1.2,stops:[[5,0],[6,.6],[7,1.5],[20,22]]}}},{id:"highway-motorway-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:4,filter:["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-width":{base:1.2,stops:[[4,0],[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":{stops:[[4,0],[5,.5]]}}},{id:"highway-path",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["==","class","path"]]],paint:{"line-color":"#cba","line-dasharray":[1.5,.75],"line-width":{base:1.2,stops:[[15,1.2],[20,4]]}}},{id:"highway-motorway-link",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:12,filter:["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway_link"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"highway-link",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"highway-minor",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!=","brunnel","tunnel"],["in","class","minor","service","track"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#fff","line-opacity":.5,"line-width":{base:1.2,stops:[[13.5,0],[14,2.5],[20,11.5]]}}},{id:"highway-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[8,.5],[20,13]]},"line-opacity":.5}},{id:"highway-primary",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["in","class","primary"]]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[8.5,0],[9,.5],[20,18]]},"line-opacity":0}},{id:"highway-trunk",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["in","class","trunk"]]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"highway-motorway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:5,filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway"]]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"railway-transit",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","transit"],["!in","brunnel","tunnel"]]],layout:{visibility:"visible"},paint:{"line-color":"hsla(0, 0%, 73%, 0.77)","line-width":{base:1.4,stops:[[14,.4],[20,1]]}}},{id:"railway-transit-hatching",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","transit"],["!in","brunnel","tunnel"]]],layout:{visibility:"visible"},paint:{"line-color":"hsla(0, 0%, 73%, 0.68)","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,2],[20,6]]}}},{id:"railway-service",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","rail"],["has","service"]]],paint:{"line-color":"hsla(0, 0%, 73%, 0.77)","line-width":{base:1.4,stops:[[14,.4],[20,1]]}}},{id:"railway-service-hatching",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","rail"],["has","service"]]],layout:{visibility:"visible"},paint:{"line-color":"hsla(0, 0%, 73%, 0.68)","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,2],[20,6]]}}},{id:"railway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!has","service"],["!in","brunnel","bridge","tunnel"],["==","class","rail"]]],paint:{"line-color":"#bbb","line-width":{base:1.4,stops:[[14,.4],[15,.75],[20,2]]}}},{id:"railway-hatching",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!has","service"],["!in","brunnel","bridge","tunnel"],["==","class","rail"]]],paint:{"line-color":"#bbb","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,3],[20,8]]}}},{id:"bridge-motorway-link-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway_link"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"bridge-link-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"bridge-secondary-tertiary-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[8,1.5],[20,28]]}}},{id:"bridge-trunk-primary-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"hsl(28, 76%, 67%)","line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,26]]}}},{id:"bridge-motorway-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":.5}},{id:"bridge-path-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","brunnel","bridge"],["==","class","path"]]],paint:{"line-color":"#f8f4f0","line-width":{base:1.2,stops:[[15,1.2],[20,18]]}}},{id:"bridge-path",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","brunnel","bridge"],["==","class","path"]]],paint:{"line-color":"#cba","line-width":{base:1.2,stops:[[15,1.2],[20,4]]},"line-dasharray":[1.5,.75]}},{id:"bridge-motorway-link",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway_link"]],layout:{"line-join":"round"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"bridge-link",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-join":"round"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"bridge-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,20]]}}},{id:"bridge-trunk-primary",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]}}},{id:"bridge-motorway",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway"]],layout:{"line-join":"round"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"bridge-railway",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","rail"]],paint:{"line-color":"#bbb","line-width":{base:1.4,stops:[[14,.4],[15,.75],[20,2]]}}},{id:"bridge-railway-hatching",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","rail"]],paint:{"line-color":"#bbb","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,3],[20,8]]}}},{id:"cablecar",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["==","class","cable_car"],layout:{visibility:"visible","line-cap":"round"},paint:{"line-color":"hsl(0, 0%, 70%)","line-width":{base:1,stops:[[11,1],[19,2.5]]}}},{id:"cablecar-dash",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["==","class","cable_car"],layout:{visibility:"visible","line-cap":"round"},paint:{"line-color":"hsl(0, 0%, 70%)","line-width":{base:1,stops:[[11,3],[19,5.5]]},"line-dasharray":[2,3]}},{id:"boundary-land-level-4",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",[">=","admin_level",4],["<=","admin_level",8],["!=","maritime",1]],layout:{"line-join":"round"},paint:{"line-color":"#9e9cab","line-dasharray":[3,1,1,1],"line-width":{base:1.4,stops:[[4,.4],[5,1],[12,3]]},"line-opacity":.6}},{id:"boundary-land-level-2",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["==","admin_level",2],["!=","maritime",1],["!=","disputed",1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"hsl(248, 7%, 66%)","line-width":{base:1,stops:[[0,.6],[4,1.4],[5,2],[12,2]]}}},{id:"boundary-land-disputed",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["!=","maritime",1],["==","disputed",1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"hsl(248, 7%, 70%)","line-dasharray":[1,3],"line-width":{base:1,stops:[[0,.6],[4,1.4],[5,2],[12,8]]}}},{id:"boundary-water",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["in","admin_level",2,4],["==","maritime",1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(154, 189, 214, 1)","line-width":{base:1,stops:[[0,.6],[4,1],[5,1],[12,1]]},"line-opacity":{stops:[[6,0],[10,0]]}}},{id:"waterway-name",type:"symbol",source:"openmaptiles","source-layer":"waterway",minzoom:13,filter:["all",["==","$type","LineString"],["has","name"]],layout:{"text-font":["Noto Sans Italic"],"text-size":14,"text-field":"{name:latin} {name:nonlatin}","text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"line","text-letter-spacing":.2,"symbol-spacing":350},paint:{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{id:"water-name-lakeline",type:"symbol",source:"openmaptiles","source-layer":"water_name",filter:["==","$type","LineString"],layout:{"text-font":["Noto Sans Italic"],"text-size":14,"text-field":`{name:latin} {name:nonlatin}`,"text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"line","symbol-spacing":350,"text-letter-spacing":.2},paint:{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{id:"water-name-ocean",type:"symbol",source:"openmaptiles","source-layer":"water_name",filter:["all",["==","$type","Point"],["==","class","ocean"]],layout:{"text-font":["Noto Sans Italic"],"text-size":14,"text-field":"{name:latin}","text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"point","symbol-spacing":350,"text-letter-spacing":.2},paint:{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{id:"water-name-other",type:"symbol",source:"openmaptiles","source-layer":"water_name",filter:["all",["==","$type","Point"],["!in","class","ocean"]],layout:{"text-font":["Noto Sans Italic"],"text-size":{stops:[[0,10],[6,14]]},"text-field":`{name:latin} {name:nonlatin}`,"text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"point","symbol-spacing":350,"text-letter-spacing":.2,visibility:"visible"},paint:{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{id:"poi-level-3",type:"symbol",source:"openmaptiles","source-layer":"poi",minzoom:16,filter:["all",["==","$type","Point"],[">=","rank",25]],layout:{"text-padding":2,"text-font":["Noto Sans Regular"],"text-anchor":"top","icon-image":"{class}_11","text-field":`{name:latin} {name:nonlatin}`,"text-offset":[0,.6],"text-size":12,"text-max-width":9},paint:{"text-halo-blur":.5,"text-color":"#666","text-halo-width":1,"text-halo-color":"#ffffff"}},{id:"poi-level-2",type:"symbol",source:"openmaptiles","source-layer":"poi",minzoom:15,filter:["all",["==","$type","Point"],["<=","rank",24],[">=","rank",15]],layout:{"text-padding":2,"text-font":["Noto Sans Regular"],"text-anchor":"top","icon-image":"{class}_11","text-field":`{name:latin} {name:nonlatin}`,"text-offset":[0,.6],"text-size":12,"text-max-width":9},paint:{"text-halo-blur":.5,"text-color":"#666","text-halo-width":1,"text-halo-color":"#ffffff"}},{id:"poi-level-1",type:"symbol",source:"openmaptiles","source-layer":"poi",minzoom:14,filter:["all",["==","$type","Point"],["<=","rank",14],["has","name"]],layout:{"text-padding":2,"text-font":["Noto Sans Regular"],"text-anchor":"top","icon-image":"{class}_11","text-field":`{name:latin} {name:nonlatin}`,"text-offset":[0,.6],"text-size":11,"text-max-width":9},paint:{"text-halo-blur":.5,"text-color":"rgba(191, 228, 172, 1)","text-halo-width":1,"text-halo-color":"rgba(30, 29, 29, 1)"}},{id:"poi-railway",type:"symbol",source:"openmaptiles","source-layer":"poi",minzoom:13,filter:["all",["==","$type","Point"],["has","name"],["==","class","railway"],["==","subclass","station"]],layout:{"text-padding":2,"text-font":["Noto Sans Regular"],"text-anchor":"top","icon-image":"{class}_11","text-field":`{name:latin} {name:nonlatin}`,"text-offset":[0,.6],"text-size":12,"text-max-width":9,"icon-optional":!1,"icon-ignore-placement":!1,"icon-allow-overlap":!1,"text-ignore-placement":!1,"text-allow-overlap":!1,"text-optional":!0},paint:{"text-halo-blur":.5,"text-color":"#666","text-halo-width":1,"text-halo-color":"#ffffff"}},{id:"road_oneway",type:"symbol",source:"openmaptiles","source-layer":"transportation",minzoom:15,filter:["all",["==","oneway",1],["in","class","motorway","trunk","primary","secondary","tertiary","minor","service"]],layout:{"symbol-placement":"line","icon-image":"oneway","symbol-spacing":75,"icon-padding":2,"icon-rotation-alignment":"map","icon-rotate":90,"icon-size":{stops:[[15,.5],[19,1]]}},paint:{"icon-opacity":.5}},{id:"road_oneway_opposite",type:"symbol",source:"openmaptiles","source-layer":"transportation",minzoom:15,filter:["all",["==","oneway",-1],["in","class","motorway","trunk","primary","secondary","tertiary","minor","service"]],layout:{"symbol-placement":"line","icon-image":"oneway","symbol-spacing":75,"icon-padding":2,"icon-rotation-alignment":"map","icon-rotate":-90,"icon-size":{stops:[[15,.5],[19,1]]}},paint:{"icon-opacity":.5}},{id:"highway-name-path",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:15.5,filter:["==","class","path"],layout:{"text-size":{base:1,stops:[[13,12],[14,13]]},"text-font":["Noto Sans Regular"],"text-field":"{name:latin} {name:nonlatin}","symbol-placement":"line","text-rotation-alignment":"map"},paint:{"text-halo-color":"#f8f4f0","text-color":"hsl(30, 23%, 62%)","text-halo-width":.5}},{id:"highway-name-minor",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:15,filter:["all",["==","$type","LineString"],["in","class","minor","service","track"]],layout:{"text-size":{base:1,stops:[[13,12],[14,13]]},"text-font":["Noto Sans Regular"],"text-field":"{name:latin} {name:nonlatin}","symbol-placement":"line","text-rotation-alignment":"map"},paint:{"text-halo-blur":.5,"text-color":"#765","text-halo-width":1}},{id:"highway-name-major",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:12.2,filter:["in","class","primary","secondary","tertiary","trunk"],layout:{"text-size":{base:1,stops:[[13,12],[14,13]]},"text-font":["Noto Sans Regular"],"text-field":"{name:latin} {name:nonlatin}","symbol-placement":"line","text-rotation-alignment":"map"},paint:{"text-halo-blur":.5,"text-color":"#765","text-halo-width":1}},{id:"highway-shield",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:8,filter:["all",["<=","ref_length",6],["==","$type","LineString"],["!in","network","us-interstate","us-highway","us-state"]],layout:{"text-size":10,"icon-image":"road_{ref_length}","icon-rotation-alignment":"viewport","symbol-spacing":200,"text-font":["Noto Sans Regular"],"symbol-placement":{base:1,stops:[[10,"point"],[11,"line"]]},"text-rotation-alignment":"viewport","icon-size":1,"text-field":"{ref}"},paint:{"text-opacity":1,"text-color":"rgba(20, 19, 19, 1)","text-halo-color":"rgba(230, 221, 221, 0)","text-halo-width":2,"icon-color":"rgba(183, 18, 18, 1)","icon-opacity":.3,"icon-halo-color":"rgba(183, 55, 55, 0)"}},{id:"highway-shield-us-interstate",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:7,filter:["all",["<=","ref_length",6],["==","$type","LineString"],["in","network","us-interstate"]],layout:{"text-size":10,"icon-image":"{network}_{ref_length}","icon-rotation-alignment":"viewport","symbol-spacing":200,"text-font":["Noto Sans Regular"],"symbol-placement":{base:1,stops:[[7,"point"],[7,"line"],[8,"line"]]},"text-rotation-alignment":"viewport","icon-size":1,"text-field":"{ref}"},paint:{"text-color":"rgba(0, 0, 0, 1)"}},{id:"highway-shield-us-other",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:9,filter:["all",["<=","ref_length",6],["==","$type","LineString"],["in","network","us-highway","us-state"]],layout:{"text-size":10,"icon-image":"{network}_{ref_length}","icon-rotation-alignment":"viewport","symbol-spacing":200,"text-font":["Noto Sans Regular"],"symbol-placement":{base:1,stops:[[10,"point"],[11,"line"]]},"text-rotation-alignment":"viewport","icon-size":1,"text-field":"{ref}"},paint:{"text-color":"rgba(0, 0, 0, 1)"}},{id:"place-other",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",minzoom:12,filter:["!in","class","city","town","village","country","continent"],layout:{"text-letter-spacing":.1,"text-size":{base:1.2,stops:[[12,10],[15,14]]},"text-font":["Noto Sans Bold"],"text-field":`{name:latin} {name:nonlatin}`,"text-transform":"uppercase","text-max-width":9,visibility:"visible"},paint:{"text-color":"rgba(255,255,255,1)","text-halo-width":1.2,"text-halo-color":"rgba(57, 28, 28, 1)"}},{id:"place-village",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",minzoom:10,filter:["==","class","village"],layout:{"text-font":["Noto Sans Regular"],"text-size":{base:1.2,stops:[[10,12],[15,16]]},"text-field":`{name:latin} {name:nonlatin}`,"text-max-width":8,visibility:"visible"},paint:{"text-color":"rgba(255, 255, 255, 1)","text-halo-width":1.2,"text-halo-color":"rgba(10, 9, 9, 0.8)"}},{id:"place-town",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["==","class","town"],layout:{"text-font":["Noto Sans Regular"],"text-size":{base:1.2,stops:[[10,14],[15,24]]},"text-field":`{name:latin} {name:nonlatin}`,"text-max-width":8,visibility:"visible"},paint:{"text-color":"rgba(255, 255, 255, 1)","text-halo-width":1.2,"text-halo-color":"rgba(22, 22, 22, 0.8)"}},{id:"place-city",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["!=","capital",2],["==","class","city"]],layout:{"text-font":["Noto Sans Regular"],"text-size":{base:1.2,stops:[[7,14],[11,24]]},"text-field":`{name:latin} {name:nonlatin}`,"text-max-width":8,visibility:"visible"},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-width":1.2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-city-capital",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","capital",2],["==","class","city"]],layout:{"text-font":["Noto Sans Regular"],"text-size":{base:1.2,stops:[[7,14],[11,24]]},"text-field":`{name:latin} {name:nonlatin}`,"text-max-width":8,"icon-image":"star_11","text-offset":[.4,0],"icon-size":.8,"text-anchor":"left",visibility:"visible"},paint:{"text-color":"#333","text-halo-width":1.2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-other",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],[">=","rank",3],["!has","iso_a2"]],layout:{"text-font":["Noto Sans Italic"],"text-field":"{name:latin}","text-size":{stops:[[3,11],[7,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-3",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],[">=","rank",3],["has","iso_a2"]],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":{stops:[[3,11],[7,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-2",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],["==","rank",2],["has","iso_a2"]],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":{stops:[[2,11],[5,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-1",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],["==","rank",1],["has","iso_a2"]],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":{stops:[[1,11],[4,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-continent",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",maxzoom:1,filter:["==","class","continent"],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":14,"text-max-width":6.25,"text-transform":"uppercase",visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}}],id:"qebnlkra6"}}}),DV=Ze({"src/plots/map/styles/arcgis-sat.js"(Z,q){q.exports={version:8,name:"orto",metadata:{},center:[1.537786,41.837539],zoom:12,bearing:0,pitch:0,light:{anchor:"viewport",color:"white",intensity:.4,position:[1.15,45,30]},sources:{ortoEsri:{type:"raster",tiles:["https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}"],tileSize:256,maxzoom:18,attribution:"ESRI © ESRI"},ortoInstaMaps:{type:"raster",tiles:["https://tilemaps.icgc.cat/mapfactory/wmts/orto_8_12/CAT3857/{z}/{x}/{y}.png"],tileSize:256,maxzoom:13},ortoICGC:{type:"raster",tiles:["https://geoserveis.icgc.cat/icc_mapesmultibase/noutm/wmts/orto/GRID3857/{z}/{x}/{y}.jpeg"],tileSize:256,minzoom:13.1,maxzoom:20},openmaptiles:{type:"vector",url:"https://geoserveis.icgc.cat/contextmaps/basemap.json"}},sprite:"https://geoserveis.icgc.cat/contextmaps/sprites/sprite@1",glyphs:"https://geoserveis.icgc.cat/contextmaps/glyphs/{fontstack}/{range}.pbf",layers:[{id:"background",type:"background",paint:{"background-color":"#F4F9F4"}},{id:"ortoEsri",type:"raster",source:"ortoEsri",maxzoom:16,layout:{visibility:"visible"}},{id:"ortoICGC",type:"raster",source:"ortoICGC",minzoom:13.1,maxzoom:19,layout:{visibility:"visible"}},{id:"ortoInstaMaps",type:"raster",source:"ortoInstaMaps",maxzoom:13,layout:{visibility:"visible"}}]}}}),_0=Ze({"src/plots/map/constants.js"(Z,q){"use strict";var d=Km(),x=RV(),A=DV(),M='\xA9 OpenStreetMap contributors',e="https://basemaps.cartocdn.com/gl/positron-gl-style/style.json",t="https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json",r="https://basemaps.cartocdn.com/gl/voyager-gl-style/style.json",o="https://basemaps.cartocdn.com/gl/positron-nolabels-gl-style/style.json",a="https://basemaps.cartocdn.com/gl/dark-matter-nolabels-gl-style/style.json",i="https://basemaps.cartocdn.com/gl/voyager-nolabels-gl-style/style.json",n={basic:r,streets:r,outdoors:r,light:e,dark:t,satellite:A,"satellite-streets":x,"open-street-map":{id:"osm",version:8,sources:{"plotly-osm-tiles":{type:"raster",attribution:M,tiles:["https://tile.openstreetmap.org/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-osm-tiles",type:"raster",source:"plotly-osm-tiles",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"white-bg":{id:"white-bg",version:8,sources:{},layers:[{id:"white-bg",type:"background",paint:{"background-color":"#FFFFFF"},minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"carto-positron":e,"carto-darkmatter":t,"carto-voyager":r,"carto-positron-nolabels":o,"carto-darkmatter-nolabels":a,"carto-voyager-nolabels":i},s=d(n);q.exports={styleValueDflt:"basic",stylesMap:n,styleValuesMap:s,traceLayerPrefix:"plotly-trace-layer-",layoutLayerPrefix:"plotly-layout-layer-",missingStyleErrorMsg:["No valid maplibre style found, please set `map.style` to one of:",s.join(", "),"or use a tile service."].join(` `),mapOnErrorMsg:"Map error."}}}),Ex=Ze({"src/plots/map/layout_attributes.js"(Z,q){"use strict";var d=ca(),x=Yn().defaultLine,A=bc().attributes,M=tc(),e=tf().textposition,t=pc().overrideAll,r=Dl().templatedArray,o=_0(),a=M({noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0});a.family.dflt="Open Sans Regular, Arial Unicode MS Regular";var i=q.exports=t({_arrayAttrRegexps:[d.counterRegex("map",".layers",!0)],domain:A({name:"map"}),style:{valType:"any",values:o.styleValuesMap,dflt:o.styleValueDflt},center:{lon:{valType:"number",dflt:0},lat:{valType:"number",dflt:0}},zoom:{valType:"number",dflt:1},bearing:{valType:"number",dflt:0},pitch:{valType:"number",dflt:0},bounds:{west:{valType:"number"},east:{valType:"number"},south:{valType:"number"},north:{valType:"number"}},layers:r("layer",{visible:{valType:"boolean",dflt:!0},sourcetype:{valType:"enumerated",values:["geojson","vector","raster","image"],dflt:"geojson"},source:{valType:"any"},sourcelayer:{valType:"string",dflt:""},sourceattribution:{valType:"string"},type:{valType:"enumerated",values:["circle","line","fill","symbol","raster"],dflt:"circle"},coordinates:{valType:"any"},below:{valType:"string"},color:{valType:"color",dflt:x},opacity:{valType:"number",min:0,max:1,dflt:1},minzoom:{valType:"number",min:0,max:24,dflt:0},maxzoom:{valType:"number",min:0,max:24,dflt:24},circle:{radius:{valType:"number",dflt:15}},line:{width:{valType:"number",dflt:2},dash:{valType:"data_array"}},fill:{outlinecolor:{valType:"color",dflt:x}},symbol:{icon:{valType:"string",dflt:"marker"},iconsize:{valType:"number",dflt:10},text:{valType:"string",dflt:""},placement:{valType:"enumerated",values:["point","line","line-center"],dflt:"point"},textfont:a,textposition:d.extendFlat({},e,{arrayOk:!1})}})},"plot","from-root");i.uirevision={valType:"any",editType:"none"}}}),ET=Ze({"src/traces/scattermap/attributes.js"(Z,q){"use strict";var d=Cs().hovertemplateAttrs,x=Cs().texttemplateAttrs,A=$d(),M=dg(),e=tf(),t=Ex(),r=eu(),o=Mu(),a=rs().extendFlat,i=pc().overrideAll,n=Ex(),s=M.line,c=M.marker;q.exports=i({lon:M.lon,lat:M.lat,cluster:{enabled:{valType:"boolean"},maxzoom:a({},n.layers.maxzoom,{}),step:{valType:"number",arrayOk:!0,dflt:-1,min:-1},size:{valType:"number",arrayOk:!0,dflt:20,min:0},color:{valType:"color",arrayOk:!0},opacity:a({},c.opacity,{dflt:1})},mode:a({},e.mode,{dflt:"markers"}),text:a({},e.text,{}),texttemplate:x({editType:"plot"},{keys:["lat","lon","text"]}),hovertext:a({},e.hovertext,{}),line:{color:s.color,width:s.width},connectgaps:e.connectgaps,marker:a({symbol:{valType:"string",dflt:"circle",arrayOk:!0},angle:{valType:"number",dflt:"auto",arrayOk:!0},allowoverlap:{valType:"boolean",dflt:!1},opacity:c.opacity,size:c.size,sizeref:c.sizeref,sizemin:c.sizemin,sizemode:c.sizemode},o("marker")),fill:M.fill,fillcolor:A(),textfont:t.layers.symbol.textfont,textposition:t.layers.symbol.textposition,below:{valType:"string"},selected:{marker:e.selected.marker},unselected:{marker:e.unselected.marker},hoverinfo:a({},r.hoverinfo,{flags:["lon","lat","text","name"]}),hovertemplate:d()},"calc","nested")}}),P6=Ze({"src/traces/scattermap/constants.js"(Z,q){"use strict";var d=["Metropolis Black Italic","Metropolis Black","Metropolis Bold Italic","Metropolis Bold","Metropolis Extra Bold Italic","Metropolis Extra Bold","Metropolis Extra Light Italic","Metropolis Extra Light","Metropolis Light Italic","Metropolis Light","Metropolis Medium Italic","Metropolis Medium","Metropolis Regular Italic","Metropolis Regular","Metropolis Semi Bold Italic","Metropolis Semi Bold","Metropolis Thin Italic","Metropolis Thin","Open Sans Bold Italic","Open Sans Bold","Open Sans Extrabold Italic","Open Sans Extrabold","Open Sans Italic","Open Sans Light Italic","Open Sans Light","Open Sans Regular","Open Sans Semibold Italic","Open Sans Semibold","Klokantech Noto Sans Bold","Klokantech Noto Sans CJK Bold","Klokantech Noto Sans CJK Regular","Klokantech Noto Sans Italic","Klokantech Noto Sans Regular"];q.exports={isSupportedFont:function(x){return d.indexOf(x)!==-1}}}}),zV=Ze({"src/traces/scattermap/defaults.js"(Z,q){"use strict";var d=ca(),x=Fu(),A=md(),M=Dd(),e=zd(),t=ev(),r=ET(),o=P6().isSupportedFont;q.exports=function(n,s,c,f){function g(m,h){return d.coerce(n,s,r,m,h)}function v(m,h){return d.coerce2(n,s,r,m,h)}var T=a(n,s,g);if(!T){s.visible=!1;return}if(g("text"),g("texttemplate"),g("hovertext"),g("hovertemplate"),g("mode"),g("below"),x.hasMarkers(s)){A(n,s,c,f,g,{noLine:!0,noAngle:!0}),g("marker.allowoverlap"),g("marker.angle");var l=s.marker;l.symbol!=="circle"&&(d.isArrayOrTypedArray(l.size)&&(l.size=l.size[0]),d.isArrayOrTypedArray(l.color)&&(l.color=l.color[0]))}x.hasLines(s)&&(M(n,s,c,f,g,{noDash:!0}),g("connectgaps"));var _=v("cluster.maxzoom"),w=v("cluster.step"),S=v("cluster.color",s.marker&&s.marker.color||c),E=v("cluster.size"),y=v("cluster.opacity"),b=_!==!1||w!==!1||S!==!1||E!==!1||y!==!1,p=g("cluster.enabled",b);if(p||x.hasText(s)){var u=f.font.family;e(n,s,f,g,{noSelect:!0,noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,font:{family:o(u)?u:"Open Sans Regular",weight:f.font.weight,style:f.font.style,size:f.font.size,color:f.font.color}})}g("fill"),s.fill!=="none"&&t(n,s,c,g),d.coerceSelectionMarkerOpacity(s,g)};function a(i,n,s){var c=s("lon")||[],f=s("lat")||[],g=Math.min(c.length,f.length);return n._length=g,g}}}),I6=Ze({"src/traces/scattermap/format_labels.js"(Z,q){"use strict";var d=Wo();q.exports=function(A,M,e){var t={},r=e[M.subplot]._subplot,o=r.mockAxis,a=A.lonlat;return t.lonLabel=d.tickText(o,o.c2l(a[0]),!0).text,t.latLabel=d.tickText(o,o.c2l(a[1]),!0).text,t}}}),R6=Ze({"src/plots/map/convert_text_opts.js"(Z,q){"use strict";var d=ca();q.exports=function(A,M){var e=A.split(" "),t=e[0],r=e[1],o=d.isArrayOrTypedArray(M)?d.mean(M):M,a=.5+o/100,i=1.5+o/100,n=["",""],s=[0,0];switch(t){case"top":n[0]="top",s[1]=-i;break;case"bottom":n[0]="bottom",s[1]=i;break}switch(r){case"left":n[1]="right",s[0]=-a;break;case"right":n[1]="left",s[0]=a;break}var c;return n[0]&&n[1]?c=n.join("-"):n[0]?c=n[0]:n[1]?c=n[1]:c="center",{anchor:c,offset:s}}}}),FV=Ze({"src/traces/scattermap/convert.js"(Z,q){"use strict";var d=ns(),x=ca(),A=qs().BADNUM,M=d0(),e=rc(),t=as(),r=r1(),o=Fu(),a=P6().isSupportedFont,i=R6(),n=Qp().appendArrayPointValue,s=fu().NEWLINES,c=fu().BR_TAG_ALL;q.exports=function(y,b){var p=b[0].trace,u=p.visible===!0&&p._length!==0,m=p.fill!=="none",h=o.hasLines(p),P=o.hasMarkers(p),L=o.hasText(p),z=P&&p.marker.symbol==="circle",F=P&&p.marker.symbol!=="circle",B=p.cluster&&p.cluster.enabled,O=f("fill"),I=f("line"),N=f("circle"),U=f("symbol"),W={fill:O,line:I,circle:N,symbol:U};if(!u)return W;var Q;if((m||h)&&(Q=M.calcTraceToLineCoords(b)),m&&(O.geojson=M.makePolygon(Q),O.layout.visibility="visible",x.extendFlat(O.paint,{"fill-color":p.fillcolor})),h&&(I.geojson=M.makeLine(Q),I.layout.visibility="visible",x.extendFlat(I.paint,{"line-width":p.line.width,"line-color":p.line.color,"line-opacity":p.opacity})),z){var ue=g(b);N.geojson=ue.geojson,N.layout.visibility="visible",B&&(N.filter=["!",["has","point_count"]],W.cluster={type:"circle",filter:["has","point_count"],layout:{visibility:"visible"},paint:{"circle-color":w(p.cluster.color,p.cluster.step),"circle-radius":w(p.cluster.size,p.cluster.step),"circle-opacity":w(p.cluster.opacity,p.cluster.step)}},W.clusterCount={type:"symbol",filter:["has","point_count"],paint:{},layout:{"text-field":"{point_count_abbreviated}","text-font":S(p),"text-size":12}}),x.extendFlat(N.paint,{"circle-color":ue.mcc,"circle-radius":ue.mrc,"circle-opacity":ue.mo})}if(z&&B&&(N.filter=["!",["has","point_count"]]),(F||L)&&(U.geojson=v(b,y),x.extendFlat(U.layout,{visibility:"visible","icon-image":"{symbol}-15","text-field":"{text}"}),F&&(x.extendFlat(U.layout,{"icon-size":p.marker.size/10}),"angle"in p.marker&&p.marker.angle!=="auto"&&x.extendFlat(U.layout,{"icon-rotate":{type:"identity",property:"angle"},"icon-rotation-alignment":"map"}),U.layout["icon-allow-overlap"]=p.marker.allowoverlap,x.extendFlat(U.paint,{"icon-opacity":p.opacity*p.marker.opacity,"icon-color":p.marker.color})),L)){var le=(p.marker||{}).size,he=i(p.textposition,le);x.extendFlat(U.layout,{"text-size":p.textfont.size,"text-anchor":he.anchor,"text-offset":he.offset,"text-font":S(p)}),x.extendFlat(U.paint,{"text-color":p.textfont.color,"text-opacity":p.opacity})}return W};function f(E){return{type:E,geojson:M.makeBlank(),layout:{visibility:"none"},filter:null,paint:{}}}function g(E){var y=E[0].trace,b=y.marker,p=y.selectedpoints,u=x.isArrayOrTypedArray(b.color),m=x.isArrayOrTypedArray(b.size),h=x.isArrayOrTypedArray(b.opacity),P;function L(le){return y.opacity*le}function z(le){return le/2}var F;u&&(e.hasColorscale(y,"marker")?F=e.makeColorScaleFuncFromTrace(b):F=x.identity);var B;m&&(B=r(y));var O;h&&(O=function(le){var he=d(le)?+x.constrain(le,0,1):0;return L(he)});var I=[];for(P=0;P850?P+=" Black":u>750?P+=" Extra Bold":u>650?P+=" Bold":u>550?P+=" Semi Bold":u>450?P+=" Medium":u>350?P+=" Regular":u>250?P+=" Light":u>150?P+=" Extra Light":P+=" Thin"):m.slice(0,2).join(" ")==="Open Sans"?(P="Open Sans",u>750?P+=" Extrabold":u>650?P+=" Bold":u>550?P+=" Semibold":u>350?P+=" Regular":P+=" Light"):m.slice(0,3).join(" ")==="Klokantech Noto Sans"&&(P="Klokantech Noto Sans",m[3]==="CJK"&&(P+=" CJK"),P+=u>500?" Bold":" Regular")),h&&(P+=" Italic"),P==="Open Sans Regular Italic"?P="Open Sans Italic":P==="Open Sans Regular Bold"?P="Open Sans Bold":P==="Open Sans Regular Bold Italic"?P="Open Sans Bold Italic":P==="Klokantech Noto Sans Regular Italic"&&(P="Klokantech Noto Sans Italic"),a(P)||(P=b);var L=P.split(", ");return L}}}),OV=Ze({"src/traces/scattermap/plot.js"(Z,q){"use strict";var d=ca(),x=FV(),A=_0().traceLayerPrefix,M={cluster:["cluster","clusterCount","circle"],nonCluster:["fill","line","circle","symbol"]};function e(r,o,a,i){this.type="scattermap",this.subplot=r,this.uid=o,this.clusterEnabled=a,this.isHidden=i,this.sourceIds={fill:"source-"+o+"-fill",line:"source-"+o+"-line",circle:"source-"+o+"-circle",symbol:"source-"+o+"-symbol",cluster:"source-"+o+"-circle",clusterCount:"source-"+o+"-circle"},this.layerIds={fill:A+o+"-fill",line:A+o+"-line",circle:A+o+"-circle",symbol:A+o+"-symbol",cluster:A+o+"-cluster",clusterCount:A+o+"-cluster-count"},this.below=null}var t=e.prototype;t.addSource=function(r,o,a){var i={type:"geojson",data:o.geojson};a&&a.enabled&&d.extendFlat(i,{cluster:!0,clusterMaxZoom:a.maxzoom});var n=this.subplot.map.getSource(this.sourceIds[r]);n?n.setData(o.geojson):this.subplot.map.addSource(this.sourceIds[r],i)},t.setSourceData=function(r,o){this.subplot.map.getSource(this.sourceIds[r]).setData(o.geojson)},t.addLayer=function(r,o,a){var i={type:o.type,id:this.layerIds[r],source:this.sourceIds[r],layout:o.layout,paint:o.paint};o.filter&&(i.filter=o.filter);for(var n=this.layerIds[r],s,c=this.subplot.getMapLayers(),f=0;f=0;h--){var P=m[h];n.removeLayer(v.layerIds[P])}u||n.removeSource(v.sourceIds.circle)}function _(u){for(var m=M.nonCluster,h=0;h=0;h--){var P=m[h];n.removeLayer(v.layerIds[P]),u||n.removeSource(v.sourceIds[P])}}function S(u){g?l(u):w(u)}function E(u){f?T(u):_(u)}function y(){for(var u=f?M.cluster:M.nonCluster,m=0;m=0;i--){var n=a[i];o.removeLayer(this.layerIds[n]),o.removeSource(this.sourceIds[n])}},q.exports=function(o,a){var i=a[0].trace,n=i.cluster&&i.cluster.enabled,s=i.visible!==!0,c=new e(o,i.uid,n,s),f=x(o.gd,a),g=c.below=o.belowLookup["trace-"+i.uid],v,T,l;if(n)for(c.addSource("circle",f.circle,i.cluster),v=0;v=0?Math.floor((i+180)/360):Math.ceil((i-180)/360),E=S*360,y=i-E;function b(B){var O=B.lonlat;if(O[0]===e||_&&T.indexOf(B.i+1)===-1)return 1/0;var I=x.modHalf(O[0],360),N=O[1],U=v.project([I,N]),W=U.x-f.c2p([y,N]),Q=U.y-g.c2p([I,n]),ue=Math.max(3,B.mrc||0);return Math.max(Math.sqrt(W*W+Q*Q)-ue,1-3/ue)}if(d.getClosest(s,b,a),a.index!==!1){var p=s[a.index],u=p.lonlat,m=[x.modHalf(u[0],360)+E,u[1]],h=f.c2p(m),P=g.c2p(m),L=p.mrc||1;a.x0=h-L,a.x1=h+L,a.y0=P-L,a.y1=P+L;var z={};z[c.subplot]={_subplot:v};var F=c._module.formatLabels(p,c,z);return a.lonLabel=F.lonLabel,a.latLabel=F.latLabel,a.color=A(c,p),a.extraText=o(c,p,s[0].t.labels),a.hovertemplate=c.hovertemplate,[a]}}function o(a,i,n){if(a.hovertemplate)return;var s=i.hi||a.hoverinfo,c=s.split("+"),f=c.indexOf("all")!==-1,g=c.indexOf("lon")!==-1,v=c.indexOf("lat")!==-1,T=i.lonlat,l=[];function _(w){return w+"\xB0"}return f||g&&v?l.push("("+_(T[1])+", "+_(T[0])+")"):g?l.push(n.lon+_(T[0])):v&&l.push(n.lat+_(T[1])),(f||c.indexOf("text")!==-1)&&M(i,a,l),l.join("
")}q.exports={hoverPoints:r,getExtraText:o}}}),BV=Ze({"src/traces/scattermap/event_data.js"(Z,q){"use strict";q.exports=function(x,A){return x.lon=A.lon,x.lat=A.lat,x}}}),NV=Ze({"src/traces/scattermap/select.js"(Z,q){"use strict";var d=ca(),x=Fu(),A=qs().BADNUM;q.exports=function(e,t){var r=e.cd,o=e.xaxis,a=e.yaxis,i=[],n=r[0].trace,s;if(!x.hasMarkers(n))return[];if(t===!1)for(s=0;s1)return 1;for(var K=H,pe=0;pe<8;pe++){var ke=this.sampleCurveX(K)-H;if(Math.abs(ke)ke?We=K:ft=K,K=.5*(ft-We)+We;return K},solve:function(H,D){return this.sampleCurveY(this.solveCurveX(H,D))}};var c=r(n);let f,g;function v(){return f==null&&(f=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),f}function T(){if(g==null&&(g=!1,v())){let D=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(D){for(let pe=0;pe<5*5;pe++){let ke=4*pe;D.fillStyle=`rgb(${ke},${ke+1},${ke+2})`,D.fillRect(pe%5,Math.floor(pe/5),1,1)}let K=D.getImageData(0,0,5,5).data;for(let pe=0;pe<5*5*4;pe++)if(pe%4!=3&&K[pe]!==pe){g=!0;break}}}return g||!1}function l(H,D,K,pe){let ke=new c(H,D,K,pe);return je=>ke.solve(je)}let _=l(.25,.1,.25,1);function w(H,D,K){return Math.min(K,Math.max(D,H))}function S(H,D,K){let pe=K-D,ke=((H-D)%pe+pe)%pe+D;return ke===D?K:ke}function E(H,...D){for(let K of D)for(let pe in K)H[pe]=K[pe];return H}let y=1;function b(H,D,K){let pe={};for(let ke in H)pe[ke]=D.call(this,H[ke],ke,H);return pe}function p(H,D,K){let pe={};for(let ke in H)D.call(this,H[ke],ke,H)&&(pe[ke]=H[ke]);return pe}function u(H){return Array.isArray(H)?H.map(u):typeof H=="object"&&H?b(H,u):H}let m={};function h(H){m[H]||(typeof console<"u"&&console.warn(H),m[H]=!0)}function P(H,D,K){return(K.y-H.y)*(D.x-H.x)>(D.y-H.y)*(K.x-H.x)}function L(H){return typeof WorkerGlobalScope<"u"&&H!==void 0&&H instanceof WorkerGlobalScope}let z=null;function F(H){return typeof ImageBitmap<"u"&&H instanceof ImageBitmap}let B="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function O(H,D,K,pe,ke){return t(this,void 0,void 0,function*(){if(typeof VideoFrame>"u")throw new Error("VideoFrame not supported");let je=new VideoFrame(H,{timestamp:0});try{let We=je?.format;if(!We||!We.startsWith("BGR")&&!We.startsWith("RGB"))throw new Error(`Unrecognized format ${We}`);let ft=We.startsWith("BGR"),Mt=new Uint8ClampedArray(pe*ke*4);if(yield je.copyTo(Mt,function(Ut,nr,Mr,zr,Hr){let oa=4*Math.max(-nr,0),va=(Math.max(0,Mr)-Mr)*zr*4+oa,Ga=4*zr,Qa=Math.max(0,nr),Yi=Math.max(0,Mr);return{rect:{x:Qa,y:Yi,width:Math.min(Ut.width,nr+zr)-Qa,height:Math.min(Ut.height,Mr+Hr)-Yi},layout:[{offset:va,stride:Ga}]}}(H,D,K,pe,ke)),ft)for(let Ut=0;UtL(self)?self.worker&&self.worker.referrer:(window.location.protocol==="blob:"?window.parent:window).location.href,$=function(H,D){if(/:\/\//.test(H.url)&&!/^https?:|^file:/.test(H.url)){let pe=ue(H.url);if(pe)return pe(H,D);if(L(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:H,targetMapId:le},D)}if(!(/^file:/.test(K=H.url)||/^file:/.test(G())&&!/^\w+:/.test(K))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return function(pe,ke){return t(this,void 0,void 0,function*(){let je=new Request(pe.url,{method:pe.method||"GET",body:pe.body,credentials:pe.credentials,headers:pe.headers,cache:pe.cache,referrer:G(),signal:ke.signal});pe.type!=="json"||je.headers.has("Accept")||je.headers.set("Accept","application/json");let We=yield fetch(je);if(!We.ok){let Ut=yield We.blob();throw new he(We.status,We.statusText,pe.url,Ut)}let ft;ft=pe.type==="arrayBuffer"||pe.type==="image"?We.arrayBuffer():pe.type==="json"?We.json():We.text();let Mt=yield ft;if(ke.signal.aborted)throw W();return{data:Mt,cacheControl:We.headers.get("Cache-Control"),expires:We.headers.get("Expires")}})}(H,D);if(L(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:H,mustQueue:!0,targetMapId:le},D)}var K;return function(pe,ke){return new Promise((je,We)=>{var ft;let Mt=new XMLHttpRequest;Mt.open(pe.method||"GET",pe.url,!0),pe.type!=="arrayBuffer"&&pe.type!=="image"||(Mt.responseType="arraybuffer");for(let Ut in pe.headers)Mt.setRequestHeader(Ut,pe.headers[Ut]);pe.type==="json"&&(Mt.responseType="text",!((ft=pe.headers)===null||ft===void 0)&&ft.Accept||Mt.setRequestHeader("Accept","application/json")),Mt.withCredentials=pe.credentials==="include",Mt.onerror=()=>{We(new Error(Mt.statusText))},Mt.onload=()=>{if(!ke.signal.aborted)if((Mt.status>=200&&Mt.status<300||Mt.status===0)&&Mt.response!==null){let Ut=Mt.response;if(pe.type==="json")try{Ut=JSON.parse(Mt.response)}catch(nr){return void We(nr)}je({data:Ut,cacheControl:Mt.getResponseHeader("Cache-Control"),expires:Mt.getResponseHeader("Expires")})}else{let Ut=new Blob([Mt.response],{type:Mt.getResponseHeader("Content-Type")});We(new he(Mt.status,Mt.statusText,pe.url,Ut))}},ke.signal.addEventListener("abort",()=>{Mt.abort(),We(W())}),Mt.send(pe.body)})}(H,D)};function J(H){if(!H||H.indexOf("://")<=0||H.indexOf("data:image/")===0||H.indexOf("blob:")===0)return!0;let D=new URL(H),K=window.location;return D.protocol===K.protocol&&D.host===K.host}function X(H,D,K){K[H]&&K[H].indexOf(D)!==-1||(K[H]=K[H]||[],K[H].push(D))}function oe(H,D,K){if(K&&K[H]){let pe=K[H].indexOf(D);pe!==-1&&K[H].splice(pe,1)}}class ie{constructor(D,K={}){E(this,K),this.type=D}}class j extends ie{constructor(D,K={}){super("error",E({error:D},K))}}class ee{on(D,K){return this._listeners=this._listeners||{},X(D,K,this._listeners),this}off(D,K){return oe(D,K,this._listeners),oe(D,K,this._oneTimeListeners),this}once(D,K){return K?(this._oneTimeListeners=this._oneTimeListeners||{},X(D,K,this._oneTimeListeners),this):new Promise(pe=>this.once(D,pe))}fire(D,K){typeof D=="string"&&(D=new ie(D,K||{}));let pe=D.type;if(this.listens(pe)){D.target=this;let ke=this._listeners&&this._listeners[pe]?this._listeners[pe].slice():[];for(let ft of ke)ft.call(this,D);let je=this._oneTimeListeners&&this._oneTimeListeners[pe]?this._oneTimeListeners[pe].slice():[];for(let ft of je)oe(pe,ft,this._oneTimeListeners),ft.call(this,D);let We=this._eventedParent;We&&(E(D,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),We.fire(D))}else D instanceof j&&console.error(D.error);return this}listens(D){return this._listeners&&this._listeners[D]&&this._listeners[D].length>0||this._oneTimeListeners&&this._oneTimeListeners[D]&&this._oneTimeListeners[D].length>0||this._eventedParent&&this._eventedParent.listens(D)}setEventedParent(D,K){return this._eventedParent=D,this._eventedParentData=K,this}}var re={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sky:{type:"sky"},projection:{type:"projection"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},sky:{"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-ground-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-fog-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"sky-horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"atmosphere-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},projection:{type:{type:"enum",default:"mercator",values:{mercator:{},globe:{}}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}};let ce=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function be(H,D){let K={};for(let pe in H)pe!=="ref"&&(K[pe]=H[pe]);return ce.forEach(pe=>{pe in D&&(K[pe]=D[pe])}),K}function Ae(H,D){if(Array.isArray(H)){if(!Array.isArray(D)||H.length!==D.length)return!1;for(let K=0;K`:H.itemType.kind==="value"?"array":`array<${D}>`}return H.kind}let Ue=[st,Qe,Lt,kt,Vt,jr,Zt,Be(Sr),wr,Ir,bt];function Me(H,D){if(D.kind==="error")return null;if(H.kind==="array"){if(D.kind==="array"&&(D.N===0&&D.itemType.kind==="value"||!Me(H.itemType,D.itemType))&&(typeof H.N!="number"||H.N===D.N))return null}else{if(H.kind===D.kind)return null;if(H.kind==="value"){for(let K of Ue)if(!Me(K,D))return null}}return`Expected ${Ke(H)} but found ${Ke(D)} instead.`}function qe(H,D){return D.some(K=>K.kind===H.kind)}function Ce(H,D){return D.some(K=>K==="null"?H===null:K==="array"?Array.isArray(H):K==="object"?H&&!Array.isArray(H)&&typeof H=="object":K===typeof H)}function Te(H,D){return H.kind==="array"&&D.kind==="array"?H.itemType.kind===D.itemType.kind&&typeof H.N=="number":H.kind===D.kind}let Pe=.96422,at=.82521,yt=4/29,Tt=6/29,Ot=3*Tt*Tt,Gt=Tt*Tt*Tt,rr=Math.PI/180,Qt=180/Math.PI;function Tr(H){return(H%=360)<0&&(H+=360),H}function la([H,D,K,pe]){let ke,je,We=Ba((.2225045*(H=Ua(H))+.7168786*(D=Ua(D))+.0606169*(K=Ua(K)))/1);H===D&&D===K?ke=je=We:(ke=Ba((.4360747*H+.3850649*D+.1430804*K)/Pe),je=Ba((.0139322*H+.0971045*D+.7141733*K)/at));let ft=116*We-16;return[ft<0?0:ft,500*(ke-We),200*(We-je),pe]}function Ua(H){return H<=.04045?H/12.92:Math.pow((H+.055)/1.055,2.4)}function Ba(H){return H>Gt?Math.pow(H,1/3):H/Ot+yt}function Ra([H,D,K,pe]){let ke=(H+16)/116,je=isNaN(D)?ke:ke+D/500,We=isNaN(K)?ke:ke-K/200;return ke=1*za(ke),je=Pe*za(je),We=at*za(We),[ei(3.1338561*je-1.6168667*ke-.4906146*We),ei(-.9787684*je+1.9161415*ke+.033454*We),ei(.0719453*je-.2289914*ke+1.4052427*We),pe]}function ei(H){return(H=H<=.00304?12.92*H:1.055*Math.pow(H,1/2.4)-.055)<0?0:H>1?1:H}function za(H){return H>Tt?H*H*H:Ot*(H-yt)}function ti(H){return parseInt(H.padEnd(2,H),16)/255}function Ci(H,D){return Jt(D?H/100:H,0,1)}function Jt(H,D,K){return Math.min(Math.max(D,H),K)}function Nt(H){return!H.some(Number.isNaN)}let Kt={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};class Wt{constructor(D,K,pe,ke=1,je=!0){this.r=D,this.g=K,this.b=pe,this.a=ke,je||(this.r*=ke,this.g*=ke,this.b*=ke,ke||this.overwriteGetter("rgb",[D,K,pe,ke]))}static parse(D){if(D instanceof Wt)return D;if(typeof D!="string")return;let K=function(pe){if((pe=pe.toLowerCase().trim())==="transparent")return[0,0,0,0];let ke=Kt[pe];if(ke){let[We,ft,Mt]=ke;return[We/255,ft/255,Mt/255,1]}if(pe.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(pe)){let We=pe.length<6?1:2,ft=1;return[ti(pe.slice(ft,ft+=We)),ti(pe.slice(ft,ft+=We)),ti(pe.slice(ft,ft+=We)),ti(pe.slice(ft,ft+We)||"ff")]}if(pe.startsWith("rgb")){let We=pe.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(We){let[ft,Mt,Ut,nr,Mr,zr,Hr,oa,va,Ga,Qa,Yi]=We,xi=[nr||" ",Hr||" ",Ga].join("");if(xi===" "||xi===" /"||xi===",,"||xi===",,,"){let Hi=[Ut,zr,va].join(""),rn=Hi==="%%%"?100:Hi===""?255:0;if(rn){let jn=[Jt(+Mt/rn,0,1),Jt(+Mr/rn,0,1),Jt(+oa/rn,0,1),Qa?Ci(+Qa,Yi):1];if(Nt(jn))return jn}}return}}let je=pe.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(je){let[We,ft,Mt,Ut,nr,Mr,zr,Hr,oa]=je,va=[Mt||" ",nr||" ",zr].join("");if(va===" "||va===" /"||va===",,"||va===",,,"){let Ga=[+ft,Jt(+Ut,0,100),Jt(+Mr,0,100),Hr?Ci(+Hr,oa):1];if(Nt(Ga))return function([Qa,Yi,xi,Hi]){function rn(jn){let ko=(jn+Qa/30)%12,vs=Yi*Math.min(xi,1-xi);return xi-vs*Math.max(-1,Math.min(ko-3,9-ko,1))}return Qa=Tr(Qa),Yi/=100,xi/=100,[rn(0),rn(8),rn(4),Hi]}(Ga)}}}(D);return K?new Wt(...K,!1):void 0}get rgb(){let{r:D,g:K,b:pe,a:ke}=this,je=ke||1/0;return this.overwriteGetter("rgb",[D/je,K/je,pe/je,ke])}get hcl(){return this.overwriteGetter("hcl",function(D){let[K,pe,ke,je]=la(D),We=Math.sqrt(pe*pe+ke*ke);return[Math.round(1e4*We)?Tr(Math.atan2(ke,pe)*Qt):NaN,We,K,je]}(this.rgb))}get lab(){return this.overwriteGetter("lab",la(this.rgb))}overwriteGetter(D,K){return Object.defineProperty(this,D,{value:K}),K}toString(){let[D,K,pe,ke]=this.rgb;return`rgba(${[D,K,pe].map(je=>Math.round(255*je)).join(",")},${ke})`}}Wt.black=new Wt(0,0,0,1),Wt.white=new Wt(1,1,1,1),Wt.transparent=new Wt(0,0,0,0),Wt.red=new Wt(1,0,0,1);class Pr{constructor(D,K,pe){this.sensitivity=D?K?"variant":"case":K?"accent":"base",this.locale=pe,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(D,K){return this.collator.compare(D,K)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class ta{constructor(D,K,pe,ke,je){this.text=D,this.image=K,this.scale=pe,this.fontStack=ke,this.textColor=je}}class ma{constructor(D){this.sections=D}static fromString(D){return new ma([new ta(D,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(D=>D.text.length!==0||D.image&&D.image.name.length!==0)}static factory(D){return D instanceof ma?D:ma.fromString(D)}toString(){return this.sections.length===0?"":this.sections.map(D=>D.text).join("")}}class ra{constructor(D){this.values=D.slice()}static parse(D){if(D instanceof ra)return D;if(typeof D=="number")return new ra([D,D,D,D]);if(Array.isArray(D)&&!(D.length<1||D.length>4)){for(let K of D)if(typeof K!="number")return;switch(D.length){case 1:D=[D[0],D[0],D[0],D[0]];break;case 2:D=[D[0],D[1],D[0],D[1]];break;case 3:D=[D[0],D[1],D[2],D[1]]}return new ra(D)}}toString(){return JSON.stringify(this.values)}}let Ia=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class Ha{constructor(D){this.values=D.slice()}static parse(D){if(D instanceof Ha)return D;if(Array.isArray(D)&&!(D.length<1)&&D.length%2==0){for(let K=0;K=0&&H<=255&&typeof D=="number"&&D>=0&&D<=255&&typeof K=="number"&&K>=0&&K<=255?pe===void 0||typeof pe=="number"&&pe>=0&&pe<=1?null:`Invalid rgba value [${[H,D,K,pe].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof pe=="number"?[H,D,K,pe]:[H,D,K]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function mi(H){if(H===null||typeof H=="string"||typeof H=="boolean"||typeof H=="number"||H instanceof Wt||H instanceof Pr||H instanceof ma||H instanceof ra||H instanceof Ha||H instanceof $a)return!0;if(Array.isArray(H)){for(let D of H)if(!mi(D))return!1;return!0}if(typeof H=="object"){for(let D in H)if(!mi(H[D]))return!1;return!0}return!1}function xt(H){if(H===null)return st;if(typeof H=="string")return Lt;if(typeof H=="boolean")return kt;if(typeof H=="number")return Qe;if(H instanceof Wt)return Vt;if(H instanceof Pr)return xr;if(H instanceof ma)return jr;if(H instanceof ra)return wr;if(H instanceof Ha)return bt;if(H instanceof $a)return Ir;if(Array.isArray(H)){let D=H.length,K;for(let pe of H){let ke=xt(pe);if(K){if(K===ke)continue;K=Sr;break}K=ke}return Be(K||Sr,D)}return Zt}function ct(H){let D=typeof H;return H===null?"":D==="string"||D==="number"||D==="boolean"?String(H):H instanceof Wt||H instanceof ma||H instanceof ra||H instanceof Ha||H instanceof $a?H.toString():JSON.stringify(H)}class Nr{constructor(D,K){this.type=D,this.value=K}static parse(D,K){if(D.length!==2)return K.error(`'literal' expression requires exactly one argument, but found ${D.length-1} instead.`);if(!mi(D[1]))return K.error("invalid value");let pe=D[1],ke=xt(pe),je=K.expectedType;return ke.kind!=="array"||ke.N!==0||!je||je.kind!=="array"||typeof je.N=="number"&&je.N!==0||(ke=je),new Nr(ke,pe)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class Or{constructor(D){this.name="ExpressionEvaluationError",this.message=D}toJSON(){return this.message}}let Rr={string:Lt,number:Qe,boolean:kt,object:Zt};class Lr{constructor(D,K){this.type=D,this.args=K}static parse(D,K){if(D.length<2)return K.error("Expected at least one argument.");let pe,ke=1,je=D[0];if(je==="array"){let ft,Mt;if(D.length>2){let Ut=D[1];if(typeof Ut!="string"||!(Ut in Rr)||Ut==="object")return K.error('The item type argument of "array" must be one of string, number, boolean',1);ft=Rr[Ut],ke++}else ft=Sr;if(D.length>3){if(D[2]!==null&&(typeof D[2]!="number"||D[2]<0||D[2]!==Math.floor(D[2])))return K.error('The length argument to "array" must be a positive integer literal',2);Mt=D[2],ke++}pe=Be(ft,Mt)}else{if(!Rr[je])throw new Error(`Types doesn't contain name = ${je}`);pe=Rr[je]}let We=[];for(;keD.outputDefined())}}let Gr={"to-boolean":kt,"to-color":Vt,"to-number":Qe,"to-string":Lt};class Kr{constructor(D,K){this.type=D,this.args=K}static parse(D,K){if(D.length<2)return K.error("Expected at least one argument.");let pe=D[0];if(!Gr[pe])throw new Error(`Can't parse ${pe} as it is not part of the known types`);if((pe==="to-boolean"||pe==="to-string")&&D.length!==2)return K.error("Expected one argument.");let ke=Gr[pe],je=[];for(let We=1;We4?`Invalid rbga value ${JSON.stringify(K)}: expected an array containing either three or four numeric values.`:ai(K[0],K[1],K[2],K[3]),!pe))return new Wt(K[0]/255,K[1]/255,K[2]/255,K[3])}throw new Or(pe||`Could not parse color from value '${typeof K=="string"?K:JSON.stringify(K)}'`)}case"padding":{let K;for(let pe of this.args){K=pe.evaluate(D);let ke=ra.parse(K);if(ke)return ke}throw new Or(`Could not parse padding from value '${typeof K=="string"?K:JSON.stringify(K)}'`)}case"variableAnchorOffsetCollection":{let K;for(let pe of this.args){K=pe.evaluate(D);let ke=Ha.parse(K);if(ke)return ke}throw new Or(`Could not parse variableAnchorOffsetCollection from value '${typeof K=="string"?K:JSON.stringify(K)}'`)}case"number":{let K=null;for(let pe of this.args){if(K=pe.evaluate(D),K===null)return 0;let ke=Number(K);if(!isNaN(ke))return ke}throw new Or(`Could not convert ${JSON.stringify(K)} to number.`)}case"formatted":return ma.fromString(ct(this.args[0].evaluate(D)));case"resolvedImage":return $a.fromString(ct(this.args[0].evaluate(D)));default:return ct(this.args[0].evaluate(D))}}eachChild(D){this.args.forEach(D)}outputDefined(){return this.args.every(D=>D.outputDefined())}}let Ur=["Unknown","Point","LineString","Polygon"];class aa{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?Ur[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(D){let K=this._parseColorCache[D];return K||(K=this._parseColorCache[D]=Wt.parse(D)),K}}class da{constructor(D,K,pe=[],ke,je=new rt,We=[]){this.registry=D,this.path=pe,this.key=pe.map(ft=>`[${ft}]`).join(""),this.scope=je,this.errors=We,this.expectedType=ke,this._isConstant=K}parse(D,K,pe,ke,je={}){return K?this.concat(K,pe,ke)._parse(D,je):this._parse(D,je)}_parse(D,K){function pe(ke,je,We){return We==="assert"?new Lr(je,[ke]):We==="coerce"?new Kr(je,[ke]):ke}if(D!==null&&typeof D!="string"&&typeof D!="boolean"&&typeof D!="number"||(D=["literal",D]),Array.isArray(D)){if(D.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');let ke=D[0];if(typeof ke!="string")return this.error(`Expression name must be a string, but found ${typeof ke} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;let je=this.registry[ke];if(je){let We=je.parse(D,this);if(!We)return null;if(this.expectedType){let ft=this.expectedType,Mt=We.type;if(ft.kind!=="string"&&ft.kind!=="number"&&ft.kind!=="boolean"&&ft.kind!=="object"&&ft.kind!=="array"||Mt.kind!=="value")if(ft.kind!=="color"&&ft.kind!=="formatted"&&ft.kind!=="resolvedImage"||Mt.kind!=="value"&&Mt.kind!=="string")if(ft.kind!=="padding"||Mt.kind!=="value"&&Mt.kind!=="number"&&Mt.kind!=="array")if(ft.kind!=="variableAnchorOffsetCollection"||Mt.kind!=="value"&&Mt.kind!=="array"){if(this.checkSubtype(ft,Mt))return null}else We=pe(We,ft,K.typeAnnotation||"coerce");else We=pe(We,ft,K.typeAnnotation||"coerce");else We=pe(We,ft,K.typeAnnotation||"coerce");else We=pe(We,ft,K.typeAnnotation||"assert")}if(!(We instanceof Nr)&&We.type.kind!=="resolvedImage"&&this._isConstant(We)){let ft=new aa;try{We=new Nr(We.type,We.evaluate(ft))}catch(Mt){return this.error(Mt.message),null}}return We}return this.error(`Unknown expression "${ke}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(D===void 0?"'undefined' value invalid. Use null instead.":typeof D=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof D} instead.`)}concat(D,K,pe){let ke=typeof D=="number"?this.path.concat(D):this.path,je=pe?this.scope.concat(pe):this.scope;return new da(this.registry,this._isConstant,ke,K||null,je,this.errors)}error(D,...K){let pe=`${this.key}${K.map(ke=>`[${ke}]`).join("")}`;this.errors.push(new Fe(pe,D))}checkSubtype(D,K){let pe=Me(D,K);return pe&&this.error(pe),pe}}class fa{constructor(D,K){this.type=K.type,this.bindings=[].concat(D),this.result=K}evaluate(D){return this.result.evaluate(D)}eachChild(D){for(let K of this.bindings)D(K[1]);D(this.result)}static parse(D,K){if(D.length<4)return K.error(`Expected at least 3 arguments, but found ${D.length-1} instead.`);let pe=[];for(let je=1;je=pe.length)throw new Or(`Array index out of bounds: ${K} > ${pe.length-1}.`);if(K!==Math.floor(K))throw new Or(`Array index must be an integer, but found ${K} instead.`);return pe[K]}eachChild(D){D(this.index),D(this.input)}outputDefined(){return!1}}class kr{constructor(D,K){this.type=kt,this.needle=D,this.haystack=K}static parse(D,K){if(D.length!==3)return K.error(`Expected 2 arguments, but found ${D.length-1} instead.`);let pe=K.parse(D[1],1,Sr),ke=K.parse(D[2],2,Sr);return pe&&ke?qe(pe.type,[kt,Lt,Qe,st,Sr])?new kr(pe,ke):K.error(`Expected first argument to be of type boolean, string, number or null, but found ${Ke(pe.type)} instead`):null}evaluate(D){let K=this.needle.evaluate(D),pe=this.haystack.evaluate(D);if(!pe)return!1;if(!Ce(K,["boolean","string","number","null"]))throw new Or(`Expected first argument to be of type boolean, string, number or null, but found ${Ke(xt(K))} instead.`);if(!Ce(pe,["string","array"]))throw new Or(`Expected second argument to be of type array or string, but found ${Ke(xt(pe))} instead.`);return pe.indexOf(K)>=0}eachChild(D){D(this.needle),D(this.haystack)}outputDefined(){return!0}}class ia{constructor(D,K,pe){this.type=Qe,this.needle=D,this.haystack=K,this.fromIndex=pe}static parse(D,K){if(D.length<=2||D.length>=5)return K.error(`Expected 3 or 4 arguments, but found ${D.length-1} instead.`);let pe=K.parse(D[1],1,Sr),ke=K.parse(D[2],2,Sr);if(!pe||!ke)return null;if(!qe(pe.type,[kt,Lt,Qe,st,Sr]))return K.error(`Expected first argument to be of type boolean, string, number or null, but found ${Ke(pe.type)} instead`);if(D.length===4){let je=K.parse(D[3],3,Qe);return je?new ia(pe,ke,je):null}return new ia(pe,ke)}evaluate(D){let K=this.needle.evaluate(D),pe=this.haystack.evaluate(D);if(!Ce(K,["boolean","string","number","null"]))throw new Or(`Expected first argument to be of type boolean, string, number or null, but found ${Ke(xt(K))} instead.`);let ke;if(this.fromIndex&&(ke=this.fromIndex.evaluate(D)),Ce(pe,["string"])){let je=pe.indexOf(K,ke);return je===-1?-1:[...pe.slice(0,je)].length}if(Ce(pe,["array"]))return pe.indexOf(K,ke);throw new Or(`Expected second argument to be of type array or string, but found ${Ke(xt(pe))} instead.`)}eachChild(D){D(this.needle),D(this.haystack),this.fromIndex&&D(this.fromIndex)}outputDefined(){return!1}}class Ca{constructor(D,K,pe,ke,je,We){this.inputType=D,this.type=K,this.input=pe,this.cases=ke,this.outputs=je,this.otherwise=We}static parse(D,K){if(D.length<5)return K.error(`Expected at least 4 arguments, but found only ${D.length-1}.`);if(D.length%2!=1)return K.error("Expected an even number of arguments.");let pe,ke;K.expectedType&&K.expectedType.kind!=="value"&&(ke=K.expectedType);let je={},We=[];for(let Ut=2;UtNumber.MAX_SAFE_INTEGER)return zr.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof oa=="number"&&Math.floor(oa)!==oa)return zr.error("Numeric branch labels must be integer values.");if(pe){if(zr.checkSubtype(pe,xt(oa)))return null}else pe=xt(oa);if(je[String(oa)]!==void 0)return zr.error("Branch labels must be unique.");je[String(oa)]=We.length}let Hr=K.parse(Mr,Ut,ke);if(!Hr)return null;ke=ke||Hr.type,We.push(Hr)}let ft=K.parse(D[1],1,Sr);if(!ft)return null;let Mt=K.parse(D[D.length-1],D.length-1,ke);return Mt?ft.type.kind!=="value"&&K.concat(1).checkSubtype(pe,ft.type)?null:new Ca(pe,ke,ft,je,We,Mt):null}evaluate(D){let K=this.input.evaluate(D);return(xt(K)===this.inputType&&this.outputs[this.cases[K]]||this.otherwise).evaluate(D)}eachChild(D){D(this.input),this.outputs.forEach(D),D(this.otherwise)}outputDefined(){return this.outputs.every(D=>D.outputDefined())&&this.otherwise.outputDefined()}}class Fa{constructor(D,K,pe){this.type=D,this.branches=K,this.otherwise=pe}static parse(D,K){if(D.length<4)return K.error(`Expected at least 3 arguments, but found only ${D.length-1}.`);if(D.length%2!=0)return K.error("Expected an odd number of arguments.");let pe;K.expectedType&&K.expectedType.kind!=="value"&&(pe=K.expectedType);let ke=[];for(let We=1;WeK.outputDefined())&&this.otherwise.outputDefined()}}class Ya{constructor(D,K,pe,ke){this.type=D,this.input=K,this.beginIndex=pe,this.endIndex=ke}static parse(D,K){if(D.length<=2||D.length>=5)return K.error(`Expected 3 or 4 arguments, but found ${D.length-1} instead.`);let pe=K.parse(D[1],1,Sr),ke=K.parse(D[2],2,Qe);if(!pe||!ke)return null;if(!qe(pe.type,[Be(Sr),Lt,Sr]))return K.error(`Expected first argument to be of type array or string, but found ${Ke(pe.type)} instead`);if(D.length===4){let je=K.parse(D[3],3,Qe);return je?new Ya(pe.type,pe,ke,je):null}return new Ya(pe.type,pe,ke)}evaluate(D){let K=this.input.evaluate(D),pe=this.beginIndex.evaluate(D),ke;if(this.endIndex&&(ke=this.endIndex.evaluate(D)),Ce(K,["string"]))return[...K].slice(pe,ke).join("");if(Ce(K,["array"]))return K.slice(pe,ke);throw new Or(`Expected first argument to be of type array or string, but found ${Ke(xt(K))} instead.`)}eachChild(D){D(this.input),D(this.beginIndex),this.endIndex&&D(this.endIndex)}outputDefined(){return!1}}function ha(H,D){let K=H.length-1,pe,ke,je=0,We=K,ft=0;for(;je<=We;)if(ft=Math.floor((je+We)/2),pe=H[ft],ke=H[ft+1],pe<=D){if(ft===K||DD))throw new Or("Input is not a number.");We=ft-1}return 0}class Da{constructor(D,K,pe){this.type=D,this.input=K,this.labels=[],this.outputs=[];for(let[ke,je]of pe)this.labels.push(ke),this.outputs.push(je)}static parse(D,K){if(D.length-1<4)return K.error(`Expected at least 4 arguments, but found only ${D.length-1}.`);if((D.length-1)%2!=0)return K.error("Expected an even number of arguments.");let pe=K.parse(D[1],1,Qe);if(!pe)return null;let ke=[],je=null;K.expectedType&&K.expectedType.kind!=="value"&&(je=K.expectedType);for(let We=1;We=ft)return K.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',Ut);let Mr=K.parse(Mt,nr,je);if(!Mr)return null;je=je||Mr.type,ke.push([ft,Mr])}return new Da(je,pe,ke)}evaluate(D){let K=this.labels,pe=this.outputs;if(K.length===1)return pe[0].evaluate(D);let ke=this.input.evaluate(D);if(ke<=K[0])return pe[0].evaluate(D);let je=K.length;return ke>=K[je-1]?pe[je-1].evaluate(D):pe[ha(K,ke)].evaluate(D)}eachChild(D){D(this.input);for(let K of this.outputs)D(K)}outputDefined(){return this.outputs.every(D=>D.outputDefined())}}function Xi(H){return H&&H.__esModule&&Object.prototype.hasOwnProperty.call(H,"default")?H.default:H}var Li=fn;function fn(H,D,K,pe){this.cx=3*H,this.bx=3*(K-H)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*D,this.by=3*(pe-D)-this.cy,this.ay=1-this.cy-this.by,this.p1x=H,this.p1y=D,this.p2x=K,this.p2y=pe}fn.prototype={sampleCurveX:function(H){return((this.ax*H+this.bx)*H+this.cx)*H},sampleCurveY:function(H){return((this.ay*H+this.by)*H+this.cy)*H},sampleCurveDerivativeX:function(H){return(3*this.ax*H+2*this.bx)*H+this.cx},solveCurveX:function(H,D){if(D===void 0&&(D=1e-6),H<0)return 0;if(H>1)return 1;for(var K=H,pe=0;pe<8;pe++){var ke=this.sampleCurveX(K)-H;if(Math.abs(ke)ke?We=K:ft=K,K=.5*(ft-We)+We;return K},solve:function(H,D){return this.sampleCurveY(this.solveCurveX(H,D))}};var An=Xi(Li);function kn(H,D,K){return H+K*(D-H)}function zn(H,D,K){return H.map((pe,ke)=>kn(pe,D[ke],K))}let Xn={number:kn,color:function(H,D,K,pe="rgb"){switch(pe){case"rgb":{let[ke,je,We,ft]=zn(H.rgb,D.rgb,K);return new Wt(ke,je,We,ft,!1)}case"hcl":{let[ke,je,We,ft]=H.hcl,[Mt,Ut,nr,Mr]=D.hcl,zr,Hr;if(isNaN(ke)||isNaN(Mt))isNaN(ke)?isNaN(Mt)?zr=NaN:(zr=Mt,We!==1&&We!==0||(Hr=Ut)):(zr=ke,nr!==1&&nr!==0||(Hr=je));else{let Yi=Mt-ke;Mt>ke&&Yi>180?Yi-=360:Mt180&&(Yi+=360),zr=ke+K*Yi}let[oa,va,Ga,Qa]=function([Yi,xi,Hi,rn]){return Yi=isNaN(Yi)?0:Yi*rr,Ra([Hi,Math.cos(Yi)*xi,Math.sin(Yi)*xi,rn])}([zr,Hr??kn(je,Ut,K),kn(We,nr,K),kn(ft,Mr,K)]);return new Wt(oa,va,Ga,Qa,!1)}case"lab":{let[ke,je,We,ft]=Ra(zn(H.lab,D.lab,K));return new Wt(ke,je,We,ft,!1)}}},array:zn,padding:function(H,D,K){return new ra(zn(H.values,D.values,K))},variableAnchorOffsetCollection:function(H,D,K){let pe=H.values,ke=D.values;if(pe.length!==ke.length)throw new Or(`Cannot interpolate values of different length. from: ${H.toString()}, to: ${D.toString()}`);let je=[];for(let We=0;Wetypeof nr!="number"||nr<0||nr>1))return K.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);ke={name:"cubic-bezier",controlPoints:Ut}}}if(D.length-1<4)return K.error(`Expected at least 4 arguments, but found only ${D.length-1}.`);if((D.length-1)%2!=0)return K.error("Expected an even number of arguments.");if(je=K.parse(je,2,Qe),!je)return null;let ft=[],Mt=null;pe==="interpolate-hcl"||pe==="interpolate-lab"?Mt=Vt:K.expectedType&&K.expectedType.kind!=="value"&&(Mt=K.expectedType);for(let Ut=0;Ut=nr)return K.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',zr);let oa=K.parse(Mr,Hr,Mt);if(!oa)return null;Mt=Mt||oa.type,ft.push([nr,oa])}return Te(Mt,Qe)||Te(Mt,Vt)||Te(Mt,wr)||Te(Mt,bt)||Te(Mt,Be(Qe))?new to(Mt,pe,ke,je,ft):K.error(`Type ${Ke(Mt)} is not interpolatable.`)}evaluate(D){let K=this.labels,pe=this.outputs;if(K.length===1)return pe[0].evaluate(D);let ke=this.input.evaluate(D);if(ke<=K[0])return pe[0].evaluate(D);let je=K.length;if(ke>=K[je-1])return pe[je-1].evaluate(D);let We=ha(K,ke),ft=to.interpolationFactor(this.interpolation,ke,K[We],K[We+1]),Mt=pe[We].evaluate(D),Ut=pe[We+1].evaluate(D);switch(this.operator){case"interpolate":return Xn[this.type.kind](Mt,Ut,ft);case"interpolate-hcl":return Xn.color(Mt,Ut,ft,"hcl");case"interpolate-lab":return Xn.color(Mt,Ut,ft,"lab")}}eachChild(D){D(this.input);for(let K of this.outputs)D(K)}outputDefined(){return this.outputs.every(D=>D.outputDefined())}}function mo(H,D,K,pe){let ke=pe-K,je=H-K;return ke===0?0:D===1?je/ke:(Math.pow(D,je)-1)/(Math.pow(D,ke)-1)}class pn{constructor(D,K){this.type=D,this.args=K}static parse(D,K){if(D.length<2)return K.error("Expectected at least one argument.");let pe=null,ke=K.expectedType;ke&&ke.kind!=="value"&&(pe=ke);let je=[];for(let ft of D.slice(1)){let Mt=K.parse(ft,1+je.length,pe,void 0,{typeAnnotation:"omit"});if(!Mt)return null;pe=pe||Mt.type,je.push(Mt)}if(!pe)throw new Error("No output type");let We=ke&&je.some(ft=>Me(ke,ft.type));return new pn(We?Sr:pe,je)}evaluate(D){let K,pe=null,ke=0;for(let je of this.args)if(ke++,pe=je.evaluate(D),pe&&pe instanceof $a&&!pe.available&&(K||(K=pe.name),pe=null,ke===this.args.length&&(pe=K)),pe!==null)break;return pe}eachChild(D){this.args.forEach(D)}outputDefined(){return this.args.every(D=>D.outputDefined())}}function Jo(H,D){return H==="=="||H==="!="?D.kind==="boolean"||D.kind==="string"||D.kind==="number"||D.kind==="null"||D.kind==="value":D.kind==="string"||D.kind==="number"||D.kind==="value"}function Xo(H,D,K,pe){return pe.compare(D,K)===0}function Ts(H,D,K){let pe=H!=="=="&&H!=="!=";return class e7{constructor(je,We,ft){this.type=kt,this.lhs=je,this.rhs=We,this.collator=ft,this.hasUntypedArgument=je.type.kind==="value"||We.type.kind==="value"}static parse(je,We){if(je.length!==3&&je.length!==4)return We.error("Expected two or three arguments.");let ft=je[0],Mt=We.parse(je[1],1,Sr);if(!Mt)return null;if(!Jo(ft,Mt.type))return We.concat(1).error(`"${ft}" comparisons are not supported for type '${Ke(Mt.type)}'.`);let Ut=We.parse(je[2],2,Sr);if(!Ut)return null;if(!Jo(ft,Ut.type))return We.concat(2).error(`"${ft}" comparisons are not supported for type '${Ke(Ut.type)}'.`);if(Mt.type.kind!==Ut.type.kind&&Mt.type.kind!=="value"&&Ut.type.kind!=="value")return We.error(`Cannot compare types '${Ke(Mt.type)}' and '${Ke(Ut.type)}'.`);pe&&(Mt.type.kind==="value"&&Ut.type.kind!=="value"?Mt=new Lr(Ut.type,[Mt]):Mt.type.kind!=="value"&&Ut.type.kind==="value"&&(Ut=new Lr(Mt.type,[Ut])));let nr=null;if(je.length===4){if(Mt.type.kind!=="string"&&Ut.type.kind!=="string"&&Mt.type.kind!=="value"&&Ut.type.kind!=="value")return We.error("Cannot use collator to compare non-string types.");if(nr=We.parse(je[3],3,xr),!nr)return null}return new e7(Mt,Ut,nr)}evaluate(je){let We=this.lhs.evaluate(je),ft=this.rhs.evaluate(je);if(pe&&this.hasUntypedArgument){let Mt=xt(We),Ut=xt(ft);if(Mt.kind!==Ut.kind||Mt.kind!=="string"&&Mt.kind!=="number")throw new Or(`Expected arguments for "${H}" to be (string, string) or (number, number), but found (${Mt.kind}, ${Ut.kind}) instead.`)}if(this.collator&&!pe&&this.hasUntypedArgument){let Mt=xt(We),Ut=xt(ft);if(Mt.kind!=="string"||Ut.kind!=="string")return D(je,We,ft)}return this.collator?K(je,We,ft,this.collator.evaluate(je)):D(je,We,ft)}eachChild(je){je(this.lhs),je(this.rhs),this.collator&&je(this.collator)}outputDefined(){return!0}}}let Po=Ts("==",function(H,D,K){return D===K},Xo),so=Ts("!=",function(H,D,K){return D!==K},function(H,D,K,pe){return!Xo(0,D,K,pe)}),Vn=Ts("<",function(H,D,K){return D",function(H,D,K){return D>K},function(H,D,K,pe){return pe.compare(D,K)>0}),qo=Ts("<=",function(H,D,K){return D<=K},function(H,D,K,pe){return pe.compare(D,K)<=0}),Oo=Ts(">=",function(H,D,K){return D>=K},function(H,D,K,pe){return pe.compare(D,K)>=0});class lo{constructor(D,K,pe){this.type=xr,this.locale=pe,this.caseSensitive=D,this.diacriticSensitive=K}static parse(D,K){if(D.length!==2)return K.error("Expected one argument.");let pe=D[1];if(typeof pe!="object"||Array.isArray(pe))return K.error("Collator options argument must be an object.");let ke=K.parse(pe["case-sensitive"]!==void 0&&pe["case-sensitive"],1,kt);if(!ke)return null;let je=K.parse(pe["diacritic-sensitive"]!==void 0&&pe["diacritic-sensitive"],1,kt);if(!je)return null;let We=null;return pe.locale&&(We=K.parse(pe.locale,1,Lt),!We)?null:new lo(ke,je,We)}evaluate(D){return new Pr(this.caseSensitive.evaluate(D),this.diacriticSensitive.evaluate(D),this.locale?this.locale.evaluate(D):null)}eachChild(D){D(this.caseSensitive),D(this.diacriticSensitive),this.locale&&D(this.locale)}outputDefined(){return!1}}class Co{constructor(D,K,pe,ke,je){this.type=Lt,this.number=D,this.locale=K,this.currency=pe,this.minFractionDigits=ke,this.maxFractionDigits=je}static parse(D,K){if(D.length!==3)return K.error("Expected two arguments.");let pe=K.parse(D[1],1,Qe);if(!pe)return null;let ke=D[2];if(typeof ke!="object"||Array.isArray(ke))return K.error("NumberFormat options argument must be an object.");let je=null;if(ke.locale&&(je=K.parse(ke.locale,1,Lt),!je))return null;let We=null;if(ke.currency&&(We=K.parse(ke.currency,1,Lt),!We))return null;let ft=null;if(ke["min-fraction-digits"]&&(ft=K.parse(ke["min-fraction-digits"],1,Qe),!ft))return null;let Mt=null;return ke["max-fraction-digits"]&&(Mt=K.parse(ke["max-fraction-digits"],1,Qe),!Mt)?null:new Co(pe,je,We,ft,Mt)}evaluate(D){return new Intl.NumberFormat(this.locale?this.locale.evaluate(D):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(D):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(D):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(D):void 0}).format(this.number.evaluate(D))}eachChild(D){D(this.number),this.locale&&D(this.locale),this.currency&&D(this.currency),this.minFractionDigits&&D(this.minFractionDigits),this.maxFractionDigits&&D(this.maxFractionDigits)}outputDefined(){return!1}}class os{constructor(D){this.type=jr,this.sections=D}static parse(D,K){if(D.length<2)return K.error("Expected at least one argument.");let pe=D[1];if(!Array.isArray(pe)&&typeof pe=="object")return K.error("First argument must be an image or text section.");let ke=[],je=!1;for(let We=1;We<=D.length-1;++We){let ft=D[We];if(je&&typeof ft=="object"&&!Array.isArray(ft)){je=!1;let Mt=null;if(ft["font-scale"]&&(Mt=K.parse(ft["font-scale"],1,Qe),!Mt))return null;let Ut=null;if(ft["text-font"]&&(Ut=K.parse(ft["text-font"],1,Be(Lt)),!Ut))return null;let nr=null;if(ft["text-color"]&&(nr=K.parse(ft["text-color"],1,Vt),!nr))return null;let Mr=ke[ke.length-1];Mr.scale=Mt,Mr.font=Ut,Mr.textColor=nr}else{let Mt=K.parse(D[We],1,Sr);if(!Mt)return null;let Ut=Mt.type.kind;if(Ut!=="string"&&Ut!=="value"&&Ut!=="null"&&Ut!=="resolvedImage")return K.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");je=!0,ke.push({content:Mt,scale:null,font:null,textColor:null})}}return new os(ke)}evaluate(D){return new ma(this.sections.map(K=>{let pe=K.content.evaluate(D);return xt(pe)===Ir?new ta("",pe,null,null,null):new ta(ct(pe),null,K.scale?K.scale.evaluate(D):null,K.font?K.font.evaluate(D).join(","):null,K.textColor?K.textColor.evaluate(D):null)}))}eachChild(D){for(let K of this.sections)D(K.content),K.scale&&D(K.scale),K.font&&D(K.font),K.textColor&&D(K.textColor)}outputDefined(){return!1}}class Ys{constructor(D){this.type=Ir,this.input=D}static parse(D,K){if(D.length!==2)return K.error("Expected two arguments.");let pe=K.parse(D[1],1,Lt);return pe?new Ys(pe):K.error("No image name provided.")}evaluate(D){let K=this.input.evaluate(D),pe=$a.fromString(K);return pe&&D.availableImages&&(pe.available=D.availableImages.indexOf(K)>-1),pe}eachChild(D){D(this.input)}outputDefined(){return!1}}class Os{constructor(D){this.type=Qe,this.input=D}static parse(D,K){if(D.length!==2)return K.error(`Expected 1 argument, but found ${D.length-1} instead.`);let pe=K.parse(D[1],1);return pe?pe.type.kind!=="array"&&pe.type.kind!=="string"&&pe.type.kind!=="value"?K.error(`Expected argument of type string or array, but found ${Ke(pe.type)} instead.`):new Os(pe):null}evaluate(D){let K=this.input.evaluate(D);if(typeof K=="string")return[...K].length;if(Array.isArray(K))return K.length;throw new Or(`Expected value to be of type string or array, but found ${Ke(xt(K))} instead.`)}eachChild(D){D(this.input)}outputDefined(){return!1}}let Yo=8192;function Ui(H,D){let K=(180+H[0])/360,pe=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+H[1]*Math.PI/360)))/360,ke=Math.pow(2,D.z);return[Math.round(K*ke*Yo),Math.round(pe*ke*Yo)]}function Cn(H,D){let K=Math.pow(2,D.z);return[(ke=(H[0]/Yo+D.x)/K,360*ke-180),(pe=(H[1]/Yo+D.y)/K,360/Math.PI*Math.atan(Math.exp((180-360*pe)*Math.PI/180))-90)];var pe,ke}function tl(H,D){H[0]=Math.min(H[0],D[0]),H[1]=Math.min(H[1],D[1]),H[2]=Math.max(H[2],D[0]),H[3]=Math.max(H[3],D[1])}function Bs(H,D){return!(H[0]<=D[0]||H[2]>=D[2]||H[1]<=D[1]||H[3]>=D[3])}function uo(H,D,K){let pe=H[0]-D[0],ke=H[1]-D[1],je=H[0]-K[0],We=H[1]-K[1];return pe*We-je*ke==0&&pe*je<=0&&ke*We<=0}function $s(H,D,K,pe){return(ke=[pe[0]-K[0],pe[1]-K[1]])[0]*(je=[D[0]-H[0],D[1]-H[1]])[1]-ke[1]*je[0]!=0&&!(!ro(H,D,K,pe)||!ro(K,pe,H,D));var ke,je}function ms(H,D,K){for(let pe of K)for(let ke=0;ke(ke=H)[1]!=(We=ft[Mt+1])[1]>ke[1]&&ke[0]<(We[0]-je[0])*(ke[1]-je[1])/(We[1]-je[1])+je[0]&&(pe=!pe)}var ke,je,We;return pe}function rl(H,D){for(let K of D)if(Is(H,K))return!0;return!1}function Sn(H,D){for(let K of H)if(!Is(K,D))return!1;for(let K=0;K0&&ft<0||We<0&&ft>0}function As(H,D,K){let pe=[];for(let ke=0;keK[2]){let ke=.5*pe,je=H[0]-K[0]>ke?-pe:K[0]-H[0]>ke?pe:0;je===0&&(je=H[0]-K[2]>ke?-pe:K[2]-H[0]>ke?pe:0),H[0]+=je}tl(D,H)}function zs(H,D,K,pe){let ke=Math.pow(2,pe.z)*Yo,je=[pe.x*Yo,pe.y*Yo],We=[];for(let ft of H)for(let Mt of ft){let Ut=[Mt.x+je[0],Mt.y+je[1]];$n(Ut,D,K,ke),We.push(Ut)}return We}function au(H,D,K,pe){let ke=Math.pow(2,pe.z)*Yo,je=[pe.x*Yo,pe.y*Yo],We=[];for(let Mt of H){let Ut=[];for(let nr of Mt){let Mr=[nr.x+je[0],nr.y+je[1]];tl(D,Mr),Ut.push(Mr)}We.push(Ut)}if(D[2]-D[0]<=ke/2){(ft=D)[0]=ft[1]=1/0,ft[2]=ft[3]=-1/0;for(let Mt of We)for(let Ut of Mt)$n(Ut,D,K,ke)}var ft;return We}class fl{constructor(D,K){this.type=kt,this.geojson=D,this.geometries=K}static parse(D,K){if(D.length!==2)return K.error(`'within' expression requires exactly one argument, but found ${D.length-1} instead.`);if(mi(D[1])){let pe=D[1];if(pe.type==="FeatureCollection"){let ke=[];for(let je of pe.features){let{type:We,coordinates:ft}=je.geometry;We==="Polygon"&&ke.push(ft),We==="MultiPolygon"&&ke.push(...ft)}if(ke.length)return new fl(pe,{type:"MultiPolygon",coordinates:ke})}else if(pe.type==="Feature"){let ke=pe.geometry.type;if(ke==="Polygon"||ke==="MultiPolygon")return new fl(pe,pe.geometry)}else if(pe.type==="Polygon"||pe.type==="MultiPolygon")return new fl(pe,pe)}return K.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(D){if(D.geometry()!=null&&D.canonicalID()!=null){if(D.geometryType()==="Point")return function(K,pe){let ke=[1/0,1/0,-1/0,-1/0],je=[1/0,1/0,-1/0,-1/0],We=K.canonicalID();if(pe.type==="Polygon"){let ft=As(pe.coordinates,je,We),Mt=zs(K.geometry(),ke,je,We);if(!Bs(ke,je))return!1;for(let Ut of Mt)if(!Is(Ut,ft))return!1}if(pe.type==="MultiPolygon"){let ft=al(pe.coordinates,je,We),Mt=zs(K.geometry(),ke,je,We);if(!Bs(ke,je))return!1;for(let Ut of Mt)if(!rl(Ut,ft))return!1}return!0}(D,this.geometries);if(D.geometryType()==="LineString")return function(K,pe){let ke=[1/0,1/0,-1/0,-1/0],je=[1/0,1/0,-1/0,-1/0],We=K.canonicalID();if(pe.type==="Polygon"){let ft=As(pe.coordinates,je,We),Mt=au(K.geometry(),ke,je,We);if(!Bs(ke,je))return!1;for(let Ut of Mt)if(!Sn(Ut,ft))return!1}if(pe.type==="MultiPolygon"){let ft=al(pe.coordinates,je,We),Mt=au(K.geometry(),ke,je,We);if(!Bs(ke,je))return!1;for(let Ut of Mt)if(!po(Ut,ft))return!1}return!0}(D,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}let xu=class{constructor(H=[],D=(K,pe)=>Kpe?1:0){if(this.data=H,this.length=this.data.length,this.compare=D,this.length>0)for(let K=(this.length>>1)-1;K>=0;K--)this._down(K)}push(H){this.data.push(H),this._up(this.length++)}pop(){if(this.length===0)return;let H=this.data[0],D=this.data.pop();return--this.length>0&&(this.data[0]=D,this._down(0)),H}peek(){return this.data[0]}_up(H){let{data:D,compare:K}=this,pe=D[H];for(;H>0;){let ke=H-1>>1,je=D[ke];if(K(pe,je)>=0)break;D[H]=je,H=ke}D[H]=pe}_down(H){let{data:D,compare:K}=this,pe=this.length>>1,ke=D[H];for(;H=0)break;D[H]=D[je],H=je}D[H]=ke}};function zl(H,D,K,pe,ke){Ns(H,D,K,pe||H.length-1,ke||Eu)}function Ns(H,D,K,pe,ke){for(;pe>K;){if(pe-K>600){var je=pe-K+1,We=D-K+1,ft=Math.log(je),Mt=.5*Math.exp(2*ft/3),Ut=.5*Math.sqrt(ft*Mt*(je-Mt)/je)*(We-je/2<0?-1:1);Ns(H,D,Math.max(K,Math.floor(D-We*Mt/je+Ut)),Math.min(pe,Math.floor(D+(je-We)*Mt/je+Ut)),ke)}var nr=H[D],Mr=K,zr=pe;for(iu(H,K,D),ke(H[pe],nr)>0&&iu(H,K,pe);Mr0;)zr--}ke(H[K],nr)===0?iu(H,K,zr):iu(H,++zr,pe),zr<=D&&(K=zr+1),D<=zr&&(pe=zr-1)}}function iu(H,D,K){var pe=H[D];H[D]=H[K],H[K]=pe}function Eu(H,D){return HD?1:0}function Bc(H,D){if(H.length<=1)return[H];let K=[],pe,ke;for(let je of H){let We=Af(je);We!==0&&(je.area=Math.abs(We),ke===void 0&&(ke=We<0),ke===We<0?(pe&&K.push(pe),pe=[je]):pe.push(je))}if(pe&&K.push(pe),D>1)for(let je=0;je1?(Ut=D[Mt+1][0],nr=D[Mt+1][1]):Hr>0&&(Ut+=Mr/this.kx*Hr,nr+=zr/this.ky*Hr)),Mr=this.wrap(K[0]-Ut)*this.kx,zr=(K[1]-nr)*this.ky;let oa=Mr*Mr+zr*zr;oa180;)D-=360;return D}}function nu(H,D){return D[0]-H[0]}function Ll(H){return H[1]-H[0]+1}function ic(H,D){return H[1]>=H[0]&&H[1]H[1])return[null,null];let K=Ll(H);if(D){if(K===2)return[H,null];let ke=Math.floor(K/2);return[[H[0],H[0]+ke],[H[0]+ke,H[1]]]}if(K===1)return[H,null];let pe=Math.floor(K/2)-1;return[[H[0],H[0]+pe],[H[0]+pe+1,H[1]]]}function il(H,D){if(!ic(D,H.length))return[1/0,1/0,-1/0,-1/0];let K=[1/0,1/0,-1/0,-1/0];for(let pe=D[0];pe<=D[1];++pe)tl(K,H[pe]);return K}function vl(H){let D=[1/0,1/0,-1/0,-1/0];for(let K of H)for(let pe of K)tl(D,pe);return D}function gs(H){return H[0]!==-1/0&&H[1]!==-1/0&&H[2]!==1/0&&H[3]!==1/0}function Vs(H,D,K){if(!gs(H)||!gs(D))return NaN;let pe=0,ke=0;return H[2]D[2]&&(pe=H[0]-D[2]),H[1]>D[3]&&(ke=H[1]-D[3]),H[3]=pe)return pe;if(Bs(ke,je)){if(_h(H,D))return 0}else if(_h(D,H))return 0;let We=1/0;for(let ft of H)for(let Mt=0,Ut=ft.length,nr=Ut-1;Mt0;){let Mt=We.pop();if(Mt[0]>=je)continue;let Ut=Mt[1],nr=D?50:100;if(Ll(Ut)<=nr){if(!ic(Ut,H.length))return NaN;if(D){let Mr=ls(H,Ut,K,pe);if(isNaN(Mr)||Mr===0)return Mr;je=Math.min(je,Mr)}else for(let Mr=Ut[0];Mr<=Ut[1];++Mr){let zr=yh(H[Mr],K,pe);if(je=Math.min(je,zr),je===0)return 0}}else{let Mr=Ou(Ut,D);Qn(We,je,pe,H,ft,Mr[0]),Qn(We,je,pe,H,ft,Mr[1])}}return je}function Ul(H,D,K,pe,ke,je=1/0){let We=Math.min(je,ke.distance(H[0],K[0]));if(We===0)return We;let ft=new xu([[0,[0,H.length-1],[0,K.length-1]]],nu);for(;ft.length>0;){let Mt=ft.pop();if(Mt[0]>=We)continue;let Ut=Mt[1],nr=Mt[2],Mr=D?50:100,zr=pe?50:100;if(Ll(Ut)<=Mr&&Ll(nr)<=zr){if(!ic(Ut,H.length)&&ic(nr,K.length))return NaN;let Hr;if(D&&pe)Hr=qu(H,Ut,K,nr,ke),We=Math.min(We,Hr);else if(D&&!pe){let oa=H.slice(Ut[0],Ut[1]+1);for(let va=nr[0];va<=nr[1];++va)if(Hr=nc(K[va],oa,ke),We=Math.min(We,Hr),We===0)return We}else if(!D&&pe){let oa=K.slice(nr[0],nr[1]+1);for(let va=Ut[0];va<=Ut[1];++va)if(Hr=nc(H[va],oa,ke),We=Math.min(We,Hr),We===0)return We}else Hr=cl(H,Ut,K,nr,ke),We=Math.min(We,Hr)}else{let Hr=Ou(Ut,D),oa=Ou(nr,pe);Gc(ft,We,ke,H,K,Hr[0],oa[0]),Gc(ft,We,ke,H,K,Hr[0],oa[1]),Gc(ft,We,ke,H,K,Hr[1],oa[0]),Gc(ft,We,ke,H,K,Hr[1],oa[1])}}return We}function Mf(H){return H.type==="MultiPolygon"?H.coordinates.map(D=>({type:"Polygon",coordinates:D})):H.type==="MultiLineString"?H.coordinates.map(D=>({type:"LineString",coordinates:D})):H.type==="MultiPoint"?H.coordinates.map(D=>({type:"Point",coordinates:D})):[H]}class wc{constructor(D,K){this.type=Qe,this.geojson=D,this.geometries=K}static parse(D,K){if(D.length!==2)return K.error(`'distance' expression requires exactly one argument, but found ${D.length-1} instead.`);if(mi(D[1])){let pe=D[1];if(pe.type==="FeatureCollection")return new wc(pe,pe.features.map(ke=>Mf(ke.geometry)).flat());if(pe.type==="Feature")return new wc(pe,Mf(pe.geometry));if("type"in pe&&"coordinates"in pe)return new wc(pe,Mf(pe))}return K.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(D){if(D.geometry()!=null&&D.canonicalID()!=null){if(D.geometryType()==="Point")return function(K,pe){let ke=K.geometry(),je=ke.flat().map(Mt=>Cn([Mt.x,Mt.y],K.canonical));if(ke.length===0)return NaN;let We=new Sf(je[0][1]),ft=1/0;for(let Mt of pe){switch(Mt.type){case"Point":ft=Math.min(ft,Ul(je,!1,[Mt.coordinates],!1,We,ft));break;case"LineString":ft=Math.min(ft,Ul(je,!1,Mt.coordinates,!0,We,ft));break;case"Polygon":ft=Math.min(ft,Vu(je,!1,Mt.coordinates,We,ft))}if(ft===0)return ft}return ft}(D,this.geometries);if(D.geometryType()==="LineString")return function(K,pe){let ke=K.geometry(),je=ke.flat().map(Mt=>Cn([Mt.x,Mt.y],K.canonical));if(ke.length===0)return NaN;let We=new Sf(je[0][1]),ft=1/0;for(let Mt of pe){switch(Mt.type){case"Point":ft=Math.min(ft,Ul(je,!0,[Mt.coordinates],!1,We,ft));break;case"LineString":ft=Math.min(ft,Ul(je,!0,Mt.coordinates,!0,We,ft));break;case"Polygon":ft=Math.min(ft,Vu(je,!0,Mt.coordinates,We,ft))}if(ft===0)return ft}return ft}(D,this.geometries);if(D.geometryType()==="Polygon")return function(K,pe){let ke=K.geometry();if(ke.length===0||ke[0].length===0)return NaN;let je=Bc(ke,0).map(Mt=>Mt.map(Ut=>Ut.map(nr=>Cn([nr.x,nr.y],K.canonical)))),We=new Sf(je[0][0][0][1]),ft=1/0;for(let Mt of pe)for(let Ut of je){switch(Mt.type){case"Point":ft=Math.min(ft,Vu([Mt.coordinates],!1,Ut,We,ft));break;case"LineString":ft=Math.min(ft,Vu(Mt.coordinates,!0,Ut,We,ft));break;case"Polygon":ft=Math.min(ft,Ss(Ut,Mt.coordinates,We,ft))}if(ft===0)return ft}return ft}(D,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}let rf={"==":Po,"!=":so,">":To,"<":Vn,">=":Oo,"<=":qo,array:Lr,at:dr,boolean:Lr,case:Fa,coalesce:pn,collator:lo,format:os,image:Ys,in:kr,"index-of":ia,interpolate:to,"interpolate-hcl":to,"interpolate-lab":to,length:Os,let:fa,literal:Nr,match:Ca,number:Lr,"number-format":Co,object:Lr,slice:Ya,step:Da,string:Lr,"to-boolean":Kr,"to-color":Kr,"to-number":Kr,"to-string":Kr,var:It,within:fl,distance:wc};class Kl{constructor(D,K,pe,ke){this.name=D,this.type=K,this._evaluate=pe,this.args=ke}evaluate(D){return this._evaluate(D,this.args)}eachChild(D){this.args.forEach(D)}outputDefined(){return!1}static parse(D,K){let pe=D[0],ke=Kl.definitions[pe];if(!ke)return K.error(`Unknown expression "${pe}". If you wanted a literal array, use ["literal", [...]].`,0);let je=Array.isArray(ke)?ke[0]:ke.type,We=Array.isArray(ke)?[[ke[1],ke[2]]]:ke.overloads,ft=We.filter(([Ut])=>!Array.isArray(Ut)||Ut.length===D.length-1),Mt=null;for(let[Ut,nr]of ft){Mt=new da(K.registry,Ff,K.path,null,K.scope);let Mr=[],zr=!1;for(let Hr=1;Hr{return zr=Mr,Array.isArray(zr)?`(${zr.map(Ke).join(", ")})`:`(${Ke(zr.type)}...)`;var zr}).join(" | "),nr=[];for(let Mr=1;Mr{K=D?K&&Ff(pe):K&&pe instanceof Nr}),!!K&&Of(H)&&Ef(H,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function Of(H){if(H instanceof Kl&&(H.name==="get"&&H.args.length===1||H.name==="feature-state"||H.name==="has"&&H.args.length===1||H.name==="properties"||H.name==="geometry-type"||H.name==="id"||/^filter-/.test(H.name))||H instanceof fl||H instanceof wc)return!1;let D=!0;return H.eachChild(K=>{D&&!Of(K)&&(D=!1)}),D}function Gu(H){if(H instanceof Kl&&H.name==="feature-state")return!1;let D=!0;return H.eachChild(K=>{D&&!Gu(K)&&(D=!1)}),D}function Ef(H,D){if(H instanceof Kl&&D.indexOf(H.name)>=0)return!1;let K=!0;return H.eachChild(pe=>{K&&!Ef(pe,D)&&(K=!1)}),K}function oc(H){return{result:"success",value:H}}function Hc(H){return{result:"error",value:H}}function Jl(H){return H["property-type"]==="data-driven"||H["property-type"]==="cross-faded-data-driven"}function Uc(H){return!!H.expression&&H.expression.parameters.indexOf("zoom")>-1}function Tc(H){return!!H.expression&&H.expression.interpolated}function Gs(H){return H instanceof Number?"number":H instanceof String?"string":H instanceof Boolean?"boolean":Array.isArray(H)?"array":H===null?"null":typeof H}function Cf(H){return typeof H=="object"&&H!==null&&!Array.isArray(H)}function lh(H){return H}function Bf(H,D){let K=D.type==="color",pe=H.stops&&typeof H.stops[0][0]=="object",ke=pe||!(pe||H.property!==void 0),je=H.type||(Tc(D)?"exponential":"interval");if(K||D.type==="padding"){let nr=K?Wt.parse:ra.parse;(H=fe({},H)).stops&&(H.stops=H.stops.map(Mr=>[Mr[0],nr(Mr[1])])),H.default=nr(H.default?H.default:D.default)}if(H.colorSpace&&(We=H.colorSpace)!=="rgb"&&We!=="hcl"&&We!=="lab")throw new Error(`Unknown color space: "${H.colorSpace}"`);var We;let ft,Mt,Ut;if(je==="exponential")ft=Nf;else if(je==="interval")ft=ku;else if(je==="categorical"){ft=Kf,Mt=Object.create(null);for(let nr of H.stops)Mt[nr[0]]=nr[1];Ut=typeof H.stops[0][0]}else{if(je!=="identity")throw new Error(`Unknown function type "${je}"`);ft=ml}if(pe){let nr={},Mr=[];for(let oa=0;oaoa[0]),evaluate:({zoom:oa},va)=>Nf({stops:zr,base:H.base},D,oa).evaluate(oa,va)}}if(ke){let nr=je==="exponential"?{name:"exponential",base:H.base!==void 0?H.base:1}:null;return{kind:"camera",interpolationType:nr,interpolationFactor:to.interpolationFactor.bind(void 0,nr),zoomStops:H.stops.map(Mr=>Mr[0]),evaluate:({zoom:Mr})=>ft(H,D,Mr,Mt,Ut)}}return{kind:"source",evaluate(nr,Mr){let zr=Mr&&Mr.properties?Mr.properties[H.property]:void 0;return zr===void 0?Wc(H.default,D.default):ft(H,D,zr,Mt,Ut)}}}function Wc(H,D,K){return H!==void 0?H:D!==void 0?D:K!==void 0?K:void 0}function Kf(H,D,K,pe,ke){return Wc(typeof K===ke?pe[K]:void 0,H.default,D.default)}function ku(H,D,K){if(Gs(K)!=="number")return Wc(H.default,D.default);let pe=H.stops.length;if(pe===1||K<=H.stops[0][0])return H.stops[0][1];if(K>=H.stops[pe-1][0])return H.stops[pe-1][1];let ke=ha(H.stops.map(je=>je[0]),K);return H.stops[ke][1]}function Nf(H,D,K){let pe=H.base!==void 0?H.base:1;if(Gs(K)!=="number")return Wc(H.default,D.default);let ke=H.stops.length;if(ke===1||K<=H.stops[0][0])return H.stops[0][1];if(K>=H.stops[ke-1][0])return H.stops[ke-1][1];let je=ha(H.stops.map(nr=>nr[0]),K),We=function(nr,Mr,zr,Hr){let oa=Hr-zr,va=nr-zr;return oa===0?0:Mr===1?va/oa:(Math.pow(Mr,va)-1)/(Math.pow(Mr,oa)-1)}(K,pe,H.stops[je][0],H.stops[je+1][0]),ft=H.stops[je][1],Mt=H.stops[je+1][1],Ut=Xn[D.type]||lh;return typeof ft.evaluate=="function"?{evaluate(...nr){let Mr=ft.evaluate.apply(void 0,nr),zr=Mt.evaluate.apply(void 0,nr);if(Mr!==void 0&&zr!==void 0)return Ut(Mr,zr,We,H.colorSpace)}}:Ut(ft,Mt,We,H.colorSpace)}function ml(H,D,K){switch(D.type){case"color":K=Wt.parse(K);break;case"formatted":K=ma.fromString(K.toString());break;case"resolvedImage":K=$a.fromString(K.toString());break;case"padding":K=ra.parse(K);break;default:Gs(K)===D.type||D.type==="enum"&&D.values[K]||(K=void 0)}return Wc(K,H.default,D.default)}Kl.register(rf,{error:[{kind:"error"},[Lt],(H,[D])=>{throw new Or(D.evaluate(H))}],typeof:[Lt,[Sr],(H,[D])=>Ke(xt(D.evaluate(H)))],"to-rgba":[Be(Qe,4),[Vt],(H,[D])=>{let[K,pe,ke,je]=D.evaluate(H).rgb;return[255*K,255*pe,255*ke,je]}],rgb:[Vt,[Qe,Qe,Qe],Yf],rgba:[Vt,[Qe,Qe,Qe,Qe],Yf],has:{type:kt,overloads:[[[Lt],(H,[D])=>zf(D.evaluate(H),H.properties())],[[Lt,Zt],(H,[D,K])=>zf(D.evaluate(H),K.evaluate(H))]]},get:{type:Sr,overloads:[[[Lt],(H,[D])=>af(D.evaluate(H),H.properties())],[[Lt,Zt],(H,[D,K])=>af(D.evaluate(H),K.evaluate(H))]]},"feature-state":[Sr,[Lt],(H,[D])=>af(D.evaluate(H),H.featureState||{})],properties:[Zt,[],H=>H.properties()],"geometry-type":[Lt,[],H=>H.geometryType()],id:[Sr,[],H=>H.id()],zoom:[Qe,[],H=>H.globals.zoom],"heatmap-density":[Qe,[],H=>H.globals.heatmapDensity||0],"line-progress":[Qe,[],H=>H.globals.lineProgress||0],accumulated:[Sr,[],H=>H.globals.accumulated===void 0?null:H.globals.accumulated],"+":[Qe,Nc(Qe),(H,D)=>{let K=0;for(let pe of D)K+=pe.evaluate(H);return K}],"*":[Qe,Nc(Qe),(H,D)=>{let K=1;for(let pe of D)K*=pe.evaluate(H);return K}],"-":{type:Qe,overloads:[[[Qe,Qe],(H,[D,K])=>D.evaluate(H)-K.evaluate(H)],[[Qe],(H,[D])=>-D.evaluate(H)]]},"/":[Qe,[Qe,Qe],(H,[D,K])=>D.evaluate(H)/K.evaluate(H)],"%":[Qe,[Qe,Qe],(H,[D,K])=>D.evaluate(H)%K.evaluate(H)],ln2:[Qe,[],()=>Math.LN2],pi:[Qe,[],()=>Math.PI],e:[Qe,[],()=>Math.E],"^":[Qe,[Qe,Qe],(H,[D,K])=>Math.pow(D.evaluate(H),K.evaluate(H))],sqrt:[Qe,[Qe],(H,[D])=>Math.sqrt(D.evaluate(H))],log10:[Qe,[Qe],(H,[D])=>Math.log(D.evaluate(H))/Math.LN10],ln:[Qe,[Qe],(H,[D])=>Math.log(D.evaluate(H))],log2:[Qe,[Qe],(H,[D])=>Math.log(D.evaluate(H))/Math.LN2],sin:[Qe,[Qe],(H,[D])=>Math.sin(D.evaluate(H))],cos:[Qe,[Qe],(H,[D])=>Math.cos(D.evaluate(H))],tan:[Qe,[Qe],(H,[D])=>Math.tan(D.evaluate(H))],asin:[Qe,[Qe],(H,[D])=>Math.asin(D.evaluate(H))],acos:[Qe,[Qe],(H,[D])=>Math.acos(D.evaluate(H))],atan:[Qe,[Qe],(H,[D])=>Math.atan(D.evaluate(H))],min:[Qe,Nc(Qe),(H,D)=>Math.min(...D.map(K=>K.evaluate(H)))],max:[Qe,Nc(Qe),(H,D)=>Math.max(...D.map(K=>K.evaluate(H)))],abs:[Qe,[Qe],(H,[D])=>Math.abs(D.evaluate(H))],round:[Qe,[Qe],(H,[D])=>{let K=D.evaluate(H);return K<0?-Math.round(-K):Math.round(K)}],floor:[Qe,[Qe],(H,[D])=>Math.floor(D.evaluate(H))],ceil:[Qe,[Qe],(H,[D])=>Math.ceil(D.evaluate(H))],"filter-==":[kt,[Lt,Sr],(H,[D,K])=>H.properties()[D.value]===K.value],"filter-id-==":[kt,[Sr],(H,[D])=>H.id()===D.value],"filter-type-==":[kt,[Lt],(H,[D])=>H.geometryType()===D.value],"filter-<":[kt,[Lt,Sr],(H,[D,K])=>{let pe=H.properties()[D.value],ke=K.value;return typeof pe==typeof ke&&pe{let K=H.id(),pe=D.value;return typeof K==typeof pe&&K":[kt,[Lt,Sr],(H,[D,K])=>{let pe=H.properties()[D.value],ke=K.value;return typeof pe==typeof ke&&pe>ke}],"filter-id->":[kt,[Sr],(H,[D])=>{let K=H.id(),pe=D.value;return typeof K==typeof pe&&K>pe}],"filter-<=":[kt,[Lt,Sr],(H,[D,K])=>{let pe=H.properties()[D.value],ke=K.value;return typeof pe==typeof ke&&pe<=ke}],"filter-id-<=":[kt,[Sr],(H,[D])=>{let K=H.id(),pe=D.value;return typeof K==typeof pe&&K<=pe}],"filter->=":[kt,[Lt,Sr],(H,[D,K])=>{let pe=H.properties()[D.value],ke=K.value;return typeof pe==typeof ke&&pe>=ke}],"filter-id->=":[kt,[Sr],(H,[D])=>{let K=H.id(),pe=D.value;return typeof K==typeof pe&&K>=pe}],"filter-has":[kt,[Sr],(H,[D])=>D.value in H.properties()],"filter-has-id":[kt,[],H=>H.id()!==null&&H.id()!==void 0],"filter-type-in":[kt,[Be(Lt)],(H,[D])=>D.value.indexOf(H.geometryType())>=0],"filter-id-in":[kt,[Be(Sr)],(H,[D])=>D.value.indexOf(H.id())>=0],"filter-in-small":[kt,[Lt,Be(Sr)],(H,[D,K])=>K.value.indexOf(H.properties()[D.value])>=0],"filter-in-large":[kt,[Lt,Be(Sr)],(H,[D,K])=>function(pe,ke,je,We){for(;je<=We;){let ft=je+We>>1;if(ke[ft]===pe)return!0;ke[ft]>pe?We=ft-1:je=ft+1}return!1}(H.properties()[D.value],K.value,0,K.value.length-1)],all:{type:kt,overloads:[[[kt,kt],(H,[D,K])=>D.evaluate(H)&&K.evaluate(H)],[Nc(kt),(H,D)=>{for(let K of D)if(!K.evaluate(H))return!1;return!0}]]},any:{type:kt,overloads:[[[kt,kt],(H,[D,K])=>D.evaluate(H)||K.evaluate(H)],[Nc(kt),(H,D)=>{for(let K of D)if(K.evaluate(H))return!0;return!1}]]},"!":[kt,[kt],(H,[D])=>!D.evaluate(H)],"is-supported-script":[kt,[Lt],(H,[D])=>{let K=H.globals&&H.globals.isSupportedScript;return!K||K(D.evaluate(H))}],upcase:[Lt,[Lt],(H,[D])=>D.evaluate(H).toUpperCase()],downcase:[Lt,[Lt],(H,[D])=>D.evaluate(H).toLowerCase()],concat:[Lt,Nc(Sr),(H,D)=>D.map(K=>ct(K.evaluate(H))).join("")],"resolved-locale":[Lt,[xr],(H,[D])=>D.evaluate(H).resolvedLocale()]});class Lu{constructor(D,K){var pe;this.expression=D,this._warningHistory={},this._evaluator=new aa,this._defaultValue=K?(pe=K).type==="color"&&Cf(pe.default)?new Wt(0,0,0,0):pe.type==="color"?Wt.parse(pe.default)||null:pe.type==="padding"?ra.parse(pe.default)||null:pe.type==="variableAnchorOffsetCollection"?Ha.parse(pe.default)||null:pe.default===void 0?null:pe.default:null,this._enumValues=K&&K.type==="enum"?K.values:null}evaluateWithoutErrorHandling(D,K,pe,ke,je,We){return this._evaluator.globals=D,this._evaluator.feature=K,this._evaluator.featureState=pe,this._evaluator.canonical=ke,this._evaluator.availableImages=je||null,this._evaluator.formattedSection=We,this.expression.evaluate(this._evaluator)}evaluate(D,K,pe,ke,je,We){this._evaluator.globals=D,this._evaluator.feature=K||null,this._evaluator.featureState=pe||null,this._evaluator.canonical=ke,this._evaluator.availableImages=je||null,this._evaluator.formattedSection=We||null;try{let ft=this.expression.evaluate(this._evaluator);if(ft==null||typeof ft=="number"&&ft!=ft)return this._defaultValue;if(this._enumValues&&!(ft in this._enumValues))throw new Or(`Expected value to be one of ${Object.keys(this._enumValues).map(Mt=>JSON.stringify(Mt)).join(", ")}, but found ${JSON.stringify(ft)} instead.`);return ft}catch(ft){return this._warningHistory[ft.message]||(this._warningHistory[ft.message]=!0,typeof console<"u"&&console.warn(ft.message)),this._defaultValue}}}function Ac(H){return Array.isArray(H)&&H.length>0&&typeof H[0]=="string"&&H[0]in rf}function nl(H,D){let K=new da(rf,Ff,[],D?function(ke){let je={color:Vt,string:Lt,number:Qe,enum:Lt,boolean:kt,formatted:jr,padding:wr,resolvedImage:Ir,variableAnchorOffsetCollection:bt};return ke.type==="array"?Be(je[ke.value]||Sr,ke.length):je[ke.type]}(D):void 0),pe=K.parse(H,void 0,void 0,void 0,D&&D.type==="string"?{typeAnnotation:"coerce"}:void 0);return pe?oc(new Lu(pe,D)):Hc(K.errors)}class dc{constructor(D,K){this.kind=D,this._styleExpression=K,this.isStateDependent=D!=="constant"&&!Gu(K.expression)}evaluateWithoutErrorHandling(D,K,pe,ke,je,We){return this._styleExpression.evaluateWithoutErrorHandling(D,K,pe,ke,je,We)}evaluate(D,K,pe,ke,je,We){return this._styleExpression.evaluate(D,K,pe,ke,je,We)}}class vu{constructor(D,K,pe,ke){this.kind=D,this.zoomStops=pe,this._styleExpression=K,this.isStateDependent=D!=="camera"&&!Gu(K.expression),this.interpolationType=ke}evaluateWithoutErrorHandling(D,K,pe,ke,je,We){return this._styleExpression.evaluateWithoutErrorHandling(D,K,pe,ke,je,We)}evaluate(D,K,pe,ke,je,We){return this._styleExpression.evaluate(D,K,pe,ke,je,We)}interpolationFactor(D,K,pe){return this.interpolationType?to.interpolationFactor(this.interpolationType,D,K,pe):0}}function bu(H,D){let K=nl(H,D);if(K.result==="error")return K;let pe=K.value.expression,ke=Of(pe);if(!ke&&!Jl(D))return Hc([new Fe("","data expressions not supported")]);let je=Ef(pe,["zoom"]);if(!je&&!Uc(D))return Hc([new Fe("","zoom expressions not supported")]);let We=Uf(pe);return We||je?We instanceof Fe?Hc([We]):We instanceof to&&!Tc(D)?Hc([new Fe("",'"interpolate" expressions cannot be used with this property')]):oc(We?new vu(ke?"camera":"composite",K.value,We.labels,We instanceof to?We.interpolation:void 0):new dc(ke?"constant":"source",K.value)):Hc([new Fe("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class Ml{constructor(D,K){this._parameters=D,this._specification=K,fe(this,Bf(this._parameters,this._specification))}static deserialize(D){return new Ml(D._parameters,D._specification)}static serialize(D){return{_parameters:D._parameters,_specification:D._specification}}}function Uf(H){let D=null;if(H instanceof fa)D=Uf(H.result);else if(H instanceof pn){for(let K of H.args)if(D=Uf(K),D)break}else(H instanceof Da||H instanceof to)&&H.input instanceof Kl&&H.input.name==="zoom"&&(D=H);return D instanceof Fe||H.eachChild(K=>{let pe=Uf(K);pe instanceof Fe?D=pe:!D&&pe?D=new Fe("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):D&&pe&&D!==pe&&(D=new Fe("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),D}function Jf(H){if(H===!0||H===!1)return!0;if(!Array.isArray(H)||H.length===0)return!1;switch(H[0]){case"has":return H.length>=2&&H[1]!=="$id"&&H[1]!=="$type";case"in":return H.length>=3&&(typeof H[1]!="string"||Array.isArray(H[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return H.length!==3||Array.isArray(H[1])||Array.isArray(H[2]);case"any":case"all":for(let D of H.slice(1))if(!Jf(D)&&typeof D!="boolean")return!1;return!0;default:return!0}}let Bu={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Sc(H){if(H==null)return{filter:()=>!0,needGeometry:!1};Jf(H)||(H=nf(H));let D=nl(H,Bu);if(D.result==="error")throw new Error(D.value.map(K=>`${K.key}: ${K.message}`).join(", "));return{filter:(K,pe,ke)=>D.value.evaluate(K,pe,{},ke),needGeometry:Lh(H)}}function vc(H,D){return HD?1:0}function Lh(H){if(!Array.isArray(H))return!1;if(H[0]==="within"||H[0]==="distance")return!0;for(let D=1;D"||D==="<="||D===">="?df(H[1],H[2],D):D==="any"?(K=H.slice(1),["any"].concat(K.map(nf))):D==="all"?["all"].concat(H.slice(1).map(nf)):D==="none"?["all"].concat(H.slice(1).map(nf).map(tu)):D==="in"?Nu(H[1],H.slice(2)):D==="!in"?tu(Nu(H[1],H.slice(2))):D==="has"?of(H[1]):D!=="!has"||tu(of(H[1]));var K}function df(H,D,K){switch(H){case"$type":return[`filter-type-${K}`,D];case"$id":return[`filter-id-${K}`,D];default:return[`filter-${K}`,H,D]}}function Nu(H,D){if(D.length===0)return!1;switch(H){case"$type":return["filter-type-in",["literal",D]];case"$id":return["filter-id-in",["literal",D]];default:return D.length>200&&!D.some(K=>typeof K!=typeof D[0])?["filter-in-large",H,["literal",D.sort(vc)]]:["filter-in-small",H,["literal",D]]}}function of(H){switch(H){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",H]}}function tu(H){return["!",H]}function Xc(H){let D=typeof H;if(D==="number"||D==="boolean"||D==="string"||H==null)return JSON.stringify(H);if(Array.isArray(H)){let ke="[";for(let je of H)ke+=`${Xc(je)},`;return`${ke}]`}let K=Object.keys(H).sort(),pe="{";for(let ke=0;kepe.maximum?[new _e(D,K,`${K} is greater than the maximum value ${pe.maximum}`)]:[]}function sf(H){let D=H.valueSpec,K=ol(H.value.type),pe,ke,je,We={},ft=K!=="categorical"&&H.value.property===void 0,Mt=!ft,Ut=Gs(H.value.stops)==="array"&&Gs(H.value.stops[0])==="array"&&Gs(H.value.stops[0][0])==="object",nr=Pu({key:H.key,value:H.value,valueSpec:H.styleSpec.function,validateSpec:H.validateSpec,style:H.style,styleSpec:H.styleSpec,objectElementValidators:{stops:function(Hr){if(K==="identity")return[new _e(Hr.key,Hr.value,'identity function may not have a "stops" property')];let oa=[],va=Hr.value;return oa=oa.concat(kf({key:Hr.key,value:va,valueSpec:Hr.valueSpec,validateSpec:Hr.validateSpec,style:Hr.style,styleSpec:Hr.styleSpec,arrayElementValidator:Mr})),Gs(va)==="array"&&va.length===0&&oa.push(new _e(Hr.key,va,"array must have at least one stop")),oa},default:function(Hr){return Hr.validateSpec({key:Hr.key,value:Hr.value,valueSpec:D,validateSpec:Hr.validateSpec,style:Hr.style,styleSpec:Hr.styleSpec})}}});return K==="identity"&&ft&&nr.push(new _e(H.key,H.value,'missing required property "property"')),K==="identity"||H.value.stops||nr.push(new _e(H.key,H.value,'missing required property "stops"')),K==="exponential"&&H.valueSpec.expression&&!Tc(H.valueSpec)&&nr.push(new _e(H.key,H.value,"exponential functions not supported")),H.styleSpec.$version>=8&&(Mt&&!Jl(H.valueSpec)?nr.push(new _e(H.key,H.value,"property functions not supported")):ft&&!Uc(H.valueSpec)&&nr.push(new _e(H.key,H.value,"zoom functions not supported"))),K!=="categorical"&&!Ut||H.value.property!==void 0||nr.push(new _e(H.key,H.value,'"property" property is required')),nr;function Mr(Hr){let oa=[],va=Hr.value,Ga=Hr.key;if(Gs(va)!=="array")return[new _e(Ga,va,`array expected, ${Gs(va)} found`)];if(va.length!==2)return[new _e(Ga,va,`array length 2 expected, length ${va.length} found`)];if(Ut){if(Gs(va[0])!=="object")return[new _e(Ga,va,`object expected, ${Gs(va[0])} found`)];if(va[0].zoom===void 0)return[new _e(Ga,va,"object stop key must have zoom")];if(va[0].value===void 0)return[new _e(Ga,va,"object stop key must have value")];if(je&&je>ol(va[0].zoom))return[new _e(Ga,va[0].zoom,"stop zoom values must appear in ascending order")];ol(va[0].zoom)!==je&&(je=ol(va[0].zoom),ke=void 0,We={}),oa=oa.concat(Pu({key:`${Ga}[0]`,value:va[0],valueSpec:{zoom:{}},validateSpec:Hr.validateSpec,style:Hr.style,styleSpec:Hr.styleSpec,objectElementValidators:{zoom:hl,value:zr}}))}else oa=oa.concat(zr({key:`${Ga}[0]`,value:va[0],valueSpec:{},validateSpec:Hr.validateSpec,style:Hr.style,styleSpec:Hr.styleSpec},va));return Ac(mu(va[1]))?oa.concat([new _e(`${Ga}[1]`,va[1],"expressions are not allowed in function stops.")]):oa.concat(Hr.validateSpec({key:`${Ga}[1]`,value:va[1],valueSpec:D,validateSpec:Hr.validateSpec,style:Hr.style,styleSpec:Hr.styleSpec}))}function zr(Hr,oa){let va=Gs(Hr.value),Ga=ol(Hr.value),Qa=Hr.value!==null?Hr.value:oa;if(pe){if(va!==pe)return[new _e(Hr.key,Qa,`${va} stop domain type must match previous stop domain type ${pe}`)]}else pe=va;if(va!=="number"&&va!=="string"&&va!=="boolean")return[new _e(Hr.key,Qa,"stop domain value must be a number, string, or boolean")];if(va!=="number"&&K!=="categorical"){let Yi=`number expected, ${va} found`;return Jl(D)&&K===void 0&&(Yi+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new _e(Hr.key,Qa,Yi)]}return K!=="categorical"||va!=="number"||isFinite(Ga)&&Math.floor(Ga)===Ga?K!=="categorical"&&va==="number"&&ke!==void 0&&Ganew _e(`${H.key}${pe.key}`,H.value,pe.message));let K=D.value.expression||D.value._styleExpression.expression;if(H.expressionContext==="property"&&H.propertyKey==="text-font"&&!K.outputDefined())return[new _e(H.key,H.value,`Invalid data expression for "${H.propertyKey}". Output values must be contained as literals within the expression.`)];if(H.expressionContext==="property"&&H.propertyType==="layout"&&!Gu(K))return[new _e(H.key,H.value,'"feature-state" data expressions are not supported with layout properties.')];if(H.expressionContext==="filter"&&!Gu(K))return[new _e(H.key,H.value,'"feature-state" data expressions are not supported with filters.')];if(H.expressionContext&&H.expressionContext.indexOf("cluster")===0){if(!Ef(K,["zoom","feature-state"]))return[new _e(H.key,H.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(H.expressionContext==="cluster-initial"&&!Of(K))return[new _e(H.key,H.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Hu(H){let D=H.key,K=H.value,pe=H.valueSpec,ke=[];return Array.isArray(pe.values)?pe.values.indexOf(ol(K))===-1&&ke.push(new _e(D,K,`expected one of [${pe.values.join(", ")}], ${JSON.stringify(K)} found`)):Object.keys(pe.values).indexOf(ol(K))===-1&&ke.push(new _e(D,K,`expected one of [${Object.keys(pe.values).join(", ")}], ${JSON.stringify(K)} found`)),ke}function mf(H){return Jf(mu(H.value))?Mc(fe({},H,{expressionContext:"filter",valueSpec:{value:"boolean"}})):Wu(H)}function Wu(H){let D=H.value,K=H.key;if(Gs(D)!=="array")return[new _e(K,D,`array expected, ${Gs(D)} found`)];let pe=H.styleSpec,ke,je=[];if(D.length<1)return[new _e(K,D,"filter array must have at least 1 element")];switch(je=je.concat(Hu({key:`${K}[0]`,value:D[0],valueSpec:pe.filter_operator,style:H.style,styleSpec:H.styleSpec})),ol(D[0])){case"<":case"<=":case">":case">=":D.length>=2&&ol(D[1])==="$type"&&je.push(new _e(K,D,`"$type" cannot be use with operator "${D[0]}"`));case"==":case"!=":D.length!==3&&je.push(new _e(K,D,`filter array for operator "${D[0]}" must have 3 elements`));case"in":case"!in":D.length>=2&&(ke=Gs(D[1]),ke!=="string"&&je.push(new _e(`${K}[1]`,D[1],`string expected, ${ke} found`)));for(let We=2;We{Ut in K&&D.push(new _e(pe,K[Ut],`"${Ut}" is prohibited for ref layers`))}),ke.layers.forEach(Ut=>{ol(Ut.id)===ft&&(Mt=Ut)}),Mt?Mt.ref?D.push(new _e(pe,K.ref,"ref cannot reference another ref layer")):We=ol(Mt.type):D.push(new _e(pe,K.ref,`ref layer "${ft}" not found`))}else if(We!=="background")if(K.source){let Mt=ke.sources&&ke.sources[K.source],Ut=Mt&&ol(Mt.type);Mt?Ut==="vector"&&We==="raster"?D.push(new _e(pe,K.source,`layer "${K.id}" requires a raster source`)):Ut!=="raster-dem"&&We==="hillshade"?D.push(new _e(pe,K.source,`layer "${K.id}" requires a raster-dem source`)):Ut==="raster"&&We!=="raster"?D.push(new _e(pe,K.source,`layer "${K.id}" requires a vector source`)):Ut!=="vector"||K["source-layer"]?Ut==="raster-dem"&&We!=="hillshade"?D.push(new _e(pe,K.source,"raster-dem source can only be used with layer type 'hillshade'.")):We!=="line"||!K.paint||!K.paint["line-gradient"]||Ut==="geojson"&&Mt.lineMetrics||D.push(new _e(pe,K,`layer "${K.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):D.push(new _e(pe,K,`layer "${K.id}" must specify a "source-layer"`)):D.push(new _e(pe,K.source,`source "${K.source}" not found`))}else D.push(new _e(pe,K,'missing required property "source"'));return D=D.concat(Pu({key:pe,value:K,valueSpec:je.layer,style:H.style,styleSpec:H.styleSpec,validateSpec:H.validateSpec,objectElementValidators:{"*":()=>[],type:()=>H.validateSpec({key:`${pe}.type`,value:K.type,valueSpec:je.layer.type,style:H.style,styleSpec:H.styleSpec,validateSpec:H.validateSpec,object:K,objectKey:"type"}),filter:mf,layout:Mt=>Pu({layer:K,key:Mt.key,value:Mt.value,style:Mt.style,styleSpec:Mt.styleSpec,validateSpec:Mt.validateSpec,objectElementValidators:{"*":Ut=>ru(fe({layerType:We},Ut))}}),paint:Mt=>Pu({layer:K,key:Mt.key,value:Mt.value,style:Mt.style,styleSpec:Mt.styleSpec,validateSpec:Mt.validateSpec,objectElementValidators:{"*":Ut=>Lf(fe({layerType:We},Ut))}})}})),D}function Xu(H){let D=H.value,K=H.key,pe=Gs(D);return pe!=="string"?[new _e(K,D,`string expected, ${pe} found`)]:[]}let Ec={promoteId:function({key:H,value:D}){if(Gs(D)==="string")return Xu({key:H,value:D});{let K=[];for(let pe in D)K.push(...Xu({key:`${H}.${pe}`,value:D[pe]}));return K}}};function mc(H){let D=H.value,K=H.key,pe=H.styleSpec,ke=H.style,je=H.validateSpec;if(!D.type)return[new _e(K,D,'"type" is required')];let We=ol(D.type),ft;switch(We){case"vector":case"raster":return ft=Pu({key:K,value:D,valueSpec:pe[`source_${We.replace("-","_")}`],style:H.style,styleSpec:pe,objectElementValidators:Ec,validateSpec:je}),ft;case"raster-dem":return ft=function(Mt){var Ut;let nr=(Ut=Mt.sourceName)!==null&&Ut!==void 0?Ut:"",Mr=Mt.value,zr=Mt.styleSpec,Hr=zr.source_raster_dem,oa=Mt.style,va=[],Ga=Gs(Mr);if(Mr===void 0)return va;if(Ga!=="object")return va.push(new _e("source_raster_dem",Mr,`object expected, ${Ga} found`)),va;let Qa=ol(Mr.encoding)==="custom",Yi=["redFactor","greenFactor","blueFactor","baseShift"],xi=Mt.value.encoding?`"${Mt.value.encoding}"`:"Default";for(let Hi in Mr)!Qa&&Yi.includes(Hi)?va.push(new _e(Hi,Mr[Hi],`In "${nr}": "${Hi}" is only valid when "encoding" is set to "custom". ${xi} encoding found`)):Hr[Hi]?va=va.concat(Mt.validateSpec({key:Hi,value:Mr[Hi],valueSpec:Hr[Hi],validateSpec:Mt.validateSpec,style:oa,styleSpec:zr})):va.push(new _e(Hi,Mr[Hi],`unknown property "${Hi}"`));return va}({sourceName:K,value:D,style:H.style,styleSpec:pe,validateSpec:je}),ft;case"geojson":if(ft=Pu({key:K,value:D,valueSpec:pe.source_geojson,style:ke,styleSpec:pe,validateSpec:je,objectElementValidators:Ec}),D.cluster)for(let Mt in D.clusterProperties){let[Ut,nr]=D.clusterProperties[Mt],Mr=typeof Ut=="string"?[Ut,["accumulated"],["get",Mt]]:Ut;ft.push(...Mc({key:`${K}.${Mt}.map`,value:nr,validateSpec:je,expressionContext:"cluster-map"})),ft.push(...Mc({key:`${K}.${Mt}.reduce`,value:Mr,validateSpec:je,expressionContext:"cluster-reduce"}))}return ft;case"video":return Pu({key:K,value:D,valueSpec:pe.source_video,style:ke,validateSpec:je,styleSpec:pe});case"image":return Pu({key:K,value:D,valueSpec:pe.source_image,style:ke,validateSpec:je,styleSpec:pe});case"canvas":return[new _e(K,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Hu({key:`${K}.type`,value:D.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:ke,validateSpec:je,styleSpec:pe})}}function jl(H){let D=H.value,K=H.styleSpec,pe=K.light,ke=H.style,je=[],We=Gs(D);if(D===void 0)return je;if(We!=="object")return je=je.concat([new _e("light",D,`object expected, ${We} found`)]),je;for(let ft in D){let Mt=ft.match(/^(.*)-transition$/);je=je.concat(Mt&&pe[Mt[1]]&&pe[Mt[1]].transition?H.validateSpec({key:ft,value:D[ft],valueSpec:K.transition,validateSpec:H.validateSpec,style:ke,styleSpec:K}):pe[ft]?H.validateSpec({key:ft,value:D[ft],valueSpec:pe[ft],validateSpec:H.validateSpec,style:ke,styleSpec:K}):[new _e(ft,D[ft],`unknown property "${ft}"`)])}return je}function gu(H){let D=H.value,K=H.styleSpec,pe=K.sky,ke=H.style,je=Gs(D);if(D===void 0)return[];if(je!=="object")return[new _e("sky",D,`object expected, ${je} found`)];let We=[];for(let ft in D)We=We.concat(pe[ft]?H.validateSpec({key:ft,value:D[ft],valueSpec:pe[ft],style:ke,styleSpec:K}):[new _e(ft,D[ft],`unknown property "${ft}"`)]);return We}function Cc(H){let D=H.value,K=H.styleSpec,pe=K.terrain,ke=H.style,je=[],We=Gs(D);if(D===void 0)return je;if(We!=="object")return je=je.concat([new _e("terrain",D,`object expected, ${We} found`)]),je;for(let ft in D)je=je.concat(pe[ft]?H.validateSpec({key:ft,value:D[ft],valueSpec:pe[ft],validateSpec:H.validateSpec,style:ke,styleSpec:K}):[new _e(ft,D[ft],`unknown property "${ft}"`)]);return je}function Yc(H){let D=[],K=H.value,pe=H.key;if(Array.isArray(K)){let ke=[],je=[];for(let We in K)K[We].id&&ke.includes(K[We].id)&&D.push(new _e(pe,K,`all the sprites' ids must be unique, but ${K[We].id} is duplicated`)),ke.push(K[We].id),K[We].url&&je.includes(K[We].url)&&D.push(new _e(pe,K,`all the sprites' URLs must be unique, but ${K[We].url} is duplicated`)),je.push(K[We].url),D=D.concat(Pu({key:`${pe}[${We}]`,value:K[We],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:H.validateSpec}));return D}return Xu({key:pe,value:K})}let sc={"*":()=>[],array:kf,boolean:function(H){let D=H.value,K=H.key,pe=Gs(D);return pe!=="boolean"?[new _e(K,D,`boolean expected, ${pe} found`)]:[]},number:hl,color:function(H){let D=H.key,K=H.value,pe=Gs(K);return pe!=="string"?[new _e(D,K,`color expected, ${pe} found`)]:Wt.parse(String(K))?[]:[new _e(D,K,`color expected, "${K}" found`)]},constants:vf,enum:Hu,filter:mf,function:sf,layer:jf,object:Pu,source:mc,light:jl,sky:gu,terrain:Cc,projection:function(H){let D=H.value,K=H.styleSpec,pe=K.projection,ke=H.style,je=Gs(D);if(D===void 0)return[];if(je!=="object")return[new _e("projection",D,`object expected, ${je} found`)];let We=[];for(let ft in D)We=We.concat(pe[ft]?H.validateSpec({key:ft,value:D[ft],valueSpec:pe[ft],style:ke,styleSpec:K}):[new _e(ft,D[ft],`unknown property "${ft}"`)]);return We},string:Xu,formatted:function(H){return Xu(H).length===0?[]:Mc(H)},resolvedImage:function(H){return Xu(H).length===0?[]:Mc(H)},padding:function(H){let D=H.key,K=H.value;if(Gs(K)==="array"){if(K.length<1||K.length>4)return[new _e(D,K,`padding requires 1 to 4 values; ${K.length} values found`)];let pe={type:"number"},ke=[];for(let je=0;je[]}})),H.constants&&(K=K.concat(vf({key:"constants",value:H.constants,style:H,styleSpec:D,validateSpec:kc}))),$r(K)}function na(H){return function(D){return H(ws(Uo({},D),{validateSpec:kc}))}}function $r(H){return[].concat(H).sort((D,K)=>D.line-K.line)}function La(H){return function(...D){return $r(H.apply(this,D))}}yr.source=La(na(mc)),yr.sprite=La(na(Yc)),yr.glyphs=La(na(er)),yr.light=La(na(jl)),yr.sky=La(na(gu)),yr.terrain=La(na(Cc)),yr.layer=La(na(jf)),yr.filter=La(na(mf)),yr.paintProperty=La(na(Lf)),yr.layoutProperty=La(na(ru));let hi=yr,Pi=hi.light,Zi=hi.sky,tn=hi.paintProperty,dn=hi.layoutProperty;function Ri(H,D){let K=!1;if(D&&D.length)for(let pe of D)H.fire(new j(new Error(pe.message))),K=!0;return K}class Fi{constructor(D,K,pe){let ke=this.cells=[];if(D instanceof ArrayBuffer){this.arrayBuffer=D;let We=new Int32Array(this.arrayBuffer);D=We[0],this.d=(K=We[1])+2*(pe=We[2]);for(let Mt=0;Mt=Mr[oa+0]&&ke>=Mr[oa+1])?(ft[Hr]=!0,We.push(nr[Hr])):ft[Hr]=!1}}}}_forEachCell(D,K,pe,ke,je,We,ft,Mt){let Ut=this._convertToCellCoord(D),nr=this._convertToCellCoord(K),Mr=this._convertToCellCoord(pe),zr=this._convertToCellCoord(ke);for(let Hr=Ut;Hr<=Mr;Hr++)for(let oa=nr;oa<=zr;oa++){let va=this.d*oa+Hr;if((!Mt||Mt(this._convertFromCellCoord(Hr),this._convertFromCellCoord(oa),this._convertFromCellCoord(Hr+1),this._convertFromCellCoord(oa+1)))&&je.call(this,D,K,pe,ke,va,We,ft,Mt))return}}_convertFromCellCoord(D){return(D-this.padding)/this.scale}_convertToCellCoord(D){return Math.max(0,Math.min(this.d-1,Math.floor(D*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;let D=this.cells,K=3+this.cells.length+1+1,pe=0;for(let We=0;We=0)continue;let We=H[je];ke[je]=qi[K].shallow.indexOf(je)>=0?We:Jn(We,D)}H instanceof Error&&(ke.message=H.message)}if(ke.$name)throw new Error("$name property is reserved for worker serialization logic.");return K!=="Object"&&(ke.$name=K),ke}function co(H){if(ao(H))return H;if(Array.isArray(H))return H.map(co);if(typeof H!="object")throw new Error("can't deserialize object of type "+typeof H);let D=Kn(H)||"Object";if(!qi[D])throw new Error(`can't deserialize unregistered class ${D}`);let{klass:K}=qi[D];if(!K)throw new Error(`can't deserialize unregistered class ${D}`);if(K.deserialize)return K.deserialize(H);let pe=Object.create(K.prototype);for(let ke of Object.keys(H)){if(ke==="$name")continue;let je=H[ke];pe[ke]=qi[D].shallow.indexOf(ke)>=0?je:co(je)}return pe}class wn{constructor(){this.first=!0}update(D,K){let pe=Math.floor(D);return this.first?(this.first=!1,this.lastIntegerZoom=pe,this.lastIntegerZoomTime=0,this.lastZoom=D,this.lastFloorZoom=pe,!0):(this.lastFloorZoom>pe?(this.lastIntegerZoom=pe+1,this.lastIntegerZoomTime=K):this.lastFloorZoomH>=128&&H<=255,"Hangul Jamo":H=>H>=4352&&H<=4607,Khmer:H=>H>=6016&&H<=6143,"General Punctuation":H=>H>=8192&&H<=8303,"Letterlike Symbols":H=>H>=8448&&H<=8527,"Number Forms":H=>H>=8528&&H<=8591,"Miscellaneous Technical":H=>H>=8960&&H<=9215,"Control Pictures":H=>H>=9216&&H<=9279,"Optical Character Recognition":H=>H>=9280&&H<=9311,"Enclosed Alphanumerics":H=>H>=9312&&H<=9471,"Geometric Shapes":H=>H>=9632&&H<=9727,"Miscellaneous Symbols":H=>H>=9728&&H<=9983,"Miscellaneous Symbols and Arrows":H=>H>=11008&&H<=11263,"Ideographic Description Characters":H=>H>=12272&&H<=12287,"CJK Symbols and Punctuation":H=>H>=12288&&H<=12351,Katakana:H=>H>=12448&&H<=12543,Kanbun:H=>H>=12688&&H<=12703,"CJK Strokes":H=>H>=12736&&H<=12783,"Enclosed CJK Letters and Months":H=>H>=12800&&H<=13055,"CJK Compatibility":H=>H>=13056&&H<=13311,"Yijing Hexagram Symbols":H=>H>=19904&&H<=19967,"Private Use Area":H=>H>=57344&&H<=63743,"Vertical Forms":H=>H>=65040&&H<=65055,"CJK Compatibility Forms":H=>H>=65072&&H<=65103,"Small Form Variants":H=>H>=65104&&H<=65135,"Halfwidth and Fullwidth Forms":H=>H>=65280&&H<=65519};function _o(H){for(let D of H)if(ys(D.charCodeAt(0)))return!0;return!1}function Qo(H){for(let D of H)if(!Rs(D.charCodeAt(0)))return!1;return!0}function xs(H){let D=H.map(K=>{try{return new RegExp(`\\p{sc=${K}}`,"u").source}catch{return null}}).filter(K=>K);return new RegExp(D.join("|"),"u")}let Qs=xs(["Arab","Dupl","Mong","Ougr","Syrc"]);function Rs(H){return!Qs.test(String.fromCodePoint(H))}let Ks=xs(["Bopo","Hani","Hira","Kana","Kits","Nshu","Tang","Yiii"]);function ys(H){return!(H!==746&&H!==747&&(H<4352||!(un["CJK Compatibility Forms"](H)&&!(H>=65097&&H<=65103)||un["CJK Compatibility"](H)||un["CJK Strokes"](H)||!(!un["CJK Symbols and Punctuation"](H)||H>=12296&&H<=12305||H>=12308&&H<=12319||H===12336)||un["Enclosed CJK Letters and Months"](H)||un["Ideographic Description Characters"](H)||un.Kanbun(H)||un.Katakana(H)&&H!==12540||!(!un["Halfwidth and Fullwidth Forms"](H)||H===65288||H===65289||H===65293||H>=65306&&H<=65310||H===65339||H===65341||H===65343||H>=65371&&H<=65503||H===65507||H>=65512&&H<=65519)||!(!un["Small Form Variants"](H)||H>=65112&&H<=65118||H>=65123&&H<=65126)||un["Vertical Forms"](H)||un["Yijing Hexagram Symbols"](H)||new RegExp("\\p{sc=Cans}","u").test(String.fromCodePoint(H))||new RegExp("\\p{sc=Hang}","u").test(String.fromCodePoint(H))||Ks.test(String.fromCodePoint(H)))))}function Fl(H){return!(ys(H)||function(D){return!!(un["Latin-1 Supplement"](D)&&(D===167||D===169||D===174||D===177||D===188||D===189||D===190||D===215||D===247)||un["General Punctuation"](D)&&(D===8214||D===8224||D===8225||D===8240||D===8241||D===8251||D===8252||D===8258||D===8263||D===8264||D===8265||D===8273)||un["Letterlike Symbols"](D)||un["Number Forms"](D)||un["Miscellaneous Technical"](D)&&(D>=8960&&D<=8967||D>=8972&&D<=8991||D>=8996&&D<=9e3||D===9003||D>=9085&&D<=9114||D>=9150&&D<=9165||D===9167||D>=9169&&D<=9179||D>=9186&&D<=9215)||un["Control Pictures"](D)&&D!==9251||un["Optical Character Recognition"](D)||un["Enclosed Alphanumerics"](D)||un["Geometric Shapes"](D)||un["Miscellaneous Symbols"](D)&&!(D>=9754&&D<=9759)||un["Miscellaneous Symbols and Arrows"](D)&&(D>=11026&&D<=11055||D>=11088&&D<=11097||D>=11192&&D<=11243)||un["CJK Symbols and Punctuation"](D)||un.Katakana(D)||un["Private Use Area"](D)||un["CJK Compatibility Forms"](D)||un["Small Form Variants"](D)||un["Halfwidth and Fullwidth Forms"](D)||D===8734||D===8756||D===8757||D>=9984&&D<=10087||D>=10102&&D<=10131||D===65532||D===65533)}(H))}let yl=xs(["Adlm","Arab","Armi","Avst","Chrs","Cprt","Egyp","Elym","Gara","Hatr","Hebr","Hung","Khar","Lydi","Mand","Mani","Mend","Merc","Mero","Narb","Nbat","Nkoo","Orkh","Palm","Phli","Phlp","Phnx","Prti","Rohg","Samr","Sarb","Sogo","Syrc","Thaa","Todr","Yezi"]);function sl(H){return yl.test(String.fromCodePoint(H))}function Un(H,D){return!(!D&&sl(H)||H>=2304&&H<=3583||H>=3840&&H<=4255||un.Khmer(H))}function Io(H){for(let D of H)if(sl(D.charCodeAt(0)))return!0;return!1}let Xs=new class{constructor(){this.applyArabicShaping=null,this.processBidirectionalText=null,this.processStyledBidirectionalText=null,this.pluginStatus="unavailable",this.pluginURL=null}setState(H){this.pluginStatus=H.pluginStatus,this.pluginURL=H.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(H){this.applyArabicShaping=H.applyArabicShaping,this.processBidirectionalText=H.processBidirectionalText,this.processStyledBidirectionalText=H.processStyledBidirectionalText}isParsed(){return this.applyArabicShaping!=null&&this.processBidirectionalText!=null&&this.processStyledBidirectionalText!=null}getPluginURL(){return this.pluginURL}getRTLTextPluginStatus(){return this.pluginStatus}};class Ls{constructor(D,K){this.zoom=D,K?(this.now=K.now,this.fadeDuration=K.fadeDuration,this.zoomHistory=K.zoomHistory,this.transition=K.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new wn,this.transition={})}isSupportedScript(D){return function(K,pe){for(let ke of K)if(!Un(ke.charCodeAt(0),pe))return!1;return!0}(D,Xs.getRTLTextPluginStatus()==="loaded")}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){let D=this.zoom,K=D-Math.floor(D),pe=this.crossFadingFactor();return D>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:K+(1-K)*pe}:{fromScale:.5,toScale:1,t:1-(1-pe)*K}}}class ou{constructor(D,K){this.property=D,this.value=K,this.expression=function(pe,ke){if(Cf(pe))return new Ml(pe,ke);if(Ac(pe)){let je=bu(pe,ke);if(je.result==="error")throw new Error(je.value.map(We=>`${We.key}: ${We.message}`).join(", "));return je.value}{let je=pe;return ke.type==="color"&&typeof pe=="string"?je=Wt.parse(pe):ke.type!=="padding"||typeof pe!="number"&&!Array.isArray(pe)?ke.type==="variableAnchorOffsetCollection"&&Array.isArray(pe)&&(je=Ha.parse(pe)):je=ra.parse(pe),{kind:"constant",evaluate:()=>je}}}(K===void 0?D.specification.default:K,D.specification)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}possiblyEvaluate(D,K,pe){return this.property.possiblyEvaluate(this,D,K,pe)}}class Iu{constructor(D){this.property=D,this.value=new ou(D,void 0)}transitioned(D,K){return new Lc(this.property,this.value,K,E({},D.transition,this.transition),D.now)}untransitioned(){return new Lc(this.property,this.value,null,{},0)}}class Zu{constructor(D){this._properties=D,this._values=Object.create(D.defaultTransitionablePropertyValues)}getValue(D){return u(this._values[D].value.value)}setValue(D,K){Object.prototype.hasOwnProperty.call(this._values,D)||(this._values[D]=new Iu(this._values[D].property)),this._values[D].value=new ou(this._values[D].property,K===null?void 0:u(K))}getTransition(D){return u(this._values[D].transition)}setTransition(D,K){Object.prototype.hasOwnProperty.call(this._values,D)||(this._values[D]=new Iu(this._values[D].property)),this._values[D].transition=u(K)||void 0}serialize(){let D={};for(let K of Object.keys(this._values)){let pe=this.getValue(K);pe!==void 0&&(D[K]=pe);let ke=this.getTransition(K);ke!==void 0&&(D[`${K}-transition`]=ke)}return D}transitioned(D,K){let pe=new yu(this._properties);for(let ke of Object.keys(this._values))pe._values[ke]=this._values[ke].transitioned(D,K._values[ke]);return pe}untransitioned(){let D=new yu(this._properties);for(let K of Object.keys(this._values))D._values[K]=this._values[K].untransitioned();return D}}class Lc{constructor(D,K,pe,ke,je){this.property=D,this.value=K,this.begin=je+ke.delay||0,this.end=this.begin+ke.duration||0,D.specification.transition&&(ke.delay||ke.duration)&&(this.prior=pe)}possiblyEvaluate(D,K,pe){let ke=D.now||0,je=this.value.possiblyEvaluate(D,K,pe),We=this.prior;if(We){if(ke>this.end)return this.prior=null,je;if(this.value.isDataDriven())return this.prior=null,je;if(ke=1)return 1;let Ut=Mt*Mt,nr=Ut*Mt;return 4*(Mt<.5?nr:3*(Mt-Ut)+nr-.75)}(ft))}}return je}}class yu{constructor(D){this._properties=D,this._values=Object.create(D.defaultTransitioningPropertyValues)}possiblyEvaluate(D,K,pe){let ke=new gc(this._properties);for(let je of Object.keys(this._values))ke._values[je]=this._values[je].possiblyEvaluate(D,K,pe);return ke}hasTransition(){for(let D of Object.keys(this._values))if(this._values[D].prior)return!0;return!1}}class Pc{constructor(D){this._properties=D,this._values=Object.create(D.defaultPropertyValues)}hasValue(D){return this._values[D].value!==void 0}getValue(D){return u(this._values[D].value)}setValue(D,K){this._values[D]=new ou(this._values[D].property,K===null?void 0:u(K))}serialize(){let D={};for(let K of Object.keys(this._values)){let pe=this.getValue(K);pe!==void 0&&(D[K]=pe)}return D}possiblyEvaluate(D,K,pe){let ke=new gc(this._properties);for(let je of Object.keys(this._values))ke._values[je]=this._values[je].possiblyEvaluate(D,K,pe);return ke}}class wu{constructor(D,K,pe){this.property=D,this.value=K,this.parameters=pe}isConstant(){return this.value.kind==="constant"}constantOr(D){return this.value.kind==="constant"?this.value.value:D}evaluate(D,K,pe,ke){return this.property.evaluate(this.value,this.parameters,D,K,pe,ke)}}class gc{constructor(D){this._properties=D,this._values=Object.create(D.defaultPossiblyEvaluatedValues)}get(D){return this._values[D]}}class fo{constructor(D){this.specification=D}possiblyEvaluate(D,K){if(D.isDataDriven())throw new Error("Value should not be data driven");return D.expression.evaluate(K)}interpolate(D,K,pe){let ke=Xn[this.specification.type];return ke?ke(D,K,pe):D}}class zo{constructor(D,K){this.specification=D,this.overrides=K}possiblyEvaluate(D,K,pe,ke){return new wu(this,D.expression.kind==="constant"||D.expression.kind==="camera"?{kind:"constant",value:D.expression.evaluate(K,null,{},pe,ke)}:D.expression,K)}interpolate(D,K,pe){if(D.value.kind!=="constant"||K.value.kind!=="constant")return D;if(D.value.value===void 0||K.value.value===void 0)return new wu(this,{kind:"constant",value:void 0},D.parameters);let ke=Xn[this.specification.type];if(ke){let je=ke(D.value.value,K.value.value,pe);return new wu(this,{kind:"constant",value:je},D.parameters)}return D}evaluate(D,K,pe,ke,je,We){return D.kind==="constant"?D.value:D.evaluate(K,pe,ke,je,We)}}class Ic extends zo{possiblyEvaluate(D,K,pe,ke){if(D.value===void 0)return new wu(this,{kind:"constant",value:void 0},K);if(D.expression.kind==="constant"){let je=D.expression.evaluate(K,null,{},pe,ke),We=D.property.specification.type==="resolvedImage"&&typeof je!="string"?je.name:je,ft=this._calculate(We,We,We,K);return new wu(this,{kind:"constant",value:ft},K)}if(D.expression.kind==="camera"){let je=this._calculate(D.expression.evaluate({zoom:K.zoom-1}),D.expression.evaluate({zoom:K.zoom}),D.expression.evaluate({zoom:K.zoom+1}),K);return new wu(this,{kind:"constant",value:je},K)}return new wu(this,D.expression,K)}evaluate(D,K,pe,ke,je,We){if(D.kind==="source"){let ft=D.evaluate(K,pe,ke,je,We);return this._calculate(ft,ft,ft,K)}return D.kind==="composite"?this._calculate(D.evaluate({zoom:Math.floor(K.zoom)-1},pe,ke),D.evaluate({zoom:Math.floor(K.zoom)},pe,ke),D.evaluate({zoom:Math.floor(K.zoom)+1},pe,ke),K):D.value}_calculate(D,K,pe,ke){return ke.zoom>ke.zoomHistory.lastIntegerZoom?{from:D,to:K}:{from:pe,to:K}}interpolate(D){return D}}class lc{constructor(D){this.specification=D}possiblyEvaluate(D,K,pe,ke){if(D.value!==void 0){if(D.expression.kind==="constant"){let je=D.expression.evaluate(K,null,{},pe,ke);return this._calculate(je,je,je,K)}return this._calculate(D.expression.evaluate(new Ls(Math.floor(K.zoom-1),K)),D.expression.evaluate(new Ls(Math.floor(K.zoom),K)),D.expression.evaluate(new Ls(Math.floor(K.zoom+1),K)),K)}}_calculate(D,K,pe,ke){return ke.zoom>ke.zoomHistory.lastIntegerZoom?{from:D,to:K}:{from:pe,to:K}}interpolate(D){return D}}class Yu{constructor(D){this.specification=D}possiblyEvaluate(D,K,pe,ke){return!!D.expression.evaluate(K,null,{},pe,ke)}interpolate(){return!1}}class Ne{constructor(D){this.properties=D,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(let K in D){let pe=D[K];pe.specification.overridable&&this.overridableProperties.push(K);let ke=this.defaultPropertyValues[K]=new ou(pe,void 0),je=this.defaultTransitionablePropertyValues[K]=new Iu(pe);this.defaultTransitioningPropertyValues[K]=je.untransitioned(),this.defaultPossiblyEvaluatedValues[K]=ke.possiblyEvaluate({})}}}_i("DataDrivenProperty",zo),_i("DataConstantProperty",fo),_i("CrossFadedDataDrivenProperty",Ic),_i("CrossFadedProperty",lc),_i("ColorRampProperty",Yu);let R="-transition";class ae extends ee{constructor(D,K){if(super(),this.id=D.id,this.type=D.type,this._featureFilter={filter:()=>!0,needGeometry:!1},D.type!=="custom"&&(this.metadata=D.metadata,this.minzoom=D.minzoom,this.maxzoom=D.maxzoom,D.type!=="background"&&(this.source=D.source,this.sourceLayer=D["source-layer"],this.filter=D.filter),K.layout&&(this._unevaluatedLayout=new Pc(K.layout)),K.paint)){this._transitionablePaint=new Zu(K.paint);for(let pe in D.paint)this.setPaintProperty(pe,D.paint[pe],{validate:!1});for(let pe in D.layout)this.setLayoutProperty(pe,D.layout[pe],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new gc(K.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(D){return D==="visibility"?this.visibility:this._unevaluatedLayout.getValue(D)}setLayoutProperty(D,K,pe={}){K!=null&&this._validate(dn,`layers.${this.id}.layout.${D}`,D,K,pe)||(D!=="visibility"?this._unevaluatedLayout.setValue(D,K):this.visibility=K)}getPaintProperty(D){return D.endsWith(R)?this._transitionablePaint.getTransition(D.slice(0,-11)):this._transitionablePaint.getValue(D)}setPaintProperty(D,K,pe={}){if(K!=null&&this._validate(tn,`layers.${this.id}.paint.${D}`,D,K,pe))return!1;if(D.endsWith(R))return this._transitionablePaint.setTransition(D.slice(0,-11),K||void 0),!1;{let ke=this._transitionablePaint._values[D],je=ke.property.specification["property-type"]==="cross-faded-data-driven",We=ke.value.isDataDriven(),ft=ke.value;this._transitionablePaint.setValue(D,K),this._handleSpecialPaintPropertyUpdate(D);let Mt=this._transitionablePaint._values[D].value;return Mt.isDataDriven()||We||je||this._handleOverridablePaintPropertyUpdate(D,ft,Mt)}}_handleSpecialPaintPropertyUpdate(D){}_handleOverridablePaintPropertyUpdate(D,K,pe){return!1}isHidden(D){return!!(this.minzoom&&D=this.maxzoom)||this.visibility==="none"}updateTransitions(D){this._transitioningPaint=this._transitionablePaint.transitioned(D,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(D,K){D.getCrossfadeParameters&&(this._crossfadeParameters=D.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(D,void 0,K)),this.paint=this._transitioningPaint.possiblyEvaluate(D,void 0,K)}serialize(){let D={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(D.layout=D.layout||{},D.layout.visibility=this.visibility),p(D,(K,pe)=>!(K===void 0||pe==="layout"&&!Object.keys(K).length||pe==="paint"&&!Object.keys(K).length))}_validate(D,K,pe,ke,je={}){return(!je||je.validate!==!1)&&Ri(this,D.call(hi,{key:K,layerType:this.type,objectKey:pe,value:ke,styleSpec:re,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(let D in this.paint._values){let K=this.paint.get(D);if(K instanceof wu&&Jl(K.property.specification)&&(K.value.kind==="source"||K.value.kind==="composite")&&K.value.isStateDependent)return!0}return!1}}let we={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class Se{constructor(D,K){this._structArray=D,this._pos1=K*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class Oe{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(D,K){return D._trim(),K&&(D.isTransferred=!0,K.push(D.arrayBuffer)),{length:D.length,arrayBuffer:D.arrayBuffer}}static deserialize(D){let K=Object.create(this.prototype);return K.arrayBuffer=D.arrayBuffer,K.length=D.length,K.capacity=D.arrayBuffer.byteLength/K.bytesPerElement,K._refreshViews(),K}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(D){this.reserve(D),this.length=D}reserve(D){if(D>this.capacity){this.capacity=Math.max(D,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);let K=this.uint8;this._refreshViews(),K&&this.uint8.set(K)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function pt(H,D=1){let K=0,pe=0;return{members:H.map(ke=>{let je=we[ke.type].BYTES_PER_ELEMENT,We=K=At(K,Math.max(D,je)),ft=ke.components||1;return pe=Math.max(pe,je),K+=je*ft,{name:ke.name,type:ke.type,components:ft,offset:We}}),size:At(K,Math.max(pe,D)),alignment:D}}function At(H,D){return Math.ceil(H/D)*D}class Bt extends Oe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(D,K){let pe=this.length;return this.resize(pe+1),this.emplace(pe,D,K)}emplace(D,K,pe){let ke=2*D;return this.int16[ke+0]=K,this.int16[ke+1]=pe,D}}Bt.prototype.bytesPerElement=4,_i("StructArrayLayout2i4",Bt);class $t extends Oe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(D,K,pe){let ke=this.length;return this.resize(ke+1),this.emplace(ke,D,K,pe)}emplace(D,K,pe,ke){let je=3*D;return this.int16[je+0]=K,this.int16[je+1]=pe,this.int16[je+2]=ke,D}}$t.prototype.bytesPerElement=6,_i("StructArrayLayout3i6",$t);class br extends Oe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(D,K,pe,ke){let je=this.length;return this.resize(je+1),this.emplace(je,D,K,pe,ke)}emplace(D,K,pe,ke,je){let We=4*D;return this.int16[We+0]=K,this.int16[We+1]=pe,this.int16[We+2]=ke,this.int16[We+3]=je,D}}br.prototype.bytesPerElement=8,_i("StructArrayLayout4i8",br);class Ar extends Oe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(D,K,pe,ke,je,We){let ft=this.length;return this.resize(ft+1),this.emplace(ft,D,K,pe,ke,je,We)}emplace(D,K,pe,ke,je,We,ft){let Mt=6*D;return this.int16[Mt+0]=K,this.int16[Mt+1]=pe,this.int16[Mt+2]=ke,this.int16[Mt+3]=je,this.int16[Mt+4]=We,this.int16[Mt+5]=ft,D}}Ar.prototype.bytesPerElement=12,_i("StructArrayLayout2i4i12",Ar);class Yr extends Oe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(D,K,pe,ke,je,We){let ft=this.length;return this.resize(ft+1),this.emplace(ft,D,K,pe,ke,je,We)}emplace(D,K,pe,ke,je,We,ft){let Mt=4*D,Ut=8*D;return this.int16[Mt+0]=K,this.int16[Mt+1]=pe,this.uint8[Ut+4]=ke,this.uint8[Ut+5]=je,this.uint8[Ut+6]=We,this.uint8[Ut+7]=ft,D}}Yr.prototype.bytesPerElement=8,_i("StructArrayLayout2i4ub8",Yr);class sa extends Oe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(D,K){let pe=this.length;return this.resize(pe+1),this.emplace(pe,D,K)}emplace(D,K,pe){let ke=2*D;return this.float32[ke+0]=K,this.float32[ke+1]=pe,D}}sa.prototype.bytesPerElement=8,_i("StructArrayLayout2f8",sa);class He extends Oe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(D,K,pe,ke,je,We,ft,Mt,Ut,nr){let Mr=this.length;return this.resize(Mr+1),this.emplace(Mr,D,K,pe,ke,je,We,ft,Mt,Ut,nr)}emplace(D,K,pe,ke,je,We,ft,Mt,Ut,nr,Mr){let zr=10*D;return this.uint16[zr+0]=K,this.uint16[zr+1]=pe,this.uint16[zr+2]=ke,this.uint16[zr+3]=je,this.uint16[zr+4]=We,this.uint16[zr+5]=ft,this.uint16[zr+6]=Mt,this.uint16[zr+7]=Ut,this.uint16[zr+8]=nr,this.uint16[zr+9]=Mr,D}}He.prototype.bytesPerElement=20,_i("StructArrayLayout10ui20",He);class Je extends Oe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(D,K,pe,ke,je,We,ft,Mt,Ut,nr,Mr,zr){let Hr=this.length;return this.resize(Hr+1),this.emplace(Hr,D,K,pe,ke,je,We,ft,Mt,Ut,nr,Mr,zr)}emplace(D,K,pe,ke,je,We,ft,Mt,Ut,nr,Mr,zr,Hr){let oa=12*D;return this.int16[oa+0]=K,this.int16[oa+1]=pe,this.int16[oa+2]=ke,this.int16[oa+3]=je,this.uint16[oa+4]=We,this.uint16[oa+5]=ft,this.uint16[oa+6]=Mt,this.uint16[oa+7]=Ut,this.int16[oa+8]=nr,this.int16[oa+9]=Mr,this.int16[oa+10]=zr,this.int16[oa+11]=Hr,D}}Je.prototype.bytesPerElement=24,_i("StructArrayLayout4i4ui4i24",Je);class ut extends Oe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(D,K,pe){let ke=this.length;return this.resize(ke+1),this.emplace(ke,D,K,pe)}emplace(D,K,pe,ke){let je=3*D;return this.float32[je+0]=K,this.float32[je+1]=pe,this.float32[je+2]=ke,D}}ut.prototype.bytesPerElement=12,_i("StructArrayLayout3f12",ut);class dt extends Oe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(D){let K=this.length;return this.resize(K+1),this.emplace(K,D)}emplace(D,K){return this.uint32[1*D+0]=K,D}}dt.prototype.bytesPerElement=4,_i("StructArrayLayout1ul4",dt);class Ct extends Oe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(D,K,pe,ke,je,We,ft,Mt,Ut){let nr=this.length;return this.resize(nr+1),this.emplace(nr,D,K,pe,ke,je,We,ft,Mt,Ut)}emplace(D,K,pe,ke,je,We,ft,Mt,Ut,nr){let Mr=10*D,zr=5*D;return this.int16[Mr+0]=K,this.int16[Mr+1]=pe,this.int16[Mr+2]=ke,this.int16[Mr+3]=je,this.int16[Mr+4]=We,this.int16[Mr+5]=ft,this.uint32[zr+3]=Mt,this.uint16[Mr+8]=Ut,this.uint16[Mr+9]=nr,D}}Ct.prototype.bytesPerElement=20,_i("StructArrayLayout6i1ul2ui20",Ct);class wt extends Oe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(D,K,pe,ke,je,We){let ft=this.length;return this.resize(ft+1),this.emplace(ft,D,K,pe,ke,je,We)}emplace(D,K,pe,ke,je,We,ft){let Mt=6*D;return this.int16[Mt+0]=K,this.int16[Mt+1]=pe,this.int16[Mt+2]=ke,this.int16[Mt+3]=je,this.int16[Mt+4]=We,this.int16[Mt+5]=ft,D}}wt.prototype.bytesPerElement=12,_i("StructArrayLayout2i2i2i12",wt);class Dt extends Oe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(D,K,pe,ke,je){let We=this.length;return this.resize(We+1),this.emplace(We,D,K,pe,ke,je)}emplace(D,K,pe,ke,je,We){let ft=4*D,Mt=8*D;return this.float32[ft+0]=K,this.float32[ft+1]=pe,this.float32[ft+2]=ke,this.int16[Mt+6]=je,this.int16[Mt+7]=We,D}}Dt.prototype.bytesPerElement=16,_i("StructArrayLayout2f1f2i16",Dt);class ur extends Oe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(D,K,pe,ke,je,We){let ft=this.length;return this.resize(ft+1),this.emplace(ft,D,K,pe,ke,je,We)}emplace(D,K,pe,ke,je,We,ft){let Mt=16*D,Ut=4*D,nr=8*D;return this.uint8[Mt+0]=K,this.uint8[Mt+1]=pe,this.float32[Ut+1]=ke,this.float32[Ut+2]=je,this.int16[nr+6]=We,this.int16[nr+7]=ft,D}}ur.prototype.bytesPerElement=16,_i("StructArrayLayout2ub2f2i16",ur);class mr extends Oe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(D,K,pe){let ke=this.length;return this.resize(ke+1),this.emplace(ke,D,K,pe)}emplace(D,K,pe,ke){let je=3*D;return this.uint16[je+0]=K,this.uint16[je+1]=pe,this.uint16[je+2]=ke,D}}mr.prototype.bytesPerElement=6,_i("StructArrayLayout3ui6",mr);class Er extends Oe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(D,K,pe,ke,je,We,ft,Mt,Ut,nr,Mr,zr,Hr,oa,va,Ga,Qa){let Yi=this.length;return this.resize(Yi+1),this.emplace(Yi,D,K,pe,ke,je,We,ft,Mt,Ut,nr,Mr,zr,Hr,oa,va,Ga,Qa)}emplace(D,K,pe,ke,je,We,ft,Mt,Ut,nr,Mr,zr,Hr,oa,va,Ga,Qa,Yi){let xi=24*D,Hi=12*D,rn=48*D;return this.int16[xi+0]=K,this.int16[xi+1]=pe,this.uint16[xi+2]=ke,this.uint16[xi+3]=je,this.uint32[Hi+2]=We,this.uint32[Hi+3]=ft,this.uint32[Hi+4]=Mt,this.uint16[xi+10]=Ut,this.uint16[xi+11]=nr,this.uint16[xi+12]=Mr,this.float32[Hi+7]=zr,this.float32[Hi+8]=Hr,this.uint8[rn+36]=oa,this.uint8[rn+37]=va,this.uint8[rn+38]=Ga,this.uint32[Hi+10]=Qa,this.int16[xi+22]=Yi,D}}Er.prototype.bytesPerElement=48,_i("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",Er);class Br extends Oe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(D,K,pe,ke,je,We,ft,Mt,Ut,nr,Mr,zr,Hr,oa,va,Ga,Qa,Yi,xi,Hi,rn,jn,ko,vs,go,Dn,is,Vo){let Bo=this.length;return this.resize(Bo+1),this.emplace(Bo,D,K,pe,ke,je,We,ft,Mt,Ut,nr,Mr,zr,Hr,oa,va,Ga,Qa,Yi,xi,Hi,rn,jn,ko,vs,go,Dn,is,Vo)}emplace(D,K,pe,ke,je,We,ft,Mt,Ut,nr,Mr,zr,Hr,oa,va,Ga,Qa,Yi,xi,Hi,rn,jn,ko,vs,go,Dn,is,Vo,Bo){let _n=32*D,us=16*D;return this.int16[_n+0]=K,this.int16[_n+1]=pe,this.int16[_n+2]=ke,this.int16[_n+3]=je,this.int16[_n+4]=We,this.int16[_n+5]=ft,this.int16[_n+6]=Mt,this.int16[_n+7]=Ut,this.uint16[_n+8]=nr,this.uint16[_n+9]=Mr,this.uint16[_n+10]=zr,this.uint16[_n+11]=Hr,this.uint16[_n+12]=oa,this.uint16[_n+13]=va,this.uint16[_n+14]=Ga,this.uint16[_n+15]=Qa,this.uint16[_n+16]=Yi,this.uint16[_n+17]=xi,this.uint16[_n+18]=Hi,this.uint16[_n+19]=rn,this.uint16[_n+20]=jn,this.uint16[_n+21]=ko,this.uint16[_n+22]=vs,this.uint32[us+12]=go,this.float32[us+13]=Dn,this.float32[us+14]=is,this.uint16[_n+30]=Vo,this.uint16[_n+31]=Bo,D}}Br.prototype.bytesPerElement=64,_i("StructArrayLayout8i15ui1ul2f2ui64",Br);class Qr extends Oe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(D){let K=this.length;return this.resize(K+1),this.emplace(K,D)}emplace(D,K){return this.float32[1*D+0]=K,D}}Qr.prototype.bytesPerElement=4,_i("StructArrayLayout1f4",Qr);class ga extends Oe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(D,K,pe){let ke=this.length;return this.resize(ke+1),this.emplace(ke,D,K,pe)}emplace(D,K,pe,ke){let je=3*D;return this.uint16[6*D+0]=K,this.float32[je+1]=pe,this.float32[je+2]=ke,D}}ga.prototype.bytesPerElement=12,_i("StructArrayLayout1ui2f12",ga);class Sa extends Oe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(D,K,pe){let ke=this.length;return this.resize(ke+1),this.emplace(ke,D,K,pe)}emplace(D,K,pe,ke){let je=4*D;return this.uint32[2*D+0]=K,this.uint16[je+2]=pe,this.uint16[je+3]=ke,D}}Sa.prototype.bytesPerElement=8,_i("StructArrayLayout1ul2ui8",Sa);class Oa extends Oe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(D,K){let pe=this.length;return this.resize(pe+1),this.emplace(pe,D,K)}emplace(D,K,pe){let ke=2*D;return this.uint16[ke+0]=K,this.uint16[ke+1]=pe,D}}Oa.prototype.bytesPerElement=4,_i("StructArrayLayout2ui4",Oa);class di extends Oe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(D){let K=this.length;return this.resize(K+1),this.emplace(K,D)}emplace(D,K){return this.uint16[1*D+0]=K,D}}di.prototype.bytesPerElement=2,_i("StructArrayLayout1ui2",di);class Wi extends Oe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(D,K,pe,ke){let je=this.length;return this.resize(je+1),this.emplace(je,D,K,pe,ke)}emplace(D,K,pe,ke,je){let We=4*D;return this.float32[We+0]=K,this.float32[We+1]=pe,this.float32[We+2]=ke,this.float32[We+3]=je,D}}Wi.prototype.bytesPerElement=16,_i("StructArrayLayout4f16",Wi);class Gi extends Se{get anchorPointX(){return this._structArray.int16[this._pos2+0]}get anchorPointY(){return this._structArray.int16[this._pos2+1]}get x1(){return this._structArray.int16[this._pos2+2]}get y1(){return this._structArray.int16[this._pos2+3]}get x2(){return this._structArray.int16[this._pos2+4]}get y2(){return this._structArray.int16[this._pos2+5]}get featureIndex(){return this._structArray.uint32[this._pos4+3]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+8]}get bucketIndex(){return this._structArray.uint16[this._pos2+9]}get anchorPoint(){return new i(this.anchorPointX,this.anchorPointY)}}Gi.prototype.size=20;class on extends Ct{get(D){return new Gi(this,D)}}_i("CollisionBoxArray",on);class Tn extends Se{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+2]}get numGlyphs(){return this._structArray.uint16[this._pos2+3]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+2]}get lineStartIndex(){return this._structArray.uint32[this._pos4+3]}get lineLength(){return this._structArray.uint32[this._pos4+4]}get segment(){return this._structArray.uint16[this._pos2+10]}get lowerSize(){return this._structArray.uint16[this._pos2+11]}get upperSize(){return this._structArray.uint16[this._pos2+12]}get lineOffsetX(){return this._structArray.float32[this._pos4+7]}get lineOffsetY(){return this._structArray.float32[this._pos4+8]}get writingMode(){return this._structArray.uint8[this._pos1+36]}get placedOrientation(){return this._structArray.uint8[this._pos1+37]}set placedOrientation(D){this._structArray.uint8[this._pos1+37]=D}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(D){this._structArray.uint8[this._pos1+38]=D}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(D){this._structArray.uint32[this._pos4+10]=D}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}Tn.prototype.size=48;class Wn extends Er{get(D){return new Tn(this,D)}}_i("PlacedSymbolArray",Wn);class Bn extends Se{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+2]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+3]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+4]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+5]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+6]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+7]}get key(){return this._structArray.uint16[this._pos2+8]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+9]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+10]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get featureIndex(){return this._structArray.uint16[this._pos2+17]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+18]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+19]}get numIconVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+21]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+22]}get crossTileID(){return this._structArray.uint32[this._pos4+12]}set crossTileID(D){this._structArray.uint32[this._pos4+12]=D}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+14]}get textAnchorOffsetStartIndex(){return this._structArray.uint16[this._pos2+30]}get textAnchorOffsetEndIndex(){return this._structArray.uint16[this._pos2+31]}}Bn.prototype.size=64;class Ao extends Br{get(D){return new Bn(this,D)}}_i("SymbolInstanceArray",Ao);class ss extends Qr{getoffsetX(D){return this.float32[1*D+0]}}_i("GlyphOffsetArray",ss);class So extends $t{getx(D){return this.int16[3*D+0]}gety(D){return this.int16[3*D+1]}gettileUnitDistanceFromAnchor(D){return this.int16[3*D+2]}}_i("SymbolLineVertexArray",So);class Ko extends Se{get textAnchor(){return this._structArray.uint16[this._pos2+0]}get textOffset0(){return this._structArray.float32[this._pos4+1]}get textOffset1(){return this._structArray.float32[this._pos4+2]}}Ko.prototype.size=12;class hs extends ga{get(D){return new Ko(this,D)}}_i("TextAnchorOffsetArray",hs);class ll extends Se{get featureIndex(){return this._structArray.uint32[this._pos4+0]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+2]}get bucketIndex(){return this._structArray.uint16[this._pos2+3]}}ll.prototype.size=8;class Js extends Sa{get(D){return new ll(this,D)}}_i("FeatureIndexArray",Js);class es extends Bt{}class ts extends Bt{}class Pl extends Bt{}class $l extends Ar{}class Ru extends Yr{}class hu extends sa{}class wl extends He{}class su extends Je{}class uc extends ut{}class ql extends dt{}class Vl extends wt{}class de extends ur{}class De extends mr{}class et extends Oa{}let vt=pt([{name:"a_pos",components:2,type:"Int16"}],4),{members:_t}=vt;class St{constructor(D=[]){this.segments=D}prepareSegment(D,K,pe,ke){let je=this.segments[this.segments.length-1];return D>St.MAX_VERTEX_ARRAY_LENGTH&&h(`Max vertices per segment is ${St.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${D}`),(!je||je.vertexLength+D>St.MAX_VERTEX_ARRAY_LENGTH||je.sortKey!==ke)&&(je={vertexOffset:K.length,primitiveOffset:pe.length,vertexLength:0,primitiveLength:0},ke!==void 0&&(je.sortKey=ke),this.segments.push(je)),je}get(){return this.segments}destroy(){for(let D of this.segments)for(let K in D.vaos)D.vaos[K].destroy()}static simpleSegment(D,K,pe,ke){return new St([{vertexOffset:D,primitiveOffset:K,vertexLength:pe,primitiveLength:ke,vaos:{},sortKey:0}])}}function ar(H,D){return 256*(H=w(Math.floor(H),0,255))+w(Math.floor(D),0,255)}St.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,_i("SegmentVector",St);let zt=pt([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]);var gr={exports:{}},Vr={exports:{}};Vr.exports=function(H,D){var K,pe,ke,je,We,ft,Mt,Ut;for(pe=H.length-(K=3&H.length),ke=D,We=3432918353,ft=461845907,Ut=0;Ut>>16)*We&65535)<<16)&4294967295)<<15|Mt>>>17))*ft+(((Mt>>>16)*ft&65535)<<16)&4294967295)<<13|ke>>>19))+((5*(ke>>>16)&65535)<<16)&4294967295))+((58964+(je>>>16)&65535)<<16);switch(Mt=0,K){case 3:Mt^=(255&H.charCodeAt(Ut+2))<<16;case 2:Mt^=(255&H.charCodeAt(Ut+1))<<8;case 1:ke^=Mt=(65535&(Mt=(Mt=(65535&(Mt^=255&H.charCodeAt(Ut)))*We+(((Mt>>>16)*We&65535)<<16)&4294967295)<<15|Mt>>>17))*ft+(((Mt>>>16)*ft&65535)<<16)&4294967295}return ke^=H.length,ke=2246822507*(65535&(ke^=ke>>>16))+((2246822507*(ke>>>16)&65535)<<16)&4294967295,ke=3266489909*(65535&(ke^=ke>>>13))+((3266489909*(ke>>>16)&65535)<<16)&4294967295,(ke^=ke>>>16)>>>0};var Wr=Vr.exports,Ta={exports:{}};Ta.exports=function(H,D){for(var K,pe=H.length,ke=D^pe,je=0;pe>=4;)K=1540483477*(65535&(K=255&H.charCodeAt(je)|(255&H.charCodeAt(++je))<<8|(255&H.charCodeAt(++je))<<16|(255&H.charCodeAt(++je))<<24))+((1540483477*(K>>>16)&65535)<<16),ke=1540483477*(65535&ke)+((1540483477*(ke>>>16)&65535)<<16)^(K=1540483477*(65535&(K^=K>>>24))+((1540483477*(K>>>16)&65535)<<16)),pe-=4,++je;switch(pe){case 3:ke^=(255&H.charCodeAt(je+2))<<16;case 2:ke^=(255&H.charCodeAt(je+1))<<8;case 1:ke=1540483477*(65535&(ke^=255&H.charCodeAt(je)))+((1540483477*(ke>>>16)&65535)<<16)}return ke=1540483477*(65535&(ke^=ke>>>13))+((1540483477*(ke>>>16)&65535)<<16),(ke^=ke>>>15)>>>0};var ya=Wr,ri=Ta.exports;gr.exports=ya,gr.exports.murmur3=ya,gr.exports.murmur2=ri;var ni=r(gr.exports);class Ma{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(D,K,pe,ke){this.ids.push(Na(D)),this.positions.push(K,pe,ke)}getPositions(D){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");let K=Na(D),pe=0,ke=this.ids.length-1;for(;pe>1;this.ids[We]>=K?ke=We:pe=We+1}let je=[];for(;this.ids[pe]===K;)je.push({index:this.positions[3*pe],start:this.positions[3*pe+1],end:this.positions[3*pe+2]}),pe++;return je}static serialize(D,K){let pe=new Float64Array(D.ids),ke=new Uint32Array(D.positions);return Ka(pe,ke,0,pe.length-1),K&&K.push(pe.buffer,ke.buffer),{ids:pe,positions:ke}}static deserialize(D){let K=new Ma;return K.ids=D.ids,K.positions=D.positions,K.indexed=!0,K}}function Na(H){let D=+H;return!isNaN(D)&&D<=Number.MAX_SAFE_INTEGER?D:ni(String(H))}function Ka(H,D,K,pe){for(;K>1],je=K-1,We=pe+1;for(;;){do je++;while(H[je]ke);if(je>=We)break;vi(H,je,We),vi(D,3*je,3*We),vi(D,3*je+1,3*We+1),vi(D,3*je+2,3*We+2)}We-K`u_${ke}`),this.type=pe}setUniform(D,K,pe){D.set(pe.constantOr(this.value))}getBinding(D,K,pe){return this.type==="color"?new an(D,K):new Pa(D,K)}}class eo{constructor(D,K){this.uniformNames=K.map(pe=>`u_${pe}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(D,K){this.pixelRatioFrom=K.pixelRatio,this.pixelRatioTo=D.pixelRatio,this.patternFrom=K.tlbr,this.patternTo=D.tlbr}setUniform(D,K,pe,ke){let je=ke==="u_pattern_to"?this.patternTo:ke==="u_pattern_from"?this.patternFrom:ke==="u_pixel_ratio_to"?this.pixelRatioTo:ke==="u_pixel_ratio_from"?this.pixelRatioFrom:null;je&&D.set(je)}getBinding(D,K,pe){return pe.substr(0,9)==="u_pattern"?new sn(D,K):new Pa(D,K)}}class $o{constructor(D,K,pe,ke){this.expression=D,this.type=pe,this.maxValue=0,this.paintVertexAttributes=K.map(je=>({name:`a_${je}`,type:"Float32",components:pe==="color"?2:1,offset:0})),this.paintVertexArray=new ke}populatePaintArray(D,K,pe,ke,je){let We=this.paintVertexArray.length,ft=this.expression.evaluate(new Ls(0),K,{},ke,[],je);this.paintVertexArray.resize(D),this._setPaintValue(We,D,ft)}updatePaintArray(D,K,pe,ke){let je=this.expression.evaluate({zoom:0},pe,ke);this._setPaintValue(D,K,je)}_setPaintValue(D,K,pe){if(this.type==="color"){let ke=Pn(pe);for(let je=D;je`u_${ft}_t`),this.type=pe,this.useIntegerZoom=ke,this.zoom=je,this.maxValue=0,this.paintVertexAttributes=K.map(ft=>({name:`a_${ft}`,type:"Float32",components:pe==="color"?4:2,offset:0})),this.paintVertexArray=new We}populatePaintArray(D,K,pe,ke,je){let We=this.expression.evaluate(new Ls(this.zoom),K,{},ke,[],je),ft=this.expression.evaluate(new Ls(this.zoom+1),K,{},ke,[],je),Mt=this.paintVertexArray.length;this.paintVertexArray.resize(D),this._setPaintValue(Mt,D,We,ft)}updatePaintArray(D,K,pe,ke){let je=this.expression.evaluate({zoom:this.zoom},pe,ke),We=this.expression.evaluate({zoom:this.zoom+1},pe,ke);this._setPaintValue(D,K,je,We)}_setPaintValue(D,K,pe,ke){if(this.type==="color"){let je=Pn(pe),We=Pn(ke);for(let ft=D;ft`#define HAS_UNIFORM_${ke}`))}return D}getBinderAttributes(){let D=[];for(let K in this.binders){let pe=this.binders[K];if(pe instanceof $o||pe instanceof io)for(let ke=0;ke!0){this.programConfigurations={};for(let ke of D)this.programConfigurations[ke.id]=new ul(ke,K,pe);this.needsUpload=!1,this._featureMap=new Ma,this._bufferOffset=0}populatePaintArrays(D,K,pe,ke,je,We){for(let ft in this.programConfigurations)this.programConfigurations[ft].populatePaintArrays(D,K,ke,je,We);K.id!==void 0&&this._featureMap.add(K.id,pe,this._bufferOffset,D),this._bufferOffset=D,this.needsUpload=!0}updatePaintArrays(D,K,pe,ke){for(let je of pe)this.needsUpload=this.programConfigurations[je.id].updatePaintArrays(D,this._featureMap,K,je,ke)||this.needsUpload}get(D){return this.programConfigurations[D]}upload(D){if(this.needsUpload){for(let K in this.programConfigurations)this.programConfigurations[K].upload(D);this.needsUpload=!1}}destroy(){for(let D in this.programConfigurations)this.programConfigurations[D].destroy()}}function _l(H,D){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[H]||[H.replace(`${D}-`,"").replace(/-/g,"_")]}function gn(H,D,K){let pe={color:{source:sa,composite:Wi},number:{source:Qr,composite:sa}},ke=function(je){return{"line-pattern":{source:wl,composite:wl},"fill-pattern":{source:wl,composite:wl},"fill-extrusion-pattern":{source:wl,composite:wl}}[je]}(H);return ke&&ke[K]||pe[D][K]}_i("ConstantBinder",Zn),_i("CrossFadedConstantBinder",eo),_i("SourceExpressionBinder",$o),_i("CrossFadedCompositeBinder",Zo),_i("CompositeExpressionBinder",io),_i("ProgramConfiguration",ul,{omit:["_buffers"]}),_i("ProgramConfigurationSet",el);let vo=8192,cs=Math.pow(2,14)-1,ps=-cs-1;function Tl(H){let D=vo/H.extent,K=H.loadGeometry();for(let pe=0;peWe.x+1||MtWe.y+1)&&h("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return K}function Gl(H,D){return{type:H.type,id:H.id,properties:H.properties,geometry:D?Tl(H):[]}}function Tu(H,D,K,pe,ke){H.emplaceBack(2*D+(pe+1)/2,2*K+(ke+1)/2)}class Il{constructor(D){this.zoom=D.zoom,this.overscaling=D.overscaling,this.layers=D.layers,this.layerIds=this.layers.map(K=>K.id),this.index=D.index,this.hasPattern=!1,this.layoutVertexArray=new ts,this.indexArray=new De,this.segments=new St,this.programConfigurations=new el(D.layers,D.zoom),this.stateDependentLayerIds=this.layers.filter(K=>K.isStateDependent()).map(K=>K.id)}populate(D,K,pe){let ke=this.layers[0],je=[],We=null,ft=!1;ke.type==="circle"&&(We=ke.layout.get("circle-sort-key"),ft=!We.isConstant());for(let{feature:Mt,id:Ut,index:nr,sourceLayerIndex:Mr}of D){let zr=this.layers[0]._featureFilter.needGeometry,Hr=Gl(Mt,zr);if(!this.layers[0]._featureFilter.filter(new Ls(this.zoom),Hr,pe))continue;let oa=ft?We.evaluate(Hr,{},pe):void 0,va={id:Ut,properties:Mt.properties,type:Mt.type,sourceLayerIndex:Mr,index:nr,geometry:zr?Hr.geometry:Tl(Mt),patterns:{},sortKey:oa};je.push(va)}ft&&je.sort((Mt,Ut)=>Mt.sortKey-Ut.sortKey);for(let Mt of je){let{geometry:Ut,index:nr,sourceLayerIndex:Mr}=Mt,zr=D[nr].feature;this.addFeature(Mt,Ut,nr,pe),K.featureIndex.insert(zr,Ut,nr,Mr,this.index)}}update(D,K,pe){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(D,K,this.stateDependentLayers,pe)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(D){this.uploaded||(this.layoutVertexBuffer=D.createVertexBuffer(this.layoutVertexArray,_t),this.indexBuffer=D.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(D),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(D,K,pe,ke){for(let je of K)for(let We of je){let ft=We.x,Mt=We.y;if(ft<0||ft>=vo||Mt<0||Mt>=vo)continue;let Ut=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,D.sortKey),nr=Ut.vertexLength;Tu(this.layoutVertexArray,ft,Mt,-1,-1),Tu(this.layoutVertexArray,ft,Mt,1,-1),Tu(this.layoutVertexArray,ft,Mt,1,1),Tu(this.layoutVertexArray,ft,Mt,-1,1),this.indexArray.emplaceBack(nr,nr+1,nr+2),this.indexArray.emplaceBack(nr,nr+3,nr+2),Ut.vertexLength+=4,Ut.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,D,pe,{},ke)}}function yc(H,D){for(let K=0;K1){if(ua(H,D))return!0;for(let pe=0;pe1?K:K.sub(D)._mult(ke)._add(D))}function Ja(H,D){let K,pe,ke,je=!1;for(let We=0;WeD.y!=ke.y>D.y&&D.x<(ke.x-pe.x)*(D.y-pe.y)/(ke.y-pe.y)+pe.x&&(je=!je)}return je}function Ai(H,D){let K=!1;for(let pe=0,ke=H.length-1;peD.y!=We.y>D.y&&D.x<(We.x-je.x)*(D.y-je.y)/(We.y-je.y)+je.x&&(K=!K)}return K}function bi(H,D,K){let pe=K[0],ke=K[2];if(H.xke.x&&D.x>ke.x||H.yke.y&&D.y>ke.y)return!1;let je=P(H,D,K[0]);return je!==P(H,D,K[1])||je!==P(H,D,K[2])||je!==P(H,D,K[3])}function fi(H,D,K){let pe=D.paint.get(H).value;return pe.kind==="constant"?pe.value:K.programConfigurations.get(D.id).getMaxValue(H)}function yn(H){return Math.sqrt(H[0]*H[0]+H[1]*H[1])}function Oi(H,D,K,pe,ke){if(!D[0]&&!D[1])return H;let je=i.convert(D)._mult(ke);K==="viewport"&&je._rotate(-pe);let We=[];for(let ft=0;ftVa(Ga,va))}(Ut,Mt),Hr=Mr?nr*ft:nr;for(let oa of ke)for(let va of oa){let Ga=Mr?va:Va(va,Mt),Qa=Hr,Yi=hn([],[va.x,va.y,0,1],Mt);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?Qa*=Yi[3]/We.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(Qa*=We.cameraToCenterDistance/Yi[3]),nt(zr,Ga,Qa))return!0}return!1}}function Va(H,D){let K=hn([],[H.x,H.y,0,1],D);return new i(K[0]/K[3],K[1]/K[3])}class $i extends Il{}let zi;_i("HeatmapBucket",$i,{omit:["layers"]});var Si={get paint(){return zi=zi||new Ne({"heatmap-radius":new zo(re.paint_heatmap["heatmap-radius"]),"heatmap-weight":new zo(re.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new fo(re.paint_heatmap["heatmap-intensity"]),"heatmap-color":new Yu(re.paint_heatmap["heatmap-color"]),"heatmap-opacity":new fo(re.paint_heatmap["heatmap-opacity"])})}};function Ti(H,{width:D,height:K},pe,ke){if(ke){if(ke instanceof Uint8ClampedArray)ke=new Uint8Array(ke.buffer);else if(ke.length!==D*K*pe)throw new RangeError(`mismatched image size. expected: ${ke.length} but got: ${D*K*pe}`)}else ke=new Uint8Array(D*K*pe);return H.width=D,H.height=K,H.data=ke,H}function Ki(H,{width:D,height:K},pe){if(D===H.width&&K===H.height)return;let ke=Ti({},{width:D,height:K},pe);mn(H,ke,{x:0,y:0},{x:0,y:0},{width:Math.min(H.width,D),height:Math.min(H.height,K)},pe),H.width=D,H.height=K,H.data=ke.data}function mn(H,D,K,pe,ke,je){if(ke.width===0||ke.height===0)return D;if(ke.width>H.width||ke.height>H.height||K.x>H.width-ke.width||K.y>H.height-ke.height)throw new RangeError("out of range source coordinates for image copy");if(ke.width>D.width||ke.height>D.height||pe.x>D.width-ke.width||pe.y>D.height-ke.height)throw new RangeError("out of range destination coordinates for image copy");let We=H.data,ft=D.data;if(We===ft)throw new Error("srcData equals dstData, so image is already copied");for(let Mt=0;Mt{D[H.evaluationKey]=Mt;let Ut=H.expression.evaluate(D);ke.data[We+ft+0]=Math.floor(255*Ut.r/Ut.a),ke.data[We+ft+1]=Math.floor(255*Ut.g/Ut.a),ke.data[We+ft+2]=Math.floor(255*Ut.b/Ut.a),ke.data[We+ft+3]=Math.floor(255*Ut.a)};if(H.clips)for(let We=0,ft=0;We80*K){ft=1/0,Mt=1/0;let nr=-1/0,Mr=-1/0;for(let zr=K;zrnr&&(nr=Hr),oa>Mr&&(Mr=oa)}Ut=Math.max(nr-ft,Mr-Mt),Ut=Ut!==0?32767/Ut:0}return Ql(je,We,K,ft,Mt,Ut,0),We}function Al(H,D,K,pe,ke){let je;if(ke===function(We,ft,Mt,Ut){let nr=0;for(let Mr=ft,zr=Mt-Ut;Mr0)for(let We=D;We=D;We-=pe)je=hr(We/pe|0,H[We],H[We+1],je);return je&&Le(je,je.next)&&(gt(je),je=je.next),je}function El(H,D){if(!H)return H;D||(D=H);let K,pe=H;do if(K=!1,pe.steiner||!Le(pe,pe.next)&&Ge(pe.prev,pe,pe.next)!==0)pe=pe.next;else{if(gt(pe),pe=D=pe.prev,pe===pe.next)break;K=!0}while(K||pe!==D);return D}function Ql(H,D,K,pe,ke,je,We){if(!H)return;!We&&je&&function(Mt,Ut,nr,Mr){let zr=Mt;do zr.z===0&&(zr.z=Y(zr.x,zr.y,Ut,nr,Mr)),zr.prevZ=zr.prev,zr.nextZ=zr.next,zr=zr.next;while(zr!==Mt);zr.prevZ.nextZ=null,zr.prevZ=null,function(Hr){let oa,va=1;do{let Ga,Qa=Hr;Hr=null;let Yi=null;for(oa=0;Qa;){oa++;let xi=Qa,Hi=0;for(let jn=0;jn0||rn>0&ξ)Hi!==0&&(rn===0||!xi||Qa.z<=xi.z)?(Ga=Qa,Qa=Qa.nextZ,Hi--):(Ga=xi,xi=xi.nextZ,rn--),Yi?Yi.nextZ=Ga:Hr=Ga,Ga.prevZ=Yi,Yi=Ga;Qa=xi}Yi.nextZ=null,va*=2}while(oa>1)}(zr)}(H,pe,ke,je);let ft=H;for(;H.prev!==H.next;){let Mt=H.prev,Ut=H.next;if(je?pl(H,pe,ke,je):Fs(H))D.push(Mt.i,H.i,Ut.i),gt(H),H=Ut.next,ft=Ut.next;else if((H=Ut)===ft){We?We===1?Ql(H=bl(El(H),D),D,K,pe,ke,je,2):We===2&&Hn(H,D,K,pe,ke,je):Ql(El(H),D,K,pe,ke,je,1);break}}}function Fs(H){let D=H.prev,K=H,pe=H.next;if(Ge(D,K,pe)>=0)return!1;let ke=D.x,je=K.x,We=pe.x,ft=D.y,Mt=K.y,Ut=pe.y,nr=keje?ke>We?ke:We:je>We?je:We,Hr=ft>Mt?ft>Ut?ft:Ut:Mt>Ut?Mt:Ut,oa=pe.next;for(;oa!==D;){if(oa.x>=nr&&oa.x<=zr&&oa.y>=Mr&&oa.y<=Hr&&te(ke,ft,je,Mt,We,Ut,oa.x,oa.y)&&Ge(oa.prev,oa,oa.next)>=0)return!1;oa=oa.next}return!0}function pl(H,D,K,pe){let ke=H.prev,je=H,We=H.next;if(Ge(ke,je,We)>=0)return!1;let ft=ke.x,Mt=je.x,Ut=We.x,nr=ke.y,Mr=je.y,zr=We.y,Hr=ftMt?ft>Ut?ft:Ut:Mt>Ut?Mt:Ut,Ga=nr>Mr?nr>zr?nr:zr:Mr>zr?Mr:zr,Qa=Y(Hr,oa,D,K,pe),Yi=Y(va,Ga,D,K,pe),xi=H.prevZ,Hi=H.nextZ;for(;xi&&xi.z>=Qa&&Hi&&Hi.z<=Yi;){if(xi.x>=Hr&&xi.x<=va&&xi.y>=oa&&xi.y<=Ga&&xi!==ke&&xi!==We&&te(ft,nr,Mt,Mr,Ut,zr,xi.x,xi.y)&&Ge(xi.prev,xi,xi.next)>=0||(xi=xi.prevZ,Hi.x>=Hr&&Hi.x<=va&&Hi.y>=oa&&Hi.y<=Ga&&Hi!==ke&&Hi!==We&&te(ft,nr,Mt,Mr,Ut,zr,Hi.x,Hi.y)&&Ge(Hi.prev,Hi,Hi.next)>=0))return!1;Hi=Hi.nextZ}for(;xi&&xi.z>=Qa;){if(xi.x>=Hr&&xi.x<=va&&xi.y>=oa&&xi.y<=Ga&&xi!==ke&&xi!==We&&te(ft,nr,Mt,Mr,Ut,zr,xi.x,xi.y)&&Ge(xi.prev,xi,xi.next)>=0)return!1;xi=xi.prevZ}for(;Hi&&Hi.z<=Yi;){if(Hi.x>=Hr&&Hi.x<=va&&Hi.y>=oa&&Hi.y<=Ga&&Hi!==ke&&Hi!==We&&te(ft,nr,Mt,Mr,Ut,zr,Hi.x,Hi.y)&&Ge(Hi.prev,Hi,Hi.next)>=0)return!1;Hi=Hi.nextZ}return!0}function bl(H,D){let K=H;do{let pe=K.prev,ke=K.next.next;!Le(pe,ke)&&$e(pe,K,K.next,ke)&&_r(pe,ke)&&_r(ke,pe)&&(D.push(pe.i,K.i,ke.i),gt(K),gt(K.next),K=H=ke),K=K.next}while(K!==H);return El(K)}function Hn(H,D,K,pe,ke,je){let We=H;do{let ft=We.next.next;for(;ft!==We.prev;){if(We.i!==ft.i&&me(We,ft)){let Mt=Fr(We,ft);return We=El(We,We.next),Mt=El(Mt,Mt.next),Ql(We,D,K,pe,ke,je,0),void Ql(Mt,D,K,pe,ke,je,0)}ft=ft.next}We=We.next}while(We!==H)}function Cl(H,D){return H.x-D.x}function Lo(H,D){let K=function(ke,je){let We=je,ft=ke.x,Mt=ke.y,Ut,nr=-1/0;do{if(Mt<=We.y&&Mt>=We.next.y&&We.next.y!==We.y){let va=We.x+(Mt-We.y)*(We.next.x-We.x)/(We.next.y-We.y);if(va<=ft&&va>nr&&(nr=va,Ut=We.x=We.x&&We.x>=zr&&ft!==We.x&&te(MtUt.x||We.x===Ut.x&&ve(Ut,We)))&&(Ut=We,oa=va)}We=We.next}while(We!==Mr);return Ut}(H,D);if(!K)return D;let pe=Fr(K,H);return El(pe,pe.next),El(K,K.next)}function ve(H,D){return Ge(H.prev,H,D.prev)<0&&Ge(D.next,H,H.next)<0}function Y(H,D,K,pe,ke){return(H=1431655765&((H=858993459&((H=252645135&((H=16711935&((H=(H-K)*ke|0)|H<<8))|H<<4))|H<<2))|H<<1))|(D=1431655765&((D=858993459&((D=252645135&((D=16711935&((D=(D-pe)*ke|0)|D<<8))|D<<4))|D<<2))|D<<1))<<1}function ye(H){let D=H,K=H;do(D.x=(H-We)*(je-ft)&&(H-We)*(pe-ft)>=(K-We)*(D-ft)&&(K-We)*(je-ft)>=(ke-We)*(pe-ft)}function me(H,D){return H.next.i!==D.i&&H.prev.i!==D.i&&!function(K,pe){let ke=K;do{if(ke.i!==K.i&&ke.next.i!==K.i&&ke.i!==pe.i&&ke.next.i!==pe.i&&$e(ke,ke.next,K,pe))return!0;ke=ke.next}while(ke!==K);return!1}(H,D)&&(_r(H,D)&&_r(D,H)&&function(K,pe){let ke=K,je=!1,We=(K.x+pe.x)/2,ft=(K.y+pe.y)/2;do ke.y>ft!=ke.next.y>ft&&ke.next.y!==ke.y&&We<(ke.next.x-ke.x)*(ft-ke.y)/(ke.next.y-ke.y)+ke.x&&(je=!je),ke=ke.next;while(ke!==K);return je}(H,D)&&(Ge(H.prev,H,D.prev)||Ge(H,D.prev,D))||Le(H,D)&&Ge(H.prev,H,H.next)>0&&Ge(D.prev,D,D.next)>0)}function Ge(H,D,K){return(D.y-H.y)*(K.x-D.x)-(D.x-H.x)*(K.y-D.y)}function Le(H,D){return H.x===D.x&&H.y===D.y}function $e(H,D,K,pe){let ke=jt(Ge(H,D,K)),je=jt(Ge(H,D,pe)),We=jt(Ge(K,pe,H)),ft=jt(Ge(K,pe,D));return ke!==je&&We!==ft||!(ke!==0||!mt(H,K,D))||!(je!==0||!mt(H,pe,D))||!(We!==0||!mt(K,H,pe))||!(ft!==0||!mt(K,D,pe))}function mt(H,D,K){return D.x<=Math.max(H.x,K.x)&&D.x>=Math.min(H.x,K.x)&&D.y<=Math.max(H.y,K.y)&&D.y>=Math.min(H.y,K.y)}function jt(H){return H>0?1:H<0?-1:0}function _r(H,D){return Ge(H.prev,H,H.next)<0?Ge(H,D,H.next)>=0&&Ge(H,H.prev,D)>=0:Ge(H,D,H.prev)<0||Ge(H,H.next,D)<0}function Fr(H,D){let K=Et(H.i,H.x,H.y),pe=Et(D.i,D.x,D.y),ke=H.next,je=D.prev;return H.next=D,D.prev=H,K.next=ke,ke.prev=K,pe.next=K,K.prev=pe,je.next=pe,pe.prev=je,pe}function hr(H,D,K,pe){let ke=Et(H,D,K);return pe?(ke.next=pe.next,ke.prev=pe,pe.next.prev=ke,pe.next=ke):(ke.prev=ke,ke.next=ke),ke}function gt(H){H.next.prev=H.prev,H.prev.next=H.next,H.prevZ&&(H.prevZ.nextZ=H.nextZ),H.nextZ&&(H.nextZ.prevZ=H.prevZ)}function Et(H,D,K){return{i:H,x:D,y:K,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function Ft(H,D,K){let pe=K.patternDependencies,ke=!1;for(let je of D){let We=je.paint.get(`${H}-pattern`);We.isConstant()||(ke=!0);let ft=We.constantOr(null);ft&&(ke=!0,pe[ft.to]=!0,pe[ft.from]=!0)}return ke}function ir(H,D,K,pe,ke){let je=ke.patternDependencies;for(let We of D){let ft=We.paint.get(`${H}-pattern`).value;if(ft.kind!=="constant"){let Mt=ft.evaluate({zoom:pe-1},K,{},ke.availableImages),Ut=ft.evaluate({zoom:pe},K,{},ke.availableImages),nr=ft.evaluate({zoom:pe+1},K,{},ke.availableImages);Mt=Mt&&Mt.name?Mt.name:Mt,Ut=Ut&&Ut.name?Ut.name:Ut,nr=nr&&nr.name?nr.name:nr,je[Mt]=!0,je[Ut]=!0,je[nr]=!0,K.patterns[We.id]={min:Mt,mid:Ut,max:nr}}}return K}class fr{constructor(D){this.zoom=D.zoom,this.overscaling=D.overscaling,this.layers=D.layers,this.layerIds=this.layers.map(K=>K.id),this.index=D.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new Pl,this.indexArray=new De,this.indexArray2=new et,this.programConfigurations=new el(D.layers,D.zoom),this.segments=new St,this.segments2=new St,this.stateDependentLayerIds=this.layers.filter(K=>K.isStateDependent()).map(K=>K.id)}populate(D,K,pe){this.hasPattern=Ft("fill",this.layers,K);let ke=this.layers[0].layout.get("fill-sort-key"),je=!ke.isConstant(),We=[];for(let{feature:ft,id:Mt,index:Ut,sourceLayerIndex:nr}of D){let Mr=this.layers[0]._featureFilter.needGeometry,zr=Gl(ft,Mr);if(!this.layers[0]._featureFilter.filter(new Ls(this.zoom),zr,pe))continue;let Hr=je?ke.evaluate(zr,{},pe,K.availableImages):void 0,oa={id:Mt,properties:ft.properties,type:ft.type,sourceLayerIndex:nr,index:Ut,geometry:Mr?zr.geometry:Tl(ft),patterns:{},sortKey:Hr};We.push(oa)}je&&We.sort((ft,Mt)=>ft.sortKey-Mt.sortKey);for(let ft of We){let{geometry:Mt,index:Ut,sourceLayerIndex:nr}=ft;if(this.hasPattern){let Mr=ir("fill",this.layers,ft,this.zoom,K);this.patternFeatures.push(Mr)}else this.addFeature(ft,Mt,Ut,pe,{});K.featureIndex.insert(D[Ut].feature,Mt,Ut,nr,this.index)}}update(D,K,pe){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(D,K,this.stateDependentLayers,pe)}addFeatures(D,K,pe){for(let ke of this.patternFeatures)this.addFeature(ke,ke.geometry,ke.index,K,pe)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(D){this.uploaded||(this.layoutVertexBuffer=D.createVertexBuffer(this.layoutVertexArray,Hl),this.indexBuffer=D.createIndexBuffer(this.indexArray),this.indexBuffer2=D.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(D),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(D,K,pe,ke,je){for(let We of Bc(K,500)){let ft=0;for(let Hr of We)ft+=Hr.length;let Mt=this.segments.prepareSegment(ft,this.layoutVertexArray,this.indexArray),Ut=Mt.vertexLength,nr=[],Mr=[];for(let Hr of We){if(Hr.length===0)continue;Hr!==We[0]&&Mr.push(nr.length/2);let oa=this.segments2.prepareSegment(Hr.length,this.layoutVertexArray,this.indexArray2),va=oa.vertexLength;this.layoutVertexArray.emplaceBack(Hr[0].x,Hr[0].y),this.indexArray2.emplaceBack(va+Hr.length-1,va),nr.push(Hr[0].x),nr.push(Hr[0].y);for(let Ga=1;Ga>3}if(ke--,pe===1||pe===2)je+=H.readSVarint(),We+=H.readSVarint(),pe===1&&(D&&ft.push(D),D=[]),D.push(new ba(je,We));else{if(pe!==7)throw new Error("unknown command "+pe);D&&D.push(D[0].clone())}}return D&&ft.push(D),ft},Xa.prototype.bbox=function(){var H=this._pbf;H.pos=this._geometry;for(var D=H.readVarint()+H.pos,K=1,pe=0,ke=0,je=0,We=1/0,ft=-1/0,Mt=1/0,Ut=-1/0;H.pos>3}if(pe--,K===1||K===2)(ke+=H.readSVarint())ft&&(ft=ke),(je+=H.readSVarint())Ut&&(Ut=je);else if(K!==7)throw new Error("unknown command "+K)}return[We,Mt,ft,Ut]},Xa.prototype.toGeoJSON=function(H,D,K){var pe,ke,je=this.extent*Math.pow(2,K),We=this.extent*H,ft=this.extent*D,Mt=this.loadGeometry(),Ut=Xa.types[this.type];function nr(Hr){for(var oa=0;oa>3;ke=We===1?pe.readString():We===2?pe.readFloat():We===3?pe.readDouble():We===4?pe.readVarint64():We===5?pe.readVarint():We===6?pe.readSVarint():We===7?pe.readBoolean():null}return ke}(K))}wi.prototype.feature=function(H){if(H<0||H>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[H];var D=this._pbf.readVarint()+this._pbf.pos;return new Bi(this._pbf,D,this.extent,this._keys,this._values)};var Vi=pi;function cn(H,D,K){if(H===3){var pe=new Vi(K,K.readVarint()+K.pos);pe.length&&(D[pe.name]=pe)}}Jr.VectorTile=function(H,D){this.layers=H.readFields(cn,{},D)},Jr.VectorTileFeature=yi,Jr.VectorTileLayer=pi;let xo=Jr.VectorTileFeature.types,jo=Math.pow(2,13);function ks(H,D,K,pe,ke,je,We,ft){H.emplaceBack(D,K,2*Math.floor(pe*jo)+We,ke*jo*2,je*jo*2,Math.round(ft))}class Fo{constructor(D){this.zoom=D.zoom,this.overscaling=D.overscaling,this.layers=D.layers,this.layerIds=this.layers.map(K=>K.id),this.index=D.index,this.hasPattern=!1,this.layoutVertexArray=new $l,this.centroidVertexArray=new es,this.indexArray=new De,this.programConfigurations=new el(D.layers,D.zoom),this.segments=new St,this.stateDependentLayerIds=this.layers.filter(K=>K.isStateDependent()).map(K=>K.id)}populate(D,K,pe){this.features=[],this.hasPattern=Ft("fill-extrusion",this.layers,K);for(let{feature:ke,id:je,index:We,sourceLayerIndex:ft}of D){let Mt=this.layers[0]._featureFilter.needGeometry,Ut=Gl(ke,Mt);if(!this.layers[0]._featureFilter.filter(new Ls(this.zoom),Ut,pe))continue;let nr={id:je,sourceLayerIndex:ft,index:We,geometry:Mt?Ut.geometry:Tl(ke),properties:ke.properties,type:ke.type,patterns:{}};this.hasPattern?this.features.push(ir("fill-extrusion",this.layers,nr,this.zoom,K)):this.addFeature(nr,nr.geometry,We,pe,{}),K.featureIndex.insert(ke,nr.geometry,We,ft,this.index,!0)}}addFeatures(D,K,pe){for(let ke of this.features){let{geometry:je}=ke;this.addFeature(ke,je,ke.index,K,pe)}}update(D,K,pe){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(D,K,this.stateDependentLayers,pe)}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(D){this.uploaded||(this.layoutVertexBuffer=D.createVertexBuffer(this.layoutVertexArray,Dr),this.centroidVertexBuffer=D.createVertexBuffer(this.centroidVertexArray,qt.members,!0),this.indexBuffer=D.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(D),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(D,K,pe,ke,je){for(let We of Bc(K,500)){let ft={x:0,y:0,vertexCount:0},Mt=0;for(let oa of We)Mt+=oa.length;let Ut=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(let oa of We){if(oa.length===0||Hs(oa))continue;let va=0;for(let Ga=0;Ga=1){let Yi=oa[Ga-1];if(!bs(Qa,Yi)){Ut.vertexLength+4>St.MAX_VERTEX_ARRAY_LENGTH&&(Ut=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));let xi=Qa.sub(Yi)._perp()._unit(),Hi=Yi.dist(Qa);va+Hi>32768&&(va=0),ks(this.layoutVertexArray,Qa.x,Qa.y,xi.x,xi.y,0,0,va),ks(this.layoutVertexArray,Qa.x,Qa.y,xi.x,xi.y,0,1,va),ft.x+=2*Qa.x,ft.y+=2*Qa.y,ft.vertexCount+=2,va+=Hi,ks(this.layoutVertexArray,Yi.x,Yi.y,xi.x,xi.y,0,0,va),ks(this.layoutVertexArray,Yi.x,Yi.y,xi.x,xi.y,0,1,va),ft.x+=2*Yi.x,ft.y+=2*Yi.y,ft.vertexCount+=2;let rn=Ut.vertexLength;this.indexArray.emplaceBack(rn,rn+2,rn+1),this.indexArray.emplaceBack(rn+1,rn+2,rn+3),Ut.vertexLength+=4,Ut.primitiveLength+=2}}}}if(Ut.vertexLength+Mt>St.MAX_VERTEX_ARRAY_LENGTH&&(Ut=this.segments.prepareSegment(Mt,this.layoutVertexArray,this.indexArray)),xo[D.type]!=="Polygon")continue;let nr=[],Mr=[],zr=Ut.vertexLength;for(let oa of We)if(oa.length!==0){oa!==We[0]&&Mr.push(nr.length/2);for(let va=0;vavo)||H.y===D.y&&(H.y<0||H.y>vo)}function Hs(H){return H.every(D=>D.x<0)||H.every(D=>D.x>vo)||H.every(D=>D.y<0)||H.every(D=>D.y>vo)}let pu;_i("FillExtrusionBucket",Fo,{omit:["layers","features"]});var Mp={get paint(){return pu=pu||new Ne({"fill-extrusion-opacity":new fo(re["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new zo(re["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new fo(re["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new fo(re["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new Ic(re["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new zo(re["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new zo(re["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new fo(re["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})}};class Ep extends ae{constructor(D){super(D,Mp)}createBucket(D){return new Fo(D)}queryRadius(){return yn(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(D,K,pe,ke,je,We,ft,Mt){let Ut=Oi(D,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),We.angle,ft),nr=this.paint.get("fill-extrusion-height").evaluate(K,pe),Mr=this.paint.get("fill-extrusion-base").evaluate(K,pe),zr=function(oa,va,Ga,Qa){let Yi=[];for(let xi of oa){let Hi=[xi.x,xi.y,0,1];hn(Hi,Hi,va),Yi.push(new i(Hi[0]/Hi[3],Hi[1]/Hi[3]))}return Yi}(Ut,Mt),Hr=function(oa,va,Ga,Qa){let Yi=[],xi=[],Hi=Qa[8]*va,rn=Qa[9]*va,jn=Qa[10]*va,ko=Qa[11]*va,vs=Qa[8]*Ga,go=Qa[9]*Ga,Dn=Qa[10]*Ga,is=Qa[11]*Ga;for(let Vo of oa){let Bo=[],_n=[];for(let us of Vo){let No=us.x,Es=us.y,Ku=Qa[0]*No+Qa[4]*Es+Qa[12],Uu=Qa[1]*No+Qa[5]*Es+Qa[13],Qf=Qa[2]*No+Qa[6]*Es+Qa[14],Hp=Qa[3]*No+Qa[7]*Es+Qa[15],bh=Qf+jn,eh=Hp+ko,Jh=Ku+vs,$h=Uu+go,Qh=Qf+Dn,uf=Hp+is,th=new i((Ku+Hi)/eh,(Uu+rn)/eh);th.z=bh/eh,Bo.push(th);let Fh=new i(Jh/uf,$h/uf);Fh.z=Qh/uf,_n.push(Fh)}Yi.push(Bo),xi.push(_n)}return[Yi,xi]}(ke,Mr,nr,Mt);return function(oa,va,Ga){let Qa=1/0;Yt(Ga,va)&&(Qa=qp(Ga,va[0]));for(let Yi=0;YiK.id),this.index=D.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(K=>{this.gradients[K.id]={}}),this.layoutVertexArray=new Ru,this.layoutVertexArray2=new hu,this.indexArray=new De,this.programConfigurations=new el(D.layers,D.zoom),this.segments=new St,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(K=>K.isStateDependent()).map(K=>K.id)}populate(D,K,pe){this.hasPattern=Ft("line",this.layers,K);let ke=this.layers[0].layout.get("line-sort-key"),je=!ke.isConstant(),We=[];for(let{feature:ft,id:Mt,index:Ut,sourceLayerIndex:nr}of D){let Mr=this.layers[0]._featureFilter.needGeometry,zr=Gl(ft,Mr);if(!this.layers[0]._featureFilter.filter(new Ls(this.zoom),zr,pe))continue;let Hr=je?ke.evaluate(zr,{},pe):void 0,oa={id:Mt,properties:ft.properties,type:ft.type,sourceLayerIndex:nr,index:Ut,geometry:Mr?zr.geometry:Tl(ft),patterns:{},sortKey:Hr};We.push(oa)}je&&We.sort((ft,Mt)=>ft.sortKey-Mt.sortKey);for(let ft of We){let{geometry:Mt,index:Ut,sourceLayerIndex:nr}=ft;if(this.hasPattern){let Mr=ir("line",this.layers,ft,this.zoom,K);this.patternFeatures.push(Mr)}else this.addFeature(ft,Mt,Ut,pe,{});K.featureIndex.insert(D[Ut].feature,Mt,Ut,nr,this.index)}}update(D,K,pe){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(D,K,this.stateDependentLayers,pe)}addFeatures(D,K,pe){for(let ke of this.patternFeatures)this.addFeature(ke,ke.geometry,ke.index,K,pe)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(D){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=D.createVertexBuffer(this.layoutVertexArray2,rd)),this.layoutVertexBuffer=D.createVertexBuffer(this.layoutVertexArray,td),this.indexBuffer=D.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(D),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(D){if(D.properties&&Object.prototype.hasOwnProperty.call(D.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(D.properties,"mapbox_clip_end"))return{start:+D.properties.mapbox_clip_start,end:+D.properties.mapbox_clip_end}}addFeature(D,K,pe,ke,je){let We=this.layers[0].layout,ft=We.get("line-join").evaluate(D,{}),Mt=We.get("line-cap"),Ut=We.get("line-miter-limit"),nr=We.get("line-round-limit");this.lineClips=this.lineFeatureClips(D);for(let Mr of K)this.addLine(Mr,D,ft,Mt,Ut,nr);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,D,pe,je,ke)}addLine(D,K,pe,ke,je,We){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let Qa=0;Qa=2&&D[Mt-1].equals(D[Mt-2]);)Mt--;let Ut=0;for(;Ut0;if(ko&&Qa>Ut){let is=zr.dist(Hr);if(is>2*nr){let Vo=zr.sub(zr.sub(Hr)._mult(nr/is)._round());this.updateDistance(Hr,Vo),this.addCurrentVertex(Vo,va,0,0,Mr),Hr=Vo}}let go=Hr&&oa,Dn=go?pe:ft?"butt":ke;if(go&&Dn==="round"&&(rnje&&(Dn="bevel"),Dn==="bevel"&&(rn>2&&(Dn="flipbevel"),rn100)Yi=Ga.mult(-1);else{let is=rn*va.add(Ga).mag()/va.sub(Ga).mag();Yi._perp()._mult(is*(vs?-1:1))}this.addCurrentVertex(zr,Yi,0,0,Mr),this.addCurrentVertex(zr,Yi.mult(-1),0,0,Mr)}else if(Dn==="bevel"||Dn==="fakeround"){let is=-Math.sqrt(rn*rn-1),Vo=vs?is:0,Bo=vs?0:is;if(Hr&&this.addCurrentVertex(zr,va,Vo,Bo,Mr),Dn==="fakeround"){let _n=Math.round(180*jn/Math.PI/20);for(let us=1;us<_n;us++){let No=us/_n;if(No!==.5){let Ku=No-.5;No+=No*Ku*(No-1)*((1.0904+xi*(xi*(3.55645-1.43519*xi)-3.2452))*Ku*Ku+(.848013+xi*(.215638*xi-1.06021)))}let Es=Ga.sub(va)._mult(No)._add(va)._unit()._mult(vs?-1:1);this.addHalfVertex(zr,Es.x,Es.y,!1,vs,0,Mr)}}oa&&this.addCurrentVertex(zr,Ga,-Vo,-Bo,Mr)}else if(Dn==="butt")this.addCurrentVertex(zr,Yi,0,0,Mr);else if(Dn==="square"){let is=Hr?1:-1;this.addCurrentVertex(zr,Yi,is,is,Mr)}else Dn==="round"&&(Hr&&(this.addCurrentVertex(zr,va,0,0,Mr),this.addCurrentVertex(zr,va,1,1,Mr,!0)),oa&&(this.addCurrentVertex(zr,Ga,-1,-1,Mr,!0),this.addCurrentVertex(zr,Ga,0,0,Mr)));if(ko&&Qa2*nr){let Vo=zr.add(oa.sub(zr)._mult(nr/is)._round());this.updateDistance(zr,Vo),this.addCurrentVertex(Vo,Ga,0,0,Mr),zr=Vo}}}}addCurrentVertex(D,K,pe,ke,je,We=!1){let ft=K.y*ke-K.x,Mt=-K.y-K.x*ke;this.addHalfVertex(D,K.x+K.y*pe,K.y-K.x*pe,We,!1,pe,je),this.addHalfVertex(D,ft,Mt,We,!0,-ke,je),this.distance>Cp/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(D,K,pe,ke,je,We))}addHalfVertex({x:D,y:K},pe,ke,je,We,ft,Mt){let Ut=.5*(this.lineClips?this.scaledDistance*(Cp-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((D<<1)+(je?1:0),(K<<1)+(We?1:0),Math.round(63*pe)+128,Math.round(63*ke)+128,1+(ft===0?0:ft<0?-1:1)|(63&Ut)<<2,Ut>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);let nr=Mt.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,nr),Mt.primitiveLength++),We?this.e2=nr:this.e1=nr}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(D,K){this.distance+=D.dist(K),this.updateScaledDistance()}}let kp,kv;_i("LineBucket",Vp,{omit:["layers","patternFeatures"]});var Vd={get paint(){return kv=kv||new Ne({"line-opacity":new zo(re.paint_line["line-opacity"]),"line-color":new zo(re.paint_line["line-color"]),"line-translate":new fo(re.paint_line["line-translate"]),"line-translate-anchor":new fo(re.paint_line["line-translate-anchor"]),"line-width":new zo(re.paint_line["line-width"]),"line-gap-width":new zo(re.paint_line["line-gap-width"]),"line-offset":new zo(re.paint_line["line-offset"]),"line-blur":new zo(re.paint_line["line-blur"]),"line-dasharray":new lc(re.paint_line["line-dasharray"]),"line-pattern":new Ic(re.paint_line["line-pattern"]),"line-gradient":new Yu(re.paint_line["line-gradient"])})},get layout(){return kp=kp||new Ne({"line-cap":new fo(re.layout_line["line-cap"]),"line-join":new zo(re.layout_line["line-join"]),"line-miter-limit":new fo(re.layout_line["line-miter-limit"]),"line-round-limit":new fo(re.layout_line["line-round-limit"]),"line-sort-key":new zo(re.layout_line["line-sort-key"])})}};class qf extends zo{possiblyEvaluate(D,K){return K=new Ls(Math.floor(K.zoom),{now:K.now,fadeDuration:K.fadeDuration,zoomHistory:K.zoomHistory,transition:K.transition}),super.possiblyEvaluate(D,K)}evaluate(D,K,pe,ke){return K=E({},K,{zoom:Math.floor(K.zoom)}),super.evaluate(D,K,pe,ke)}}let Gd;class Lv extends ae{constructor(D){super(D,Vd),this.gradientVersion=0,Gd||(Gd=new qf(Vd.paint.properties["line-width"].specification),Gd.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(D){if(D==="line-gradient"){let K=this.gradientExpression();this.stepInterpolant=!!function(pe){return pe._styleExpression!==void 0}(K)&&K._styleExpression.expression instanceof Da,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(D,K){super.recalculate(D,K),this.paint._values["line-floorwidth"]=Gd.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,D)}createBucket(D){return new Vp(D)}queryRadius(D){let K=D,pe=ch(fi("line-width",this,K),fi("line-gap-width",this,K)),ke=fi("line-offset",this,K);return pe/2+Math.abs(ke)+yn(this.paint.get("line-translate"))}queryIntersectsFeature(D,K,pe,ke,je,We,ft){let Mt=Oi(D,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),We.angle,ft),Ut=ft/2*ch(this.paint.get("line-width").evaluate(K,pe),this.paint.get("line-gap-width").evaluate(K,pe)),nr=this.paint.get("line-offset").evaluate(K,pe);return nr&&(ke=function(Mr,zr){let Hr=[];for(let oa=0;oa=3){for(let Ga=0;Ga0?D+2*H:H}let iv=pt([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),im=pt([{name:"a_projected_pos",components:3,type:"Float32"}],4);pt([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);let nm=pt([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_box_real",components:2,type:"Int16"}]);pt([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);let Pv=pt([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),nv=pt([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function ov(H,D,K){return H.sections.forEach(pe=>{pe.text=function(ke,je,We){let ft=je.layout.get("text-transform").evaluate(We,{});return ft==="uppercase"?ke=ke.toLocaleUpperCase():ft==="lowercase"&&(ke=ke.toLocaleLowerCase()),Xs.applyArabicShaping&&(ke=Xs.applyArabicShaping(ke)),ke}(pe.text,D,K)}),H}pt([{name:"triangle",components:3,type:"Uint16"}]),pt([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}]),pt([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",name:"collisionCircleDiameter"},{type:"Uint16",name:"textAnchorOffsetStartIndex"},{type:"Uint16",name:"textAnchorOffsetEndIndex"}]),pt([{type:"Float32",name:"offsetX"}]),pt([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),pt([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);let cc={"!":"\uFE15","#":"\uFF03",$:"\uFF04","%":"\uFF05","&":"\uFF06","(":"\uFE35",")":"\uFE36","*":"\uFF0A","+":"\uFF0B",",":"\uFE10","-":"\uFE32",".":"\u30FB","/":"\uFF0F",":":"\uFE13",";":"\uFE14","<":"\uFE3F","=":"\uFF1D",">":"\uFE40","?":"\uFE16","@":"\uFF20","[":"\uFE47","\\":"\uFF3C","]":"\uFE48","^":"\uFF3E",_:"\uFE33","`":"\uFF40","{":"\uFE37","|":"\u2015","}":"\uFE38","~":"\uFF5E","\xA2":"\uFFE0","\xA3":"\uFFE1","\xA5":"\uFFE5","\xA6":"\uFFE4","\xAC":"\uFFE2","\xAF":"\uFFE3","\u2013":"\uFE32","\u2014":"\uFE31","\u2018":"\uFE43","\u2019":"\uFE44","\u201C":"\uFE41","\u201D":"\uFE42","\u2026":"\uFE19","\u2027":"\u30FB","\u20A9":"\uFFE6","\u3001":"\uFE11","\u3002":"\uFE12","\u3008":"\uFE3F","\u3009":"\uFE40","\u300A":"\uFE3D","\u300B":"\uFE3E","\u300C":"\uFE41","\u300D":"\uFE42","\u300E":"\uFE43","\u300F":"\uFE44","\u3010":"\uFE3B","\u3011":"\uFE3C","\u3014":"\uFE39","\u3015":"\uFE3A","\u3016":"\uFE17","\u3017":"\uFE18","\uFF01":"\uFE15","\uFF08":"\uFE35","\uFF09":"\uFE36","\uFF0C":"\uFE10","\uFF0D":"\uFE32","\uFF0E":"\u30FB","\uFF1A":"\uFE13","\uFF1B":"\uFE14","\uFF1C":"\uFE3F","\uFF1E":"\uFE40","\uFF1F":"\uFE16","\uFF3B":"\uFE47","\uFF3D":"\uFE48","\uFF3F":"\uFE33","\uFF5B":"\uFE37","\uFF5C":"\u2015","\uFF5D":"\uFE38","\uFF5F":"\uFE35","\uFF60":"\uFE36","\uFF61":"\uFE12","\uFF62":"\uFE41","\uFF63":"\uFE42"};var lu=24,Dh=Au,Iv=function(H,D,K,pe,ke){var je,We,ft=8*ke-pe-1,Mt=(1<>1,nr=-7,Mr=K?ke-1:0,zr=K?-1:1,Hr=H[D+Mr];for(Mr+=zr,je=Hr&(1<<-nr)-1,Hr>>=-nr,nr+=ft;nr>0;je=256*je+H[D+Mr],Mr+=zr,nr-=8);for(We=je&(1<<-nr)-1,je>>=-nr,nr+=pe;nr>0;We=256*We+H[D+Mr],Mr+=zr,nr-=8);if(je===0)je=1-Ut;else{if(je===Mt)return We?NaN:1/0*(Hr?-1:1);We+=Math.pow(2,pe),je-=Ut}return(Hr?-1:1)*We*Math.pow(2,je-pe)},om=function(H,D,K,pe,ke,je){var We,ft,Mt,Ut=8*je-ke-1,nr=(1<>1,zr=ke===23?Math.pow(2,-24)-Math.pow(2,-77):0,Hr=pe?0:je-1,oa=pe?1:-1,va=D<0||D===0&&1/D<0?1:0;for(D=Math.abs(D),isNaN(D)||D===1/0?(ft=isNaN(D)?1:0,We=nr):(We=Math.floor(Math.log(D)/Math.LN2),D*(Mt=Math.pow(2,-We))<1&&(We--,Mt*=2),(D+=We+Mr>=1?zr/Mt:zr*Math.pow(2,1-Mr))*Mt>=2&&(We++,Mt/=2),We+Mr>=nr?(ft=0,We=nr):We+Mr>=1?(ft=(D*Mt-1)*Math.pow(2,ke),We+=Mr):(ft=D*Math.pow(2,Mr-1)*Math.pow(2,ke),We=0));ke>=8;H[K+Hr]=255&ft,Hr+=oa,ft/=256,ke-=8);for(We=We<0;H[K+Hr]=255&We,Hr+=oa,We/=256,Ut-=8);H[K+Hr-oa]|=128*va};function Au(H){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(H)?H:new Uint8Array(H||0),this.pos=0,this.type=0,this.length=this.buf.length}Au.Varint=0,Au.Fixed64=1,Au.Bytes=2,Au.Fixed32=5;var x0=4294967296,sv=1/x0,_g=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");function Lp(H){return H.type===Au.Bytes?H.readVarint()+H.pos:H.pos+1}function lv(H,D,K){return K?4294967296*D+(H>>>0):4294967296*(D>>>0)+(H>>>0)}function xg(H,D,K){var pe=D<=16383?1:D<=2097151?2:D<=268435455?3:Math.floor(Math.log(D)/(7*Math.LN2));K.realloc(pe);for(var ke=K.pos-1;ke>=H;ke--)K.buf[ke+pe]=K.buf[ke]}function b0(H,D){for(var K=0;K>>8,H[K+2]=D>>>16,H[K+3]=D>>>24}function kx(H,D){return(H[D]|H[D+1]<<8|H[D+2]<<16)+(H[D+3]<<24)}Au.prototype={destroy:function(){this.buf=null},readFields:function(H,D,K){for(K=K||this.length;this.pos>3,je=this.pos;this.type=7&pe,H(ke,D,this),this.pos===je&&this.skip(pe)}return D},readMessage:function(H,D){return this.readFields(H,D,this.readVarint()+this.pos)},readFixed32:function(){var H=Rv(this.buf,this.pos);return this.pos+=4,H},readSFixed32:function(){var H=kx(this.buf,this.pos);return this.pos+=4,H},readFixed64:function(){var H=Rv(this.buf,this.pos)+Rv(this.buf,this.pos+4)*x0;return this.pos+=8,H},readSFixed64:function(){var H=Rv(this.buf,this.pos)+kx(this.buf,this.pos+4)*x0;return this.pos+=8,H},readFloat:function(){var H=Iv(this.buf,this.pos,!0,23,4);return this.pos+=4,H},readDouble:function(){var H=Iv(this.buf,this.pos,!0,52,8);return this.pos+=8,H},readVarint:function(H){var D,K,pe=this.buf;return D=127&(K=pe[this.pos++]),K<128?D:(D|=(127&(K=pe[this.pos++]))<<7,K<128?D:(D|=(127&(K=pe[this.pos++]))<<14,K<128?D:(D|=(127&(K=pe[this.pos++]))<<21,K<128?D:function(ke,je,We){var ft,Mt,Ut=We.buf;if(ft=(112&(Mt=Ut[We.pos++]))>>4,Mt<128||(ft|=(127&(Mt=Ut[We.pos++]))<<3,Mt<128)||(ft|=(127&(Mt=Ut[We.pos++]))<<10,Mt<128)||(ft|=(127&(Mt=Ut[We.pos++]))<<17,Mt<128)||(ft|=(127&(Mt=Ut[We.pos++]))<<24,Mt<128)||(ft|=(1&(Mt=Ut[We.pos++]))<<31,Mt<128))return lv(ke,ft,je);throw new Error("Expected varint not more than 10 bytes")}(D|=(15&(K=pe[this.pos]))<<28,H,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var H=this.readVarint();return H%2==1?(H+1)/-2:H/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var H=this.readVarint()+this.pos,D=this.pos;return this.pos=H,H-D>=12&&_g?function(K,pe,ke){return _g.decode(K.subarray(pe,ke))}(this.buf,D,H):function(K,pe,ke){for(var je="",We=pe;We239?4:nr>223?3:nr>191?2:1;if(We+zr>ke)break;zr===1?nr<128&&(Mr=nr):zr===2?(192&(ft=K[We+1]))==128&&(Mr=(31&nr)<<6|63&ft)<=127&&(Mr=null):zr===3?(Mt=K[We+2],(192&(ft=K[We+1]))==128&&(192&Mt)==128&&((Mr=(15&nr)<<12|(63&ft)<<6|63&Mt)<=2047||Mr>=55296&&Mr<=57343)&&(Mr=null)):zr===4&&(Mt=K[We+2],Ut=K[We+3],(192&(ft=K[We+1]))==128&&(192&Mt)==128&&(192&Ut)==128&&((Mr=(15&nr)<<18|(63&ft)<<12|(63&Mt)<<6|63&Ut)<=65535||Mr>=1114112)&&(Mr=null)),Mr===null?(Mr=65533,zr=1):Mr>65535&&(Mr-=65536,je+=String.fromCharCode(Mr>>>10&1023|55296),Mr=56320|1023&Mr),je+=String.fromCharCode(Mr),We+=zr}return je}(this.buf,D,H)},readBytes:function(){var H=this.readVarint()+this.pos,D=this.buf.subarray(this.pos,H);return this.pos=H,D},readPackedVarint:function(H,D){if(this.type!==Au.Bytes)return H.push(this.readVarint(D));var K=Lp(this);for(H=H||[];this.pos127;);else if(D===Au.Bytes)this.pos=this.readVarint()+this.pos;else if(D===Au.Fixed32)this.pos+=4;else{if(D!==Au.Fixed64)throw new Error("Unimplemented type: "+D);this.pos+=8}},writeTag:function(H,D){this.writeVarint(H<<3|D)},realloc:function(H){for(var D=this.length||16;D268435455||H<0?function(D,K){var pe,ke;if(D>=0?(pe=D%4294967296|0,ke=D/4294967296|0):(ke=~(-D/4294967296),4294967295^(pe=~(-D%4294967296))?pe=pe+1|0:(pe=0,ke=ke+1|0)),D>=18446744073709552e3||D<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");K.realloc(10),function(je,We,ft){ft.buf[ft.pos++]=127&je|128,je>>>=7,ft.buf[ft.pos++]=127&je|128,je>>>=7,ft.buf[ft.pos++]=127&je|128,je>>>=7,ft.buf[ft.pos++]=127&je|128,ft.buf[ft.pos]=127&(je>>>=7)}(pe,0,K),function(je,We){var ft=(7&je)<<4;We.buf[We.pos++]|=ft|((je>>>=3)?128:0),je&&(We.buf[We.pos++]=127&je|((je>>>=7)?128:0),je&&(We.buf[We.pos++]=127&je|((je>>>=7)?128:0),je&&(We.buf[We.pos++]=127&je|((je>>>=7)?128:0),je&&(We.buf[We.pos++]=127&je|((je>>>=7)?128:0),je&&(We.buf[We.pos++]=127&je)))))}(ke,K)}(H,this):(this.realloc(4),this.buf[this.pos++]=127&H|(H>127?128:0),H<=127||(this.buf[this.pos++]=127&(H>>>=7)|(H>127?128:0),H<=127||(this.buf[this.pos++]=127&(H>>>=7)|(H>127?128:0),H<=127||(this.buf[this.pos++]=H>>>7&127))))},writeSVarint:function(H){this.writeVarint(H<0?2*-H-1:2*H)},writeBoolean:function(H){this.writeVarint(!!H)},writeString:function(H){H=String(H),this.realloc(4*H.length),this.pos++;var D=this.pos;this.pos=function(pe,ke,je){for(var We,ft,Mt=0;Mt55295&&We<57344){if(!ft){We>56319||Mt+1===ke.length?(pe[je++]=239,pe[je++]=191,pe[je++]=189):ft=We;continue}if(We<56320){pe[je++]=239,pe[je++]=191,pe[je++]=189,ft=We;continue}We=ft-55296<<10|We-56320|65536,ft=null}else ft&&(pe[je++]=239,pe[je++]=191,pe[je++]=189,ft=null);We<128?pe[je++]=We:(We<2048?pe[je++]=We>>6|192:(We<65536?pe[je++]=We>>12|224:(pe[je++]=We>>18|240,pe[je++]=We>>12&63|128),pe[je++]=We>>6&63|128),pe[je++]=63&We|128)}return je}(this.buf,H,this.pos);var K=this.pos-D;K>=128&&xg(D,K,this),this.pos=D-1,this.writeVarint(K),this.pos+=K},writeFloat:function(H){this.realloc(4),om(this.buf,H,this.pos,!0,23,4),this.pos+=4},writeDouble:function(H){this.realloc(8),om(this.buf,H,this.pos,!0,52,8),this.pos+=8},writeBytes:function(H){var D=H.length;this.writeVarint(D),this.realloc(D);for(var K=0;K=128&&xg(K,pe,this),this.pos=K-1,this.writeVarint(pe),this.pos+=pe},writeMessage:function(H,D,K){this.writeTag(H,Au.Bytes),this.writeRawMessage(D,K)},writePackedVarint:function(H,D){D.length&&this.writeMessage(H,b0,D)},writePackedSVarint:function(H,D){D.length&&this.writeMessage(H,UT,D)},writePackedBoolean:function(H,D){D.length&&this.writeMessage(H,VT,D)},writePackedFloat:function(H,D){D.length&&this.writeMessage(H,jT,D)},writePackedDouble:function(H,D){D.length&&this.writeMessage(H,qT,D)},writePackedFixed32:function(H,D){D.length&&this.writeMessage(H,dC,D)},writePackedSFixed32:function(H,D){D.length&&this.writeMessage(H,GT,D)},writePackedFixed64:function(H,D){D.length&&this.writeMessage(H,HT,D)},writePackedSFixed64:function(H,D){D.length&&this.writeMessage(H,WT,D)},writeBytesField:function(H,D){this.writeTag(H,Au.Bytes),this.writeBytes(D)},writeFixed32Field:function(H,D){this.writeTag(H,Au.Fixed32),this.writeFixed32(D)},writeSFixed32Field:function(H,D){this.writeTag(H,Au.Fixed32),this.writeSFixed32(D)},writeFixed64Field:function(H,D){this.writeTag(H,Au.Fixed64),this.writeFixed64(D)},writeSFixed64Field:function(H,D){this.writeTag(H,Au.Fixed64),this.writeSFixed64(D)},writeVarintField:function(H,D){this.writeTag(H,Au.Varint),this.writeVarint(D)},writeSVarintField:function(H,D){this.writeTag(H,Au.Varint),this.writeSVarint(D)},writeStringField:function(H,D){this.writeTag(H,Au.Bytes),this.writeString(D)},writeFloatField:function(H,D){this.writeTag(H,Au.Fixed32),this.writeFloat(D)},writeDoubleField:function(H,D){this.writeTag(H,Au.Fixed64),this.writeDouble(D)},writeBooleanField:function(H,D){this.writeVarintField(H,!!D)}};var P1=r(Dh);let I1=3;function vC(H,D,K){H===1&&K.readMessage(XT,D)}function XT(H,D,K){if(H===3){let{id:pe,bitmap:ke,width:je,height:We,left:ft,top:Mt,advance:Ut}=K.readMessage(Lx,{});D.push({id:pe,bitmap:new In({width:je+2*I1,height:We+2*I1},ke),metrics:{width:je,height:We,left:ft,top:Mt,advance:Ut}})}}function Lx(H,D,K){H===1?D.id=K.readVarint():H===2?D.bitmap=K.readBytes():H===3?D.width=K.readVarint():H===4?D.height=K.readVarint():H===5?D.left=K.readSVarint():H===6?D.top=K.readSVarint():H===7&&(D.advance=K.readVarint())}let Px=I1;function R1(H){let D=0,K=0;for(let We of H)D+=We.w*We.h,K=Math.max(K,We.w);H.sort((We,ft)=>ft.h-We.h);let pe=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(D/.95)),K),h:1/0}],ke=0,je=0;for(let We of H)for(let ft=pe.length-1;ft>=0;ft--){let Mt=pe[ft];if(!(We.w>Mt.w||We.h>Mt.h)){if(We.x=Mt.x,We.y=Mt.y,je=Math.max(je,We.y+We.h),ke=Math.max(ke,We.x+We.w),We.w===Mt.w&&We.h===Mt.h){let Ut=pe.pop();ft=0&&pe>=D&&Tg[this.text.charCodeAt(pe)];pe--)K--;this.text=this.text.substring(D,K),this.sectionIndex=this.sectionIndex.slice(D,K)}substring(D,K){let pe=new sm;return pe.text=this.text.substring(D,K),pe.sectionIndex=this.sectionIndex.slice(D,K),pe.sections=this.sections,pe}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((D,K)=>Math.max(D,this.sections[K].scale),0)}addTextSection(D,K){this.text+=D.text,this.sections.push(T0.forText(D.scale,D.fontStack||K));let pe=this.sections.length-1;for(let ke=0;ke=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function A0(H,D,K,pe,ke,je,We,ft,Mt,Ut,nr,Mr,zr,Hr,oa){let va=sm.fromFeature(H,ke),Ga;Mr===e.ah.vertical&&va.verticalizePunctuation();let{processBidirectionalText:Qa,processStyledBidirectionalText:Yi}=Xs;if(Qa&&va.sections.length===1){Ga=[];let rn=Qa(va.toString(),lm(va,Ut,je,D,pe,Hr));for(let jn of rn){let ko=new sm;ko.text=jn,ko.sections=va.sections;for(let vs=0;vs0&&Xp>gf&&(gf=Xp)}else{let Rc=ko[uu.fontStack],Pf=Rc&&Rc[Ju];if(Pf&&Pf.rect)dm=Pf.rect,Kc=Pf.metrics;else{let Xp=jn[uu.fontStack],Zd=Xp&&Xp[Ju];if(!Zd)continue;Kc=Zd.metrics}Rp=(th-uu.scale)*lu}Wp?(rn.verticalizable=!0,fh.push({glyph:Ju,imageName:_d,x:Es,y:Ku+Rp,vertical:Wp,scale:uu.scale,fontStack:uu.fontStack,sectionIndex:fc,metrics:Kc,rect:dm}),Es+=hd*uu.scale+_n):(fh.push({glyph:Ju,imageName:_d,x:Es,y:Ku+Rp,vertical:Wp,scale:uu.scale,fontStack:uu.fontStack,sectionIndex:fc,metrics:Kc,rect:dm}),Es+=Kc.advance*uu.scale+_n)}fh.length!==0&&(Uu=Math.max(Es-_n,Uu),uv(fh,0,fh.length-1,Hp,gf)),Es=0;let Ip=Dn*th+gf;wh.lineOffset=Math.max(gf,Fh),Ku+=Ip,Qf=Math.max(Ip,Qf),++bh}var eh;let Jh=Ku-$f,{horizontalAlign:$h,verticalAlign:Qh}=Sg(is);(function(uf,th,Fh,wh,fh,gf,Ip,pp,uu){let fc=(th-Fh)*fh,Ju=0;Ju=gf!==Ip?-pp*wh-$f:(-wh*uu+.5)*Ip;for(let Rp of uf)for(let Kc of Rp.positionedGlyphs)Kc.x+=fc,Kc.y+=Ju})(rn.positionedLines,Hp,$h,Qh,Uu,Qf,Dn,Jh,go.length),rn.top+=-Qh*Jh,rn.bottom=rn.top+Jh,rn.left+=-$h*Uu,rn.right=rn.left+Uu}(Hi,D,K,pe,Ga,We,ft,Mt,Mr,Ut,zr,oa),!function(rn){for(let jn of rn)if(jn.positionedGlyphs.length!==0)return!1;return!0}(xi)&&Hi}let Tg={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},ZT={10:!0,32:!0,38:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0},YT={40:!0};function Ix(H,D,K,pe,ke,je){if(D.imageName){let We=pe[D.imageName];return We?We.displaySize[0]*D.scale*lu/je+ke:0}{let We=K[D.fontStack],ft=We&&We[H];return ft?ft.metrics.advance*D.scale+ke:0}}function Rx(H,D,K,pe){let ke=Math.pow(H-D,2);return pe?H=0,Ut=0;for(let Mr=0;MrUt){let nr=Math.ceil(je/Ut);ke*=nr/We,We=nr}return{x1:pe,y1:ke,x2:pe+je,y2:ke+We}}function Fx(H,D,K,pe,ke,je){let We=H.image,ft;if(We.content){let Ga=We.content,Qa=We.pixelRatio||1;ft=[Ga[0]/Qa,Ga[1]/Qa,We.displaySize[0]-Ga[2]/Qa,We.displaySize[1]-Ga[3]/Qa]}let Mt=D.left*je,Ut=D.right*je,nr,Mr,zr,Hr;K==="width"||K==="both"?(Hr=ke[0]+Mt-pe[3],Mr=ke[0]+Ut+pe[1]):(Hr=ke[0]+(Mt+Ut-We.displaySize[0])/2,Mr=Hr+We.displaySize[0]);let oa=D.top*je,va=D.bottom*je;return K==="height"||K==="both"?(nr=ke[1]+oa-pe[0],zr=ke[1]+va+pe[2]):(nr=ke[1]+(oa+va-We.displaySize[1])/2,zr=nr+We.displaySize[1]),{image:We,top:nr,right:Mr,bottom:zr,left:Hr,collisionPadding:ft}}let M0=255,yd=128,cv=M0*yd;function Ox(H,D){let{expression:K}=D;if(K.kind==="constant")return{kind:"constant",layoutSize:K.evaluate(new Ls(H+1))};if(K.kind==="source")return{kind:"source"};{let{zoomStops:pe,interpolationType:ke}=K,je=0;for(;jeWe.id),this.index=D.index,this.pixelRatio=D.pixelRatio,this.sourceLayerIndex=D.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=gi([]),this.placementViewportMatrix=gi([]);let K=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Ox(this.zoom,K["text-size"]),this.iconSizeData=Ox(this.zoom,K["icon-size"]);let pe=this.layers[0].layout,ke=pe.get("symbol-sort-key"),je=pe.get("symbol-z-order");this.canOverlap=D1(pe,"text-overlap","text-allow-overlap")!=="never"||D1(pe,"icon-overlap","icon-allow-overlap")!=="never"||pe.get("text-ignore-placement")||pe.get("icon-ignore-placement"),this.sortFeaturesByKey=je!=="viewport-y"&&!ke.isConstant(),this.sortFeaturesByY=(je==="viewport-y"||je==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,pe.get("symbol-placement")==="point"&&(this.writingModes=pe.get("text-writing-mode").map(We=>e.ah[We])),this.stateDependentLayerIds=this.layers.filter(We=>We.isStateDependent()).map(We=>We.id),this.sourceID=D.sourceID}createArrays(){this.text=new O1(new el(this.layers,this.zoom,D=>/^text/.test(D))),this.icon=new O1(new el(this.layers,this.zoom,D=>/^icon/.test(D))),this.glyphOffsetArray=new ss,this.lineVertexArray=new So,this.symbolInstances=new Ao,this.textAnchorOffsets=new hs}calculateGlyphDependencies(D,K,pe,ke,je){for(let We=0;We0)&&(We.value.kind!=="constant"||We.value.value.length>0),nr=Mt.value.kind!=="constant"||!!Mt.value.value||Object.keys(Mt.parameters).length>0,Mr=je.get("symbol-sort-key");if(this.features=[],!Ut&&!nr)return;let zr=K.iconDependencies,Hr=K.glyphDependencies,oa=K.availableImages,va=new Ls(this.zoom);for(let{feature:Ga,id:Qa,index:Yi,sourceLayerIndex:xi}of D){let Hi=ke._featureFilter.needGeometry,rn=Gl(Ga,Hi);if(!ke._featureFilter.filter(va,rn,pe))continue;let jn,ko;if(Hi||(rn.geometry=Tl(Ga)),Ut){let go=ke.getValueAndResolveTokens("text-field",rn,pe,oa),Dn=ma.factory(go),is=this.hasRTLText=this.hasRTLText||F1(Dn);(!is||Xs.getRTLTextPluginStatus()==="unavailable"||is&&Xs.isParsed())&&(jn=ov(Dn,ke,rn))}if(nr){let go=ke.getValueAndResolveTokens("icon-image",rn,pe,oa);ko=go instanceof $a?go:$a.fromString(go)}if(!jn&&!ko)continue;let vs=this.sortFeaturesByKey?Mr.evaluate(rn,{},pe):void 0;if(this.features.push({id:Qa,text:jn,icon:ko,index:Yi,sourceLayerIndex:xi,geometry:rn.geometry,properties:Ga.properties,type:JT[Ga.type],sortKey:vs}),ko&&(zr[ko.name]=!0),jn){let go=We.evaluate(rn,{},pe).join(","),Dn=je.get("text-rotation-alignment")!=="viewport"&&je.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(e.ah.vertical)>=0;for(let is of jn.sections)if(is.image)zr[is.image.name]=!0;else{let Vo=_o(jn.toString()),Bo=is.fontStack||go,_n=Hr[Bo]=Hr[Bo]||{};this.calculateGlyphDependencies(is.text,_n,Dn,this.allowVerticalPlacement,Vo)}}}je.get("symbol-placement")==="line"&&(this.features=function(Ga){let Qa={},Yi={},xi=[],Hi=0;function rn(go){xi.push(Ga[go]),Hi++}function jn(go,Dn,is){let Vo=Yi[go];return delete Yi[go],Yi[Dn]=Vo,xi[Vo].geometry[0].pop(),xi[Vo].geometry[0]=xi[Vo].geometry[0].concat(is[0]),Vo}function ko(go,Dn,is){let Vo=Qa[Dn];return delete Qa[Dn],Qa[go]=Vo,xi[Vo].geometry[0].shift(),xi[Vo].geometry[0]=is[0].concat(xi[Vo].geometry[0]),Vo}function vs(go,Dn,is){let Vo=is?Dn[0][Dn[0].length-1]:Dn[0][0];return`${go}:${Vo.x}:${Vo.y}`}for(let go=0;gogo.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((Ga,Qa)=>Ga.sortKey-Qa.sortKey)}update(D,K,pe){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(D,K,this.layers,pe),this.icon.programConfigurations.updatePaintArrays(D,K,this.layers,pe))}isEmpty(){return this.symbolInstances.length===0&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(D){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(D),this.iconCollisionBox.upload(D)),this.text.upload(D,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(D,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(D,K){let pe=this.lineVertexArray.length;if(D.segment!==void 0){let ke=D.dist(K[D.segment+1]),je=D.dist(K[D.segment]),We={};for(let ft=D.segment+1;ft=0;ft--)We[ft]={x:K[ft].x,y:K[ft].y,tileUnitDistanceFromAnchor:je},ft>0&&(je+=K[ft-1].dist(K[ft]));for(let ft=0;ft0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}addIndicesForPlacedSymbol(D,K){let pe=D.placedSymbolArray.get(K),ke=pe.vertexStartIndex+4*pe.numGlyphs;for(let je=pe.vertexStartIndex;jeke[ft]-ke[Mt]||je[Mt]-je[ft]),We}addToSortKeyRanges(D,K){let pe=this.sortKeyRanges[this.sortKeyRanges.length-1];pe&&pe.sortKey===K?pe.symbolInstanceEnd=D+1:this.sortKeyRanges.push({sortKey:K,symbolInstanceStart:D,symbolInstanceEnd:D+1})}sortFeatures(D){if(this.sortFeaturesByY&&this.sortedAngle!==D&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(D),this.sortedAngle=D,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(let K of this.symbolInstanceIndexes){let pe=this.symbolInstances.get(K);this.featureSortOrder.push(pe.featureIndex),[pe.rightJustifiedTextSymbolIndex,pe.centerJustifiedTextSymbolIndex,pe.leftJustifiedTextSymbolIndex].forEach((ke,je,We)=>{ke>=0&&We.indexOf(ke)===je&&this.addIndicesForPlacedSymbol(this.text,ke)}),pe.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,pe.verticalPlacedTextSymbolIndex),pe.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,pe.placedIconSymbolIndex),pe.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,pe.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}let lf,E0;_i("SymbolBucket",um,{omit:["layers","collisionBoxArray","features","compareText"]}),um.MAX_GLYPHS=65535,um.addDynamicAttributes=z1;var Eg={get paint(){return E0=E0||new Ne({"icon-opacity":new zo(re.paint_symbol["icon-opacity"]),"icon-color":new zo(re.paint_symbol["icon-color"]),"icon-halo-color":new zo(re.paint_symbol["icon-halo-color"]),"icon-halo-width":new zo(re.paint_symbol["icon-halo-width"]),"icon-halo-blur":new zo(re.paint_symbol["icon-halo-blur"]),"icon-translate":new fo(re.paint_symbol["icon-translate"]),"icon-translate-anchor":new fo(re.paint_symbol["icon-translate-anchor"]),"text-opacity":new zo(re.paint_symbol["text-opacity"]),"text-color":new zo(re.paint_symbol["text-color"],{runtimeType:Vt,getOverride:H=>H.textColor,hasOverride:H=>!!H.textColor}),"text-halo-color":new zo(re.paint_symbol["text-halo-color"]),"text-halo-width":new zo(re.paint_symbol["text-halo-width"]),"text-halo-blur":new zo(re.paint_symbol["text-halo-blur"]),"text-translate":new fo(re.paint_symbol["text-translate"]),"text-translate-anchor":new fo(re.paint_symbol["text-translate-anchor"])})},get layout(){return lf=lf||new Ne({"symbol-placement":new fo(re.layout_symbol["symbol-placement"]),"symbol-spacing":new fo(re.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new fo(re.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new zo(re.layout_symbol["symbol-sort-key"]),"symbol-z-order":new fo(re.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new fo(re.layout_symbol["icon-allow-overlap"]),"icon-overlap":new fo(re.layout_symbol["icon-overlap"]),"icon-ignore-placement":new fo(re.layout_symbol["icon-ignore-placement"]),"icon-optional":new fo(re.layout_symbol["icon-optional"]),"icon-rotation-alignment":new fo(re.layout_symbol["icon-rotation-alignment"]),"icon-size":new zo(re.layout_symbol["icon-size"]),"icon-text-fit":new fo(re.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new fo(re.layout_symbol["icon-text-fit-padding"]),"icon-image":new zo(re.layout_symbol["icon-image"]),"icon-rotate":new zo(re.layout_symbol["icon-rotate"]),"icon-padding":new zo(re.layout_symbol["icon-padding"]),"icon-keep-upright":new fo(re.layout_symbol["icon-keep-upright"]),"icon-offset":new zo(re.layout_symbol["icon-offset"]),"icon-anchor":new zo(re.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new fo(re.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new fo(re.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new fo(re.layout_symbol["text-rotation-alignment"]),"text-field":new zo(re.layout_symbol["text-field"]),"text-font":new zo(re.layout_symbol["text-font"]),"text-size":new zo(re.layout_symbol["text-size"]),"text-max-width":new zo(re.layout_symbol["text-max-width"]),"text-line-height":new fo(re.layout_symbol["text-line-height"]),"text-letter-spacing":new zo(re.layout_symbol["text-letter-spacing"]),"text-justify":new zo(re.layout_symbol["text-justify"]),"text-radial-offset":new zo(re.layout_symbol["text-radial-offset"]),"text-variable-anchor":new fo(re.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new zo(re.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new zo(re.layout_symbol["text-anchor"]),"text-max-angle":new fo(re.layout_symbol["text-max-angle"]),"text-writing-mode":new fo(re.layout_symbol["text-writing-mode"]),"text-rotate":new zo(re.layout_symbol["text-rotate"]),"text-padding":new fo(re.layout_symbol["text-padding"]),"text-keep-upright":new fo(re.layout_symbol["text-keep-upright"]),"text-transform":new zo(re.layout_symbol["text-transform"]),"text-offset":new zo(re.layout_symbol["text-offset"]),"text-allow-overlap":new fo(re.layout_symbol["text-allow-overlap"]),"text-overlap":new fo(re.layout_symbol["text-overlap"]),"text-ignore-placement":new fo(re.layout_symbol["text-ignore-placement"]),"text-optional":new fo(re.layout_symbol["text-optional"])})}};class C0{constructor(D){if(D.property.overrides===void 0)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=D.property.overrides?D.property.overrides.runtimeType:st,this.defaultValue=D}evaluate(D){if(D.formattedSection){let K=this.defaultValue.property.overrides;if(K&&K.hasOverride(D.formattedSection))return K.getOverride(D.formattedSection)}return D.feature&&D.featureState?this.defaultValue.evaluate(D.feature,D.featureState):this.defaultValue.property.specification.default}eachChild(D){this.defaultValue.isConstant()||D(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}_i("FormatSectionOverride",C0,{omit:["defaultValue"]});class Dv extends ae{constructor(D){super(D,Eg)}recalculate(D,K){if(super.recalculate(D,K),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout._values["icon-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout._values["text-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")==="map"?"map":"viewport"),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),this.layout.get("symbol-placement")==="point"){let pe=this.layout.get("text-writing-mode");if(pe){let ke=[];for(let je of pe)ke.indexOf(je)<0&&ke.push(je);this.layout._values["text-writing-mode"]=ke}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(D,K,pe,ke){let je=this.layout.get(D).evaluate(K,{},pe,ke),We=this._unevaluatedLayout._values[D];return We.isDataDriven()||Ac(We.value)||!je?je:function(ft,Mt){return Mt.replace(/{([^{}]+)}/g,(Ut,nr)=>ft&&nr in ft?String(ft[nr]):"")}(K.properties,je)}createBucket(D){return new um(D)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(let D of Eg.paint.overridableProperties){if(!Dv.hasPaintOverride(this.layout,D))continue;let K=this.paint.get(D),pe=new C0(K),ke=new Lu(pe,K.property.specification),je=null;je=K.value.kind==="constant"||K.value.kind==="source"?new dc("source",ke):new vu("composite",ke,K.value.zoomStops),this.paint._values[D]=new wu(K.property,je,K.parameters)}}_handleOverridablePaintPropertyUpdate(D,K,pe){return!(!this.layout||K.isDataDriven()||pe.isDataDriven())&&Dv.hasPaintOverride(this.layout,D)}static hasPaintOverride(D,K){let pe=D.get("text-field"),ke=Eg.paint.properties[K],je=!1,We=ft=>{for(let Mt of ft)if(ke.overrides&&ke.overrides.hasOverride(Mt))return void(je=!0)};if(pe.value.kind==="constant"&&pe.value.value instanceof ma)We(pe.value.value.sections);else if(pe.value.kind==="source"){let ft=Ut=>{je||(Ut instanceof Nr&&xt(Ut.value)===jr?We(Ut.value.sections):Ut instanceof os?We(Ut.sections):Ut.eachChild(ft))},Mt=pe.value;Mt._styleExpression&&ft(Mt._styleExpression.expression)}return je}}let Bx;var k0={get paint(){return Bx=Bx||new Ne({"background-color":new fo(re.paint_background["background-color"]),"background-pattern":new lc(re.paint_background["background-pattern"]),"background-opacity":new fo(re.paint_background["background-opacity"])})}};class QT extends ae{constructor(D){super(D,k0)}}let B1;var Nx={get paint(){return B1=B1||new Ne({"raster-opacity":new fo(re.paint_raster["raster-opacity"]),"raster-hue-rotate":new fo(re.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new fo(re.paint_raster["raster-brightness-min"]),"raster-brightness-max":new fo(re.paint_raster["raster-brightness-max"]),"raster-saturation":new fo(re.paint_raster["raster-saturation"]),"raster-contrast":new fo(re.paint_raster["raster-contrast"]),"raster-resampling":new fo(re.paint_raster["raster-resampling"]),"raster-fade-duration":new fo(re.paint_raster["raster-fade-duration"])})}};class L0 extends ae{constructor(D){super(D,Nx)}}class N1 extends ae{constructor(D){super(D,{}),this.onAdd=K=>{this.implementation.onAdd&&this.implementation.onAdd(K,K.painter.context.gl)},this.onRemove=K=>{this.implementation.onRemove&&this.implementation.onRemove(K,K.painter.context.gl)},this.implementation=D}is3D(){return this.implementation.renderingMode==="3d"}hasOffscreenPass(){return this.implementation.prerender!==void 0}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw new Error("Custom layers cannot be serialized")}}class U1{constructor(D){this._methodToThrottle=D,this._triggered=!1,typeof MessageChannel<"u"&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._methodToThrottle()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(()=>{this._triggered=!1,this._methodToThrottle()},0))}remove(){delete this._channel,this._methodToThrottle=()=>{}}}let j1=63710088e-1;class Hd{constructor(D,K){if(isNaN(D)||isNaN(K))throw new Error(`Invalid LngLat object: (${D}, ${K})`);if(this.lng=+D,this.lat=+K,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new Hd(S(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(D){let K=Math.PI/180,pe=this.lat*K,ke=D.lat*K,je=Math.sin(pe)*Math.sin(ke)+Math.cos(pe)*Math.cos(ke)*Math.cos((D.lng-this.lng)*K);return j1*Math.acos(Math.min(je,1))}static convert(D){if(D instanceof Hd)return D;if(Array.isArray(D)&&(D.length===2||D.length===3))return new Hd(Number(D[0]),Number(D[1]));if(!Array.isArray(D)&&typeof D=="object"&&D!==null)return new Hd(Number("lng"in D?D.lng:D.lon),Number(D.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]")}}let cm=2*Math.PI*j1;function Ux(H){return cm*Math.cos(H*Math.PI/180)}function Cg(H){return(180+H)/360}function jx(H){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+H*Math.PI/360)))/360}function kg(H,D){return H/Ux(D)}function P0(H){return 360/Math.PI*Math.atan(Math.exp((180-360*H)*Math.PI/180))-90}class I0{constructor(D,K,pe=0){this.x=+D,this.y=+K,this.z=+pe}static fromLngLat(D,K=0){let pe=Hd.convert(D);return new I0(Cg(pe.lng),jx(pe.lat),kg(K,pe.lat))}toLngLat(){return new Hd(360*this.x-180,P0(this.y))}toAltitude(){return this.z*Ux(P0(this.y))}meterInMercatorCoordinateUnits(){return 1/cm*(D=P0(this.y),1/Math.cos(D*Math.PI/180));var D}}function ad(H,D,K){var pe=2*Math.PI*6378137/256/Math.pow(2,K);return[H*pe-2*Math.PI*6378137/2,D*pe-2*Math.PI*6378137/2]}class q1{constructor(D,K,pe){if(!function(ke,je,We){return!(ke<0||ke>25||We<0||We>=Math.pow(2,ke)||je<0||je>=Math.pow(2,ke))}(D,K,pe))throw new Error(`x=${K}, y=${pe}, z=${D} outside of bounds. 0<=x<${Math.pow(2,D)}, 0<=y<${Math.pow(2,D)} 0<=z<=25 `);this.z=D,this.x=K,this.y=pe,this.key=R0(0,D,D,K,pe)}equals(D){return this.z===D.z&&this.x===D.x&&this.y===D.y}url(D,K,pe){let ke=(We=this.y,ft=this.z,Mt=ad(256*(je=this.x),256*(We=Math.pow(2,ft)-We-1),ft),Ut=ad(256*(je+1),256*(We+1),ft),Mt[0]+","+Mt[1]+","+Ut[0]+","+Ut[1]);var je,We,ft,Mt,Ut;let nr=function(Mr,zr,Hr){let oa,va="";for(let Ga=Mr;Ga>0;Ga--)oa=1<1?"@2x":"").replace(/{quadkey}/g,nr).replace(/{bbox-epsg-3857}/g,ke)}isChildOf(D){let K=this.z-D.z;return K>0&&D.x===this.x>>K&&D.y===this.y>>K}getTilePoint(D){let K=Math.pow(2,this.z);return new i((D.x*K-this.x)*vo,(D.y*K-this.y)*vo)}toString(){return`${this.z}/${this.x}/${this.y}`}}class qx{constructor(D,K){this.wrap=D,this.canonical=K,this.key=R0(D,K.z,K.z,K.x,K.y)}}class Gp{constructor(D,K,pe,ke,je){if(D= z; overscaledZ = ${D}; z = ${pe}`);this.overscaledZ=D,this.wrap=K,this.canonical=new q1(pe,+ke,+je),this.key=R0(K,D,pe,ke,je)}clone(){return new Gp(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(D){return this.overscaledZ===D.overscaledZ&&this.wrap===D.wrap&&this.canonical.equals(D.canonical)}scaledTo(D){if(D>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${D}; overscaledZ = ${this.overscaledZ}`);let K=this.canonical.z-D;return D>this.canonical.z?new Gp(D,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Gp(D,this.wrap,D,this.canonical.x>>K,this.canonical.y>>K)}calculateScaledKey(D,K){if(D>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${D}; overscaledZ = ${this.overscaledZ}`);let pe=this.canonical.z-D;return D>this.canonical.z?R0(this.wrap*+K,D,this.canonical.z,this.canonical.x,this.canonical.y):R0(this.wrap*+K,D,D,this.canonical.x>>pe,this.canonical.y>>pe)}isChildOf(D){if(D.wrap!==this.wrap)return!1;let K=this.canonical.z-D.canonical.z;return D.overscaledZ===0||D.overscaledZ>K&&D.canonical.y===this.canonical.y>>K}children(D){if(this.overscaledZ>=D)return[new Gp(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];let K=this.canonical.z+1,pe=2*this.canonical.x,ke=2*this.canonical.y;return[new Gp(K,this.wrap,K,pe,ke),new Gp(K,this.wrap,K,pe+1,ke),new Gp(K,this.wrap,K,pe,ke+1),new Gp(K,this.wrap,K,pe+1,ke+1)]}isLessThan(D){return this.wrapD.wrap)&&(this.overscaledZD.overscaledZ)&&(this.canonical.xD.canonical.x)&&this.canonical.ythis.max&&(this.max=Mr),Mr=this.dim+1||K<-1||K>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(K+1)*this.stride+(D+1)}unpack(D,K,pe){return D*this.redFactor+K*this.greenFactor+pe*this.blueFactor-this.baseShift}getPixels(){return new Di({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(D,K,pe){if(this.dim!==D.dim)throw new Error("dem dimension mismatch");let ke=K*this.dim,je=K*this.dim+this.dim,We=pe*this.dim,ft=pe*this.dim+this.dim;switch(K){case-1:ke=je-1;break;case 1:je=ke+1}switch(pe){case-1:We=ft-1;break;case 1:ft=We+1}let Mt=-K*this.dim,Ut=-pe*this.dim;for(let nr=We;nr=this._numberToString.length)throw new Error(`Out of bounds. Index requested n=${D} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[D]}}class V1{constructor(D,K,pe,ke,je){this.type="Feature",this._vectorTileFeature=D,D._z=K,D._x=pe,D._y=ke,this.properties=D.properties,this.id=je}get geometry(){return this._geometry===void 0&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry}set geometry(D){this._geometry=D}toJSON(){let D={geometry:this.geometry};for(let K in this)K!=="_geometry"&&K!=="_vectorTileFeature"&&(D[K]=this[K]);return D}}class zv{constructor(D,K){this.tileID=D,this.x=D.canonical.x,this.y=D.canonical.y,this.z=D.canonical.z,this.grid=new Fi(vo,16,0),this.grid3D=new Fi(vo,16,0),this.featureIndexArray=new Js,this.promoteId=K}insert(D,K,pe,ke,je,We){let ft=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(pe,ke,je);let Mt=We?this.grid3D:this.grid;for(let Ut=0;Ut=0&&Mr[3]>=0&&Mt.insert(ft,Mr[0],Mr[1],Mr[2],Mr[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new Jr.VectorTile(new P1(this.rawTileData)).layers,this.sourceLayerCoder=new Gx(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(D,K,pe,ke){this.loadVTLayers();let je=D.params||{},We=vo/D.tileSize/D.scale,ft=Sc(je.filter),Mt=D.queryGeometry,Ut=D.queryPadding*We,nr=Wx(Mt),Mr=this.grid.query(nr.minX-Ut,nr.minY-Ut,nr.maxX+Ut,nr.maxY+Ut),zr=Wx(D.cameraQueryGeometry),Hr=this.grid3D.query(zr.minX-Ut,zr.minY-Ut,zr.maxX+Ut,zr.maxY+Ut,(Ga,Qa,Yi,xi)=>function(Hi,rn,jn,ko,vs){for(let Dn of Hi)if(rn<=Dn.x&&jn<=Dn.y&&ko>=Dn.x&&vs>=Dn.y)return!0;let go=[new i(rn,jn),new i(rn,vs),new i(ko,vs),new i(ko,jn)];if(Hi.length>2){for(let Dn of go)if(Ai(Hi,Dn))return!0}for(let Dn=0;Dn(xi||(xi=Tl(Hi)),rn.queryIntersectsFeature(Mt,Hi,jn,xi,this.z,D.transform,We,D.pixelPosMatrix)))}return oa}loadMatchingFeature(D,K,pe,ke,je,We,ft,Mt,Ut,nr,Mr){let zr=this.bucketLayerIDs[K];if(We&&!function(Ga,Qa){for(let Yi=0;Yi=0)return!0;return!1}(We,zr))return;let Hr=this.sourceLayerCoder.decode(pe),oa=this.vtLayers[Hr].feature(ke);if(je.needGeometry){let Ga=Gl(oa,!0);if(!je.filter(new Ls(this.tileID.overscaledZ),Ga,this.tileID.canonical))return}else if(!je.filter(new Ls(this.tileID.overscaledZ),oa))return;let va=this.getId(oa,Hr);for(let Ga=0;Ga{let ft=D instanceof gc?D.get(We):null;return ft&&ft.evaluate?ft.evaluate(K,pe,ke):ft})}function Wx(H){let D=1/0,K=1/0,pe=-1/0,ke=-1/0;for(let je of H)D=Math.min(D,je.x),K=Math.min(K,je.y),pe=Math.max(pe,je.x),ke=Math.max(ke,je.y);return{minX:D,minY:K,maxX:pe,maxY:ke}}function eA(H,D){return D-H}function Xx(H,D,K,pe,ke){let je=[];for(let We=0;We=pe&&Mr.x>=pe||(nr.x>=pe?nr=new i(pe,nr.y+(pe-nr.x)/(Mr.x-nr.x)*(Mr.y-nr.y))._round():Mr.x>=pe&&(Mr=new i(pe,nr.y+(pe-nr.x)/(Mr.x-nr.x)*(Mr.y-nr.y))._round()),nr.y>=ke&&Mr.y>=ke||(nr.y>=ke?nr=new i(nr.x+(ke-nr.y)/(Mr.y-nr.y)*(Mr.x-nr.x),ke)._round():Mr.y>=ke&&(Mr=new i(nr.x+(ke-nr.y)/(Mr.y-nr.y)*(Mr.x-nr.x),ke)._round()),Mt&&nr.equals(Mt[Mt.length-1])||(Mt=[nr],je.push(Mt)),Mt.push(Mr)))))}}return je}_i("FeatureIndex",zv,{omit:["rawTileData","sourceLayerCoder"]});class Wd extends i{constructor(D,K,pe,ke){super(D,K),this.angle=pe,ke!==void 0&&(this.segment=ke)}clone(){return new Wd(this.x,this.y,this.angle,this.segment)}}function G1(H,D,K,pe,ke){if(D.segment===void 0||K===0)return!0;let je=D,We=D.segment+1,ft=0;for(;ft>-K/2;){if(We--,We<0)return!1;ft-=H[We].dist(je),je=H[We]}ft+=H[We].dist(H[We+1]),We++;let Mt=[],Ut=0;for(;ftpe;)Ut-=Mt.shift().angleDelta;if(Ut>ke)return!1;We++,ft+=nr.dist(Mr)}return!0}function Zx(H){let D=0;for(let K=0;KUt){let oa=(Ut-Mt)/Hr,va=Xn.number(Mr.x,zr.x,oa),Ga=Xn.number(Mr.y,zr.y,oa),Qa=new Wd(va,Ga,zr.angleTo(Mr),nr);return Qa._round(),!We||G1(H,Qa,ft,We,D)?Qa:void 0}Mt+=Hr}}function rA(H,D,K,pe,ke,je,We,ft,Mt){let Ut=Yx(pe,je,We),nr=Kx(pe,ke),Mr=nr*We,zr=H[0].x===0||H[0].x===Mt||H[0].y===0||H[0].y===Mt;return D-Mr=0&&Hi=0&&rn=0&&zr+Ut<=nr){let jn=new Wd(Hi,rn,Yi,oa);jn._round(),pe&&!G1(H,jn,je,pe,ke)||Hr.push(jn)}}Mr+=Qa}return ft||Hr.length||We||(Hr=Jx(H,Mr/2,K,pe,ke,je,We,!0,Mt)),Hr}_i("Anchor",Wd);let fm=zh;function $x(H,D,K,pe){let ke=[],je=H.image,We=je.pixelRatio,ft=je.paddedRect.w-2*fm,Mt=je.paddedRect.h-2*fm,Ut={x1:H.left,y1:H.top,x2:H.right,y2:H.bottom},nr=je.stretchX||[[0,ft]],Mr=je.stretchY||[[0,Mt]],zr=(_n,us)=>_n+us[1]-us[0],Hr=nr.reduce(zr,0),oa=Mr.reduce(zr,0),va=ft-Hr,Ga=Mt-oa,Qa=0,Yi=Hr,xi=0,Hi=oa,rn=0,jn=va,ko=0,vs=Ga;if(je.content&&pe){let _n=je.content,us=_n[2]-_n[0],No=_n[3]-_n[1];(je.textFitWidth||je.textFitHeight)&&(Ut=zx(H)),Qa=Xd(nr,0,_n[0]),xi=Xd(Mr,0,_n[1]),Yi=Xd(nr,_n[0],_n[2]),Hi=Xd(Mr,_n[1],_n[3]),rn=_n[0]-Qa,ko=_n[1]-xi,jn=us-Yi,vs=No-Hi}let go=Ut.x1,Dn=Ut.y1,is=Ut.x2-go,Vo=Ut.y2-Dn,Bo=(_n,us,No,Es)=>{let Ku=Lg(_n.stretch-Qa,Yi,is,go),Uu=hm(_n.fixed-rn,jn,_n.stretch,Hr),Qf=Lg(us.stretch-xi,Hi,Vo,Dn),Hp=hm(us.fixed-ko,vs,us.stretch,oa),bh=Lg(No.stretch-Qa,Yi,is,go),eh=hm(No.fixed-rn,jn,No.stretch,Hr),Jh=Lg(Es.stretch-xi,Hi,Vo,Dn),$h=hm(Es.fixed-ko,vs,Es.stretch,oa),Qh=new i(Ku,Qf),uf=new i(bh,Qf),th=new i(bh,Jh),Fh=new i(Ku,Jh),wh=new i(Uu/We,Hp/We),fh=new i(eh/We,$h/We),gf=D*Math.PI/180;if(gf){let uu=Math.sin(gf),fc=Math.cos(gf),Ju=[fc,-uu,uu,fc];Qh._matMult(Ju),uf._matMult(Ju),Fh._matMult(Ju),th._matMult(Ju)}let Ip=_n.stretch+_n.fixed,pp=us.stretch+us.fixed;return{tl:Qh,tr:uf,bl:Fh,br:th,tex:{x:je.paddedRect.x+fm+Ip,y:je.paddedRect.y+fm+pp,w:No.stretch+No.fixed-Ip,h:Es.stretch+Es.fixed-pp},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:wh,pixelOffsetBR:fh,minFontScaleX:jn/We/is,minFontScaleY:vs/We/Vo,isSDF:K}};if(pe&&(je.stretchX||je.stretchY)){let _n=Qx(nr,va,Hr),us=Qx(Mr,Ga,oa);for(let No=0;No<_n.length-1;No++){let Es=_n[No],Ku=_n[No+1];for(let Uu=0;Uu0&&(va=Math.max(10,va),this.circleDiameter=va)}else{let zr=!((Mr=We.image)===null||Mr===void 0)&&Mr.content&&(We.image.textFitWidth||We.image.textFitHeight)?zx(We):{x1:We.left,y1:We.top,x2:We.right,y2:We.bottom};zr.y1=zr.y1*ft-Mt[0],zr.y2=zr.y2*ft+Mt[2],zr.x1=zr.x1*ft-Mt[3],zr.x2=zr.x2*ft+Mt[1];let Hr=We.collisionPadding;if(Hr&&(zr.x1-=Hr[0]*ft,zr.y1-=Hr[1]*ft,zr.x2+=Hr[2]*ft,zr.y2+=Hr[3]*ft),nr){let oa=new i(zr.x1,zr.y1),va=new i(zr.x2,zr.y1),Ga=new i(zr.x1,zr.y2),Qa=new i(zr.x2,zr.y2),Yi=nr*Math.PI/180;oa._rotate(Yi),va._rotate(Yi),Ga._rotate(Yi),Qa._rotate(Yi),zr.x1=Math.min(oa.x,va.x,Ga.x,Qa.x),zr.x2=Math.max(oa.x,va.x,Ga.x,Qa.x),zr.y1=Math.min(oa.y,va.y,Ga.y,Qa.y),zr.y2=Math.max(oa.y,va.y,Ga.y,Qa.y)}D.emplaceBack(K.x,K.y,zr.x1,zr.y1,zr.x2,zr.y2,pe,ke,je)}this.boxEndIndex=D.length}}class fd{constructor(D=[],K=(pe,ke)=>peke?1:0){if(this.data=D,this.length=this.data.length,this.compare=K,this.length>0)for(let pe=(this.length>>1)-1;pe>=0;pe--)this._down(pe)}push(D){this.data.push(D),this._up(this.length++)}pop(){if(this.length===0)return;let D=this.data[0],K=this.data.pop();return--this.length>0&&(this.data[0]=K,this._down(0)),D}peek(){return this.data[0]}_up(D){let{data:K,compare:pe}=this,ke=K[D];for(;D>0;){let je=D-1>>1,We=K[je];if(pe(ke,We)>=0)break;K[D]=We,D=je}K[D]=ke}_down(D){let{data:K,compare:pe}=this,ke=this.length>>1,je=K[D];for(;D=0)break;K[D]=K[We],D=We}K[D]=je}}function aA(H,D=1,K=!1){let pe=1/0,ke=1/0,je=-1/0,We=-1/0,ft=H[0];for(let Hr=0;Hrje)&&(je=oa.x),(!Hr||oa.y>We)&&(We=oa.y)}let Mt=Math.min(je-pe,We-ke),Ut=Mt/2,nr=new fd([],iA);if(Mt===0)return new i(pe,ke);for(let Hr=pe;HrMr.d||!Mr.d)&&(Mr=Hr,K&&console.log("found best %d after %d probes",Math.round(1e4*Hr.d)/1e4,zr)),Hr.max-Mr.d<=D||(Ut=Hr.h/2,nr.push(new pm(Hr.p.x-Ut,Hr.p.y-Ut,Ut,H)),nr.push(new pm(Hr.p.x+Ut,Hr.p.y-Ut,Ut,H)),nr.push(new pm(Hr.p.x-Ut,Hr.p.y+Ut,Ut,H)),nr.push(new pm(Hr.p.x+Ut,Hr.p.y+Ut,Ut,H)),zr+=4)}return K&&(console.log(`num probes: ${zr}`),console.log(`best distance: ${Mr.d}`)),Mr.p}function iA(H,D){return D.max-H.max}function pm(H,D,K,pe){this.p=new i(H,D),this.h=K,this.d=function(ke,je){let We=!1,ft=1/0;for(let Mt=0;Mtke.y!=oa.y>ke.y&&ke.x<(oa.x-Hr.x)*(ke.y-Hr.y)/(oa.y-Hr.y)+Hr.x&&(We=!We),ft=Math.min(ft,wa(ke,Hr,oa))}}return(We?1:-1)*Math.sqrt(ft)}(this.p,pe),this.max=this.d+this.h*Math.SQRT2}var xh;e.aq=void 0,(xh=e.aq||(e.aq={}))[xh.center=1]="center",xh[xh.left=2]="left",xh[xh.right=3]="right",xh[xh.top=4]="top",xh[xh.bottom=5]="bottom",xh[xh["top-left"]=6]="top-left",xh[xh["top-right"]=7]="top-right",xh[xh["bottom-left"]=8]="bottom-left",xh[xh["bottom-right"]=9]="bottom-right";let pv=7,Fv=Number.POSITIVE_INFINITY;function H1(H,D){return D[1]!==Fv?function(K,pe,ke){let je=0,We=0;switch(pe=Math.abs(pe),ke=Math.abs(ke),K){case"top-right":case"top-left":case"top":We=ke-pv;break;case"bottom-right":case"bottom-left":case"bottom":We=-ke+pv}switch(K){case"top-right":case"bottom-right":case"right":je=-pe;break;case"top-left":case"bottom-left":case"left":je=pe}return[je,We]}(H,D[0],D[1]):function(K,pe){let ke=0,je=0;pe<0&&(pe=0);let We=pe/Math.SQRT2;switch(K){case"top-right":case"top-left":je=We-pv;break;case"bottom-right":case"bottom-left":je=-We+pv;break;case"bottom":je=-pe+pv;break;case"top":je=pe-pv}switch(K){case"top-right":case"bottom-right":ke=-We;break;case"top-left":case"bottom-left":ke=We;break;case"left":ke=pe;break;case"right":ke=-pe}return[ke,je]}(H,D[0])}function eb(H,D,K){var pe;let ke=H.layout,je=(pe=ke.get("text-variable-anchor-offset"))===null||pe===void 0?void 0:pe.evaluate(D,{},K);if(je){let ft=je.values,Mt=[];for(let Ut=0;Utzr*lu);nr.startsWith("top")?Mr[1]-=pv:nr.startsWith("bottom")&&(Mr[1]+=pv),Mt[Ut+1]=Mr}return new Ha(Mt)}let We=ke.get("text-variable-anchor");if(We){let ft;ft=H._unevaluatedLayout.getValue("text-radial-offset")!==void 0?[ke.get("text-radial-offset").evaluate(D,{},K)*lu,Fv]:ke.get("text-offset").evaluate(D,{},K).map(Ut=>Ut*lu);let Mt=[];for(let Ut of We)Mt.push(Ut,H1(Ut,ft));return new Ha(Mt)}return null}function W1(H){switch(H){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function nA(H,D,K,pe,ke,je,We,ft,Mt,Ut,nr){let Mr=je.textMaxSize.evaluate(D,{});Mr===void 0&&(Mr=We);let zr=H.layers[0].layout,Hr=zr.get("icon-offset").evaluate(D,{},nr),oa=rb(K.horizontal),va=We/24,Ga=H.tilePixelRatio*va,Qa=H.tilePixelRatio*Mr/24,Yi=H.tilePixelRatio*ft,xi=H.tilePixelRatio*zr.get("symbol-spacing"),Hi=zr.get("text-padding")*H.tilePixelRatio,rn=function(_n,us,No,Es=1){let Ku=_n.get("icon-padding").evaluate(us,{},No),Uu=Ku&&Ku.values;return[Uu[0]*Es,Uu[1]*Es,Uu[2]*Es,Uu[3]*Es]}(zr,D,nr,H.tilePixelRatio),jn=zr.get("text-max-angle")/180*Math.PI,ko=zr.get("text-rotation-alignment")!=="viewport"&&zr.get("symbol-placement")!=="point",vs=zr.get("icon-rotation-alignment")==="map"&&zr.get("symbol-placement")!=="point",go=zr.get("symbol-placement"),Dn=xi/2,is=zr.get("icon-text-fit"),Vo;pe&&is!=="none"&&(H.allowVerticalPlacement&&K.vertical&&(Vo=Fx(pe,K.vertical,is,zr.get("icon-text-fit-padding"),Hr,va)),oa&&(pe=Fx(pe,oa,is,zr.get("icon-text-fit-padding"),Hr,va)));let Bo=(_n,us)=>{us.x<0||us.x>=vo||us.y<0||us.y>=vo||function(No,Es,Ku,Uu,Qf,Hp,bh,eh,Jh,$h,Qh,uf,th,Fh,wh,fh,gf,Ip,pp,uu,fc,Ju,Rp,Kc,dm){let _d=No.addToLineVertexArray(Es,Ku),hd,Wp,Rc,Pf,Xp=0,Zd=0,dp=0,vm=0,J1=-1,Dg=-1,xd={},Ov=ni("");if(No.allowVerticalPlacement&&Uu.vertical){let Oh=eh.layout.get("text-rotate").evaluate(fc,{},Kc)+90;Rc=new hv(Jh,Es,$h,Qh,uf,Uu.vertical,th,Fh,wh,Oh),bh&&(Pf=new hv(Jh,Es,$h,Qh,uf,bh,gf,Ip,wh,Oh))}if(Qf){let Oh=eh.layout.get("icon-rotate").evaluate(fc,{}),Zp=eh.layout.get("icon-text-fit")!=="none",dv=$x(Qf,Oh,Rp,Zp),ep=bh?$x(bh,Oh,Rp,Zp):void 0;Wp=new hv(Jh,Es,$h,Qh,uf,Qf,gf,Ip,!1,Oh),Xp=4*dv.length;let Bh=No.iconSizeData,nd=null;Bh.kind==="source"?(nd=[yd*eh.layout.get("icon-size").evaluate(fc,{})],nd[0]>cv&&h(`${No.layerIds[0]}: Value for "icon-size" is >= ${M0}. Reduce your "icon-size".`)):Bh.kind==="composite"&&(nd=[yd*Ju.compositeIconSizes[0].evaluate(fc,{},Kc),yd*Ju.compositeIconSizes[1].evaluate(fc,{},Kc)],(nd[0]>cv||nd[1]>cv)&&h(`${No.layerIds[0]}: Value for "icon-size" is >= ${M0}. Reduce your "icon-size".`)),No.addSymbols(No.icon,dv,nd,uu,pp,fc,e.ah.none,Es,_d.lineStartIndex,_d.lineLength,-1,Kc),J1=No.icon.placedSymbolArray.length-1,ep&&(Zd=4*ep.length,No.addSymbols(No.icon,ep,nd,uu,pp,fc,e.ah.vertical,Es,_d.lineStartIndex,_d.lineLength,-1,Kc),Dg=No.icon.placedSymbolArray.length-1)}let hh=Object.keys(Uu.horizontal);for(let Oh of hh){let Zp=Uu.horizontal[Oh];if(!hd){Ov=ni(Zp.text);let ep=eh.layout.get("text-rotate").evaluate(fc,{},Kc);hd=new hv(Jh,Es,$h,Qh,uf,Zp,th,Fh,wh,ep)}let dv=Zp.positionedLines.length===1;if(dp+=tb(No,Es,Zp,Hp,eh,wh,fc,fh,_d,Uu.vertical?e.ah.horizontal:e.ah.horizontalOnly,dv?hh:[Oh],xd,J1,Ju,Kc),dv)break}Uu.vertical&&(vm+=tb(No,Es,Uu.vertical,Hp,eh,wh,fc,fh,_d,e.ah.vertical,["vertical"],xd,Dg,Ju,Kc));let lA=hd?hd.boxStartIndex:No.collisionBoxArray.length,zg=hd?hd.boxEndIndex:No.collisionBoxArray.length,bd=Rc?Rc.boxStartIndex:No.collisionBoxArray.length,vp=Rc?Rc.boxEndIndex:No.collisionBoxArray.length,ob=Wp?Wp.boxStartIndex:No.collisionBoxArray.length,uA=Wp?Wp.boxEndIndex:No.collisionBoxArray.length,sb=Pf?Pf.boxStartIndex:No.collisionBoxArray.length,cA=Pf?Pf.boxEndIndex:No.collisionBoxArray.length,id=-1,F0=(Oh,Zp)=>Oh&&Oh.circleDiameter?Math.max(Oh.circleDiameter,Zp):Zp;id=F0(hd,id),id=F0(Rc,id),id=F0(Wp,id),id=F0(Pf,id);let Fg=id>-1?1:0;Fg&&(id*=dm/lu),No.glyphOffsetArray.length>=um.MAX_GLYPHS&&h("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),fc.sortKey!==void 0&&No.addToSortKeyRanges(No.symbolInstances.length,fc.sortKey);let $1=eb(eh,fc,Kc),[fA,hA]=function(Oh,Zp){let dv=Oh.length,ep=Zp?.values;if(ep?.length>0)for(let Bh=0;Bh=0?xd.right:-1,xd.center>=0?xd.center:-1,xd.left>=0?xd.left:-1,xd.vertical||-1,J1,Dg,Ov,lA,zg,bd,vp,ob,uA,sb,cA,$h,dp,vm,Xp,Zd,Fg,0,th,id,fA,hA)}(H,us,_n,K,pe,ke,Vo,H.layers[0],H.collisionBoxArray,D.index,D.sourceLayerIndex,H.index,Ga,[Hi,Hi,Hi,Hi],ko,Mt,Yi,rn,vs,Hr,D,je,Ut,nr,We)};if(go==="line")for(let _n of Xx(D.geometry,0,0,vo,vo)){let us=rA(_n,xi,jn,K.vertical||oa,pe,24,Qa,H.overscaling,vo);for(let No of us)oa&&oA(H,oa.text,Dn,No)||Bo(_n,No)}else if(go==="line-center"){for(let _n of D.geometry)if(_n.length>1){let us=tA(_n,jn,K.vertical||oa,pe,24,Qa);us&&Bo(_n,us)}}else if(D.type==="Polygon")for(let _n of Bc(D.geometry,0)){let us=aA(_n,16);Bo(_n[0],new Wd(us.x,us.y,0))}else if(D.type==="LineString")for(let _n of D.geometry)Bo(_n,new Wd(_n[0].x,_n[0].y,0));else if(D.type==="Point")for(let _n of D.geometry)for(let us of _n)Bo([us],new Wd(us.x,us.y,0))}function tb(H,D,K,pe,ke,je,We,ft,Mt,Ut,nr,Mr,zr,Hr,oa){let va=function(Yi,xi,Hi,rn,jn,ko,vs,go){let Dn=rn.layout.get("text-rotate").evaluate(ko,{})*Math.PI/180,is=[];for(let Vo of xi.positionedLines)for(let Bo of Vo.positionedGlyphs){if(!Bo.rect)continue;let _n=Bo.rect||{},us=Px+1,No=!0,Es=1,Ku=0,Uu=(jn||go)&&Bo.vertical,Qf=Bo.metrics.advance*Bo.scale/2;if(go&&xi.verticalizable&&(Ku=Vo.lineOffset/2-(Bo.imageName?-(lu-Bo.metrics.width*Bo.scale)/2:(Bo.scale-1)*lu)),Bo.imageName){let uu=vs[Bo.imageName];No=uu.sdf,Es=uu.pixelRatio,us=zh/Es}let Hp=jn?[Bo.x+Qf,Bo.y]:[0,0],bh=jn?[0,0]:[Bo.x+Qf+Hi[0],Bo.y+Hi[1]-Ku],eh=[0,0];Uu&&(eh=bh,bh=[0,0]);let Jh=Bo.metrics.isDoubleResolution?2:1,$h=(Bo.metrics.left-us)*Bo.scale-Qf+bh[0],Qh=(-Bo.metrics.top-us)*Bo.scale+bh[1],uf=$h+_n.w/Jh*Bo.scale/Es,th=Qh+_n.h/Jh*Bo.scale/Es,Fh=new i($h,Qh),wh=new i(uf,Qh),fh=new i($h,th),gf=new i(uf,th);if(Uu){let uu=new i(-Qf,Qf-$f),fc=-Math.PI/2,Ju=lu/2-Qf,Rp=new i(5-$f-Ju,-(Bo.imageName?Ju:0)),Kc=new i(...eh);Fh._rotateAround(fc,uu)._add(Rp)._add(Kc),wh._rotateAround(fc,uu)._add(Rp)._add(Kc),fh._rotateAround(fc,uu)._add(Rp)._add(Kc),gf._rotateAround(fc,uu)._add(Rp)._add(Kc)}if(Dn){let uu=Math.sin(Dn),fc=Math.cos(Dn),Ju=[fc,-uu,uu,fc];Fh._matMult(Ju),wh._matMult(Ju),fh._matMult(Ju),gf._matMult(Ju)}let Ip=new i(0,0),pp=new i(0,0);is.push({tl:Fh,tr:wh,bl:fh,br:gf,tex:_n,writingMode:xi.writingMode,glyphOffset:Hp,sectionIndex:Bo.sectionIndex,isSDF:No,pixelOffsetTL:Ip,pixelOffsetBR:pp,minFontScaleX:0,minFontScaleY:0})}return is}(0,K,ft,ke,je,We,pe,H.allowVerticalPlacement),Ga=H.textSizeData,Qa=null;Ga.kind==="source"?(Qa=[yd*ke.layout.get("text-size").evaluate(We,{})],Qa[0]>cv&&h(`${H.layerIds[0]}: Value for "text-size" is >= ${M0}. Reduce your "text-size".`)):Ga.kind==="composite"&&(Qa=[yd*Hr.compositeTextSizes[0].evaluate(We,{},oa),yd*Hr.compositeTextSizes[1].evaluate(We,{},oa)],(Qa[0]>cv||Qa[1]>cv)&&h(`${H.layerIds[0]}: Value for "text-size" is >= ${M0}. Reduce your "text-size".`)),H.addSymbols(H.text,va,Qa,ft,je,We,Ut,D,Mt.lineStartIndex,Mt.lineLength,zr,oa);for(let Yi of nr)Mr[Yi]=H.text.placedSymbolArray.length-1;return 4*va.length}function rb(H){for(let D in H)return H[D];return null}function oA(H,D,K,pe){let ke=H.compareText;if(D in ke){let je=ke[D];for(let We=je.length-1;We>=0;We--)if(pe.dist(je[We])>4;if(ke!==1)throw new Error(`Got v${ke} data when expected v1.`);let je=ab[15&pe];if(!je)throw new Error("Unrecognized array type.");let[We]=new Uint16Array(D,2,1),[ft]=new Uint32Array(D,4,1);return new X1(ft,We,je,D)}constructor(D,K=64,pe=Float64Array,ke){if(isNaN(D)||D<0)throw new Error(`Unpexpected numItems value: ${D}.`);this.numItems=+D,this.nodeSize=Math.min(Math.max(+K,2),65535),this.ArrayType=pe,this.IndexArrayType=D<65536?Uint16Array:Uint32Array;let je=ab.indexOf(this.ArrayType),We=2*D*this.ArrayType.BYTES_PER_ELEMENT,ft=D*this.IndexArrayType.BYTES_PER_ELEMENT,Mt=(8-ft%8)%8;if(je<0)throw new Error(`Unexpected typed array class: ${pe}.`);ke&&ke instanceof ArrayBuffer?(this.data=ke,this.ids=new this.IndexArrayType(this.data,8,D),this.coords=new this.ArrayType(this.data,8+ft+Mt,2*D),this._pos=2*D,this._finished=!0):(this.data=new ArrayBuffer(8+We+ft+Mt),this.ids=new this.IndexArrayType(this.data,8,D),this.coords=new this.ArrayType(this.data,8+ft+Mt,2*D),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+je]),new Uint16Array(this.data,2,1)[0]=K,new Uint32Array(this.data,4,1)[0]=D)}add(D,K){let pe=this._pos>>1;return this.ids[pe]=pe,this.coords[this._pos++]=D,this.coords[this._pos++]=K,pe}finish(){let D=this._pos>>1;if(D!==this.numItems)throw new Error(`Added ${D} items when expected ${this.numItems}.`);return Pg(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(D,K,pe,ke){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:je,coords:We,nodeSize:ft}=this,Mt=[0,je.length-1,0],Ut=[];for(;Mt.length;){let nr=Mt.pop()||0,Mr=Mt.pop()||0,zr=Mt.pop()||0;if(Mr-zr<=ft){for(let Ga=zr;Ga<=Mr;Ga++){let Qa=We[2*Ga],Yi=We[2*Ga+1];Qa>=D&&Qa<=pe&&Yi>=K&&Yi<=ke&&Ut.push(je[Ga])}continue}let Hr=zr+Mr>>1,oa=We[2*Hr],va=We[2*Hr+1];oa>=D&&oa<=pe&&va>=K&&va<=ke&&Ut.push(je[Hr]),(nr===0?D<=oa:K<=va)&&(Mt.push(zr),Mt.push(Hr-1),Mt.push(1-nr)),(nr===0?pe>=oa:ke>=va)&&(Mt.push(Hr+1),Mt.push(Mr),Mt.push(1-nr))}return Ut}within(D,K,pe){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:ke,coords:je,nodeSize:We}=this,ft=[0,ke.length-1,0],Mt=[],Ut=pe*pe;for(;ft.length;){let nr=ft.pop()||0,Mr=ft.pop()||0,zr=ft.pop()||0;if(Mr-zr<=We){for(let Ga=zr;Ga<=Mr;Ga++)nb(je[2*Ga],je[2*Ga+1],D,K)<=Ut&&Mt.push(ke[Ga]);continue}let Hr=zr+Mr>>1,oa=je[2*Hr],va=je[2*Hr+1];nb(oa,va,D,K)<=Ut&&Mt.push(ke[Hr]),(nr===0?D-pe<=oa:K-pe<=va)&&(ft.push(zr),ft.push(Hr-1),ft.push(1-nr)),(nr===0?D+pe>=oa:K+pe>=va)&&(ft.push(Hr+1),ft.push(Mr),ft.push(1-nr))}return Mt}}function Pg(H,D,K,pe,ke,je){if(ke-pe<=K)return;let We=pe+ke>>1;ib(H,D,We,pe,ke,je),Pg(H,D,K,pe,We-1,1-je),Pg(H,D,K,We+1,ke,1-je)}function ib(H,D,K,pe,ke,je){for(;ke>pe;){if(ke-pe>600){let Ut=ke-pe+1,nr=K-pe+1,Mr=Math.log(Ut),zr=.5*Math.exp(2*Mr/3),Hr=.5*Math.sqrt(Mr*zr*(Ut-zr)/Ut)*(nr-Ut/2<0?-1:1);ib(H,D,K,Math.max(pe,Math.floor(K-nr*zr/Ut+Hr)),Math.min(ke,Math.floor(K+(Ut-nr)*zr/Ut+Hr)),je)}let We=D[2*K+je],ft=pe,Mt=ke;for(D0(H,D,pe,K),D[2*ke+je]>We&&D0(H,D,pe,ke);ftWe;)Mt--}D[2*pe+je]===We?D0(H,D,pe,Mt):(Mt++,D0(H,D,Mt,ke)),Mt<=K&&(pe=Mt+1),K<=Mt&&(ke=Mt-1)}}function D0(H,D,K,pe){Z1(H,K,pe),Z1(D,2*K,2*pe),Z1(D,2*K+1,2*pe+1)}function Z1(H,D,K){let pe=H[D];H[D]=H[K],H[K]=pe}function nb(H,D,K,pe){let ke=H-K,je=D-pe;return ke*ke+je*je}var Ig;e.bg=void 0,(Ig=e.bg||(e.bg={})).create="create",Ig.load="load",Ig.fullLoad="fullLoad";let z0=null,Vf=[],Y1=1e3/60,K1="loadTime",Rg="fullLoadTime",sA={mark(H){performance.mark(H)},frame(H){let D=H;z0!=null&&Vf.push(D-z0),z0=D},clearMetrics(){z0=null,Vf=[],performance.clearMeasures(K1),performance.clearMeasures(Rg);for(let H in e.bg)performance.clearMarks(e.bg[H])},getPerformanceMetrics(){performance.measure(K1,e.bg.create,e.bg.load),performance.measure(Rg,e.bg.create,e.bg.fullLoad);let H=performance.getEntriesByName(K1)[0].duration,D=performance.getEntriesByName(Rg)[0].duration,K=Vf.length,pe=1/(Vf.reduce((je,We)=>je+We,0)/K/1e3),ke=Vf.filter(je=>je>Y1).reduce((je,We)=>je+(We-Y1)/Y1,0);return{loadTime:H,fullLoadTime:D,fps:pe,percentDroppedFrames:ke/(K+ke)*100,totalFrames:K}}};e.$=class extends br{},e.A=ii,e.B=Zi,e.C=function(H){if(z==null){let D=H.navigator?H.navigator.userAgent:null;z=!!H.safari||!(!D||!(/\b(iPad|iPhone|iPod)\b/.test(D)||D.match("Safari")&&!D.match("Chrome")))}return z},e.D=fo,e.E=ee,e.F=class{constructor(H,D){this.target=H,this.mapId=D,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new U1(()=>this.process()),this.subscription=function(K,pe,ke,je){return K.addEventListener(pe,ke,!1),{unsubscribe:()=>{K.removeEventListener(pe,ke,!1)}}}(this.target,"message",K=>this.receive(K)),this.globalScope=L(self)?H:window}registerMessageHandler(H,D){this.messageHandlers[H]=D}sendAsync(H,D){return new Promise((K,pe)=>{let ke=Math.round(1e18*Math.random()).toString(36).substring(0,10);this.resolveRejects[ke]={resolve:K,reject:pe},D&&D.signal.addEventListener("abort",()=>{delete this.resolveRejects[ke];let ft={id:ke,type:"",origin:location.origin,targetMapId:H.targetMapId,sourceMapId:this.mapId};this.target.postMessage(ft)},{once:!0});let je=[],We=Object.assign(Object.assign({},H),{id:ke,sourceMapId:this.mapId,origin:location.origin,data:Jn(H.data,je)});this.target.postMessage(We,{transfer:je})})}receive(H){let D=H.data,K=D.id;if(!(D.origin!=="file://"&&location.origin!=="file://"&&D.origin!=="resource://android"&&location.origin!=="resource://android"&&D.origin!==location.origin||D.targetMapId&&this.mapId!==D.targetMapId)){if(D.type===""){delete this.tasks[K];let pe=this.abortControllers[K];return delete this.abortControllers[K],void(pe&&pe.abort())}if(L(self)||D.mustQueue)return this.tasks[K]=D,this.taskQueue.push(K),void this.invoker.trigger();this.processTask(K,D)}}process(){if(this.taskQueue.length===0)return;let H=this.taskQueue.shift(),D=this.tasks[H];delete this.tasks[H],this.taskQueue.length>0&&this.invoker.trigger(),D&&this.processTask(H,D)}processTask(H,D){return t(this,void 0,void 0,function*(){if(D.type===""){let ke=this.resolveRejects[H];return delete this.resolveRejects[H],ke?void(D.error?ke.reject(co(D.error)):ke.resolve(co(D.data))):void 0}if(!this.messageHandlers[D.type])return void this.completeTask(H,new Error(`Could not find a registered handler for ${D.type}, map ID: ${this.mapId}, available handlers: ${Object.keys(this.messageHandlers).join(", ")}`));let K=co(D.data),pe=new AbortController;this.abortControllers[H]=pe;try{let ke=yield this.messageHandlers[D.type](D.sourceMapId,K,pe);this.completeTask(H,null,ke)}catch(ke){this.completeTask(H,ke)}})}completeTask(H,D,K){let pe=[];delete this.abortControllers[H];let ke={id:H,type:"",sourceMapId:this.mapId,origin:location.origin,error:D?Jn(D):null,data:Jn(K,pe)};this.target.postMessage(ke,{transfer:pe})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}},e.G=le,e.H=function(){var H=new ii(16);return ii!=Float32Array&&(H[1]=0,H[2]=0,H[3]=0,H[4]=0,H[6]=0,H[7]=0,H[8]=0,H[9]=0,H[11]=0,H[12]=0,H[13]=0,H[14]=0),H[0]=1,H[5]=1,H[10]=1,H[15]=1,H},e.I=bg,e.J=function(H,D,K){var pe,ke,je,We,ft,Mt,Ut,nr,Mr,zr,Hr,oa,va=K[0],Ga=K[1],Qa=K[2];return D===H?(H[12]=D[0]*va+D[4]*Ga+D[8]*Qa+D[12],H[13]=D[1]*va+D[5]*Ga+D[9]*Qa+D[13],H[14]=D[2]*va+D[6]*Ga+D[10]*Qa+D[14],H[15]=D[3]*va+D[7]*Ga+D[11]*Qa+D[15]):(ke=D[1],je=D[2],We=D[3],ft=D[4],Mt=D[5],Ut=D[6],nr=D[7],Mr=D[8],zr=D[9],Hr=D[10],oa=D[11],H[0]=pe=D[0],H[1]=ke,H[2]=je,H[3]=We,H[4]=ft,H[5]=Mt,H[6]=Ut,H[7]=nr,H[8]=Mr,H[9]=zr,H[10]=Hr,H[11]=oa,H[12]=pe*va+ft*Ga+Mr*Qa+D[12],H[13]=ke*va+Mt*Ga+zr*Qa+D[13],H[14]=je*va+Ut*Ga+Hr*Qa+D[14],H[15]=We*va+nr*Ga+oa*Qa+D[15]),H},e.K=function(H,D,K){var pe=K[0],ke=K[1],je=K[2];return H[0]=D[0]*pe,H[1]=D[1]*pe,H[2]=D[2]*pe,H[3]=D[3]*pe,H[4]=D[4]*ke,H[5]=D[5]*ke,H[6]=D[6]*ke,H[7]=D[7]*ke,H[8]=D[8]*je,H[9]=D[9]*je,H[10]=D[10]*je,H[11]=D[11]*je,H[12]=D[12],H[13]=D[13],H[14]=D[14],H[15]=D[15],H},e.L=Wa,e.M=function(H,D){let K={};for(let pe=0;pe{let D=window.document.createElement("video");return D.muted=!0,new Promise(K=>{D.onloadstart=()=>{K(D)};for(let pe of H){let ke=window.document.createElement("source");J(pe)||(D.crossOrigin="Anonymous"),ke.src=pe,D.appendChild(ke)}})},e.a4=function(){return y++},e.a5=on,e.a6=um,e.a7=Sc,e.a8=Gl,e.a9=V1,e.aA=function(H){if(H.type==="custom")return new N1(H);switch(H.type){case"background":return new QT(H);case"circle":return new Za(H);case"fill":return new Xt(H);case"fill-extrusion":return new Ep(H);case"heatmap":return new Rn(H);case"hillshade":return new xl(H);case"line":return new Lv(H);case"raster":return new L0(H);case"symbol":return new Dv(H)}},e.aB=u,e.aC=function(H,D){if(!H)return[{command:"setStyle",args:[D]}];let K=[];try{if(!Ae(H.version,D.version))return[{command:"setStyle",args:[D]}];Ae(H.center,D.center)||K.push({command:"setCenter",args:[D.center]}),Ae(H.zoom,D.zoom)||K.push({command:"setZoom",args:[D.zoom]}),Ae(H.bearing,D.bearing)||K.push({command:"setBearing",args:[D.bearing]}),Ae(H.pitch,D.pitch)||K.push({command:"setPitch",args:[D.pitch]}),Ae(H.sprite,D.sprite)||K.push({command:"setSprite",args:[D.sprite]}),Ae(H.glyphs,D.glyphs)||K.push({command:"setGlyphs",args:[D.glyphs]}),Ae(H.transition,D.transition)||K.push({command:"setTransition",args:[D.transition]}),Ae(H.light,D.light)||K.push({command:"setLight",args:[D.light]}),Ae(H.terrain,D.terrain)||K.push({command:"setTerrain",args:[D.terrain]}),Ae(H.sky,D.sky)||K.push({command:"setSky",args:[D.sky]}),Ae(H.projection,D.projection)||K.push({command:"setProjection",args:[D.projection]});let pe={},ke=[];(function(We,ft,Mt,Ut){let nr;for(nr in ft=ft||{},We=We||{})Object.prototype.hasOwnProperty.call(We,nr)&&(Object.prototype.hasOwnProperty.call(ft,nr)||Xe(nr,Mt,Ut));for(nr in ft)Object.prototype.hasOwnProperty.call(ft,nr)&&(Object.prototype.hasOwnProperty.call(We,nr)?Ae(We[nr],ft[nr])||(We[nr].type==="geojson"&&ft[nr].type==="geojson"&&ot(We,ft,nr)?ze(Mt,{command:"setGeoJSONSourceData",args:[nr,ft[nr].data]}):it(nr,ft,Mt,Ut)):Re(nr,ft,Mt))})(H.sources,D.sources,ke,pe);let je=[];H.layers&&H.layers.forEach(We=>{"source"in We&&pe[We.source]?K.push({command:"removeLayer",args:[We.id]}):je.push(We)}),K=K.concat(ke),function(We,ft,Mt){ft=ft||[];let Ut=(We=We||[]).map(lt),nr=ft.map(lt),Mr=We.reduce(Ee,{}),zr=ft.reduce(Ee,{}),Hr=Ut.slice(),oa=Object.create(null),va,Ga,Qa,Yi,xi;for(let Hi=0,rn=0;Hi@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(K,pe,ke,je)=>{let We=ke||je;return D[pe]=!We||We.toLowerCase(),""}),D["max-age"]){let K=parseInt(D["max-age"],10);isNaN(K)?delete D["max-age"]:D["max-age"]=K}return D},e.ab=function(H,D){let K=[];for(let pe in H)pe in D||K.push(pe);return K},e.ac=w,e.ad=function(H,D,K){var pe=Math.sin(K),ke=Math.cos(K),je=D[0],We=D[1],ft=D[2],Mt=D[3],Ut=D[4],nr=D[5],Mr=D[6],zr=D[7];return D!==H&&(H[8]=D[8],H[9]=D[9],H[10]=D[10],H[11]=D[11],H[12]=D[12],H[13]=D[13],H[14]=D[14],H[15]=D[15]),H[0]=je*ke+Ut*pe,H[1]=We*ke+nr*pe,H[2]=ft*ke+Mr*pe,H[3]=Mt*ke+zr*pe,H[4]=Ut*ke-je*pe,H[5]=nr*ke-We*pe,H[6]=Mr*ke-ft*pe,H[7]=zr*ke-Mt*pe,H},e.ae=function(H){var D=new ii(16);return D[0]=H[0],D[1]=H[1],D[2]=H[2],D[3]=H[3],D[4]=H[4],D[5]=H[5],D[6]=H[6],D[7]=H[7],D[8]=H[8],D[9]=H[9],D[10]=H[10],D[11]=H[11],D[12]=H[12],D[13]=H[13],D[14]=H[14],D[15]=H[15],D},e.af=hn,e.ag=function(H,D){let K=0,pe=0;if(H.kind==="constant")pe=H.layoutSize;else if(H.kind!=="source"){let{interpolationType:ke,minZoom:je,maxZoom:We}=H,ft=ke?w(to.interpolationFactor(ke,D,je,We),0,1):0;H.kind==="camera"?pe=Xn.number(H.minSize,H.maxSize,ft):K=ft}return{uSizeT:K,uSize:pe}},e.ai=function(H,{uSize:D,uSizeT:K},{lowerSize:pe,upperSize:ke}){return H.kind==="source"?pe/yd:H.kind==="composite"?Xn.number(pe/yd,ke/yd,K):D},e.aj=z1,e.ak=function(H,D,K,pe){let ke=D.y-H.y,je=D.x-H.x,We=pe.y-K.y,ft=pe.x-K.x,Mt=We*je-ft*ke;if(Mt===0)return null;let Ut=(ft*(H.y-K.y)-We*(H.x-K.x))/Mt;return new i(H.x+Ut*je,H.y+Ut*ke)},e.al=Xx,e.am=yc,e.an=gi,e.ao=function(H){let D=1/0,K=1/0,pe=-1/0,ke=-1/0;for(let je of H)D=Math.min(D,je.x),K=Math.min(K,je.y),pe=Math.max(pe,je.x),ke=Math.max(ke,je.y);return[D,K,pe,ke]},e.ap=lu,e.ar=D1,e.as=function(H,D){var K=D[0],pe=D[1],ke=D[2],je=D[3],We=D[4],ft=D[5],Mt=D[6],Ut=D[7],nr=D[8],Mr=D[9],zr=D[10],Hr=D[11],oa=D[12],va=D[13],Ga=D[14],Qa=D[15],Yi=K*ft-pe*We,xi=K*Mt-ke*We,Hi=K*Ut-je*We,rn=pe*Mt-ke*ft,jn=pe*Ut-je*ft,ko=ke*Ut-je*Mt,vs=nr*va-Mr*oa,go=nr*Ga-zr*oa,Dn=nr*Qa-Hr*oa,is=Mr*Ga-zr*va,Vo=Mr*Qa-Hr*va,Bo=zr*Qa-Hr*Ga,_n=Yi*Bo-xi*Vo+Hi*is+rn*Dn-jn*go+ko*vs;return _n?(H[0]=(ft*Bo-Mt*Vo+Ut*is)*(_n=1/_n),H[1]=(ke*Vo-pe*Bo-je*is)*_n,H[2]=(va*ko-Ga*jn+Qa*rn)*_n,H[3]=(zr*jn-Mr*ko-Hr*rn)*_n,H[4]=(Mt*Dn-We*Bo-Ut*go)*_n,H[5]=(K*Bo-ke*Dn+je*go)*_n,H[6]=(Ga*Hi-oa*ko-Qa*xi)*_n,H[7]=(nr*ko-zr*Hi+Hr*xi)*_n,H[8]=(We*Vo-ft*Dn+Ut*vs)*_n,H[9]=(pe*Dn-K*Vo-je*vs)*_n,H[10]=(oa*jn-va*Hi+Qa*Yi)*_n,H[11]=(Mr*Hi-nr*jn-Hr*Yi)*_n,H[12]=(ft*go-We*is-Mt*vs)*_n,H[13]=(K*is-pe*go+ke*vs)*_n,H[14]=(va*xi-oa*rn-Ga*Yi)*_n,H[15]=(nr*rn-Mr*xi+zr*Yi)*_n,H):null},e.at=W1,e.au=Sg,e.av=X1,e.aw=function(){let H={},D=re.$version;for(let K in re.$root){let pe=re.$root[K];if(pe.required){let ke=null;ke=K==="version"?D:pe.type==="array"?[]:{},ke!=null&&(H[K]=ke)}}return H},e.ax=wn,e.ay=G,e.az=function(H){H=H.slice();let D=Object.create(null);for(let K=0;K25||pe<0||pe>=1||K<0||K>=1)},e.bc=function(H,D){return H[0]=D[0],H[1]=0,H[2]=0,H[3]=0,H[4]=0,H[5]=D[1],H[6]=0,H[7]=0,H[8]=0,H[9]=0,H[10]=D[2],H[11]=0,H[12]=0,H[13]=0,H[14]=0,H[15]=1,H},e.bd=class extends $t{},e.be=j1,e.bf=sA,e.bh=he,e.bi=function(H,D){Q.REGISTERED_PROTOCOLS[H]=D},e.bj=function(H){delete Q.REGISTERED_PROTOCOLS[H]},e.bk=function(H,D){let K={};for(let ke=0;keBo*lu)}let go=We?"center":K.get("text-justify").evaluate(Ut,{},H.canonical),Dn=K.get("symbol-placement")==="point"?K.get("text-max-width").evaluate(Ut,{},H.canonical)*lu:1/0,is=()=>{H.bucket.allowVerticalPlacement&&_o(Hi)&&(oa.vertical=A0(va,H.glyphMap,H.glyphPositions,H.imagePositions,nr,Dn,je,ko,"left",jn,Qa,e.ah.vertical,!0,zr,Mr))};if(!We&&vs){let Vo=new Set;if(go==="auto")for(let _n=0;_nt(void 0,void 0,void 0,function*(){if(H.byteLength===0)return createImageBitmap(new ImageData(1,1));let D=new Blob([new Uint8Array(H)],{type:"image/png"});try{return createImageBitmap(D)}catch(K){throw new Error(`Could not load image because of ${K.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`)}}),e.e=E,e.f=H=>new Promise((D,K)=>{let pe=new Image;pe.onload=()=>{D(pe),URL.revokeObjectURL(pe.src),pe.onload=null,window.requestAnimationFrame(()=>{pe.src=B})},pe.onerror=()=>K(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."));let ke=new Blob([new Uint8Array(H)],{type:"image/png"});pe.src=H.byteLength?URL.createObjectURL(ke):B}),e.g=ue,e.h=(H,D)=>$(E(H,{type:"json"}),D),e.i=L,e.j=j,e.k=ie,e.l=(H,D)=>$(E(H,{type:"arrayBuffer"}),D),e.m=$,e.n=function(H){return new P1(H).readFields(vC,[])},e.o=In,e.p=R1,e.q=Ne,e.r=Pi,e.s=J,e.t=Ri,e.u=hi,e.v=re,e.w=h,e.x=function([H,D,K]){return D+=90,D*=Math.PI/180,K*=Math.PI/180,{x:H*Math.cos(D)*Math.sin(K),y:H*Math.sin(D)*Math.sin(K),z:H*Math.cos(K)}},e.y=Xn,e.z=Ls}),A("worker",["./shared"],function(e){"use strict";class t{constructor(Be){this.keyCache={},Be&&this.replace(Be)}replace(Be){this._layerConfigs={},this._layers={},this.update(Be,[])}update(Be,Ke){for(let Me of Be){this._layerConfigs[Me.id]=Me;let qe=this._layers[Me.id]=e.aA(Me);qe._featureFilter=e.a7(qe.filter),this.keyCache[Me.id]&&delete this.keyCache[Me.id]}for(let Me of Ke)delete this.keyCache[Me],delete this._layerConfigs[Me],delete this._layers[Me];this.familiesBySource={};let Ue=e.bk(Object.values(this._layerConfigs),this.keyCache);for(let Me of Ue){let qe=Me.map(Tt=>this._layers[Tt.id]),Ce=qe[0];if(Ce.visibility==="none")continue;let Te=Ce.source||"",Pe=this.familiesBySource[Te];Pe||(Pe=this.familiesBySource[Te]={});let at=Ce.sourceLayer||"_geojsonTileLayer",yt=Pe[at];yt||(yt=Pe[at]=[]),yt.push(qe)}}}class r{constructor(Be){let Ke={},Ue=[];for(let Te in Be){let Pe=Be[Te],at=Ke[Te]={};for(let yt in Pe){let Tt=Pe[+yt];if(!Tt||Tt.bitmap.width===0||Tt.bitmap.height===0)continue;let Ot={x:0,y:0,w:Tt.bitmap.width+2,h:Tt.bitmap.height+2};Ue.push(Ot),at[yt]={rect:Ot,metrics:Tt.metrics}}}let{w:Me,h:qe}=e.p(Ue),Ce=new e.o({width:Me||1,height:qe||1});for(let Te in Be){let Pe=Be[Te];for(let at in Pe){let yt=Pe[+at];if(!yt||yt.bitmap.width===0||yt.bitmap.height===0)continue;let Tt=Ke[Te][at].rect;e.o.copy(yt.bitmap,Ce,{x:0,y:0},{x:Tt.x+1,y:Tt.y+1},yt.bitmap)}}this.image=Ce,this.positions=Ke}}e.bl("GlyphAtlas",r);class o{constructor(Be){this.tileID=new e.S(Be.tileID.overscaledZ,Be.tileID.wrap,Be.tileID.canonical.z,Be.tileID.canonical.x,Be.tileID.canonical.y),this.uid=Be.uid,this.zoom=Be.zoom,this.pixelRatio=Be.pixelRatio,this.tileSize=Be.tileSize,this.source=Be.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=Be.showCollisionBoxes,this.collectResourceTiming=!!Be.collectResourceTiming,this.returnDependencies=!!Be.returnDependencies,this.promoteId=Be.promoteId,this.inFlightDependencies=[]}parse(Be,Ke,Ue,Me){return e._(this,void 0,void 0,function*(){this.status="parsing",this.data=Be,this.collisionBoxArray=new e.a5;let qe=new e.bm(Object.keys(Be.layers).sort()),Ce=new e.bn(this.tileID,this.promoteId);Ce.bucketLayerIDs=[];let Te={},Pe={featureIndex:Ce,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:Ue},at=Ke.familiesBySource[this.source];for(let ei in at){let za=Be.layers[ei];if(!za)continue;za.version===1&&e.w(`Vector tile source "${this.source}" layer "${ei}" does not use vector tile spec v2 and therefore may have some rendering errors.`);let ti=qe.encode(ei),Ci=[];for(let Jt=0;Jt=Nt.maxzoom||Nt.visibility!=="none"&&(a(Jt,this.zoom,Ue),(Te[Nt.id]=Nt.createBucket({index:Ce.bucketLayerIDs.length,layers:Jt,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:ti,sourceID:this.source})).populate(Ci,Pe,this.tileID.canonical),Ce.bucketLayerIDs.push(Jt.map(Kt=>Kt.id)))}}let yt=e.aF(Pe.glyphDependencies,ei=>Object.keys(ei).map(Number));this.inFlightDependencies.forEach(ei=>ei?.abort()),this.inFlightDependencies=[];let Tt=Promise.resolve({});if(Object.keys(yt).length){let ei=new AbortController;this.inFlightDependencies.push(ei),Tt=Me.sendAsync({type:"GG",data:{stacks:yt,source:this.source,tileID:this.tileID,type:"glyphs"}},ei)}let Ot=Object.keys(Pe.iconDependencies),Gt=Promise.resolve({});if(Ot.length){let ei=new AbortController;this.inFlightDependencies.push(ei),Gt=Me.sendAsync({type:"GI",data:{icons:Ot,source:this.source,tileID:this.tileID,type:"icons"}},ei)}let rr=Object.keys(Pe.patternDependencies),Qt=Promise.resolve({});if(rr.length){let ei=new AbortController;this.inFlightDependencies.push(ei),Qt=Me.sendAsync({type:"GI",data:{icons:rr,source:this.source,tileID:this.tileID,type:"patterns"}},ei)}let[Tr,la,Ua]=yield Promise.all([Tt,Gt,Qt]),Ba=new r(Tr),Ra=new e.bo(la,Ua);for(let ei in Te){let za=Te[ei];za instanceof e.a6?(a(za.layers,this.zoom,Ue),e.bp({bucket:za,glyphMap:Tr,glyphPositions:Ba.positions,imageMap:la,imagePositions:Ra.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical})):za.hasPattern&&(za instanceof e.bq||za instanceof e.br||za instanceof e.bs)&&(a(za.layers,this.zoom,Ue),za.addFeatures(Pe,this.tileID.canonical,Ra.patternPositions))}return this.status="done",{buckets:Object.values(Te).filter(ei=>!ei.isEmpty()),featureIndex:Ce,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:Ba.image,imageAtlas:Ra,glyphMap:this.returnDependencies?Tr:null,iconMap:this.returnDependencies?la:null,glyphPositions:this.returnDependencies?Ba.positions:null}})}}function a(bt,Be,Ke){let Ue=new e.z(Be);for(let Me of bt)Me.recalculate(Ue,Ke)}class i{constructor(Be,Ke,Ue){this.actor=Be,this.layerIndex=Ke,this.availableImages=Ue,this.fetching={},this.loading={},this.loaded={}}loadVectorTile(Be,Ke){return e._(this,void 0,void 0,function*(){let Ue=yield e.l(Be.request,Ke);try{return{vectorTile:new e.bt.VectorTile(new e.bu(Ue.data)),rawData:Ue.data,cacheControl:Ue.cacheControl,expires:Ue.expires}}catch(Me){let qe=new Uint8Array(Ue.data),Ce=`Unable to parse the tile at ${Be.request.url}, `;throw Ce+=qe[0]===31&&qe[1]===139?"please make sure the data is not gzipped and that you have configured the relevant header in the server":`got error: ${Me.message}`,new Error(Ce)}})}loadTile(Be){return e._(this,void 0,void 0,function*(){let Ke=Be.uid,Ue=!!(Be&&Be.request&&Be.request.collectResourceTiming)&&new e.bv(Be.request),Me=new o(Be);this.loading[Ke]=Me;let qe=new AbortController;Me.abort=qe;try{let Ce=yield this.loadVectorTile(Be,qe);if(delete this.loading[Ke],!Ce)return null;let Te=Ce.rawData,Pe={};Ce.expires&&(Pe.expires=Ce.expires),Ce.cacheControl&&(Pe.cacheControl=Ce.cacheControl);let at={};if(Ue){let Tt=Ue.finish();Tt&&(at.resourceTiming=JSON.parse(JSON.stringify(Tt)))}Me.vectorTile=Ce.vectorTile;let yt=Me.parse(Ce.vectorTile,this.layerIndex,this.availableImages,this.actor);this.loaded[Ke]=Me,this.fetching[Ke]={rawTileData:Te,cacheControl:Pe,resourceTiming:at};try{let Tt=yield yt;return e.e({rawTileData:Te.slice(0)},Tt,Pe,at)}finally{delete this.fetching[Ke]}}catch(Ce){throw delete this.loading[Ke],Me.status="done",this.loaded[Ke]=Me,Ce}})}reloadTile(Be){return e._(this,void 0,void 0,function*(){let Ke=Be.uid;if(!this.loaded||!this.loaded[Ke])throw new Error("Should not be trying to reload a tile that was never loaded or has been removed");let Ue=this.loaded[Ke];if(Ue.showCollisionBoxes=Be.showCollisionBoxes,Ue.status==="parsing"){let Me=yield Ue.parse(Ue.vectorTile,this.layerIndex,this.availableImages,this.actor),qe;if(this.fetching[Ke]){let{rawTileData:Ce,cacheControl:Te,resourceTiming:Pe}=this.fetching[Ke];delete this.fetching[Ke],qe=e.e({rawTileData:Ce.slice(0)},Me,Te,Pe)}else qe=Me;return qe}if(Ue.status==="done"&&Ue.vectorTile)return Ue.parse(Ue.vectorTile,this.layerIndex,this.availableImages,this.actor)})}abortTile(Be){return e._(this,void 0,void 0,function*(){let Ke=this.loading,Ue=Be.uid;Ke&&Ke[Ue]&&Ke[Ue].abort&&(Ke[Ue].abort.abort(),delete Ke[Ue])})}removeTile(Be){return e._(this,void 0,void 0,function*(){this.loaded&&this.loaded[Be.uid]&&delete this.loaded[Be.uid]})}}class n{constructor(){this.loaded={}}loadTile(Be){return e._(this,void 0,void 0,function*(){let{uid:Ke,encoding:Ue,rawImageData:Me,redFactor:qe,greenFactor:Ce,blueFactor:Te,baseShift:Pe}=Be,at=Me.width+2,yt=Me.height+2,Tt=e.b(Me)?new e.R({width:at,height:yt},yield e.bw(Me,-1,-1,at,yt)):Me,Ot=new e.bx(Ke,Tt,Ue,qe,Ce,Te,Pe);return this.loaded=this.loaded||{},this.loaded[Ke]=Ot,Ot})}removeTile(Be){let Ke=this.loaded,Ue=Be.uid;Ke&&Ke[Ue]&&delete Ke[Ue]}}function s(bt,Be){if(bt.length!==0){c(bt[0],Be);for(var Ke=1;Ke=Math.abs(Te)?Ke-Pe+Te:Te-Pe+Ke,Ke=Pe}Ke+Ue>=0!=!!Be&&bt.reverse()}var f=e.by(function bt(Be,Ke){var Ue,Me=Be&&Be.type;if(Me==="FeatureCollection")for(Ue=0;Ue>31}function L(bt,Be){for(var Ke=bt.loadGeometry(),Ue=bt.type,Me=0,qe=0,Ce=Ke.length,Te=0;Tebt},O=Math.fround||(I=new Float32Array(1),bt=>(I[0]=+bt,I[0]));var I;let N=3,U=5,W=6;class Q{constructor(Be){this.options=Object.assign(Object.create(B),Be),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(Be){let{log:Ke,minZoom:Ue,maxZoom:Me}=this.options;Ke&&console.time("total time");let qe=`prepare ${Be.length} points`;Ke&&console.time(qe),this.points=Be;let Ce=[];for(let Pe=0;Pe=Ue;Pe--){let at=+Date.now();Te=this.trees[Pe]=this._createTree(this._cluster(Te,Pe)),Ke&&console.log("z%d: %d clusters in %dms",Pe,Te.numItems,+Date.now()-at)}return Ke&&console.timeEnd("total time"),this}getClusters(Be,Ke){let Ue=((Be[0]+180)%360+360)%360-180,Me=Math.max(-90,Math.min(90,Be[1])),qe=Be[2]===180?180:((Be[2]+180)%360+360)%360-180,Ce=Math.max(-90,Math.min(90,Be[3]));if(Be[2]-Be[0]>=360)Ue=-180,qe=180;else if(Ue>qe){let Tt=this.getClusters([Ue,Me,180,Ce],Ke),Ot=this.getClusters([-180,Me,qe,Ce],Ke);return Tt.concat(Ot)}let Te=this.trees[this._limitZoom(Ke)],Pe=Te.range(he(Ue),G(Ce),he(qe),G(Me)),at=Te.data,yt=[];for(let Tt of Pe){let Ot=this.stride*Tt;yt.push(at[Ot+U]>1?ue(at,Ot,this.clusterProps):this.points[at[Ot+N]])}return yt}getChildren(Be){let Ke=this._getOriginId(Be),Ue=this._getOriginZoom(Be),Me="No cluster with the specified id.",qe=this.trees[Ue];if(!qe)throw new Error(Me);let Ce=qe.data;if(Ke*this.stride>=Ce.length)throw new Error(Me);let Te=this.options.radius/(this.options.extent*Math.pow(2,Ue-1)),Pe=qe.within(Ce[Ke*this.stride],Ce[Ke*this.stride+1],Te),at=[];for(let yt of Pe){let Tt=yt*this.stride;Ce[Tt+4]===Be&&at.push(Ce[Tt+U]>1?ue(Ce,Tt,this.clusterProps):this.points[Ce[Tt+N]])}if(at.length===0)throw new Error(Me);return at}getLeaves(Be,Ke,Ue){let Me=[];return this._appendLeaves(Me,Be,Ke=Ke||10,Ue=Ue||0,0),Me}getTile(Be,Ke,Ue){let Me=this.trees[this._limitZoom(Be)],qe=Math.pow(2,Be),{extent:Ce,radius:Te}=this.options,Pe=Te/Ce,at=(Ue-Pe)/qe,yt=(Ue+1+Pe)/qe,Tt={features:[]};return this._addTileFeatures(Me.range((Ke-Pe)/qe,at,(Ke+1+Pe)/qe,yt),Me.data,Ke,Ue,qe,Tt),Ke===0&&this._addTileFeatures(Me.range(1-Pe/qe,at,1,yt),Me.data,qe,Ue,qe,Tt),Ke===qe-1&&this._addTileFeatures(Me.range(0,at,Pe/qe,yt),Me.data,-1,Ue,qe,Tt),Tt.features.length?Tt:null}getClusterExpansionZoom(Be){let Ke=this._getOriginZoom(Be)-1;for(;Ke<=this.options.maxZoom;){let Ue=this.getChildren(Be);if(Ke++,Ue.length!==1)break;Be=Ue[0].properties.cluster_id}return Ke}_appendLeaves(Be,Ke,Ue,Me,qe){let Ce=this.getChildren(Ke);for(let Te of Ce){let Pe=Te.properties;if(Pe&&Pe.cluster?qe+Pe.point_count<=Me?qe+=Pe.point_count:qe=this._appendLeaves(Be,Pe.cluster_id,Ue,Me,qe):qe1,yt,Tt,Ot;if(at)yt=le(Ke,Pe,this.clusterProps),Tt=Ke[Pe],Ot=Ke[Pe+1];else{let Qt=this.points[Ke[Pe+N]];yt=Qt.properties;let[Tr,la]=Qt.geometry.coordinates;Tt=he(Tr),Ot=G(la)}let Gt={type:1,geometry:[[Math.round(this.options.extent*(Tt*qe-Ue)),Math.round(this.options.extent*(Ot*qe-Me))]],tags:yt},rr;rr=at||this.options.generateId?Ke[Pe+N]:this.points[Ke[Pe+N]].id,rr!==void 0&&(Gt.id=rr),Ce.features.push(Gt)}}_limitZoom(Be){return Math.max(this.options.minZoom,Math.min(Math.floor(+Be),this.options.maxZoom+1))}_cluster(Be,Ke){let{radius:Ue,extent:Me,reduce:qe,minPoints:Ce}=this.options,Te=Ue/(Me*Math.pow(2,Ke)),Pe=Be.data,at=[],yt=this.stride;for(let Tt=0;TtKe&&(Tr+=Pe[Ua+U])}if(Tr>Qt&&Tr>=Ce){let la,Ua=Ot*Qt,Ba=Gt*Qt,Ra=-1,ei=((Tt/yt|0)<<5)+(Ke+1)+this.points.length;for(let za of rr){let ti=za*yt;if(Pe[ti+2]<=Ke)continue;Pe[ti+2]=Ke;let Ci=Pe[ti+U];Ua+=Pe[ti]*Ci,Ba+=Pe[ti+1]*Ci,Pe[ti+4]=ei,qe&&(la||(la=this._map(Pe,Tt,!0),Ra=this.clusterProps.length,this.clusterProps.push(la)),qe(la,this._map(Pe,ti)))}Pe[Tt+4]=ei,at.push(Ua/Tr,Ba/Tr,1/0,ei,-1,Tr),qe&&at.push(Ra)}else{for(let la=0;la1)for(let la of rr){let Ua=la*yt;if(!(Pe[Ua+2]<=Ke)){Pe[Ua+2]=Ke;for(let Ba=0;Ba>5}_getOriginZoom(Be){return(Be-this.points.length)%32}_map(Be,Ke,Ue){if(Be[Ke+U]>1){let Ce=this.clusterProps[Be[Ke+W]];return Ue?Object.assign({},Ce):Ce}let Me=this.points[Be[Ke+N]].properties,qe=this.options.map(Me);return Ue&&qe===Me?Object.assign({},qe):qe}}function ue(bt,Be,Ke){return{type:"Feature",id:bt[Be+N],properties:le(bt,Be,Ke),geometry:{type:"Point",coordinates:[(Ue=bt[Be],360*(Ue-.5)),$(bt[Be+1])]}};var Ue}function le(bt,Be,Ke){let Ue=bt[Be+U],Me=Ue>=1e4?`${Math.round(Ue/1e3)}k`:Ue>=1e3?Math.round(Ue/100)/10+"k":Ue,qe=bt[Be+W],Ce=qe===-1?{}:Object.assign({},Ke[qe]);return Object.assign(Ce,{cluster:!0,cluster_id:bt[Be+N],point_count:Ue,point_count_abbreviated:Me})}function he(bt){return bt/360+.5}function G(bt){let Be=Math.sin(bt*Math.PI/180),Ke=.5-.25*Math.log((1+Be)/(1-Be))/Math.PI;return Ke<0?0:Ke>1?1:Ke}function $(bt){let Be=(180-360*bt)*Math.PI/180;return 360*Math.atan(Math.exp(Be))/Math.PI-90}function J(bt,Be,Ke,Ue){let Me=Ue,qe=Be+(Ke-Be>>1),Ce,Te=Ke-Be,Pe=bt[Be],at=bt[Be+1],yt=bt[Ke],Tt=bt[Ke+1];for(let Ot=Be+3;OtMe)Ce=Ot,Me=Gt;else if(Gt===Me){let rr=Math.abs(Ot-qe);rrUe&&(Ce-Be>3&&J(bt,Be,Ce,Ue),bt[Ce+2]=Me,Ke-Ce>3&&J(bt,Ce,Ke,Ue))}function X(bt,Be,Ke,Ue,Me,qe){let Ce=Me-Ke,Te=qe-Ue;if(Ce!==0||Te!==0){let Pe=((bt-Ke)*Ce+(Be-Ue)*Te)/(Ce*Ce+Te*Te);Pe>1?(Ke=Me,Ue=qe):Pe>0&&(Ke+=Ce*Pe,Ue+=Te*Pe)}return Ce=bt-Ke,Te=Be-Ue,Ce*Ce+Te*Te}function oe(bt,Be,Ke,Ue){let Me={id:bt??null,type:Be,geometry:Ke,tags:Ue,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};if(Be==="Point"||Be==="MultiPoint"||Be==="LineString")ie(Me,Ke);else if(Be==="Polygon")ie(Me,Ke[0]);else if(Be==="MultiLineString")for(let qe of Ke)ie(Me,qe);else if(Be==="MultiPolygon")for(let qe of Ke)ie(Me,qe[0]);return Me}function ie(bt,Be){for(let Ke=0;Ke0&&(Ce+=Ue?(Me*yt-at*qe)/2:Math.sqrt(Math.pow(at-Me,2)+Math.pow(yt-qe,2))),Me=at,qe=yt}let Te=Be.length-3;Be[2]=1,J(Be,0,Te,Ke),Be[Te+2]=1,Be.size=Math.abs(Ce),Be.start=0,Be.end=Be.size}function ce(bt,Be,Ke,Ue){for(let Me=0;Me1?1:Ke}function ze(bt,Be,Ke,Ue,Me,qe,Ce,Te){if(Ue/=Be,qe>=(Ke/=Be)&&Ce=Ue)return null;let Pe=[];for(let at of bt){let yt=at.geometry,Tt=at.type,Ot=Me===0?at.minX:at.minY,Gt=Me===0?at.maxX:at.maxY;if(Ot>=Ke&&Gt=Ue)continue;let rr=[];if(Tt==="Point"||Tt==="MultiPoint")Re(yt,rr,Ke,Ue,Me);else if(Tt==="LineString")Xe(yt,rr,Ke,Ue,Me,!1,Te.lineMetrics);else if(Tt==="MultiLineString")ot(yt,rr,Ke,Ue,Me,!1);else if(Tt==="Polygon")ot(yt,rr,Ke,Ue,Me,!0);else if(Tt==="MultiPolygon")for(let Qt of yt){let Tr=[];ot(Qt,Tr,Ke,Ue,Me,!0),Tr.length&&rr.push(Tr)}if(rr.length){if(Te.lineMetrics&&Tt==="LineString"){for(let Qt of rr)Pe.push(oe(at.id,Tt,Qt,at.tags));continue}Tt!=="LineString"&&Tt!=="MultiLineString"||(rr.length===1?(Tt="LineString",rr=rr[0]):Tt="MultiLineString"),Tt!=="Point"&&Tt!=="MultiPoint"||(Tt=rr.length===3?"Point":"MultiPoint"),Pe.push(oe(at.id,Tt,rr,at.tags))}}return Pe.length?Pe:null}function Re(bt,Be,Ke,Ue,Me){for(let qe=0;qe=Ke&&Ce<=Ue&&tt(Be,bt[qe],bt[qe+1],bt[qe+2])}}function Xe(bt,Be,Ke,Ue,Me,qe,Ce){let Te=it(bt),Pe=Me===0?lt:Ee,at,yt,Tt=bt.start;for(let Tr=0;TrKe&&(yt=Pe(Te,la,Ua,Ra,ei,Ke),Ce&&(Te.start=Tt+at*yt)):za>Ue?ti=Ke&&(yt=Pe(Te,la,Ua,Ra,ei,Ke),Ci=!0),ti>Ue&&za<=Ue&&(yt=Pe(Te,la,Ua,Ra,ei,Ue),Ci=!0),!qe&&Ci&&(Ce&&(Te.end=Tt+at*yt),Be.push(Te),Te=it(bt)),Ce&&(Tt+=at)}let Ot=bt.length-3,Gt=bt[Ot],rr=bt[Ot+1],Qt=Me===0?Gt:rr;Qt>=Ke&&Qt<=Ue&&tt(Te,Gt,rr,bt[Ot+2]),Ot=Te.length-3,qe&&Ot>=3&&(Te[Ot]!==Te[0]||Te[Ot+1]!==Te[1])&&tt(Te,Te[0],Te[1],Te[2]),Te.length&&Be.push(Te)}function it(bt){let Be=[];return Be.size=bt.size,Be.start=bt.start,Be.end=bt.end,Be}function ot(bt,Be,Ke,Ue,Me,qe){for(let Ce of bt)Xe(Ce,Be,Ke,Ue,Me,qe,!1)}function tt(bt,Be,Ke,Ue){bt.push(Be,Ke,Ue)}function lt(bt,Be,Ke,Ue,Me,qe){let Ce=(qe-Be)/(Ue-Be);return tt(bt,qe,Ke+(Me-Ke)*Ce,1),Ce}function Ee(bt,Be,Ke,Ue,Me,qe){let Ce=(qe-Ke)/(Me-Ke);return tt(bt,Be+(Ue-Be)*Ce,qe,1),Ce}function _e(bt,Be){let Ke=[];for(let Ue=0;Ue0&&Be.size<(Me?Ce:Ue))return void(Ke.numPoints+=Be.length/3);let Te=[];for(let Pe=0;PeCe)&&(Ke.numSimplified++,Te.push(Be[Pe],Be[Pe+1])),Ke.numPoints++;Me&&function(Pe,at){let yt=0;for(let Tt=0,Ot=Pe.length,Gt=Ot-2;Tt0===at)for(let Tt=0,Ot=Pe.length;Tt24)throw new Error("maxZoom should be in the 0-24 range");if(Ke.promoteId&&Ke.generateId)throw new Error("promoteId and generateId cannot be used together.");let Me=function(qe,Ce){let Te=[];if(qe.type==="FeatureCollection")for(let Pe=0;Pe1&&console.time("creation"),Gt=this.tiles[Ot]=st(Be,Ke,Ue,Me,at),this.tileCoords.push({z:Ke,x:Ue,y:Me}),yt)){yt>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",Ke,Ue,Me,Gt.numFeatures,Gt.numPoints,Gt.numSimplified),console.timeEnd("creation"));let Ci=`z${Ke}`;this.stats[Ci]=(this.stats[Ci]||0)+1,this.total++}if(Gt.source=Be,qe==null){if(Ke===at.indexMaxZoom||Gt.numPoints<=at.indexMaxPoints)continue}else{if(Ke===at.maxZoom||Ke===qe)continue;if(qe!=null){let Ci=qe-Ke;if(Ue!==Ce>>Ci||Me!==Te>>Ci)continue}}if(Gt.source=null,Be.length===0)continue;yt>1&&console.time("clipping");let rr=.5*at.buffer/at.extent,Qt=.5-rr,Tr=.5+rr,la=1+rr,Ua=null,Ba=null,Ra=null,ei=null,za=ze(Be,Tt,Ue-rr,Ue+Tr,0,Gt.minX,Gt.maxX,at),ti=ze(Be,Tt,Ue+Qt,Ue+la,0,Gt.minX,Gt.maxX,at);Be=null,za&&(Ua=ze(za,Tt,Me-rr,Me+Tr,1,Gt.minY,Gt.maxY,at),Ba=ze(za,Tt,Me+Qt,Me+la,1,Gt.minY,Gt.maxY,at),za=null),ti&&(Ra=ze(ti,Tt,Me-rr,Me+Tr,1,Gt.minY,Gt.maxY,at),ei=ze(ti,Tt,Me+Qt,Me+la,1,Gt.minY,Gt.maxY,at),ti=null),yt>1&&console.timeEnd("clipping"),Pe.push(Ua||[],Ke+1,2*Ue,2*Me),Pe.push(Ba||[],Ke+1,2*Ue,2*Me+1),Pe.push(Ra||[],Ke+1,2*Ue+1,2*Me),Pe.push(ei||[],Ke+1,2*Ue+1,2*Me+1)}}getTile(Be,Ke,Ue){Be=+Be,Ke=+Ke,Ue=+Ue;let Me=this.options,{extent:qe,debug:Ce}=Me;if(Be<0||Be>24)return null;let Te=1<1&&console.log("drilling down to z%d-%d-%d",Be,Ke,Ue);let at,yt=Be,Tt=Ke,Ot=Ue;for(;!at&&yt>0;)yt--,Tt>>=1,Ot>>=1,at=this.tiles[Zt(yt,Tt,Ot)];return at&&at.source?(Ce>1&&(console.log("found parent tile z%d-%d-%d",yt,Tt,Ot),console.time("drilling down")),this.splitTile(at.source,yt,Tt,Ot,Be,Ke,Ue),Ce>1&&console.timeEnd("drilling down"),this.tiles[Pe]?Fe(this.tiles[Pe],qe):null):null}}function Zt(bt,Be,Ke){return 32*((1<{Tt.properties=Gt;let rr={};for(let Qt of Ot)rr[Qt]=Pe[Qt].evaluate(yt,Tt);return rr},Ce.reduce=(Gt,rr)=>{Tt.properties=rr;for(let Qt of Ot)yt.accumulated=Gt[Qt],Gt[Qt]=at[Qt].evaluate(yt,Tt)},Ce}(Be)).load((yield this._pendingData).features):(Me=yield this._pendingData,new Vt(Me,Be.geojsonVtOptions)),this.loaded={};let qe={};if(Ue){let Ce=Ue.finish();Ce&&(qe.resourceTiming={},qe.resourceTiming[Be.source]=JSON.parse(JSON.stringify(Ce)))}return qe}catch(qe){if(delete this._pendingRequest,e.bB(qe))return{abandoned:!0};throw qe}var Me})}getData(){return e._(this,void 0,void 0,function*(){return this._pendingData})}reloadTile(Be){let Ke=this.loaded;return Ke&&Ke[Be.uid]?super.reloadTile(Be):this.loadTile(Be)}loadAndProcessGeoJSON(Be,Ke){return e._(this,void 0,void 0,function*(){let Ue=yield this.loadGeoJSON(Be,Ke);if(delete this._pendingRequest,typeof Ue!="object")throw new Error(`Input data given to '${Be.source}' is not a valid GeoJSON object.`);if(f(Ue,!0),Be.filter){let Me=e.bC(Be.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(Me.result==="error")throw new Error(Me.value.map(Ce=>`${Ce.key}: ${Ce.message}`).join(", "));Ue={type:"FeatureCollection",features:Ue.features.filter(Ce=>Me.value.evaluate({zoom:0},Ce))}}return Ue})}loadGeoJSON(Be,Ke){return e._(this,void 0,void 0,function*(){let{promoteId:Ue}=Be;if(Be.request){let Me=yield e.h(Be.request,Ke);return this._dataUpdateable=xr(Me.data,Ue)?jr(Me.data,Ue):void 0,Me.data}if(typeof Be.data=="string")try{let Me=JSON.parse(Be.data);return this._dataUpdateable=xr(Me,Ue)?jr(Me,Ue):void 0,Me}catch{throw new Error(`Input data given to '${Be.source}' is not a valid GeoJSON object.`)}if(!Be.dataDiff)throw new Error(`Input data given to '${Be.source}' is not a valid GeoJSON object.`);if(!this._dataUpdateable)throw new Error(`Cannot update existing geojson data in ${Be.source}`);return function(Me,qe,Ce){var Te,Pe,at,yt;if(qe.removeAll&&Me.clear(),qe.remove)for(let Tt of qe.remove)Me.delete(Tt);if(qe.add)for(let Tt of qe.add){let Ot=Sr(Tt,Ce);Ot!=null&&Me.set(Ot,Tt)}if(qe.update)for(let Tt of qe.update){let Ot=Me.get(Tt.id);if(Ot==null)continue;let Gt=!Tt.removeAllProperties&&(((Te=Tt.removeProperties)===null||Te===void 0?void 0:Te.length)>0||((Pe=Tt.addOrUpdateProperties)===null||Pe===void 0?void 0:Pe.length)>0);if((Tt.newGeometry||Tt.removeAllProperties||Gt)&&(Ot=Object.assign({},Ot),Me.set(Tt.id,Ot),Gt&&(Ot.properties=Object.assign({},Ot.properties))),Tt.newGeometry&&(Ot.geometry=Tt.newGeometry),Tt.removeAllProperties)Ot.properties={};else if(((at=Tt.removeProperties)===null||at===void 0?void 0:at.length)>0)for(let rr of Tt.removeProperties)Object.prototype.hasOwnProperty.call(Ot.properties,rr)&&delete Ot.properties[rr];if(((yt=Tt.addOrUpdateProperties)===null||yt===void 0?void 0:yt.length)>0)for(let{key:rr,value:Qt}of Tt.addOrUpdateProperties)Ot.properties[rr]=Qt}}(this._dataUpdateable,Be.dataDiff,Ue),{type:"FeatureCollection",features:Array.from(this._dataUpdateable.values())}})}removeSource(Be){return e._(this,void 0,void 0,function*(){this._pendingRequest&&this._pendingRequest.abort()})}getClusterExpansionZoom(Be){return this._geoJSONIndex.getClusterExpansionZoom(Be.clusterId)}getClusterChildren(Be){return this._geoJSONIndex.getChildren(Be.clusterId)}getClusterLeaves(Be){return this._geoJSONIndex.getLeaves(Be.clusterId,Be.limit,Be.offset)}}class Ir{constructor(Be){this.self=Be,this.actor=new e.F(Be),this.layerIndexes={},this.availableImages={},this.workerSources={},this.demWorkerSources={},this.externalWorkerSourceTypes={},this.self.registerWorkerSource=(Ke,Ue)=>{if(this.externalWorkerSourceTypes[Ke])throw new Error(`Worker source with name "${Ke}" already registered.`);this.externalWorkerSourceTypes[Ke]=Ue},this.self.addProtocol=e.bi,this.self.removeProtocol=e.bj,this.self.registerRTLTextPlugin=Ke=>{if(e.bD.isParsed())throw new Error("RTL text plugin already registered.");e.bD.setMethods(Ke)},this.actor.registerMessageHandler("LDT",(Ke,Ue)=>this._getDEMWorkerSource(Ke,Ue.source).loadTile(Ue)),this.actor.registerMessageHandler("RDT",(Ke,Ue)=>e._(this,void 0,void 0,function*(){this._getDEMWorkerSource(Ke,Ue.source).removeTile(Ue)})),this.actor.registerMessageHandler("GCEZ",(Ke,Ue)=>e._(this,void 0,void 0,function*(){return this._getWorkerSource(Ke,Ue.type,Ue.source).getClusterExpansionZoom(Ue)})),this.actor.registerMessageHandler("GCC",(Ke,Ue)=>e._(this,void 0,void 0,function*(){return this._getWorkerSource(Ke,Ue.type,Ue.source).getClusterChildren(Ue)})),this.actor.registerMessageHandler("GCL",(Ke,Ue)=>e._(this,void 0,void 0,function*(){return this._getWorkerSource(Ke,Ue.type,Ue.source).getClusterLeaves(Ue)})),this.actor.registerMessageHandler("LD",(Ke,Ue)=>this._getWorkerSource(Ke,Ue.type,Ue.source).loadData(Ue)),this.actor.registerMessageHandler("GD",(Ke,Ue)=>this._getWorkerSource(Ke,Ue.type,Ue.source).getData()),this.actor.registerMessageHandler("LT",(Ke,Ue)=>this._getWorkerSource(Ke,Ue.type,Ue.source).loadTile(Ue)),this.actor.registerMessageHandler("RT",(Ke,Ue)=>this._getWorkerSource(Ke,Ue.type,Ue.source).reloadTile(Ue)),this.actor.registerMessageHandler("AT",(Ke,Ue)=>this._getWorkerSource(Ke,Ue.type,Ue.source).abortTile(Ue)),this.actor.registerMessageHandler("RMT",(Ke,Ue)=>this._getWorkerSource(Ke,Ue.type,Ue.source).removeTile(Ue)),this.actor.registerMessageHandler("RS",(Ke,Ue)=>e._(this,void 0,void 0,function*(){if(!this.workerSources[Ke]||!this.workerSources[Ke][Ue.type]||!this.workerSources[Ke][Ue.type][Ue.source])return;let Me=this.workerSources[Ke][Ue.type][Ue.source];delete this.workerSources[Ke][Ue.type][Ue.source],Me.removeSource!==void 0&&Me.removeSource(Ue)})),this.actor.registerMessageHandler("RM",Ke=>e._(this,void 0,void 0,function*(){delete this.layerIndexes[Ke],delete this.availableImages[Ke],delete this.workerSources[Ke],delete this.demWorkerSources[Ke]})),this.actor.registerMessageHandler("SR",(Ke,Ue)=>e._(this,void 0,void 0,function*(){this.referrer=Ue})),this.actor.registerMessageHandler("SRPS",(Ke,Ue)=>this._syncRTLPluginState(Ke,Ue)),this.actor.registerMessageHandler("IS",(Ke,Ue)=>e._(this,void 0,void 0,function*(){this.self.importScripts(Ue)})),this.actor.registerMessageHandler("SI",(Ke,Ue)=>this._setImages(Ke,Ue)),this.actor.registerMessageHandler("UL",(Ke,Ue)=>e._(this,void 0,void 0,function*(){this._getLayerIndex(Ke).update(Ue.layers,Ue.removedIds)})),this.actor.registerMessageHandler("SL",(Ke,Ue)=>e._(this,void 0,void 0,function*(){this._getLayerIndex(Ke).replace(Ue)}))}_setImages(Be,Ke){return e._(this,void 0,void 0,function*(){this.availableImages[Be]=Ke;for(let Ue in this.workerSources[Be]){let Me=this.workerSources[Be][Ue];for(let qe in Me)Me[qe].availableImages=Ke}})}_syncRTLPluginState(Be,Ke){return e._(this,void 0,void 0,function*(){if(e.bD.isParsed())return e.bD.getState();if(Ke.pluginStatus!=="loading")return e.bD.setState(Ke),Ke;let Ue=Ke.pluginURL;if(this.self.importScripts(Ue),e.bD.isParsed()){let Me={pluginStatus:"loaded",pluginURL:Ue};return e.bD.setState(Me),Me}throw e.bD.setState({pluginStatus:"error",pluginURL:""}),new Error(`RTL Text Plugin failed to import scripts from ${Ue}`)})}_getAvailableImages(Be){let Ke=this.availableImages[Be];return Ke||(Ke=[]),Ke}_getLayerIndex(Be){let Ke=this.layerIndexes[Be];return Ke||(Ke=this.layerIndexes[Be]=new t),Ke}_getWorkerSource(Be,Ke,Ue){if(this.workerSources[Be]||(this.workerSources[Be]={}),this.workerSources[Be][Ke]||(this.workerSources[Be][Ke]={}),!this.workerSources[Be][Ke][Ue]){let Me={sendAsync:(qe,Ce)=>(qe.targetMapId=Be,this.actor.sendAsync(qe,Ce))};switch(Ke){case"vector":this.workerSources[Be][Ke][Ue]=new i(Me,this._getLayerIndex(Be),this._getAvailableImages(Be));break;case"geojson":this.workerSources[Be][Ke][Ue]=new wr(Me,this._getLayerIndex(Be),this._getAvailableImages(Be));break;default:this.workerSources[Be][Ke][Ue]=new this.externalWorkerSourceTypes[Ke](Me,this._getLayerIndex(Be),this._getAvailableImages(Be))}}return this.workerSources[Be][Ke][Ue]}_getDEMWorkerSource(Be,Ke){return this.demWorkerSources[Be]||(this.demWorkerSources[Be]={}),this.demWorkerSources[Be][Ke]||(this.demWorkerSources[Be][Ke]=new n),this.demWorkerSources[Be][Ke]}}return e.i(self)&&(self.worker=new Ir(self)),Ir}),A("index",["exports","./shared"],function(e,t){"use strict";var r="4.7.1";let o,a,i={now:typeof performance<"u"&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),frameAsync:Ne=>new Promise((R,ae)=>{let we=requestAnimationFrame(R);Ne.signal.addEventListener("abort",()=>{cancelAnimationFrame(we),ae(t.c())})}),getImageData(Ne,R=0){return this.getImageCanvasContext(Ne).getImageData(-R,-R,Ne.width+2*R,Ne.height+2*R)},getImageCanvasContext(Ne){let R=window.document.createElement("canvas"),ae=R.getContext("2d",{willReadFrequently:!0});if(!ae)throw new Error("failed to create canvas 2d context");return R.width=Ne.width,R.height=Ne.height,ae.drawImage(Ne,0,0,Ne.width,Ne.height),ae},resolveURL:Ne=>(o||(o=document.createElement("a")),o.href=Ne,o.href),hardwareConcurrency:typeof navigator<"u"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(a==null&&(a=matchMedia("(prefers-reduced-motion: reduce)")),a.matches)}};class n{static testProp(R){if(!n.docStyle)return R[0];for(let ae=0;ae{window.removeEventListener("click",n.suppressClickInternal,!0)},0)}static getScale(R){let ae=R.getBoundingClientRect();return{x:ae.width/R.offsetWidth||1,y:ae.height/R.offsetHeight||1,boundingClientRect:ae}}static getPoint(R,ae,we){let Se=ae.boundingClientRect;return new t.P((we.clientX-Se.left)/ae.x-R.clientLeft,(we.clientY-Se.top)/ae.y-R.clientTop)}static mousePos(R,ae){let we=n.getScale(R);return n.getPoint(R,we,ae)}static touchPos(R,ae){let we=[],Se=n.getScale(R);for(let Oe=0;Oe{c&&T(c),c=null,v=!0},f.onerror=()=>{g=!0,c=null},f.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA="),function(Ne){let R,ae,we,Se;Ne.resetRequestQueue=()=>{R=[],ae=0,we=0,Se={}},Ne.addThrottleControl=Bt=>{let $t=we++;return Se[$t]=Bt,$t},Ne.removeThrottleControl=Bt=>{delete Se[Bt],pt()},Ne.getImage=(Bt,$t,br=!0)=>new Promise((Ar,Yr)=>{s.supported&&(Bt.headers||(Bt.headers={}),Bt.headers.accept="image/webp,*/*"),t.e(Bt,{type:"image"}),R.push({abortController:$t,requestParameters:Bt,supportImageRefresh:br,state:"queued",onError:sa=>{Yr(sa)},onSuccess:sa=>{Ar(sa)}}),pt()});let Oe=Bt=>t._(this,void 0,void 0,function*(){Bt.state="running";let{requestParameters:$t,supportImageRefresh:br,onError:Ar,onSuccess:Yr,abortController:sa}=Bt,He=br===!1&&!t.i(self)&&!t.g($t.url)&&(!$t.headers||Object.keys($t.headers).reduce((dt,Ct)=>dt&&Ct==="accept",!0));ae++;let Je=He?At($t,sa):t.m($t,sa);try{let dt=yield Je;delete Bt.abortController,Bt.state="completed",dt.data instanceof HTMLImageElement||t.b(dt.data)?Yr(dt):dt.data&&Yr({data:yield(ut=dt.data,typeof createImageBitmap=="function"?t.d(ut):t.f(ut)),cacheControl:dt.cacheControl,expires:dt.expires})}catch(dt){delete Bt.abortController,Ar(dt)}finally{ae--,pt()}var ut}),pt=()=>{let Bt=(()=>{for(let $t of Object.keys(Se))if(Se[$t]())return!0;return!1})()?t.a.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:t.a.MAX_PARALLEL_IMAGE_REQUESTS;for(let $t=ae;$t0;$t++){let br=R.shift();br.abortController.signal.aborted?$t--:Oe(br)}},At=(Bt,$t)=>new Promise((br,Ar)=>{let Yr=new Image,sa=Bt.url,He=Bt.credentials;He&&He==="include"?Yr.crossOrigin="use-credentials":(He&&He==="same-origin"||!t.s(sa))&&(Yr.crossOrigin="anonymous"),$t.signal.addEventListener("abort",()=>{Yr.src="",Ar(t.c())}),Yr.fetchPriority="high",Yr.onload=()=>{Yr.onerror=Yr.onload=null,br({data:Yr})},Yr.onerror=()=>{Yr.onerror=Yr.onload=null,$t.signal.aborted||Ar(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))},Yr.src=sa})}(l||(l={})),l.resetRequestQueue();class _{constructor(R){this._transformRequestFn=R}transformRequest(R,ae){return this._transformRequestFn&&this._transformRequestFn(R,ae)||{url:R}}setTransformRequest(R){this._transformRequestFn=R}}function w(Ne){var R=new t.A(3);return R[0]=Ne[0],R[1]=Ne[1],R[2]=Ne[2],R}var S,E=function(Ne,R,ae){return Ne[0]=R[0]-ae[0],Ne[1]=R[1]-ae[1],Ne[2]=R[2]-ae[2],Ne};S=new t.A(3),t.A!=Float32Array&&(S[0]=0,S[1]=0,S[2]=0);var y=function(Ne){var R=Ne[0],ae=Ne[1];return R*R+ae*ae};function b(Ne){let R=[];if(typeof Ne=="string")R.push({id:"default",url:Ne});else if(Ne&&Ne.length>0){let ae=[];for(let{id:we,url:Se}of Ne){let Oe=`${we}${Se}`;ae.indexOf(Oe)===-1&&(ae.push(Oe),R.push({id:we,url:Se}))}}return R}function p(Ne,R,ae){let we=Ne.split("?");return we[0]+=`${R}${ae}`,we.join("?")}(function(){var Ne=new t.A(2);t.A!=Float32Array&&(Ne[0]=0,Ne[1]=0)})();class u{constructor(R,ae,we,Se){this.context=R,this.format=we,this.texture=R.gl.createTexture(),this.update(ae,Se)}update(R,ae,we){let{width:Se,height:Oe}=R,pt=!(this.size&&this.size[0]===Se&&this.size[1]===Oe||we),{context:At}=this,{gl:Bt}=At;if(this.useMipmap=!!(ae&&ae.useMipmap),Bt.bindTexture(Bt.TEXTURE_2D,this.texture),At.pixelStoreUnpackFlipY.set(!1),At.pixelStoreUnpack.set(1),At.pixelStoreUnpackPremultiplyAlpha.set(this.format===Bt.RGBA&&(!ae||ae.premultiply!==!1)),pt)this.size=[Se,Oe],R instanceof HTMLImageElement||R instanceof HTMLCanvasElement||R instanceof HTMLVideoElement||R instanceof ImageData||t.b(R)?Bt.texImage2D(Bt.TEXTURE_2D,0,this.format,this.format,Bt.UNSIGNED_BYTE,R):Bt.texImage2D(Bt.TEXTURE_2D,0,this.format,Se,Oe,0,this.format,Bt.UNSIGNED_BYTE,R.data);else{let{x:$t,y:br}=we||{x:0,y:0};R instanceof HTMLImageElement||R instanceof HTMLCanvasElement||R instanceof HTMLVideoElement||R instanceof ImageData||t.b(R)?Bt.texSubImage2D(Bt.TEXTURE_2D,0,$t,br,Bt.RGBA,Bt.UNSIGNED_BYTE,R):Bt.texSubImage2D(Bt.TEXTURE_2D,0,$t,br,Se,Oe,Bt.RGBA,Bt.UNSIGNED_BYTE,R.data)}this.useMipmap&&this.isSizePowerOfTwo()&&Bt.generateMipmap(Bt.TEXTURE_2D)}bind(R,ae,we){let{context:Se}=this,{gl:Oe}=Se;Oe.bindTexture(Oe.TEXTURE_2D,this.texture),we!==Oe.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(we=Oe.LINEAR),R!==this.filter&&(Oe.texParameteri(Oe.TEXTURE_2D,Oe.TEXTURE_MAG_FILTER,R),Oe.texParameteri(Oe.TEXTURE_2D,Oe.TEXTURE_MIN_FILTER,we||R),this.filter=R),ae!==this.wrap&&(Oe.texParameteri(Oe.TEXTURE_2D,Oe.TEXTURE_WRAP_S,ae),Oe.texParameteri(Oe.TEXTURE_2D,Oe.TEXTURE_WRAP_T,ae),this.wrap=ae)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){let{gl:R}=this.context;R.deleteTexture(this.texture),this.texture=null}}function m(Ne){let{userImage:R}=Ne;return!!(R&&R.render&&R.render())&&(Ne.data.replace(new Uint8Array(R.data.buffer)),!0)}class h extends t.E{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new t.R({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(R){if(this.loaded!==R&&(this.loaded=R,R)){for(let{ids:ae,promiseResolve:we}of this.requestors)we(this._getImagesForIds(ae));this.requestors=[]}}getImage(R){let ae=this.images[R];if(ae&&!ae.data&&ae.spriteData){let we=ae.spriteData;ae.data=new t.R({width:we.width,height:we.height},we.context.getImageData(we.x,we.y,we.width,we.height).data),ae.spriteData=null}return ae}addImage(R,ae){if(this.images[R])throw new Error(`Image id ${R} already exist, use updateImage instead`);this._validate(R,ae)&&(this.images[R]=ae)}_validate(R,ae){let we=!0,Se=ae.data||ae.spriteData;return this._validateStretch(ae.stretchX,Se&&Se.width)||(this.fire(new t.j(new Error(`Image "${R}" has invalid "stretchX" value`))),we=!1),this._validateStretch(ae.stretchY,Se&&Se.height)||(this.fire(new t.j(new Error(`Image "${R}" has invalid "stretchY" value`))),we=!1),this._validateContent(ae.content,ae)||(this.fire(new t.j(new Error(`Image "${R}" has invalid "content" value`))),we=!1),we}_validateStretch(R,ae){if(!R)return!0;let we=0;for(let Se of R){if(Se[0]{let Se=!0;if(!this.isLoaded())for(let Oe of R)this.images[Oe]||(Se=!1);this.isLoaded()||Se?ae(this._getImagesForIds(R)):this.requestors.push({ids:R,promiseResolve:ae})})}_getImagesForIds(R){let ae={};for(let we of R){let Se=this.getImage(we);Se||(this.fire(new t.k("styleimagemissing",{id:we})),Se=this.getImage(we)),Se?ae[we]={data:Se.data.clone(),pixelRatio:Se.pixelRatio,sdf:Se.sdf,version:Se.version,stretchX:Se.stretchX,stretchY:Se.stretchY,content:Se.content,textFitWidth:Se.textFitWidth,textFitHeight:Se.textFitHeight,hasRenderCallback:!!(Se.userImage&&Se.userImage.render)}:t.w(`Image "${we}" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.`)}return ae}getPixelSize(){let{width:R,height:ae}=this.atlasImage;return{width:R,height:ae}}getPattern(R){let ae=this.patterns[R],we=this.getImage(R);if(!we)return null;if(ae&&ae.position.version===we.version)return ae.position;if(ae)ae.position.version=we.version;else{let Se={w:we.data.width+2,h:we.data.height+2,x:0,y:0},Oe=new t.I(Se,we);this.patterns[R]={bin:Se,position:Oe}}return this._updatePatternAtlas(),this.patterns[R].position}bind(R){let ae=R.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new u(R,this.atlasImage,ae.RGBA),this.atlasTexture.bind(ae.LINEAR,ae.CLAMP_TO_EDGE)}_updatePatternAtlas(){let R=[];for(let Oe in this.patterns)R.push(this.patterns[Oe].bin);let{w:ae,h:we}=t.p(R),Se=this.atlasImage;Se.resize({width:ae||1,height:we||1});for(let Oe in this.patterns){let{bin:pt}=this.patterns[Oe],At=pt.x+1,Bt=pt.y+1,$t=this.getImage(Oe).data,br=$t.width,Ar=$t.height;t.R.copy($t,Se,{x:0,y:0},{x:At,y:Bt},{width:br,height:Ar}),t.R.copy($t,Se,{x:0,y:Ar-1},{x:At,y:Bt-1},{width:br,height:1}),t.R.copy($t,Se,{x:0,y:0},{x:At,y:Bt+Ar},{width:br,height:1}),t.R.copy($t,Se,{x:br-1,y:0},{x:At-1,y:Bt},{width:1,height:Ar}),t.R.copy($t,Se,{x:0,y:0},{x:At+br,y:Bt},{width:1,height:Ar})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(R){for(let ae of R){if(this.callbackDispatchedThisFrame[ae])continue;this.callbackDispatchedThisFrame[ae]=!0;let we=this.getImage(ae);we||t.w(`Image with ID: "${ae}" was not found`),m(we)&&this.updateImage(ae,we)}}}let P=1e20;function L(Ne,R,ae,we,Se,Oe,pt,At,Bt){for(let $t=R;$t-1);Bt++,Oe[Bt]=At,pt[Bt]=$t,pt[Bt+1]=P}for(let At=0,Bt=0;At65535)throw new Error("glyphs > 65535 not supported");if(we.ranges[Oe])return{stack:R,id:ae,glyph:Se};if(!this.url)throw new Error("glyphsUrl is not set");if(!we.requests[Oe]){let At=F.loadGlyphRange(R,Oe,this.url,this.requestManager);we.requests[Oe]=At}let pt=yield we.requests[Oe];for(let At in pt)this._doesCharSupportLocalGlyph(+At)||(we.glyphs[+At]=pt[+At]);return we.ranges[Oe]=!0,{stack:R,id:ae,glyph:pt[ae]||null}})}_doesCharSupportLocalGlyph(R){return!!this.localIdeographFontFamily&&new RegExp("\\p{Ideo}|\\p{sc=Hang}|\\p{sc=Hira}|\\p{sc=Kana}","u").test(String.fromCodePoint(R))}_tinySDF(R,ae,we){let Se=this.localIdeographFontFamily;if(!Se||!this._doesCharSupportLocalGlyph(we))return;let Oe=R.tinySDF;if(!Oe){let At="400";/bold/i.test(ae)?At="900":/medium/i.test(ae)?At="500":/light/i.test(ae)&&(At="200"),Oe=R.tinySDF=new F.TinySDF({fontSize:48,buffer:6,radius:16,cutoff:.25,fontFamily:Se,fontWeight:At})}let pt=Oe.draw(String.fromCharCode(we));return{id:we,bitmap:new t.o({width:pt.width||60,height:pt.height||60},pt.data),metrics:{width:pt.glyphWidth/2||24,height:pt.glyphHeight/2||24,left:pt.glyphLeft/2+.5||0,top:pt.glyphTop/2-27.5||-8,advance:pt.glyphAdvance/2||24,isDoubleResolution:!0}}}}F.loadGlyphRange=function(Ne,R,ae,we){return t._(this,void 0,void 0,function*(){let Se=256*R,Oe=Se+255,pt=we.transformRequest(ae.replace("{fontstack}",Ne).replace("{range}",`${Se}-${Oe}`),"Glyphs"),At=yield t.l(pt,new AbortController);if(!At||!At.data)throw new Error(`Could not load glyph range. range: ${R}, ${Se}-${Oe}`);let Bt={};for(let $t of t.n(At.data))Bt[$t.id]=$t;return Bt})},F.TinySDF=class{constructor({fontSize:Ne=24,buffer:R=3,radius:ae=8,cutoff:we=.25,fontFamily:Se="sans-serif",fontWeight:Oe="normal",fontStyle:pt="normal"}={}){this.buffer=R,this.cutoff=we,this.radius=ae;let At=this.size=Ne+4*R,Bt=this._createCanvas(At),$t=this.ctx=Bt.getContext("2d",{willReadFrequently:!0});$t.font=`${pt} ${Oe} ${Ne}px ${Se}`,$t.textBaseline="alphabetic",$t.textAlign="left",$t.fillStyle="black",this.gridOuter=new Float64Array(At*At),this.gridInner=new Float64Array(At*At),this.f=new Float64Array(At),this.z=new Float64Array(At+1),this.v=new Uint16Array(At)}_createCanvas(Ne){let R=document.createElement("canvas");return R.width=R.height=Ne,R}draw(Ne){let{width:R,actualBoundingBoxAscent:ae,actualBoundingBoxDescent:we,actualBoundingBoxLeft:Se,actualBoundingBoxRight:Oe}=this.ctx.measureText(Ne),pt=Math.ceil(ae),At=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(Oe-Se))),Bt=Math.min(this.size-this.buffer,pt+Math.ceil(we)),$t=At+2*this.buffer,br=Bt+2*this.buffer,Ar=Math.max($t*br,0),Yr=new Uint8ClampedArray(Ar),sa={data:Yr,width:$t,height:br,glyphWidth:At,glyphHeight:Bt,glyphTop:pt,glyphLeft:0,glyphAdvance:R};if(At===0||Bt===0)return sa;let{ctx:He,buffer:Je,gridInner:ut,gridOuter:dt}=this;He.clearRect(Je,Je,At,Bt),He.fillText(Ne,Je,Je+pt);let Ct=He.getImageData(Je,Je,At,Bt);dt.fill(P,0,Ar),ut.fill(0,0,Ar);for(let wt=0;wt0?Er*Er:0,ut[mr]=Er<0?Er*Er:0}}L(dt,0,0,$t,br,$t,this.f,this.v,this.z),L(ut,Je,Je,At,Bt,$t,this.f,this.v,this.z);for(let wt=0;wt1&&(Bt=R[++At]);let br=Math.abs($t-Bt.left),Ar=Math.abs($t-Bt.right),Yr=Math.min(br,Ar),sa,He=Oe/we*(Se+1);if(Bt.isDash){let Je=Se-Math.abs(He);sa=Math.sqrt(Yr*Yr+Je*Je)}else sa=Se-Math.sqrt(Yr*Yr+He*He);this.data[pt+$t]=Math.max(0,Math.min(255,sa+128))}}}addRegularDash(R){for(let At=R.length-1;At>=0;--At){let Bt=R[At],$t=R[At+1];Bt.zeroLength?R.splice(At,1):$t&&$t.isDash===Bt.isDash&&($t.left=Bt.left,R.splice(At,1))}let ae=R[0],we=R[R.length-1];ae.isDash===we.isDash&&(ae.left=we.left-this.width,we.right=ae.right+this.width);let Se=this.width*this.nextRow,Oe=0,pt=R[Oe];for(let At=0;At1&&(pt=R[++Oe]);let Bt=Math.abs(At-pt.left),$t=Math.abs(At-pt.right),br=Math.min(Bt,$t);this.data[Se+At]=Math.max(0,Math.min(255,(pt.isDash?br:-br)+128))}}addDash(R,ae){let we=ae?7:0,Se=2*we+1;if(this.nextRow+Se>this.height)return t.w("LineAtlas out of space"),null;let Oe=0;for(let At=0;At{ae.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[Q]}numActive(){return Object.keys(this.active).length}}let le=Math.floor(i.hardwareConcurrency/2),he,G;function $(){return he||(he=new ue),he}ue.workerCount=t.C(globalThis)?Math.max(Math.min(le,3),1):1;class J{constructor(R,ae){this.workerPool=R,this.actors=[],this.currentActor=0,this.id=ae;let we=this.workerPool.acquire(ae);for(let Se=0;Se{ae.remove()}),this.actors=[],R&&this.workerPool.release(this.id)}registerMessageHandler(R,ae){for(let we of this.actors)we.registerMessageHandler(R,ae)}}function X(){return G||(G=new J($(),t.G),G.registerMessageHandler("GR",(Ne,R,ae)=>t.m(R,ae))),G}function oe(Ne,R){let ae=t.H();return t.J(ae,ae,[1,1,0]),t.K(ae,ae,[.5*Ne.width,.5*Ne.height,1]),t.L(ae,ae,Ne.calculatePosMatrix(R.toUnwrapped()))}function ie(Ne,R,ae,we,Se,Oe){let pt=function(Ar,Yr,sa){if(Ar)for(let He of Ar){let Je=Yr[He];if(Je&&Je.source===sa&&Je.type==="fill-extrusion")return!0}else for(let He in Yr){let Je=Yr[He];if(Je.source===sa&&Je.type==="fill-extrusion")return!0}return!1}(Se&&Se.layers,R,Ne.id),At=Oe.maxPitchScaleFactor(),Bt=Ne.tilesIn(we,At,pt);Bt.sort(j);let $t=[];for(let Ar of Bt)$t.push({wrappedTileID:Ar.tileID.wrapped().key,queryResults:Ar.tile.queryRenderedFeatures(R,ae,Ne._state,Ar.queryGeometry,Ar.cameraQueryGeometry,Ar.scale,Se,Oe,At,oe(Ne.transform,Ar.tileID))});let br=function(Ar){let Yr={},sa={};for(let He of Ar){let Je=He.queryResults,ut=He.wrappedTileID,dt=sa[ut]=sa[ut]||{};for(let Ct in Je){let wt=Je[Ct],Dt=dt[Ct]=dt[Ct]||{},ur=Yr[Ct]=Yr[Ct]||[];for(let mr of wt)Dt[mr.featureIndex]||(Dt[mr.featureIndex]=!0,ur.push(mr))}}return Yr}($t);for(let Ar in br)br[Ar].forEach(Yr=>{let sa=Yr.feature,He=Ne.getFeatureState(sa.layer["source-layer"],sa.id);sa.source=sa.layer.source,sa.layer["source-layer"]&&(sa.sourceLayer=sa.layer["source-layer"]),sa.state=He});return br}function j(Ne,R){let ae=Ne.tileID,we=R.tileID;return ae.overscaledZ-we.overscaledZ||ae.canonical.y-we.canonical.y||ae.wrap-we.wrap||ae.canonical.x-we.canonical.x}function ee(Ne,R,ae){return t._(this,void 0,void 0,function*(){let we=Ne;if(Ne.url?we=(yield t.h(R.transformRequest(Ne.url,"Source"),ae)).data:yield i.frameAsync(ae),!we)return null;let Se=t.M(t.e(we,Ne),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);return"vector_layers"in we&&we.vector_layers&&(Se.vectorLayerIds=we.vector_layers.map(Oe=>Oe.id)),Se})}class re{constructor(R,ae){R&&(ae?this.setSouthWest(R).setNorthEast(ae):Array.isArray(R)&&(R.length===4?this.setSouthWest([R[0],R[1]]).setNorthEast([R[2],R[3]]):this.setSouthWest(R[0]).setNorthEast(R[1])))}setNorthEast(R){return this._ne=R instanceof t.N?new t.N(R.lng,R.lat):t.N.convert(R),this}setSouthWest(R){return this._sw=R instanceof t.N?new t.N(R.lng,R.lat):t.N.convert(R),this}extend(R){let ae=this._sw,we=this._ne,Se,Oe;if(R instanceof t.N)Se=R,Oe=R;else{if(!(R instanceof re))return Array.isArray(R)?R.length===4||R.every(Array.isArray)?this.extend(re.convert(R)):this.extend(t.N.convert(R)):R&&("lng"in R||"lon"in R)&&"lat"in R?this.extend(t.N.convert(R)):this;if(Se=R._sw,Oe=R._ne,!Se||!Oe)return this}return ae||we?(ae.lng=Math.min(Se.lng,ae.lng),ae.lat=Math.min(Se.lat,ae.lat),we.lng=Math.max(Oe.lng,we.lng),we.lat=Math.max(Oe.lat,we.lat)):(this._sw=new t.N(Se.lng,Se.lat),this._ne=new t.N(Oe.lng,Oe.lat)),this}getCenter(){return new t.N((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)}getSouthWest(){return this._sw}getNorthEast(){return this._ne}getNorthWest(){return new t.N(this.getWest(),this.getNorth())}getSouthEast(){return new t.N(this.getEast(),this.getSouth())}getWest(){return this._sw.lng}getSouth(){return this._sw.lat}getEast(){return this._ne.lng}getNorth(){return this._ne.lat}toArray(){return[this._sw.toArray(),this._ne.toArray()]}toString(){return`LngLatBounds(${this._sw.toString()}, ${this._ne.toString()})`}isEmpty(){return!(this._sw&&this._ne)}contains(R){let{lng:ae,lat:we}=t.N.convert(R),Se=this._sw.lng<=ae&&ae<=this._ne.lng;return this._sw.lng>this._ne.lng&&(Se=this._sw.lng>=ae&&ae>=this._ne.lng),this._sw.lat<=we&&we<=this._ne.lat&&Se}static convert(R){return R instanceof re?R:R&&new re(R)}static fromLngLat(R,ae=0){let we=360*ae/40075017,Se=we/Math.cos(Math.PI/180*R.lat);return new re(new t.N(R.lng-Se,R.lat-we),new t.N(R.lng+Se,R.lat+we))}adjustAntiMeridian(){let R=new t.N(this._sw.lng,this._sw.lat),ae=new t.N(this._ne.lng,this._ne.lat);return new re(R,R.lng>ae.lng?new t.N(ae.lng+360,ae.lat):ae)}}class ce{constructor(R,ae,we){this.bounds=re.convert(this.validateBounds(R)),this.minzoom=ae||0,this.maxzoom=we||24}validateBounds(R){return Array.isArray(R)&&R.length===4?[Math.max(-180,R[0]),Math.max(-90,R[1]),Math.min(180,R[2]),Math.min(90,R[3])]:[-180,-90,180,90]}contains(R){let ae=Math.pow(2,R.z),we=Math.floor(t.O(this.bounds.getWest())*ae),Se=Math.floor(t.Q(this.bounds.getNorth())*ae),Oe=Math.ceil(t.O(this.bounds.getEast())*ae),pt=Math.ceil(t.Q(this.bounds.getSouth())*ae);return R.x>=we&&R.x=Se&&R.y{this._options.tiles=R}),this}setUrl(R){return this.setSourceProperty(()=>{this.url=R,this._options.url=R}),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}serialize(){return t.e({},this._options)}loadTile(R){return t._(this,void 0,void 0,function*(){let ae=R.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),we={request:this.map._requestManager.transformRequest(ae,"Tile"),uid:R.uid,tileID:R.tileID,zoom:R.tileID.overscaledZ,tileSize:this.tileSize*R.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};we.request.collectResourceTiming=this._collectResourceTiming;let Se="RT";if(R.actor&&R.state!=="expired"){if(R.state==="loading")return new Promise((Oe,pt)=>{R.reloadPromise={resolve:Oe,reject:pt}})}else R.actor=this.dispatcher.getActor(),Se="LT";R.abortController=new AbortController;try{let Oe=yield R.actor.sendAsync({type:Se,data:we},R.abortController);if(delete R.abortController,R.aborted)return;this._afterTileLoadWorkerResponse(R,Oe)}catch(Oe){if(delete R.abortController,R.aborted)return;if(Oe&&Oe.status!==404)throw Oe;this._afterTileLoadWorkerResponse(R,null)}})}_afterTileLoadWorkerResponse(R,ae){if(ae&&ae.resourceTiming&&(R.resourceTiming=ae.resourceTiming),ae&&this.map._refreshExpiredTiles&&R.setExpiryData(ae),R.loadVectorData(ae,this.map.painter),R.reloadPromise){let we=R.reloadPromise;R.reloadPromise=null,this.loadTile(R).then(we.resolve).catch(we.reject)}}abortTile(R){return t._(this,void 0,void 0,function*(){R.abortController&&(R.abortController.abort(),delete R.abortController),R.actor&&(yield R.actor.sendAsync({type:"AT",data:{uid:R.uid,type:this.type,source:this.id}}))})}unloadTile(R){return t._(this,void 0,void 0,function*(){R.unloadVectorData(),R.actor&&(yield R.actor.sendAsync({type:"RMT",data:{uid:R.uid,type:this.type,source:this.id}}))})}hasTransition(){return!1}}class Ae extends t.E{constructor(R,ae,we,Se){super(),this.id=R,this.dispatcher=we,this.setEventedParent(Se),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=t.e({type:"raster"},ae),t.e(this,t.M(ae,["url","scheme","tileSize"]))}load(){return t._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new t.k("dataloading",{dataType:"source"})),this._tileJSONRequest=new AbortController;try{let R=yield ee(this._options,this.map._requestManager,this._tileJSONRequest);this._tileJSONRequest=null,this._loaded=!0,R&&(t.e(this,R),R.bounds&&(this.tileBounds=new ce(R.bounds,this.minzoom,this.maxzoom)),this.fire(new t.k("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new t.k("data",{dataType:"source",sourceDataType:"content"})))}catch(R){this._tileJSONRequest=null,this.fire(new t.j(R))}})}loaded(){return this._loaded}onAdd(R){this.map=R,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}setSourceProperty(R){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null),R(),this.load()}setTiles(R){return this.setSourceProperty(()=>{this._options.tiles=R}),this}setUrl(R){return this.setSourceProperty(()=>{this.url=R,this._options.url=R}),this}serialize(){return t.e({},this._options)}hasTile(R){return!this.tileBounds||this.tileBounds.contains(R.canonical)}loadTile(R){return t._(this,void 0,void 0,function*(){let ae=R.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);R.abortController=new AbortController;try{let we=yield l.getImage(this.map._requestManager.transformRequest(ae,"Tile"),R.abortController,this.map._refreshExpiredTiles);if(delete R.abortController,R.aborted)return void(R.state="unloaded");if(we&&we.data){this.map._refreshExpiredTiles&&we.cacheControl&&we.expires&&R.setExpiryData({cacheControl:we.cacheControl,expires:we.expires});let Se=this.map.painter.context,Oe=Se.gl,pt=we.data;R.texture=this.map.painter.getTileTexture(pt.width),R.texture?R.texture.update(pt,{useMipmap:!0}):(R.texture=new u(Se,pt,Oe.RGBA,{useMipmap:!0}),R.texture.bind(Oe.LINEAR,Oe.CLAMP_TO_EDGE,Oe.LINEAR_MIPMAP_NEAREST)),R.state="loaded"}}catch(we){if(delete R.abortController,R.aborted)R.state="unloaded";else if(we)throw R.state="errored",we}})}abortTile(R){return t._(this,void 0,void 0,function*(){R.abortController&&(R.abortController.abort(),delete R.abortController)})}unloadTile(R){return t._(this,void 0,void 0,function*(){R.texture&&this.map.painter.saveTileTexture(R.texture)})}hasTransition(){return!1}}class ze extends Ae{constructor(R,ae,we,Se){super(R,ae,we,Se),this.type="raster-dem",this.maxzoom=22,this._options=t.e({type:"raster-dem"},ae),this.encoding=ae.encoding||"mapbox",this.redFactor=ae.redFactor,this.greenFactor=ae.greenFactor,this.blueFactor=ae.blueFactor,this.baseShift=ae.baseShift}loadTile(R){return t._(this,void 0,void 0,function*(){let ae=R.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),we=this.map._requestManager.transformRequest(ae,"Tile");R.neighboringTiles=this._getNeighboringTiles(R.tileID),R.abortController=new AbortController;try{let Se=yield l.getImage(we,R.abortController,this.map._refreshExpiredTiles);if(delete R.abortController,R.aborted)return void(R.state="unloaded");if(Se&&Se.data){let Oe=Se.data;this.map._refreshExpiredTiles&&Se.cacheControl&&Se.expires&&R.setExpiryData({cacheControl:Se.cacheControl,expires:Se.expires});let pt=t.b(Oe)&&t.U()?Oe:yield this.readImageNow(Oe),At={type:this.type,uid:R.uid,source:this.id,rawImageData:pt,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};if(!R.actor||R.state==="expired"){R.actor=this.dispatcher.getActor();let Bt=yield R.actor.sendAsync({type:"LDT",data:At});R.dem=Bt,R.needsHillshadePrepare=!0,R.needsTerrainPrepare=!0,R.state="loaded"}}}catch(Se){if(delete R.abortController,R.aborted)R.state="unloaded";else if(Se)throw R.state="errored",Se}})}readImageNow(R){return t._(this,void 0,void 0,function*(){if(typeof VideoFrame<"u"&&t.V()){let ae=R.width+2,we=R.height+2;try{return new t.R({width:ae,height:we},yield t.W(R,-1,-1,ae,we))}catch{}}return i.getImageData(R,1)})}_getNeighboringTiles(R){let ae=R.canonical,we=Math.pow(2,ae.z),Se=(ae.x-1+we)%we,Oe=ae.x===0?R.wrap-1:R.wrap,pt=(ae.x+1+we)%we,At=ae.x+1===we?R.wrap+1:R.wrap,Bt={};return Bt[new t.S(R.overscaledZ,Oe,ae.z,Se,ae.y).key]={backfilled:!1},Bt[new t.S(R.overscaledZ,At,ae.z,pt,ae.y).key]={backfilled:!1},ae.y>0&&(Bt[new t.S(R.overscaledZ,Oe,ae.z,Se,ae.y-1).key]={backfilled:!1},Bt[new t.S(R.overscaledZ,R.wrap,ae.z,ae.x,ae.y-1).key]={backfilled:!1},Bt[new t.S(R.overscaledZ,At,ae.z,pt,ae.y-1).key]={backfilled:!1}),ae.y+10&&t.e(Oe,{resourceTiming:Se}),this.fire(new t.k("data",Object.assign(Object.assign({},Oe),{sourceDataType:"metadata"}))),this.fire(new t.k("data",Object.assign(Object.assign({},Oe),{sourceDataType:"content"})))}catch(we){if(this._pendingLoads--,this._removed)return void this.fire(new t.k("dataabort",{dataType:"source"}));this.fire(new t.j(we))}})}loaded(){return this._pendingLoads===0}loadTile(R){return t._(this,void 0,void 0,function*(){let ae=R.actor?"RT":"LT";R.actor=this.actor;let we={type:this.type,uid:R.uid,tileID:R.tileID,zoom:R.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};R.abortController=new AbortController;let Se=yield this.actor.sendAsync({type:ae,data:we},R.abortController);delete R.abortController,R.unloadVectorData(),R.aborted||R.loadVectorData(Se,this.map.painter,ae==="RT")})}abortTile(R){return t._(this,void 0,void 0,function*(){R.abortController&&(R.abortController.abort(),delete R.abortController),R.aborted=!0})}unloadTile(R){return t._(this,void 0,void 0,function*(){R.unloadVectorData(),yield this.actor.sendAsync({type:"RMT",data:{uid:R.uid,type:this.type,source:this.id}})})}onRemove(){this._removed=!0,this.actor.sendAsync({type:"RS",data:{type:this.type,source:this.id}})}serialize(){return t.e({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}}var Xe=t.Y([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class it extends t.E{constructor(R,ae,we,Se){super(),this.id=R,this.dispatcher=we,this.coordinates=ae.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(Se),this.options=ae}load(R){return t._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new t.k("dataloading",{dataType:"source"})),this.url=this.options.url,this._request=new AbortController;try{let ae=yield l.getImage(this.map._requestManager.transformRequest(this.url,"Image"),this._request);this._request=null,this._loaded=!0,ae&&ae.data&&(this.image=ae.data,R&&(this.coordinates=R),this._finishLoading())}catch(ae){this._request=null,this._loaded=!0,this.fire(new t.j(ae))}})}loaded(){return this._loaded}updateImage(R){return R.url?(this._request&&(this._request.abort(),this._request=null),this.options.url=R.url,this.load(R.coordinates).finally(()=>{this.texture=null}),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new t.k("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(R){this.map=R,this.load()}onRemove(){this._request&&(this._request.abort(),this._request=null)}setCoordinates(R){this.coordinates=R;let ae=R.map(t.Z.fromLngLat);this.tileID=function(Se){let Oe=1/0,pt=1/0,At=-1/0,Bt=-1/0;for(let Yr of Se)Oe=Math.min(Oe,Yr.x),pt=Math.min(pt,Yr.y),At=Math.max(At,Yr.x),Bt=Math.max(Bt,Yr.y);let $t=Math.max(At-Oe,Bt-pt),br=Math.max(0,Math.floor(-Math.log($t)/Math.LN2)),Ar=Math.pow(2,br);return new t.a1(br,Math.floor((Oe+At)/2*Ar),Math.floor((pt+Bt)/2*Ar))}(ae),this.minzoom=this.maxzoom=this.tileID.z;let we=ae.map(Se=>this.tileID.getTilePoint(Se)._round());return this._boundsArray=new t.$,this._boundsArray.emplaceBack(we[0].x,we[0].y,0,0),this._boundsArray.emplaceBack(we[1].x,we[1].y,t.X,0),this._boundsArray.emplaceBack(we[3].x,we[3].y,0,t.X),this._boundsArray.emplaceBack(we[2].x,we[2].y,t.X,t.X),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new t.k("data",{dataType:"source",sourceDataType:"content"})),this}prepare(){if(Object.keys(this.tiles).length===0||!this.image)return;let R=this.map.painter.context,ae=R.gl;this.boundsBuffer||(this.boundsBuffer=R.createVertexBuffer(this._boundsArray,Xe.members)),this.boundsSegments||(this.boundsSegments=t.a0.simpleSegment(0,0,4,2)),this.texture||(this.texture=new u(R,this.image,ae.RGBA),this.texture.bind(ae.LINEAR,ae.CLAMP_TO_EDGE));let we=!1;for(let Se in this.tiles){let Oe=this.tiles[Se];Oe.state!=="loaded"&&(Oe.state="loaded",Oe.texture=this.texture,we=!0)}we&&this.fire(new t.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}loadTile(R){return t._(this,void 0,void 0,function*(){this.tileID&&this.tileID.equals(R.tileID.canonical)?(this.tiles[String(R.tileID.wrap)]=R,R.buckets={}):R.state="errored"})}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}class ot extends it{constructor(R,ae,we,Se){super(R,ae,we,Se),this.roundZoom=!0,this.type="video",this.options=ae}load(){return t._(this,void 0,void 0,function*(){this._loaded=!1;let R=this.options;this.urls=[];for(let ae of R.urls)this.urls.push(this.map._requestManager.transformRequest(ae,"Source").url);try{let ae=yield t.a3(this.urls);if(this._loaded=!0,!ae)return;this.video=ae,this.video.loop=!0,this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading()}catch(ae){this.fire(new t.j(ae))}})}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(R){if(this.video){let ae=this.video.seekable;Rae.end(0)?this.fire(new t.j(new t.a2(`sources.${this.id}`,null,`Playback for this video can be set only between the ${ae.start(0)} and ${ae.end(0)}-second mark.`))):this.video.currentTime=R}}getVideo(){return this.video}onAdd(R){this.map||(this.map=R,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(Object.keys(this.tiles).length===0||this.video.readyState<2)return;let R=this.map.painter.context,ae=R.gl;this.boundsBuffer||(this.boundsBuffer=R.createVertexBuffer(this._boundsArray,Xe.members)),this.boundsSegments||(this.boundsSegments=t.a0.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(ae.LINEAR,ae.CLAMP_TO_EDGE),ae.texSubImage2D(ae.TEXTURE_2D,0,0,0,ae.RGBA,ae.UNSIGNED_BYTE,this.video)):(this.texture=new u(R,this.video,ae.RGBA),this.texture.bind(ae.LINEAR,ae.CLAMP_TO_EDGE));let we=!1;for(let Se in this.tiles){let Oe=this.tiles[Se];Oe.state!=="loaded"&&(Oe.state="loaded",Oe.texture=this.texture,we=!0)}we&&this.fire(new t.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}}class tt extends it{constructor(R,ae,we,Se){super(R,ae,we,Se),ae.coordinates?Array.isArray(ae.coordinates)&&ae.coordinates.length===4&&!ae.coordinates.some(Oe=>!Array.isArray(Oe)||Oe.length!==2||Oe.some(pt=>typeof pt!="number"))||this.fire(new t.j(new t.a2(`sources.${R}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new t.j(new t.a2(`sources.${R}`,null,'missing required property "coordinates"'))),ae.animate&&typeof ae.animate!="boolean"&&this.fire(new t.j(new t.a2(`sources.${R}`,null,'optional "animate" property must be a boolean value'))),ae.canvas?typeof ae.canvas=="string"||ae.canvas instanceof HTMLCanvasElement||this.fire(new t.j(new t.a2(`sources.${R}`,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new t.j(new t.a2(`sources.${R}`,null,'missing required property "canvas"'))),this.options=ae,this.animate=ae.animate===void 0||ae.animate}load(){return t._(this,void 0,void 0,function*(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof HTMLCanvasElement?this.options.canvas:document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new t.j(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())})}getCanvas(){return this.canvas}onAdd(R){this.map=R,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let R=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,R=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,R=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;let ae=this.map.painter.context,we=ae.gl;this.boundsBuffer||(this.boundsBuffer=ae.createVertexBuffer(this._boundsArray,Xe.members)),this.boundsSegments||(this.boundsSegments=t.a0.simpleSegment(0,0,4,2)),this.texture?(R||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new u(ae,this.canvas,we.RGBA,{premultiply:!0});let Se=!1;for(let Oe in this.tiles){let pt=this.tiles[Oe];pt.state!=="loaded"&&(pt.state="loaded",pt.texture=this.texture,Se=!0)}Se&&this.fire(new t.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(let R of[this.canvas.width,this.canvas.height])if(isNaN(R)||R<=0)return!0;return!1}}let lt={},Ee=Ne=>{switch(Ne){case"geojson":return Re;case"image":return it;case"raster":return Ae;case"raster-dem":return ze;case"vector":return be;case"video":return ot;case"canvas":return tt}return lt[Ne]},_e="RTLPluginLoaded";class fe extends t.E{constructor(){super(...arguments),this.status="unavailable",this.url=null,this.dispatcher=X()}_syncState(R){return this.status=R,this.dispatcher.broadcast("SRPS",{pluginStatus:R,pluginURL:this.url}).catch(ae=>{throw this.status="error",ae})}getRTLTextPluginStatus(){return this.status}clearRTLTextPlugin(){this.status="unavailable",this.url=null}setRTLTextPlugin(R){return t._(this,arguments,void 0,function*(ae,we=!1){if(this.url)throw new Error("setRTLTextPlugin cannot be called multiple times.");if(this.url=i.resolveURL(ae),!this.url)throw new Error(`requested url ${ae} is invalid`);if(this.status==="unavailable"){if(!we)return this._requestImport();this.status="deferred",this._syncState(this.status)}else if(this.status==="requested")return this._requestImport()})}_requestImport(){return t._(this,void 0,void 0,function*(){yield this._syncState("loading"),this.status="loaded",this.fire(new t.k(_e))})}lazyLoad(){this.status==="unavailable"?this.status="requested":this.status==="deferred"&&this._requestImport()}}let Fe=null;function rt(){return Fe||(Fe=new fe),Fe}class st{constructor(R,ae){this.timeAdded=0,this.fadeEndTime=0,this.tileID=R,this.uid=t.a4(),this.uses=0,this.tileSize=ae,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.rtt=[],this.rttCoords={},this.expiredRequestCount=0,this.state="loading"}registerFadeDuration(R){let ae=R+this.timeAdded;aeOe.getLayer($t)).filter(Boolean);if(Bt.length!==0){At.layers=Bt,At.stateDependentLayerIds&&(At.stateDependentLayers=At.stateDependentLayerIds.map($t=>Bt.filter(br=>br.id===$t)[0]));for(let $t of Bt)pt[$t.id]=At}}return pt}(R.buckets,ae.style),this.hasSymbolBuckets=!1;for(let Se in this.buckets){let Oe=this.buckets[Se];if(Oe instanceof t.a6){if(this.hasSymbolBuckets=!0,!we)break;Oe.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(let Se in this.buckets){let Oe=this.buckets[Se];if(Oe instanceof t.a6&&Oe.hasRTLText){this.hasRTLText=!0,rt().lazyLoad();break}}this.queryPadding=0;for(let Se in this.buckets){let Oe=this.buckets[Se];this.queryPadding=Math.max(this.queryPadding,ae.style.getLayer(Se).queryRadius(Oe))}R.imageAtlas&&(this.imageAtlas=R.imageAtlas),R.glyphAtlasImage&&(this.glyphAtlasImage=R.glyphAtlasImage)}else this.collisionBoxArray=new t.a5}unloadVectorData(){for(let R in this.buckets)this.buckets[R].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"}getBucket(R){return this.buckets[R.id]}upload(R){for(let we in this.buckets){let Se=this.buckets[we];Se.uploadPending()&&Se.upload(R)}let ae=R.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new u(R,this.imageAtlas.image,ae.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new u(R,this.glyphAtlasImage,ae.ALPHA),this.glyphAtlasImage=null)}prepare(R){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(R,this.imageAtlasTexture)}queryRenderedFeatures(R,ae,we,Se,Oe,pt,At,Bt,$t,br){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:Se,cameraQueryGeometry:Oe,scale:pt,tileSize:this.tileSize,pixelPosMatrix:br,transform:Bt,params:At,queryPadding:this.queryPadding*$t},R,ae,we):{}}querySourceFeatures(R,ae){let we=this.latestFeatureIndex;if(!we||!we.rawTileData)return;let Se=we.loadVTLayers(),Oe=ae&&ae.sourceLayer?ae.sourceLayer:"",pt=Se._geojsonTileLayer||Se[Oe];if(!pt)return;let At=t.a7(ae&&ae.filter),{z:Bt,x:$t,y:br}=this.tileID.canonical,Ar={z:Bt,x:$t,y:br};for(let Yr=0;Yrwe)Se=!1;else if(ae)if(this.expirationTime{this.remove(R,Oe)},we)),this.data[Se].push(Oe),this.order.push(Se),this.order.length>this.max){let pt=this._getAndRemoveByKey(this.order[0]);pt&&this.onRemove(pt)}return this}has(R){return R.wrapped().key in this.data}getAndRemove(R){return this.has(R)?this._getAndRemoveByKey(R.wrapped().key):null}_getAndRemoveByKey(R){let ae=this.data[R].shift();return ae.timeout&&clearTimeout(ae.timeout),this.data[R].length===0&&delete this.data[R],this.order.splice(this.order.indexOf(R),1),ae.value}getByKey(R){let ae=this.data[R];return ae?ae[0].value:null}get(R){return this.has(R)?this.data[R.wrapped().key][0].value:null}remove(R,ae){if(!this.has(R))return this;let we=R.wrapped().key,Se=ae===void 0?0:this.data[we].indexOf(ae),Oe=this.data[we][Se];return this.data[we].splice(Se,1),Oe.timeout&&clearTimeout(Oe.timeout),this.data[we].length===0&&delete this.data[we],this.onRemove(Oe.value),this.order.splice(this.order.indexOf(we),1),this}setMaxSize(R){for(this.max=R;this.order.length>this.max;){let ae=this._getAndRemoveByKey(this.order[0]);ae&&this.onRemove(ae)}return this}filter(R){let ae=[];for(let we in this.data)for(let Se of this.data[we])R(Se.value)||ae.push(Se);for(let we of ae)this.remove(we.value.tileID,we)}}class Lt{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(R,ae,we){let Se=String(ae);if(this.stateChanges[R]=this.stateChanges[R]||{},this.stateChanges[R][Se]=this.stateChanges[R][Se]||{},t.e(this.stateChanges[R][Se],we),this.deletedStates[R]===null){this.deletedStates[R]={};for(let Oe in this.state[R])Oe!==Se&&(this.deletedStates[R][Oe]=null)}else if(this.deletedStates[R]&&this.deletedStates[R][Se]===null){this.deletedStates[R][Se]={};for(let Oe in this.state[R][Se])we[Oe]||(this.deletedStates[R][Se][Oe]=null)}else for(let Oe in we)this.deletedStates[R]&&this.deletedStates[R][Se]&&this.deletedStates[R][Se][Oe]===null&&delete this.deletedStates[R][Se][Oe]}removeFeatureState(R,ae,we){if(this.deletedStates[R]===null)return;let Se=String(ae);if(this.deletedStates[R]=this.deletedStates[R]||{},we&&ae!==void 0)this.deletedStates[R][Se]!==null&&(this.deletedStates[R][Se]=this.deletedStates[R][Se]||{},this.deletedStates[R][Se][we]=null);else if(ae!==void 0)if(this.stateChanges[R]&&this.stateChanges[R][Se])for(we in this.deletedStates[R][Se]={},this.stateChanges[R][Se])this.deletedStates[R][Se][we]=null;else this.deletedStates[R][Se]=null;else this.deletedStates[R]=null}getState(R,ae){let we=String(ae),Se=t.e({},(this.state[R]||{})[we],(this.stateChanges[R]||{})[we]);if(this.deletedStates[R]===null)return{};if(this.deletedStates[R]){let Oe=this.deletedStates[R][ae];if(Oe===null)return{};for(let pt in Oe)delete Se[pt]}return Se}initializeTileState(R,ae){R.setFeatureState(this.state,ae)}coalesceChanges(R,ae){let we={};for(let Se in this.stateChanges){this.state[Se]=this.state[Se]||{};let Oe={};for(let pt in this.stateChanges[Se])this.state[Se][pt]||(this.state[Se][pt]={}),t.e(this.state[Se][pt],this.stateChanges[Se][pt]),Oe[pt]=this.state[Se][pt];we[Se]=Oe}for(let Se in this.deletedStates){this.state[Se]=this.state[Se]||{};let Oe={};if(this.deletedStates[Se]===null)for(let pt in this.state[Se])Oe[pt]={},this.state[Se][pt]={};else for(let pt in this.deletedStates[Se]){if(this.deletedStates[Se][pt]===null)this.state[Se][pt]={};else for(let At of Object.keys(this.deletedStates[Se][pt]))delete this.state[Se][pt][At];Oe[pt]=this.state[Se][pt]}we[Se]=we[Se]||{},t.e(we[Se],Oe)}if(this.stateChanges={},this.deletedStates={},Object.keys(we).length!==0)for(let Se in R)R[Se].setFeatureState(we,ae)}}class kt extends t.E{constructor(R,ae,we){super(),this.id=R,this.dispatcher=we,this.on("data",Se=>this._dataHandler(Se)),this.on("dataloading",()=>{this._sourceErrored=!1}),this.on("error",()=>{this._sourceErrored=this._source.loaded()}),this._source=((Se,Oe,pt,At)=>{let Bt=new(Ee(Oe.type))(Se,Oe,pt,At);if(Bt.id!==Se)throw new Error(`Expected Source id to be ${Se} instead of ${Bt.id}`);return Bt})(R,ae,we,this),this._tiles={},this._cache=new Qe(0,Se=>this._unloadTile(Se)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new Lt,this._didEmitContent=!1,this._updated=!1}onAdd(R){this.map=R,this._maxTileCacheSize=R?R._maxTileCacheSize:null,this._maxTileCacheZoomLevels=R?R._maxTileCacheZoomLevels:null,this._source&&this._source.onAdd&&this._source.onAdd(R)}onRemove(R){this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(R)}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;if(!(this.used===void 0&&this.usedForTerrain===void 0||this.used||this.usedForTerrain))return!0;if(!this._updated)return!1;for(let R in this._tiles){let ae=this._tiles[R];if(ae.state!=="loaded"&&ae.state!=="errored")return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;let R=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,R&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(R,ae,we){return t._(this,void 0,void 0,function*(){try{yield this._source.loadTile(R),this._tileLoaded(R,ae,we)}catch(Se){R.state="errored",Se.status!==404?this._source.fire(new t.j(Se,{tile:R})):this.update(this.transform,this.terrain)}})}_unloadTile(R){this._source.unloadTile&&this._source.unloadTile(R)}_abortTile(R){this._source.abortTile&&this._source.abortTile(R),this._source.fire(new t.k("dataabort",{tile:R,coord:R.tileID,dataType:"source"}))}serialize(){return this._source.serialize()}prepare(R){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(let ae in this._tiles){let we=this._tiles[ae];we.upload(R),we.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map(R=>R.tileID).sort(Vt).map(R=>R.key)}getRenderableIds(R){let ae=[];for(let we in this._tiles)this._isIdRenderable(we,R)&&ae.push(this._tiles[we]);return R?ae.sort((we,Se)=>{let Oe=we.tileID,pt=Se.tileID,At=new t.P(Oe.canonical.x,Oe.canonical.y)._rotate(this.transform.angle),Bt=new t.P(pt.canonical.x,pt.canonical.y)._rotate(this.transform.angle);return Oe.overscaledZ-pt.overscaledZ||Bt.y-At.y||Bt.x-At.x}).map(we=>we.tileID.key):ae.map(we=>we.tileID).sort(Vt).map(we=>we.key)}hasRenderableParent(R){let ae=this.findLoadedParent(R,0);return!!ae&&this._isIdRenderable(ae.tileID.key)}_isIdRenderable(R,ae){return this._tiles[R]&&this._tiles[R].hasData()&&!this._coveredTiles[R]&&(ae||!this._tiles[R].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(let R in this._tiles)this._tiles[R].state!=="errored"&&this._reloadTile(R,"reloading")}}_reloadTile(R,ae){return t._(this,void 0,void 0,function*(){let we=this._tiles[R];we&&(we.state!=="loading"&&(we.state=ae),yield this._loadTile(we,R,ae))})}_tileLoaded(R,ae,we){R.timeAdded=i.now(),we==="expired"&&(R.refreshedUponExpiration=!0),this._setTileReloadTimer(ae,R),this.getSource().type==="raster-dem"&&R.dem&&this._backfillDEM(R),this._state.initializeTileState(R,this.map?this.map.painter:null),R.aborted||this._source.fire(new t.k("data",{dataType:"source",tile:R,coord:R.tileID}))}_backfillDEM(R){let ae=this.getRenderableIds();for(let Se=0;Se1||(Math.abs(pt)>1&&(Math.abs(pt+Bt)===1?pt+=Bt:Math.abs(pt-Bt)===1&&(pt-=Bt)),Oe.dem&&Se.dem&&(Se.dem.backfillBorder(Oe.dem,pt,At),Se.neighboringTiles&&Se.neighboringTiles[$t]&&(Se.neighboringTiles[$t].backfilled=!0)))}}getTile(R){return this.getTileByID(R.key)}getTileByID(R){return this._tiles[R]}_retainLoadedChildren(R,ae,we,Se){for(let Oe in this._tiles){let pt=this._tiles[Oe];if(Se[Oe]||!pt.hasData()||pt.tileID.overscaledZ<=ae||pt.tileID.overscaledZ>we)continue;let At=pt.tileID;for(;pt&&pt.tileID.overscaledZ>ae+1;){let $t=pt.tileID.scaledTo(pt.tileID.overscaledZ-1);pt=this._tiles[$t.key],pt&&pt.hasData()&&(At=$t)}let Bt=At;for(;Bt.overscaledZ>ae;)if(Bt=Bt.scaledTo(Bt.overscaledZ-1),R[Bt.key]){Se[At.key]=At;break}}}findLoadedParent(R,ae){if(R.key in this._loadedParentTiles){let we=this._loadedParentTiles[R.key];return we&&we.tileID.overscaledZ>=ae?we:null}for(let we=R.overscaledZ-1;we>=ae;we--){let Se=R.scaledTo(we),Oe=this._getLoadedTile(Se);if(Oe)return Oe}}findLoadedSibling(R){return this._getLoadedTile(R)}_getLoadedTile(R){let ae=this._tiles[R.key];return ae&&ae.hasData()?ae:this._cache.getByKey(R.wrapped().key)}updateCacheSize(R){let ae=Math.ceil(R.width/this._source.tileSize)+1,we=Math.ceil(R.height/this._source.tileSize)+1,Se=Math.floor(ae*we*(this._maxTileCacheZoomLevels===null?t.a.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels)),Oe=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,Se):Se;this._cache.setMaxSize(Oe)}handleWrapJump(R){let ae=Math.round((R-(this._prevLng===void 0?R:this._prevLng))/360);if(this._prevLng=R,ae){let we={};for(let Se in this._tiles){let Oe=this._tiles[Se];Oe.tileID=Oe.tileID.unwrapTo(Oe.tileID.wrap+ae),we[Oe.tileID.key]=Oe}this._tiles=we;for(let Se in this._timers)clearTimeout(this._timers[Se]),delete this._timers[Se];for(let Se in this._tiles)this._setTileReloadTimer(Se,this._tiles[Se])}}_updateCoveredAndRetainedTiles(R,ae,we,Se,Oe,pt){let At={},Bt={},$t=Object.keys(R),br=i.now();for(let Ar of $t){let Yr=R[Ar],sa=this._tiles[Ar];if(!sa||sa.fadeEndTime!==0&&sa.fadeEndTime<=br)continue;let He=this.findLoadedParent(Yr,ae),Je=this.findLoadedSibling(Yr),ut=He||Je||null;ut&&(this._addTile(ut.tileID),At[ut.tileID.key]=ut.tileID),Bt[Ar]=Yr}this._retainLoadedChildren(Bt,Se,we,R);for(let Ar in At)R[Ar]||(this._coveredTiles[Ar]=!0,R[Ar]=At[Ar]);if(pt){let Ar={},Yr={};for(let sa of Oe)this._tiles[sa.key].hasData()?Ar[sa.key]=sa:Yr[sa.key]=sa;for(let sa in Yr){let He=Yr[sa].children(this._source.maxzoom);this._tiles[He[0].key]&&this._tiles[He[1].key]&&this._tiles[He[2].key]&&this._tiles[He[3].key]&&(Ar[He[0].key]=R[He[0].key]=He[0],Ar[He[1].key]=R[He[1].key]=He[1],Ar[He[2].key]=R[He[2].key]=He[2],Ar[He[3].key]=R[He[3].key]=He[3],delete Yr[sa])}for(let sa in Yr){let He=Yr[sa],Je=this.findLoadedParent(He,this._source.minzoom),ut=this.findLoadedSibling(He),dt=Je||ut||null;if(dt){Ar[dt.tileID.key]=R[dt.tileID.key]=dt.tileID;for(let Ct in Ar)Ar[Ct].isChildOf(dt.tileID)&&delete Ar[Ct]}}for(let sa in this._tiles)Ar[sa]||(this._coveredTiles[sa]=!0)}}update(R,ae){if(!this._sourceLoaded||this._paused)return;let we;this.transform=R,this.terrain=ae,this.updateCacheSize(R),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?we=R.getVisibleUnwrappedCoordinates(this._source.tileID).map(br=>new t.S(br.canonical.z,br.wrap,br.canonical.z,br.canonical.x,br.canonical.y)):(we=R.coveringTiles({tileSize:this.usedForTerrain?this.tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:!this.usedForTerrain&&this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled,terrain:ae}),this._source.hasTile&&(we=we.filter(br=>this._source.hasTile(br)))):we=[];let Se=R.coveringZoomLevel(this._source),Oe=Math.max(Se-kt.maxOverzooming,this._source.minzoom),pt=Math.max(Se+kt.maxUnderzooming,this._source.minzoom);if(this.usedForTerrain){let br={};for(let Ar of we)if(Ar.canonical.z>this._source.minzoom){let Yr=Ar.scaledTo(Ar.canonical.z-1);br[Yr.key]=Yr;let sa=Ar.scaledTo(Math.max(this._source.minzoom,Math.min(Ar.canonical.z,5)));br[sa.key]=sa}we=we.concat(Object.values(br))}let At=we.length===0&&!this._updated&&this._didEmitContent;this._updated=!0,At&&this.fire(new t.k("data",{sourceDataType:"idle",dataType:"source",sourceId:this.id}));let Bt=this._updateRetainedTiles(we,Se);Zt(this._source.type)&&this._updateCoveredAndRetainedTiles(Bt,Oe,pt,Se,we,ae);for(let br in Bt)this._tiles[br].clearFadeHold();let $t=t.ab(this._tiles,Bt);for(let br of $t){let Ar=this._tiles[br];Ar.hasSymbolBuckets&&!Ar.holdingForFade()?Ar.setHoldDuration(this.map._fadeDuration):Ar.hasSymbolBuckets&&!Ar.symbolFadeFinished()||this._removeTile(br)}this._updateLoadedParentTileCache(),this._updateLoadedSiblingTileCache()}releaseSymbolFadeTiles(){for(let R in this._tiles)this._tiles[R].holdingForFade()&&this._removeTile(R)}_updateRetainedTiles(R,ae){var we;let Se={},Oe={},pt=Math.max(ae-kt.maxOverzooming,this._source.minzoom),At=Math.max(ae+kt.maxUnderzooming,this._source.minzoom),Bt={};for(let $t of R){let br=this._addTile($t);Se[$t.key]=$t,br.hasData()||aethis._source.maxzoom){let Yr=$t.children(this._source.maxzoom)[0],sa=this.getTile(Yr);if(sa&&sa.hasData()){Se[Yr.key]=Yr;continue}}else{let Yr=$t.children(this._source.maxzoom);if(Se[Yr[0].key]&&Se[Yr[1].key]&&Se[Yr[2].key]&&Se[Yr[3].key])continue}let Ar=br.wasRequested();for(let Yr=$t.overscaledZ-1;Yr>=pt;--Yr){let sa=$t.scaledTo(Yr);if(Oe[sa.key])break;if(Oe[sa.key]=!0,br=this.getTile(sa),!br&&Ar&&(br=this._addTile(sa)),br){let He=br.hasData();if((He||!(!((we=this.map)===null||we===void 0)&&we.cancelPendingTileRequestsWhileZooming)||Ar)&&(Se[sa.key]=sa),Ar=br.wasRequested(),He)break}}}return Se}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(let R in this._tiles){let ae=[],we,Se=this._tiles[R].tileID;for(;Se.overscaledZ>0;){if(Se.key in this._loadedParentTiles){we=this._loadedParentTiles[Se.key];break}ae.push(Se.key);let Oe=Se.scaledTo(Se.overscaledZ-1);if(we=this._getLoadedTile(Oe),we)break;Se=Oe}for(let Oe of ae)this._loadedParentTiles[Oe]=we}}_updateLoadedSiblingTileCache(){this._loadedSiblingTiles={};for(let R in this._tiles){let ae=this._tiles[R].tileID,we=this._getLoadedTile(ae);this._loadedSiblingTiles[ae.key]=we}}_addTile(R){let ae=this._tiles[R.key];if(ae)return ae;ae=this._cache.getAndRemove(R),ae&&(this._setTileReloadTimer(R.key,ae),ae.tileID=R,this._state.initializeTileState(ae,this.map?this.map.painter:null),this._cacheTimers[R.key]&&(clearTimeout(this._cacheTimers[R.key]),delete this._cacheTimers[R.key],this._setTileReloadTimer(R.key,ae)));let we=ae;return ae||(ae=new st(R,this._source.tileSize*R.overscaleFactor()),this._loadTile(ae,R.key,ae.state)),ae.uses++,this._tiles[R.key]=ae,we||this._source.fire(new t.k("dataloading",{tile:ae,coord:ae.tileID,dataType:"source"})),ae}_setTileReloadTimer(R,ae){R in this._timers&&(clearTimeout(this._timers[R]),delete this._timers[R]);let we=ae.getExpiryTimeout();we&&(this._timers[R]=setTimeout(()=>{this._reloadTile(R,"expired"),delete this._timers[R]},we))}_removeTile(R){let ae=this._tiles[R];ae&&(ae.uses--,delete this._tiles[R],this._timers[R]&&(clearTimeout(this._timers[R]),delete this._timers[R]),ae.uses>0||(ae.hasData()&&ae.state!=="reloading"?this._cache.add(ae.tileID,ae,ae.getExpiryTimeout()):(ae.aborted=!0,this._abortTile(ae),this._unloadTile(ae))))}_dataHandler(R){let ae=R.sourceDataType;R.dataType==="source"&&ae==="metadata"&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&R.dataType==="source"&&ae==="content"&&(this.reload(),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0)}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(let R in this._tiles)this._removeTile(R);this._cache.reset()}tilesIn(R,ae,we){let Se=[],Oe=this.transform;if(!Oe)return Se;let pt=we?Oe.getCameraQueryGeometry(R):R,At=R.map(He=>Oe.pointCoordinate(He,this.terrain)),Bt=pt.map(He=>Oe.pointCoordinate(He,this.terrain)),$t=this.getIds(),br=1/0,Ar=1/0,Yr=-1/0,sa=-1/0;for(let He of Bt)br=Math.min(br,He.x),Ar=Math.min(Ar,He.y),Yr=Math.max(Yr,He.x),sa=Math.max(sa,He.y);for(let He=0;He<$t.length;He++){let Je=this._tiles[$t[He]];if(Je.holdingForFade())continue;let ut=Je.tileID,dt=Math.pow(2,Oe.zoom-Je.tileID.overscaledZ),Ct=ae*Je.queryPadding*t.X/Je.tileSize/dt,wt=[ut.getTilePoint(new t.Z(br,Ar)),ut.getTilePoint(new t.Z(Yr,sa))];if(wt[0].x-Ct=0&&wt[1].y+Ct>=0){let Dt=At.map(mr=>ut.getTilePoint(mr)),ur=Bt.map(mr=>ut.getTilePoint(mr));Se.push({tile:Je,tileID:ut,queryGeometry:Dt,cameraQueryGeometry:ur,scale:dt})}}return Se}getVisibleCoordinates(R){let ae=this.getRenderableIds(R).map(we=>this._tiles[we].tileID);for(let we of ae)we.posMatrix=this.transform.calculatePosMatrix(we.toUnwrapped());return ae}hasTransition(){if(this._source.hasTransition())return!0;if(Zt(this._source.type)){let R=i.now();for(let ae in this._tiles)if(this._tiles[ae].fadeEndTime>=R)return!0}return!1}setFeatureState(R,ae,we){this._state.updateState(R=R||"_geojsonTileLayer",ae,we)}removeFeatureState(R,ae,we){this._state.removeFeatureState(R=R||"_geojsonTileLayer",ae,we)}getFeatureState(R,ae){return this._state.getState(R=R||"_geojsonTileLayer",ae)}setDependencies(R,ae,we){let Se=this._tiles[R];Se&&Se.setDependencies(ae,we)}reloadTilesForDependencies(R,ae){for(let we in this._tiles)this._tiles[we].hasDependency(R,ae)&&this._reloadTile(we,"reloading");this._cache.filter(we=>!we.hasDependency(R,ae))}}function Vt(Ne,R){let ae=Math.abs(2*Ne.wrap)-+(Ne.wrap<0),we=Math.abs(2*R.wrap)-+(R.wrap<0);return Ne.overscaledZ-R.overscaledZ||we-ae||R.canonical.y-Ne.canonical.y||R.canonical.x-Ne.canonical.x}function Zt(Ne){return Ne==="raster"||Ne==="image"||Ne==="video"}kt.maxOverzooming=10,kt.maxUnderzooming=3;class Sr{constructor(R,ae){this.reset(R,ae)}reset(R,ae){this.points=R||[],this._distances=[0];for(let we=1;we0?(Se-pt)/At:0;return this.points[Oe].mult(1-Bt).add(this.points[ae].mult(Bt))}}function xr(Ne,R){let ae=!0;return Ne==="always"||Ne!=="never"&&R!=="never"||(ae=!1),ae}class jr{constructor(R,ae,we){let Se=this.boxCells=[],Oe=this.circleCells=[];this.xCellCount=Math.ceil(R/we),this.yCellCount=Math.ceil(ae/we);for(let pt=0;ptthis.width||Se<0||ae>this.height)return[];let Bt=[];if(R<=0&&ae<=0&&this.width<=we&&this.height<=Se){if(Oe)return[{key:null,x1:R,y1:ae,x2:we,y2:Se}];for(let $t=0;$t0}hitTestCircle(R,ae,we,Se,Oe){let pt=R-we,At=R+we,Bt=ae-we,$t=ae+we;if(At<0||pt>this.width||$t<0||Bt>this.height)return!1;let br=[];return this._forEachCell(pt,Bt,At,$t,this._queryCellCircle,br,{hitTest:!0,overlapMode:Se,circle:{x:R,y:ae,radius:we},seenUids:{box:{},circle:{}}},Oe),br.length>0}_queryCell(R,ae,we,Se,Oe,pt,At,Bt){let{seenUids:$t,hitTest:br,overlapMode:Ar}=At,Yr=this.boxCells[Oe];if(Yr!==null){let He=this.bboxes;for(let Je of Yr)if(!$t.box[Je]){$t.box[Je]=!0;let ut=4*Je,dt=this.boxKeys[Je];if(R<=He[ut+2]&&ae<=He[ut+3]&&we>=He[ut+0]&&Se>=He[ut+1]&&(!Bt||Bt(dt))&&(!br||!xr(Ar,dt.overlapMode))&&(pt.push({key:dt,x1:He[ut],y1:He[ut+1],x2:He[ut+2],y2:He[ut+3]}),br))return!0}}let sa=this.circleCells[Oe];if(sa!==null){let He=this.circles;for(let Je of sa)if(!$t.circle[Je]){$t.circle[Je]=!0;let ut=3*Je,dt=this.circleKeys[Je];if(this._circleAndRectCollide(He[ut],He[ut+1],He[ut+2],R,ae,we,Se)&&(!Bt||Bt(dt))&&(!br||!xr(Ar,dt.overlapMode))){let Ct=He[ut],wt=He[ut+1],Dt=He[ut+2];if(pt.push({key:dt,x1:Ct-Dt,y1:wt-Dt,x2:Ct+Dt,y2:wt+Dt}),br)return!0}}}return!1}_queryCellCircle(R,ae,we,Se,Oe,pt,At,Bt){let{circle:$t,seenUids:br,overlapMode:Ar}=At,Yr=this.boxCells[Oe];if(Yr!==null){let He=this.bboxes;for(let Je of Yr)if(!br.box[Je]){br.box[Je]=!0;let ut=4*Je,dt=this.boxKeys[Je];if(this._circleAndRectCollide($t.x,$t.y,$t.radius,He[ut+0],He[ut+1],He[ut+2],He[ut+3])&&(!Bt||Bt(dt))&&!xr(Ar,dt.overlapMode))return pt.push(!0),!0}}let sa=this.circleCells[Oe];if(sa!==null){let He=this.circles;for(let Je of sa)if(!br.circle[Je]){br.circle[Je]=!0;let ut=3*Je,dt=this.circleKeys[Je];if(this._circlesCollide(He[ut],He[ut+1],He[ut+2],$t.x,$t.y,$t.radius)&&(!Bt||Bt(dt))&&!xr(Ar,dt.overlapMode))return pt.push(!0),!0}}}_forEachCell(R,ae,we,Se,Oe,pt,At,Bt){let $t=this._convertToXCellCoord(R),br=this._convertToYCellCoord(ae),Ar=this._convertToXCellCoord(we),Yr=this._convertToYCellCoord(Se);for(let sa=$t;sa<=Ar;sa++)for(let He=br;He<=Yr;He++)if(Oe.call(this,R,ae,we,Se,this.xCellCount*He+sa,pt,At,Bt))return}_convertToXCellCoord(R){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(R*this.xScale)))}_convertToYCellCoord(R){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(R*this.yScale)))}_circlesCollide(R,ae,we,Se,Oe,pt){let At=Se-R,Bt=Oe-ae,$t=we+pt;return $t*$t>At*At+Bt*Bt}_circleAndRectCollide(R,ae,we,Se,Oe,pt,At){let Bt=(pt-Se)/2,$t=Math.abs(R-(Se+Bt));if($t>Bt+we)return!1;let br=(At-Oe)/2,Ar=Math.abs(ae-(Oe+br));if(Ar>br+we)return!1;if($t<=Bt||Ar<=br)return!0;let Yr=$t-Bt,sa=Ar-br;return Yr*Yr+sa*sa<=we*we}}function wr(Ne,R,ae,we,Se){let Oe=t.H();return R?(t.K(Oe,Oe,[1/Se,1/Se,1]),ae||t.ad(Oe,Oe,we.angle)):t.L(Oe,we.labelPlaneMatrix,Ne),Oe}function Ir(Ne,R,ae,we,Se){if(R){let Oe=t.ae(Ne);return t.K(Oe,Oe,[Se,Se,1]),ae||t.ad(Oe,Oe,-we.angle),Oe}return we.glCoordMatrix}function bt(Ne,R,ae,we){let Se;we?(Se=[Ne,R,we(Ne,R),1],t.af(Se,Se,ae)):(Se=[Ne,R,0,1],Qt(Se,Se,ae));let Oe=Se[3];return{point:new t.P(Se[0]/Oe,Se[1]/Oe),signedDistanceFromCamera:Oe,isOccluded:!1}}function Be(Ne,R){return .5+Ne/R*.5}function Ke(Ne,R){return Ne.x>=-R[0]&&Ne.x<=R[0]&&Ne.y>=-R[1]&&Ne.y<=R[1]}function Ue(Ne,R,ae,we,Se,Oe,pt,At,Bt,$t,br,Ar,Yr,sa,He){let Je=we?Ne.textSizeData:Ne.iconSizeData,ut=t.ag(Je,ae.transform.zoom),dt=[256/ae.width*2+1,256/ae.height*2+1],Ct=we?Ne.text.dynamicLayoutVertexArray:Ne.icon.dynamicLayoutVertexArray;Ct.clear();let wt=Ne.lineVertexArray,Dt=we?Ne.text.placedSymbolArray:Ne.icon.placedSymbolArray,ur=ae.transform.width/ae.transform.height,mr=!1;for(let Er=0;ErMath.abs(ae.x-R.x)*we?{useVertical:!0}:(Ne===t.ah.vertical?R.yae.x)?{needsFlipping:!0}:null}function Ce(Ne,R,ae,we,Se,Oe,pt,At,Bt,$t,br){let Ar=ae/24,Yr=R.lineOffsetX*Ar,sa=R.lineOffsetY*Ar,He;if(R.numGlyphs>1){let Je=R.glyphStartIndex+R.numGlyphs,ut=R.lineStartIndex,dt=R.lineStartIndex+R.lineLength,Ct=Me(Ar,At,Yr,sa,we,R,br,Ne);if(!Ct)return{notEnoughRoom:!0};let wt=bt(Ct.first.point.x,Ct.first.point.y,pt,Ne.getElevation).point,Dt=bt(Ct.last.point.x,Ct.last.point.y,pt,Ne.getElevation).point;if(Se&&!we){let ur=qe(R.writingMode,wt,Dt,$t);if(ur)return ur}He=[Ct.first];for(let ur=R.glyphStartIndex+1;ur0?wt.point:function(mr,Er,Br,Qr,ga,Sa){return Te(mr,Er,Br,1,ga,Sa)}(Ne.tileAnchorPoint,Ct,ut,0,Oe,Ne),ur=qe(R.writingMode,ut,Dt,$t);if(ur)return ur}let Je=Ot(Ar*At.getoffsetX(R.glyphStartIndex),Yr,sa,we,R.segment,R.lineStartIndex,R.lineStartIndex+R.lineLength,Ne,br);if(!Je||Ne.projectionCache.anyProjectionOccluded)return{notEnoughRoom:!0};He=[Je]}for(let Je of He)t.aj(Bt,Je.point,Je.angle);return{}}function Te(Ne,R,ae,we,Se,Oe){let pt=Ne.add(Ne.sub(R)._unit()),At=Se!==void 0?bt(pt.x,pt.y,Se,Oe.getElevation).point:at(pt.x,pt.y,Oe).point,Bt=ae.sub(At);return ae.add(Bt._mult(we/Bt.mag()))}function Pe(Ne,R,ae){let we=R.projectionCache;if(we.projections[Ne])return we.projections[Ne];let Se=new t.P(R.lineVertexArray.getx(Ne),R.lineVertexArray.gety(Ne)),Oe=at(Se.x,Se.y,R);if(Oe.signedDistanceFromCamera>0)return we.projections[Ne]=Oe.point,we.anyProjectionOccluded=we.anyProjectionOccluded||Oe.isOccluded,Oe.point;let pt=Ne-ae.direction;return function(At,Bt,$t,br,Ar){return Te(At,Bt,$t,br,void 0,Ar)}(ae.distanceFromAnchor===0?R.tileAnchorPoint:new t.P(R.lineVertexArray.getx(pt),R.lineVertexArray.gety(pt)),Se,ae.previousVertex,ae.absOffsetX-ae.distanceFromAnchor+1,R)}function at(Ne,R,ae){let we=Ne+ae.translation[0],Se=R+ae.translation[1],Oe;return!ae.pitchWithMap&&ae.projection.useSpecialProjectionForSymbols?(Oe=ae.projection.projectTileCoordinates(we,Se,ae.unwrappedTileID,ae.getElevation),Oe.point.x=(.5*Oe.point.x+.5)*ae.width,Oe.point.y=(.5*-Oe.point.y+.5)*ae.height):(Oe=bt(we,Se,ae.labelPlaneMatrix,ae.getElevation),Oe.isOccluded=!1),Oe}function yt(Ne,R,ae){return Ne._unit()._perp()._mult(R*ae)}function Tt(Ne,R,ae,we,Se,Oe,pt,At,Bt){if(At.projectionCache.offsets[Ne])return At.projectionCache.offsets[Ne];let $t=ae.add(R);if(Ne+Bt.direction=Se)return At.projectionCache.offsets[Ne]=$t,$t;let br=Pe(Ne+Bt.direction,At,Bt),Ar=yt(br.sub(ae),pt,Bt.direction),Yr=ae.add(Ar),sa=br.add(Ar);return At.projectionCache.offsets[Ne]=t.ak(Oe,$t,Yr,sa)||$t,At.projectionCache.offsets[Ne]}function Ot(Ne,R,ae,we,Se,Oe,pt,At,Bt){let $t=we?Ne-R:Ne+R,br=$t>0?1:-1,Ar=0;we&&(br*=-1,Ar=Math.PI),br<0&&(Ar+=Math.PI);let Yr,sa=br>0?Oe+Se:Oe+Se+1;At.projectionCache.cachedAnchorPoint?Yr=At.projectionCache.cachedAnchorPoint:(Yr=at(At.tileAnchorPoint.x,At.tileAnchorPoint.y,At).point,At.projectionCache.cachedAnchorPoint=Yr);let He,Je,ut=Yr,dt=Yr,Ct=0,wt=0,Dt=Math.abs($t),ur=[],mr;for(;Ct+wt<=Dt;){if(sa+=br,sa=pt)return null;Ct+=wt,dt=ut,Je=He;let Qr={absOffsetX:Dt,direction:br,distanceFromAnchor:Ct,previousVertex:dt};if(ut=Pe(sa,At,Qr),ae===0)ur.push(dt),mr=ut.sub(dt);else{let ga,Sa=ut.sub(dt);ga=Sa.mag()===0?yt(Pe(sa+br,At,Qr).sub(ut),ae,br):yt(Sa,ae,br),Je||(Je=dt.add(ga)),He=Tt(sa,ga,ut,Oe,pt,Je,ae,At,Qr),ur.push(Je),mr=He.sub(Je)}wt=mr.mag()}let Er=mr._mult((Dt-Ct)/wt)._add(Je||dt),Br=Ar+Math.atan2(ut.y-dt.y,ut.x-dt.x);return ur.push(Er),{point:Er,angle:Bt?Br:0,path:ur}}let Gt=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function rr(Ne,R){for(let ae=0;ae=1;Bn--)on.push(Wi.path[Bn]);for(let Bn=1;BnAo.signedDistanceFromCamera<=0)?[]:Bn.map(Ao=>Ao.point)}let Wn=[];if(on.length>0){let Bn=on[0].clone(),Ao=on[0].clone();for(let ss=1;ss=Sa.x&&Ao.x<=Oa.x&&Bn.y>=Sa.y&&Ao.y<=Oa.y?[on]:Ao.xOa.x||Ao.yOa.y?[]:t.al([on],Sa.x,Sa.y,Oa.x,Oa.y)}for(let Bn of Wn){di.reset(Bn,.25*ga);let Ao=0;Ao=di.length<=.5*ga?1:Math.ceil(di.paddedLength/Tn)+1;for(let ss=0;ssbt(Se.x,Se.y,we,ae.getElevation))}queryRenderedSymbols(R){if(R.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};let ae=[],we=1/0,Se=1/0,Oe=-1/0,pt=-1/0;for(let br of R){let Ar=new t.P(br.x+Tr,br.y+Tr);we=Math.min(we,Ar.x),Se=Math.min(Se,Ar.y),Oe=Math.max(Oe,Ar.x),pt=Math.max(pt,Ar.y),ae.push(Ar)}let At=this.grid.query(we,Se,Oe,pt).concat(this.ignoredGrid.query(we,Se,Oe,pt)),Bt={},$t={};for(let br of At){let Ar=br.key;if(Bt[Ar.bucketInstanceId]===void 0&&(Bt[Ar.bucketInstanceId]={}),Bt[Ar.bucketInstanceId][Ar.featureIndex])continue;let Yr=[new t.P(br.x1,br.y1),new t.P(br.x2,br.y1),new t.P(br.x2,br.y2),new t.P(br.x1,br.y2)];t.am(ae,Yr)&&(Bt[Ar.bucketInstanceId][Ar.featureIndex]=!0,$t[Ar.bucketInstanceId]===void 0&&($t[Ar.bucketInstanceId]=[]),$t[Ar.bucketInstanceId].push(Ar.featureIndex))}return $t}insertCollisionBox(R,ae,we,Se,Oe,pt){(we?this.ignoredGrid:this.grid).insert({bucketInstanceId:Se,featureIndex:Oe,collisionGroupID:pt,overlapMode:ae},R[0],R[1],R[2],R[3])}insertCollisionCircles(R,ae,we,Se,Oe,pt){let At=we?this.ignoredGrid:this.grid,Bt={bucketInstanceId:Se,featureIndex:Oe,collisionGroupID:pt,overlapMode:ae};for(let $t=0;$t=this.screenRightBoundary||Sethis.screenBottomBoundary}isInsideGrid(R,ae,we,Se){return we>=0&&R=0&&aethis.projectAndGetPerspectiveRatio(we,ga.x,ga.y,Se,$t));Br=Qr.some(ga=>!ga.isOccluded),Er=Qr.map(ga=>ga.point)}else Br=!0;return{box:t.ao(Er),allPointsOccluded:!Br}}}function Ua(Ne,R,ae){return R*(t.X/(Ne.tileSize*Math.pow(2,ae-Ne.tileID.overscaledZ)))}class Ba{constructor(R,ae,we,Se){this.opacity=R?Math.max(0,Math.min(1,R.opacity+(R.placed?ae:-ae))):Se&&we?1:0,this.placed=we}isHidden(){return this.opacity===0&&!this.placed}}class Ra{constructor(R,ae,we,Se,Oe){this.text=new Ba(R?R.text:null,ae,we,Oe),this.icon=new Ba(R?R.icon:null,ae,Se,Oe)}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class ei{constructor(R,ae,we){this.text=R,this.icon=ae,this.skipFade=we}}class za{constructor(){this.invProjMatrix=t.H(),this.viewportMatrix=t.H(),this.circles=[]}}class ti{constructor(R,ae,we,Se,Oe){this.bucketInstanceId=R,this.featureIndex=ae,this.sourceLayerIndex=we,this.bucketIndex=Se,this.tileID=Oe}}class Ci{constructor(R){this.crossSourceCollisions=R,this.maxGroupID=0,this.collisionGroups={}}get(R){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[R]){let ae=++this.maxGroupID;this.collisionGroups[R]={ID:ae,predicate:we=>we.collisionGroupID===ae}}return this.collisionGroups[R]}}function Jt(Ne,R,ae,we,Se){let{horizontalAlign:Oe,verticalAlign:pt}=t.au(Ne);return new t.P(-(Oe-.5)*R+we[0]*Se,-(pt-.5)*ae+we[1]*Se)}class Nt{constructor(R,ae,we,Se,Oe,pt){this.transform=R.clone(),this.terrain=we,this.collisionIndex=new la(this.transform,ae),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=Se,this.retainedQueryData={},this.collisionGroups=new Ci(Oe),this.collisionCircleArrays={},this.collisionBoxArrays=new Map,this.prevPlacement=pt,pt&&(pt.prevPlacement=void 0),this.placedOrientations={}}_getTerrainElevationFunc(R){let ae=this.terrain;return ae?(we,Se)=>ae.getElevation(R,we,Se):null}getBucketParts(R,ae,we,Se){let Oe=we.getBucket(ae),pt=we.latestFeatureIndex;if(!Oe||!pt||ae.id!==Oe.layerIds[0])return;let At=we.collisionBoxArray,Bt=Oe.layers[0].layout,$t=Oe.layers[0].paint,br=Math.pow(2,this.transform.zoom-we.tileID.overscaledZ),Ar=we.tileSize/t.X,Yr=we.tileID.toUnwrapped(),sa=this.transform.calculatePosMatrix(Yr),He=Bt.get("text-pitch-alignment")==="map",Je=Bt.get("text-rotation-alignment")==="map",ut=Ua(we,1,this.transform.zoom),dt=this.collisionIndex.mapProjection.translatePosition(this.transform,we,$t.get("text-translate"),$t.get("text-translate-anchor")),Ct=this.collisionIndex.mapProjection.translatePosition(this.transform,we,$t.get("icon-translate"),$t.get("icon-translate-anchor")),wt=wr(sa,He,Je,this.transform,ut),Dt=null;if(He){let mr=Ir(sa,He,Je,this.transform,ut);Dt=t.L([],this.transform.labelPlaneMatrix,mr)}this.retainedQueryData[Oe.bucketInstanceId]=new ti(Oe.bucketInstanceId,pt,Oe.sourceLayerIndex,Oe.index,we.tileID);let ur={bucket:Oe,layout:Bt,translationText:dt,translationIcon:Ct,posMatrix:sa,unwrappedTileID:Yr,textLabelPlaneMatrix:wt,labelToScreenMatrix:Dt,scale:br,textPixelRatio:Ar,holdingForFade:we.holdingForFade(),collisionBoxArray:At,partiallyEvaluatedTextSize:t.ag(Oe.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(Oe.sourceID)};if(Se)for(let mr of Oe.sortKeyRanges){let{sortKey:Er,symbolInstanceStart:Br,symbolInstanceEnd:Qr}=mr;R.push({sortKey:Er,symbolInstanceStart:Br,symbolInstanceEnd:Qr,parameters:ur})}else R.push({symbolInstanceStart:0,symbolInstanceEnd:Oe.symbolInstances.length,parameters:ur})}attemptAnchorPlacement(R,ae,we,Se,Oe,pt,At,Bt,$t,br,Ar,Yr,sa,He,Je,ut,dt,Ct,wt){let Dt=t.aq[R.textAnchor],ur=[R.textOffset0,R.textOffset1],mr=Jt(Dt,we,Se,ur,Oe),Er=this.collisionIndex.placeCollisionBox(ae,Yr,Bt,$t,br,At,pt,ut,Ar.predicate,wt,mr);if((!Ct||this.collisionIndex.placeCollisionBox(Ct,Yr,Bt,$t,br,At,pt,dt,Ar.predicate,wt,mr).placeable)&&Er.placeable){let Br;if(this.prevPlacement&&this.prevPlacement.variableOffsets[sa.crossTileID]&&this.prevPlacement.placements[sa.crossTileID]&&this.prevPlacement.placements[sa.crossTileID].text&&(Br=this.prevPlacement.variableOffsets[sa.crossTileID].anchor),sa.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[sa.crossTileID]={textOffset:ur,width:we,height:Se,anchor:Dt,textBoxScale:Oe,prevAnchor:Br},this.markUsedJustification(He,Dt,sa,Je),He.allowVerticalPlacement&&(this.markUsedOrientation(He,Je,sa),this.placedOrientations[sa.crossTileID]=Je),{shift:mr,placedGlyphBoxes:Er}}}placeLayerBucketPart(R,ae,we){let{bucket:Se,layout:Oe,translationText:pt,translationIcon:At,posMatrix:Bt,unwrappedTileID:$t,textLabelPlaneMatrix:br,labelToScreenMatrix:Ar,textPixelRatio:Yr,holdingForFade:sa,collisionBoxArray:He,partiallyEvaluatedTextSize:Je,collisionGroup:ut}=R.parameters,dt=Oe.get("text-optional"),Ct=Oe.get("icon-optional"),wt=t.ar(Oe,"text-overlap","text-allow-overlap"),Dt=wt==="always",ur=t.ar(Oe,"icon-overlap","icon-allow-overlap"),mr=ur==="always",Er=Oe.get("text-rotation-alignment")==="map",Br=Oe.get("text-pitch-alignment")==="map",Qr=Oe.get("icon-text-fit")!=="none",ga=Oe.get("symbol-z-order")==="viewport-y",Sa=Dt&&(mr||!Se.hasIconData()||Ct),Oa=mr&&(Dt||!Se.hasTextData()||dt);!Se.collisionArrays&&He&&Se.deserializeCollisionBoxes(He);let di=this._getTerrainElevationFunc(this.retainedQueryData[Se.bucketInstanceId].tileID),Wi=(Gi,on,Tn)=>{var Wn,Bn;if(ae[Gi.crossTileID])return;if(sa)return void(this.placements[Gi.crossTileID]=new ei(!1,!1,!1));let Ao=!1,ss=!1,So=!0,Ko=null,hs={box:null,placeable:!1,offscreen:null},ll={box:null,placeable:!1,offscreen:null},Js=null,es=null,ts=null,Pl=0,$l=0,Ru=0;on.textFeatureIndex?Pl=on.textFeatureIndex:Gi.useRuntimeCollisionCircles&&(Pl=Gi.featureIndex),on.verticalTextFeatureIndex&&($l=on.verticalTextFeatureIndex);let hu=on.textBox;if(hu){let ql=et=>{let vt=t.ah.horizontal;if(Se.allowVerticalPlacement&&!et&&this.prevPlacement){let _t=this.prevPlacement.placedOrientations[Gi.crossTileID];_t&&(this.placedOrientations[Gi.crossTileID]=_t,vt=_t,this.markUsedOrientation(Se,vt,Gi))}return vt},Vl=(et,vt)=>{if(Se.allowVerticalPlacement&&Gi.numVerticalGlyphVertices>0&&on.verticalTextBox){for(let _t of Se.writingModes)if(_t===t.ah.vertical?(hs=vt(),ll=hs):hs=et(),hs&&hs.placeable)break}else hs=et()},de=Gi.textAnchorOffsetStartIndex,De=Gi.textAnchorOffsetEndIndex;if(De===de){let et=(vt,_t)=>{let St=this.collisionIndex.placeCollisionBox(vt,wt,Yr,Bt,$t,Br,Er,pt,ut.predicate,di);return St&&St.placeable&&(this.markUsedOrientation(Se,_t,Gi),this.placedOrientations[Gi.crossTileID]=_t),St};Vl(()=>et(hu,t.ah.horizontal),()=>{let vt=on.verticalTextBox;return Se.allowVerticalPlacement&&Gi.numVerticalGlyphVertices>0&&vt?et(vt,t.ah.vertical):{box:null,offscreen:null}}),ql(hs&&hs.placeable)}else{let et=t.aq[(Bn=(Wn=this.prevPlacement)===null||Wn===void 0?void 0:Wn.variableOffsets[Gi.crossTileID])===null||Bn===void 0?void 0:Bn.anchor],vt=(St,ar,zt)=>{let gr=St.x2-St.x1,Vr=St.y2-St.y1,Wr=Gi.textBoxScale,Ta=Qr&&ur==="never"?ar:null,ya=null,ri=wt==="never"?1:2,ni="never";et&&ri++;for(let Ma=0;Mavt(hu,on.iconBox,t.ah.horizontal),()=>{let St=on.verticalTextBox;return Se.allowVerticalPlacement&&(!hs||!hs.placeable)&&Gi.numVerticalGlyphVertices>0&&St?vt(St,on.verticalIconBox,t.ah.vertical):{box:null,occluded:!0,offscreen:null}}),hs&&(Ao=hs.placeable,So=hs.offscreen);let _t=ql(hs&&hs.placeable);if(!Ao&&this.prevPlacement){let St=this.prevPlacement.variableOffsets[Gi.crossTileID];St&&(this.variableOffsets[Gi.crossTileID]=St,this.markUsedJustification(Se,St.anchor,Gi,_t))}}}if(Js=hs,Ao=Js&&Js.placeable,So=Js&&Js.offscreen,Gi.useRuntimeCollisionCircles){let ql=Se.text.placedSymbolArray.get(Gi.centerJustifiedTextSymbolIndex),Vl=t.ai(Se.textSizeData,Je,ql),de=Oe.get("text-padding");es=this.collisionIndex.placeCollisionCircles(wt,ql,Se.lineVertexArray,Se.glyphOffsetArray,Vl,Bt,$t,br,Ar,we,Br,ut.predicate,Gi.collisionCircleDiameter,de,pt,di),es.circles.length&&es.collisionDetected&&!we&&t.w("Collisions detected, but collision boxes are not shown"),Ao=Dt||es.circles.length>0&&!es.collisionDetected,So=So&&es.offscreen}if(on.iconFeatureIndex&&(Ru=on.iconFeatureIndex),on.iconBox){let ql=Vl=>this.collisionIndex.placeCollisionBox(Vl,ur,Yr,Bt,$t,Br,Er,At,ut.predicate,di,Qr&&Ko?Ko:void 0);ll&&ll.placeable&&on.verticalIconBox?(ts=ql(on.verticalIconBox),ss=ts.placeable):(ts=ql(on.iconBox),ss=ts.placeable),So=So&&ts.offscreen}let wl=dt||Gi.numHorizontalGlyphVertices===0&&Gi.numVerticalGlyphVertices===0,su=Ct||Gi.numIconVertices===0;wl||su?su?wl||(ss=ss&&Ao):Ao=ss&&Ao:ss=Ao=ss&&Ao;let uc=ss&&ts.placeable;if(Ao&&Js.placeable&&this.collisionIndex.insertCollisionBox(Js.box,wt,Oe.get("text-ignore-placement"),Se.bucketInstanceId,ll&&ll.placeable&&$l?$l:Pl,ut.ID),uc&&this.collisionIndex.insertCollisionBox(ts.box,ur,Oe.get("icon-ignore-placement"),Se.bucketInstanceId,Ru,ut.ID),es&&Ao&&this.collisionIndex.insertCollisionCircles(es.circles,wt,Oe.get("text-ignore-placement"),Se.bucketInstanceId,Pl,ut.ID),we&&this.storeCollisionData(Se.bucketInstanceId,Tn,on,Js,ts,es),Gi.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");if(Se.bucketInstanceId===0)throw new Error("bucket.bucketInstanceId can't be 0");this.placements[Gi.crossTileID]=new ei(Ao||Sa,ss||Oa,So||Se.justReloaded),ae[Gi.crossTileID]=!0};if(ga){if(R.symbolInstanceStart!==0)throw new Error("bucket.bucketInstanceId should be 0");let Gi=Se.getSortedSymbolIndexes(this.transform.angle);for(let on=Gi.length-1;on>=0;--on){let Tn=Gi[on];Wi(Se.symbolInstances.get(Tn),Se.collisionArrays[Tn],Tn)}}else for(let Gi=R.symbolInstanceStart;Gi=0&&(R.text.placedSymbolArray.get(At).crossTileID=Oe>=0&&At!==Oe?0:we.crossTileID)}markUsedOrientation(R,ae,we){let Se=ae===t.ah.horizontal||ae===t.ah.horizontalOnly?ae:0,Oe=ae===t.ah.vertical?ae:0,pt=[we.leftJustifiedTextSymbolIndex,we.centerJustifiedTextSymbolIndex,we.rightJustifiedTextSymbolIndex];for(let At of pt)R.text.placedSymbolArray.get(At).placedOrientation=Se;we.verticalPlacedTextSymbolIndex&&(R.text.placedSymbolArray.get(we.verticalPlacedTextSymbolIndex).placedOrientation=Oe)}commit(R){this.commitTime=R,this.zoomAtLastRecencyCheck=this.transform.zoom;let ae=this.prevPlacement,we=!1;this.prevZoomAdjustment=ae?ae.zoomAdjustment(this.transform.zoom):0;let Se=ae?ae.symbolFadeChange(R):1,Oe=ae?ae.opacities:{},pt=ae?ae.variableOffsets:{},At=ae?ae.placedOrientations:{};for(let Bt in this.placements){let $t=this.placements[Bt],br=Oe[Bt];br?(this.opacities[Bt]=new Ra(br,Se,$t.text,$t.icon),we=we||$t.text!==br.text.placed||$t.icon!==br.icon.placed):(this.opacities[Bt]=new Ra(null,Se,$t.text,$t.icon,$t.skipFade),we=we||$t.text||$t.icon)}for(let Bt in Oe){let $t=Oe[Bt];if(!this.opacities[Bt]){let br=new Ra($t,Se,!1,!1);br.isHidden()||(this.opacities[Bt]=br,we=we||$t.text.placed||$t.icon.placed)}}for(let Bt in pt)this.variableOffsets[Bt]||!this.opacities[Bt]||this.opacities[Bt].isHidden()||(this.variableOffsets[Bt]=pt[Bt]);for(let Bt in At)this.placedOrientations[Bt]||!this.opacities[Bt]||this.opacities[Bt].isHidden()||(this.placedOrientations[Bt]=At[Bt]);if(ae&&ae.lastPlacementChangeTime===void 0)throw new Error("Last placement time for previous placement is not defined");we?this.lastPlacementChangeTime=R:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=ae?ae.lastPlacementChangeTime:R)}updateLayerOpacities(R,ae){let we={};for(let Se of ae){let Oe=Se.getBucket(R);Oe&&Se.latestFeatureIndex&&R.id===Oe.layerIds[0]&&this.updateBucketOpacities(Oe,Se.tileID,we,Se.collisionBoxArray)}}updateBucketOpacities(R,ae,we,Se){R.hasTextData()&&(R.text.opacityVertexArray.clear(),R.text.hasVisibleVertices=!1),R.hasIconData()&&(R.icon.opacityVertexArray.clear(),R.icon.hasVisibleVertices=!1),R.hasIconCollisionBoxData()&&R.iconCollisionBox.collisionVertexArray.clear(),R.hasTextCollisionBoxData()&&R.textCollisionBox.collisionVertexArray.clear();let Oe=R.layers[0],pt=Oe.layout,At=new Ra(null,0,!1,!1,!0),Bt=pt.get("text-allow-overlap"),$t=pt.get("icon-allow-overlap"),br=Oe._unevaluatedLayout.hasValue("text-variable-anchor")||Oe._unevaluatedLayout.hasValue("text-variable-anchor-offset"),Ar=pt.get("text-rotation-alignment")==="map",Yr=pt.get("text-pitch-alignment")==="map",sa=pt.get("icon-text-fit")!=="none",He=new Ra(null,0,Bt&&($t||!R.hasIconData()||pt.get("icon-optional")),$t&&(Bt||!R.hasTextData()||pt.get("text-optional")),!0);!R.collisionArrays&&Se&&(R.hasIconCollisionBoxData()||R.hasTextCollisionBoxData())&&R.deserializeCollisionBoxes(Se);let Je=(dt,Ct,wt)=>{for(let Dt=0;Dt0,Br=this.placedOrientations[Ct.crossTileID],Qr=Br===t.ah.vertical,ga=Br===t.ah.horizontal||Br===t.ah.horizontalOnly;if(wt>0||Dt>0){let Oa=$a(mr.text);Je(R.text,wt,Qr?ai:Oa),Je(R.text,Dt,ga?ai:Oa);let di=mr.text.isHidden();[Ct.rightJustifiedTextSymbolIndex,Ct.centerJustifiedTextSymbolIndex,Ct.leftJustifiedTextSymbolIndex].forEach(on=>{on>=0&&(R.text.placedSymbolArray.get(on).hidden=di||Qr?1:0)}),Ct.verticalPlacedTextSymbolIndex>=0&&(R.text.placedSymbolArray.get(Ct.verticalPlacedTextSymbolIndex).hidden=di||ga?1:0);let Wi=this.variableOffsets[Ct.crossTileID];Wi&&this.markUsedJustification(R,Wi.anchor,Ct,Br);let Gi=this.placedOrientations[Ct.crossTileID];Gi&&(this.markUsedJustification(R,"left",Ct,Gi),this.markUsedOrientation(R,Gi,Ct))}if(Er){let Oa=$a(mr.icon),di=!(sa&&Ct.verticalPlacedIconSymbolIndex&&Qr);Ct.placedIconSymbolIndex>=0&&(Je(R.icon,Ct.numIconVertices,di?Oa:ai),R.icon.placedSymbolArray.get(Ct.placedIconSymbolIndex).hidden=mr.icon.isHidden()),Ct.verticalPlacedIconSymbolIndex>=0&&(Je(R.icon,Ct.numVerticalIconVertices,di?ai:Oa),R.icon.placedSymbolArray.get(Ct.verticalPlacedIconSymbolIndex).hidden=mr.icon.isHidden())}let Sa=ut&&ut.has(dt)?ut.get(dt):{text:null,icon:null};if(R.hasIconCollisionBoxData()||R.hasTextCollisionBoxData()){let Oa=R.collisionArrays[dt];if(Oa){let di=new t.P(0,0);if(Oa.textBox||Oa.verticalTextBox){let Wi=!0;if(br){let Gi=this.variableOffsets[ur];Gi?(di=Jt(Gi.anchor,Gi.width,Gi.height,Gi.textOffset,Gi.textBoxScale),Ar&&di._rotate(Yr?this.transform.angle:-this.transform.angle)):Wi=!1}if(Oa.textBox||Oa.verticalTextBox){let Gi;Oa.textBox&&(Gi=Qr),Oa.verticalTextBox&&(Gi=ga),Kt(R.textCollisionBox.collisionVertexArray,mr.text.placed,!Wi||Gi,Sa.text,di.x,di.y)}}if(Oa.iconBox||Oa.verticalIconBox){let Wi=!!(!ga&&Oa.verticalIconBox),Gi;Oa.iconBox&&(Gi=Wi),Oa.verticalIconBox&&(Gi=!Wi),Kt(R.iconCollisionBox.collisionVertexArray,mr.icon.placed,Gi,Sa.icon,sa?di.x:0,sa?di.y:0)}}}}if(R.sortFeatures(this.transform.angle),this.retainedQueryData[R.bucketInstanceId]&&(this.retainedQueryData[R.bucketInstanceId].featureSortOrder=R.featureSortOrder),R.hasTextData()&&R.text.opacityVertexBuffer&&R.text.opacityVertexBuffer.updateData(R.text.opacityVertexArray),R.hasIconData()&&R.icon.opacityVertexBuffer&&R.icon.opacityVertexBuffer.updateData(R.icon.opacityVertexArray),R.hasIconCollisionBoxData()&&R.iconCollisionBox.collisionVertexBuffer&&R.iconCollisionBox.collisionVertexBuffer.updateData(R.iconCollisionBox.collisionVertexArray),R.hasTextCollisionBoxData()&&R.textCollisionBox.collisionVertexBuffer&&R.textCollisionBox.collisionVertexBuffer.updateData(R.textCollisionBox.collisionVertexArray),R.text.opacityVertexArray.length!==R.text.layoutVertexArray.length/4)throw new Error(`bucket.text.opacityVertexArray.length (= ${R.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${R.text.layoutVertexArray.length}) / 4`);if(R.icon.opacityVertexArray.length!==R.icon.layoutVertexArray.length/4)throw new Error(`bucket.icon.opacityVertexArray.length (= ${R.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${R.icon.layoutVertexArray.length}) / 4`);if(R.bucketInstanceId in this.collisionCircleArrays){let dt=this.collisionCircleArrays[R.bucketInstanceId];R.placementInvProjMatrix=dt.invProjMatrix,R.placementViewportMatrix=dt.viewportMatrix,R.collisionCircleArray=dt.circles,delete this.collisionCircleArrays[R.bucketInstanceId]}}symbolFadeChange(R){return this.fadeDuration===0?1:(R-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(R){return Math.max(0,(this.transform.zoom-R)/1.5)}hasTransitions(R){return this.stale||R-this.lastPlacementChangeTimeR}setStale(){this.stale=!0}}function Kt(Ne,R,ae,we,Se,Oe){we&&we.length!==0||(we=[0,0,0,0]);let pt=we[0]-Tr,At=we[1]-Tr,Bt=we[2]-Tr,$t=we[3]-Tr;Ne.emplaceBack(R?1:0,ae?1:0,Se||0,Oe||0,pt,At),Ne.emplaceBack(R?1:0,ae?1:0,Se||0,Oe||0,Bt,At),Ne.emplaceBack(R?1:0,ae?1:0,Se||0,Oe||0,Bt,$t),Ne.emplaceBack(R?1:0,ae?1:0,Se||0,Oe||0,pt,$t)}let Wt=Math.pow(2,25),Pr=Math.pow(2,24),ta=Math.pow(2,17),ma=Math.pow(2,16),ra=Math.pow(2,9),Ia=Math.pow(2,8),Ha=Math.pow(2,1);function $a(Ne){if(Ne.opacity===0&&!Ne.placed)return 0;if(Ne.opacity===1&&Ne.placed)return 4294967295;let R=Ne.placed?1:0,ae=Math.floor(127*Ne.opacity);return ae*Wt+R*Pr+ae*ta+R*ma+ae*ra+R*Ia+ae*Ha+R}let ai=0;function mi(){return{isOccluded:(Ne,R,ae)=>!1,getPitchedTextCorrection:(Ne,R,ae)=>1,get useSpecialProjectionForSymbols(){return!1},projectTileCoordinates(Ne,R,ae,we){throw new Error("Not implemented.")},translatePosition:(Ne,R,ae,we)=>function(Se,Oe,pt,At,Bt=!1){if(!pt[0]&&!pt[1])return[0,0];let $t=Bt?At==="map"?Se.angle:0:At==="viewport"?-Se.angle:0;if($t){let br=Math.sin($t),Ar=Math.cos($t);pt=[pt[0]*Ar-pt[1]*br,pt[0]*br+pt[1]*Ar]}return[Bt?pt[0]:Ua(Oe,pt[0],Se.zoom),Bt?pt[1]:Ua(Oe,pt[1],Se.zoom)]}(Ne,R,ae,we),getCircleRadiusCorrection:Ne=>1}}class xt{constructor(R){this._sortAcrossTiles=R.layout.get("symbol-z-order")!=="viewport-y"&&!R.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(R,ae,we,Se,Oe){let pt=this._bucketParts;for(;this._currentTileIndexAt.sortKey-Bt.sortKey));this._currentPartIndex!this._forceFullPlacement&&i.now()-Se>2;for(;this._currentPlacementIndex>=0;){let pt=ae[R[this._currentPlacementIndex]],At=this.placement.collisionIndex.transform.zoom;if(pt.type==="symbol"&&(!pt.minzoom||pt.minzoom<=At)&&(!pt.maxzoom||pt.maxzoom>At)){if(this._inProgressLayer||(this._inProgressLayer=new xt(pt)),this._inProgressLayer.continuePlacement(we[pt.source],this.placement,this._showCollisionBoxes,pt,Oe))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(R){return this.placement.commit(R),this.placement}}let Nr=512/t.X/2;class Or{constructor(R,ae,we){this.tileID=R,this.bucketInstanceId=we,this._symbolsByKey={};let Se=new Map;for(let Oe=0;Oe({x:Math.floor(Bt.anchorX*Nr),y:Math.floor(Bt.anchorY*Nr)})),crossTileIDs:pt.map(Bt=>Bt.crossTileID)};if(At.positions.length>128){let Bt=new t.av(At.positions.length,16,Uint16Array);for(let{x:$t,y:br}of At.positions)Bt.add($t,br);Bt.finish(),delete At.positions,At.index=Bt}this._symbolsByKey[Oe]=At}}getScaledCoordinates(R,ae){let{x:we,y:Se,z:Oe}=this.tileID.canonical,{x:pt,y:At,z:Bt}=ae.canonical,$t=Nr/Math.pow(2,Bt-Oe),br=(At*t.X+R.anchorY)*$t,Ar=Se*t.X*Nr;return{x:Math.floor((pt*t.X+R.anchorX)*$t-we*t.X*Nr),y:Math.floor(br-Ar)}}findMatches(R,ae,we){let Se=this.tileID.canonical.zR)}}class Rr{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class Lr{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(R){let ae=Math.round((R-this.lng)/360);if(ae!==0)for(let we in this.indexes){let Se=this.indexes[we],Oe={};for(let pt in Se){let At=Se[pt];At.tileID=At.tileID.unwrapTo(At.tileID.wrap+ae),Oe[At.tileID.key]=At}this.indexes[we]=Oe}this.lng=R}addBucket(R,ae,we){if(this.indexes[R.overscaledZ]&&this.indexes[R.overscaledZ][R.key]){if(this.indexes[R.overscaledZ][R.key].bucketInstanceId===ae.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(R.overscaledZ,this.indexes[R.overscaledZ][R.key])}for(let Oe=0;OeR.overscaledZ)for(let At in pt){let Bt=pt[At];Bt.tileID.isChildOf(R)&&Bt.findMatches(ae.symbolInstances,R,Se)}else{let At=pt[R.scaledTo(Number(Oe)).key];At&&At.findMatches(ae.symbolInstances,R,Se)}}for(let Oe=0;Oe{ae[we]=!0});for(let we in this.layerIndexes)ae[we]||delete this.layerIndexes[we]}}let Kr=(Ne,R)=>t.t(Ne,R&&R.filter(ae=>ae.identifier!=="source.canvas")),Ur=t.aw();class aa extends t.E{constructor(R,ae={}){super(),this._rtlPluginLoaded=()=>{for(let we in this.sourceCaches){let Se=this.sourceCaches[we].getSource().type;Se!=="vector"&&Se!=="geojson"||this.sourceCaches[we].reload()}},this.map=R,this.dispatcher=new J($(),R._getMapId()),this.dispatcher.registerMessageHandler("GG",(we,Se)=>this.getGlyphs(we,Se)),this.dispatcher.registerMessageHandler("GI",(we,Se)=>this.getImages(we,Se)),this.imageManager=new h,this.imageManager.setEventedParent(this),this.glyphManager=new F(R._requestManager,ae.localIdeographFontFamily),this.lineAtlas=new W(256,512),this.crossTileSymbolIndex=new Gr,this._spritesImagesIds={},this._layers={},this._order=[],this.sourceCaches={},this.zoomHistory=new t.ax,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("SR",t.ay()),rt().on(_e,this._rtlPluginLoaded),this.on("data",we=>{if(we.dataType!=="source"||we.sourceDataType!=="metadata")return;let Se=this.sourceCaches[we.sourceId];if(!Se)return;let Oe=Se.getSource();if(Oe&&Oe.vectorLayerIds)for(let pt in this._layers){let At=this._layers[pt];At.source===Oe.id&&this._validateLayer(At)}})}loadURL(R,ae={},we){this.fire(new t.k("dataloading",{dataType:"style"})),ae.validate=typeof ae.validate!="boolean"||ae.validate;let Se=this.map._requestManager.transformRequest(R,"Style");this._loadStyleRequest=new AbortController;let Oe=this._loadStyleRequest;t.h(Se,this._loadStyleRequest).then(pt=>{this._loadStyleRequest=null,this._load(pt.data,ae,we)}).catch(pt=>{this._loadStyleRequest=null,pt&&!Oe.signal.aborted&&this.fire(new t.j(pt))})}loadJSON(R,ae={},we){this.fire(new t.k("dataloading",{dataType:"style"})),this._frameRequest=new AbortController,i.frameAsync(this._frameRequest).then(()=>{this._frameRequest=null,ae.validate=ae.validate!==!1,this._load(R,ae,we)}).catch(()=>{})}loadEmpty(){this.fire(new t.k("dataloading",{dataType:"style"})),this._load(Ur,{validate:!1})}_load(R,ae,we){var Se;let Oe=ae.transformStyle?ae.transformStyle(we,R):R;if(!ae.validate||!Kr(this,t.u(Oe))){this._loaded=!0,this.stylesheet=Oe;for(let pt in Oe.sources)this.addSource(pt,Oe.sources[pt],{validate:!1});Oe.sprite?this._loadSprite(Oe.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(Oe.glyphs),this._createLayers(),this.light=new I(this.stylesheet.light),this.sky=new U(this.stylesheet.sky),this.map.setTerrain((Se=this.stylesheet.terrain)!==null&&Se!==void 0?Se:null),this.fire(new t.k("data",{dataType:"style"})),this.fire(new t.k("style.load"))}}_createLayers(){let R=t.az(this.stylesheet.layers);this.dispatcher.broadcast("SL",R),this._order=R.map(ae=>ae.id),this._layers={},this._serializedLayers=null;for(let ae of R){let we=t.aA(ae);we.setEventedParent(this,{layer:{id:ae.id}}),this._layers[ae.id]=we}}_loadSprite(R,ae=!1,we=void 0){let Se;this.imageManager.setLoaded(!1),this._spriteRequest=new AbortController,function(Oe,pt,At,Bt){return t._(this,void 0,void 0,function*(){let $t=b(Oe),br=At>1?"@2x":"",Ar={},Yr={};for(let{id:sa,url:He}of $t){let Je=pt.transformRequest(p(He,br,".json"),"SpriteJSON");Ar[sa]=t.h(Je,Bt);let ut=pt.transformRequest(p(He,br,".png"),"SpriteImage");Yr[sa]=l.getImage(ut,Bt)}return yield Promise.all([...Object.values(Ar),...Object.values(Yr)]),function(sa,He){return t._(this,void 0,void 0,function*(){let Je={};for(let ut in sa){Je[ut]={};let dt=i.getImageCanvasContext((yield He[ut]).data),Ct=(yield sa[ut]).data;for(let wt in Ct){let{width:Dt,height:ur,x:mr,y:Er,sdf:Br,pixelRatio:Qr,stretchX:ga,stretchY:Sa,content:Oa,textFitWidth:di,textFitHeight:Wi}=Ct[wt];Je[ut][wt]={data:null,pixelRatio:Qr,sdf:Br,stretchX:ga,stretchY:Sa,content:Oa,textFitWidth:di,textFitHeight:Wi,spriteData:{width:Dt,height:ur,x:mr,y:Er,context:dt}}}}return Je})}(Ar,Yr)})}(R,this.map._requestManager,this.map.getPixelRatio(),this._spriteRequest).then(Oe=>{if(this._spriteRequest=null,Oe)for(let pt in Oe){this._spritesImagesIds[pt]=[];let At=this._spritesImagesIds[pt]?this._spritesImagesIds[pt].filter(Bt=>!(Bt in Oe)):[];for(let Bt of At)this.imageManager.removeImage(Bt),this._changedImages[Bt]=!0;for(let Bt in Oe[pt]){let $t=pt==="default"?Bt:`${pt}:${Bt}`;this._spritesImagesIds[pt].push($t),$t in this.imageManager.images?this.imageManager.updateImage($t,Oe[pt][Bt],!1):this.imageManager.addImage($t,Oe[pt][Bt]),ae&&(this._changedImages[$t]=!0)}}}).catch(Oe=>{this._spriteRequest=null,Se=Oe,this.fire(new t.j(Se))}).finally(()=>{this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),ae&&(this._changed=!0),this.dispatcher.broadcast("SI",this._availableImages),this.fire(new t.k("data",{dataType:"style"})),we&&we(Se)})}_unloadSprite(){for(let R of Object.values(this._spritesImagesIds).flat())this.imageManager.removeImage(R),this._changedImages[R]=!0;this._spritesImagesIds={},this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new t.k("data",{dataType:"style"}))}_validateLayer(R){let ae=this.sourceCaches[R.source];if(!ae)return;let we=R.sourceLayer;if(!we)return;let Se=ae.getSource();(Se.type==="geojson"||Se.vectorLayerIds&&Se.vectorLayerIds.indexOf(we)===-1)&&this.fire(new t.j(new Error(`Source layer "${we}" does not exist on source "${Se.id}" as specified by style layer "${R.id}".`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(let R in this.sourceCaches)if(!this.sourceCaches[R].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeByIds(R,ae=!1){let we=this._serializedAllLayers();if(!R||R.length===0)return Object.values(ae?t.aB(we):we);let Se=[];for(let Oe of R)if(we[Oe]){let pt=ae?t.aB(we[Oe]):we[Oe];Se.push(pt)}return Se}_serializedAllLayers(){let R=this._serializedLayers;if(R)return R;R=this._serializedLayers={};let ae=Object.keys(this._layers);for(let we of ae){let Se=this._layers[we];Se.type!=="custom"&&(R[we]=Se.serialize())}return R}hasTransitions(){if(this.light&&this.light.hasTransition()||this.sky&&this.sky.hasTransition())return!0;for(let R in this.sourceCaches)if(this.sourceCaches[R].hasTransition())return!0;for(let R in this._layers)if(this._layers[R].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(R){if(!this._loaded)return;let ae=this._changed;if(ae){let Se=Object.keys(this._updatedLayers),Oe=Object.keys(this._removedLayers);(Se.length||Oe.length)&&this._updateWorkerLayers(Se,Oe);for(let pt in this._updatedSources){let At=this._updatedSources[pt];if(At==="reload")this._reloadSource(pt);else{if(At!=="clear")throw new Error(`Invalid action ${At}`);this._clearSource(pt)}}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(let pt in this._updatedPaintProps)this._layers[pt].updateTransitions(R);this.light.updateTransitions(R),this.sky.updateTransitions(R),this._resetUpdates()}let we={};for(let Se in this.sourceCaches){let Oe=this.sourceCaches[Se];we[Se]=Oe.used,Oe.used=!1}for(let Se of this._order){let Oe=this._layers[Se];Oe.recalculate(R,this._availableImages),!Oe.isHidden(R.zoom)&&Oe.source&&(this.sourceCaches[Oe.source].used=!0)}for(let Se in we){let Oe=this.sourceCaches[Se];!!we[Se]!=!!Oe.used&&Oe.fire(new t.k("data",{sourceDataType:"visibility",dataType:"source",sourceId:Se}))}this.light.recalculate(R),this.sky.recalculate(R),this.z=R.zoom,ae&&this.fire(new t.k("data",{dataType:"style"}))}_updateTilesForChangedImages(){let R=Object.keys(this._changedImages);if(R.length){for(let ae in this.sourceCaches)this.sourceCaches[ae].reloadTilesForDependencies(["icons","patterns"],R);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(let R in this.sourceCaches)this.sourceCaches[R].reloadTilesForDependencies(["glyphs"],[""]);this._glyphsDidChange=!1}}_updateWorkerLayers(R,ae){this.dispatcher.broadcast("UL",{layers:this._serializeByIds(R,!1),removedIds:ae})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(R,ae={}){var we;this._checkLoaded();let Se=this.serialize();if(R=ae.transformStyle?ae.transformStyle(Se,R):R,((we=ae.validate)===null||we===void 0||we)&&Kr(this,t.u(R)))return!1;(R=t.aB(R)).layers=t.az(R.layers);let Oe=t.aC(Se,R),pt=this._getOperationsToPerform(Oe);if(pt.unimplemented.length>0)throw new Error(`Unimplemented: ${pt.unimplemented.join(", ")}.`);if(pt.operations.length===0)return!1;for(let At of pt.operations)At();return this.stylesheet=R,this._serializedLayers=null,!0}_getOperationsToPerform(R){let ae=[],we=[];for(let Se of R)switch(Se.command){case"setCenter":case"setZoom":case"setBearing":case"setPitch":continue;case"addLayer":ae.push(()=>this.addLayer.apply(this,Se.args));break;case"removeLayer":ae.push(()=>this.removeLayer.apply(this,Se.args));break;case"setPaintProperty":ae.push(()=>this.setPaintProperty.apply(this,Se.args));break;case"setLayoutProperty":ae.push(()=>this.setLayoutProperty.apply(this,Se.args));break;case"setFilter":ae.push(()=>this.setFilter.apply(this,Se.args));break;case"addSource":ae.push(()=>this.addSource.apply(this,Se.args));break;case"removeSource":ae.push(()=>this.removeSource.apply(this,Se.args));break;case"setLayerZoomRange":ae.push(()=>this.setLayerZoomRange.apply(this,Se.args));break;case"setLight":ae.push(()=>this.setLight.apply(this,Se.args));break;case"setGeoJSONSourceData":ae.push(()=>this.setGeoJSONSourceData.apply(this,Se.args));break;case"setGlyphs":ae.push(()=>this.setGlyphs.apply(this,Se.args));break;case"setSprite":ae.push(()=>this.setSprite.apply(this,Se.args));break;case"setSky":ae.push(()=>this.setSky.apply(this,Se.args));break;case"setTerrain":ae.push(()=>this.map.setTerrain.apply(this,Se.args));break;case"setTransition":ae.push(()=>{});break;default:we.push(Se.command)}return{operations:ae,unimplemented:we}}addImage(R,ae){if(this.getImage(R))return this.fire(new t.j(new Error(`An image named "${R}" already exists.`)));this.imageManager.addImage(R,ae),this._afterImageUpdated(R)}updateImage(R,ae){this.imageManager.updateImage(R,ae)}getImage(R){return this.imageManager.getImage(R)}removeImage(R){if(!this.getImage(R))return this.fire(new t.j(new Error(`An image named "${R}" does not exist.`)));this.imageManager.removeImage(R),this._afterImageUpdated(R)}_afterImageUpdated(R){this._availableImages=this.imageManager.listImages(),this._changedImages[R]=!0,this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new t.k("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(R,ae,we={}){if(this._checkLoaded(),this.sourceCaches[R]!==void 0)throw new Error(`Source "${R}" already exists.`);if(!ae.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(ae).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(ae.type)>=0&&this._validate(t.u.source,`sources.${R}`,ae,null,we))return;this.map&&this.map._collectResourceTiming&&(ae.collectResourceTiming=!0);let Se=this.sourceCaches[R]=new kt(R,ae,this.dispatcher);Se.style=this,Se.setEventedParent(this,()=>({isSourceLoaded:Se.loaded(),source:Se.serialize(),sourceId:R})),Se.onAdd(this.map),this._changed=!0}removeSource(R){if(this._checkLoaded(),this.sourceCaches[R]===void 0)throw new Error("There is no source with this ID");for(let we in this._layers)if(this._layers[we].source===R)return this.fire(new t.j(new Error(`Source "${R}" cannot be removed while layer "${we}" is using it.`)));let ae=this.sourceCaches[R];delete this.sourceCaches[R],delete this._updatedSources[R],ae.fire(new t.k("data",{sourceDataType:"metadata",dataType:"source",sourceId:R})),ae.setEventedParent(null),ae.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(R,ae){if(this._checkLoaded(),this.sourceCaches[R]===void 0)throw new Error(`There is no source with this ID=${R}`);let we=this.sourceCaches[R].getSource();if(we.type!=="geojson")throw new Error(`geojsonSource.type is ${we.type}, which is !== 'geojson`);we.setData(ae),this._changed=!0}getSource(R){return this.sourceCaches[R]&&this.sourceCaches[R].getSource()}addLayer(R,ae,we={}){this._checkLoaded();let Se=R.id;if(this.getLayer(Se))return void this.fire(new t.j(new Error(`Layer "${Se}" already exists on this map.`)));let Oe;if(R.type==="custom"){if(Kr(this,t.aD(R)))return;Oe=t.aA(R)}else{if("source"in R&&typeof R.source=="object"&&(this.addSource(Se,R.source),R=t.aB(R),R=t.e(R,{source:Se})),this._validate(t.u.layer,`layers.${Se}`,R,{arrayIndex:-1},we))return;Oe=t.aA(R),this._validateLayer(Oe),Oe.setEventedParent(this,{layer:{id:Se}})}let pt=ae?this._order.indexOf(ae):this._order.length;if(ae&&pt===-1)this.fire(new t.j(new Error(`Cannot add layer "${Se}" before non-existing layer "${ae}".`)));else{if(this._order.splice(pt,0,Se),this._layerOrderChanged=!0,this._layers[Se]=Oe,this._removedLayers[Se]&&Oe.source&&Oe.type!=="custom"){let At=this._removedLayers[Se];delete this._removedLayers[Se],At.type!==Oe.type?this._updatedSources[Oe.source]="clear":(this._updatedSources[Oe.source]="reload",this.sourceCaches[Oe.source].pause())}this._updateLayer(Oe),Oe.onAdd&&Oe.onAdd(this.map)}}moveLayer(R,ae){if(this._checkLoaded(),this._changed=!0,!this._layers[R])return void this.fire(new t.j(new Error(`The layer '${R}' does not exist in the map's style and cannot be moved.`)));if(R===ae)return;let we=this._order.indexOf(R);this._order.splice(we,1);let Se=ae?this._order.indexOf(ae):this._order.length;ae&&Se===-1?this.fire(new t.j(new Error(`Cannot move layer "${R}" before non-existing layer "${ae}".`))):(this._order.splice(Se,0,R),this._layerOrderChanged=!0)}removeLayer(R){this._checkLoaded();let ae=this._layers[R];if(!ae)return void this.fire(new t.j(new Error(`Cannot remove non-existing layer "${R}".`)));ae.setEventedParent(null);let we=this._order.indexOf(R);this._order.splice(we,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[R]=ae,delete this._layers[R],this._serializedLayers&&delete this._serializedLayers[R],delete this._updatedLayers[R],delete this._updatedPaintProps[R],ae.onRemove&&ae.onRemove(this.map)}getLayer(R){return this._layers[R]}getLayersOrder(){return[...this._order]}hasLayer(R){return R in this._layers}setLayerZoomRange(R,ae,we){this._checkLoaded();let Se=this.getLayer(R);Se?Se.minzoom===ae&&Se.maxzoom===we||(ae!=null&&(Se.minzoom=ae),we!=null&&(Se.maxzoom=we),this._updateLayer(Se)):this.fire(new t.j(new Error(`Cannot set the zoom range of non-existing layer "${R}".`)))}setFilter(R,ae,we={}){this._checkLoaded();let Se=this.getLayer(R);if(Se){if(!t.aE(Se.filter,ae))return ae==null?(Se.filter=void 0,void this._updateLayer(Se)):void(this._validate(t.u.filter,`layers.${Se.id}.filter`,ae,null,we)||(Se.filter=t.aB(ae),this._updateLayer(Se)))}else this.fire(new t.j(new Error(`Cannot filter non-existing layer "${R}".`)))}getFilter(R){return t.aB(this.getLayer(R).filter)}setLayoutProperty(R,ae,we,Se={}){this._checkLoaded();let Oe=this.getLayer(R);Oe?t.aE(Oe.getLayoutProperty(ae),we)||(Oe.setLayoutProperty(ae,we,Se),this._updateLayer(Oe)):this.fire(new t.j(new Error(`Cannot style non-existing layer "${R}".`)))}getLayoutProperty(R,ae){let we=this.getLayer(R);if(we)return we.getLayoutProperty(ae);this.fire(new t.j(new Error(`Cannot get style of non-existing layer "${R}".`)))}setPaintProperty(R,ae,we,Se={}){this._checkLoaded();let Oe=this.getLayer(R);Oe?t.aE(Oe.getPaintProperty(ae),we)||(Oe.setPaintProperty(ae,we,Se)&&this._updateLayer(Oe),this._changed=!0,this._updatedPaintProps[R]=!0,this._serializedLayers=null):this.fire(new t.j(new Error(`Cannot style non-existing layer "${R}".`)))}getPaintProperty(R,ae){return this.getLayer(R).getPaintProperty(ae)}setFeatureState(R,ae){this._checkLoaded();let we=R.source,Se=R.sourceLayer,Oe=this.sourceCaches[we];if(Oe===void 0)return void this.fire(new t.j(new Error(`The source '${we}' does not exist in the map's style.`)));let pt=Oe.getSource().type;pt==="geojson"&&Se?this.fire(new t.j(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):pt!=="vector"||Se?(R.id===void 0&&this.fire(new t.j(new Error("The feature id parameter must be provided."))),Oe.setFeatureState(Se,R.id,ae)):this.fire(new t.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(R,ae){this._checkLoaded();let we=R.source,Se=this.sourceCaches[we];if(Se===void 0)return void this.fire(new t.j(new Error(`The source '${we}' does not exist in the map's style.`)));let Oe=Se.getSource().type,pt=Oe==="vector"?R.sourceLayer:void 0;Oe!=="vector"||pt?ae&&typeof R.id!="string"&&typeof R.id!="number"?this.fire(new t.j(new Error("A feature id is required to remove its specific state property."))):Se.removeFeatureState(pt,R.id,ae):this.fire(new t.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(R){this._checkLoaded();let ae=R.source,we=R.sourceLayer,Se=this.sourceCaches[ae];if(Se!==void 0)return Se.getSource().type!=="vector"||we?(R.id===void 0&&this.fire(new t.j(new Error("The feature id parameter must be provided."))),Se.getFeatureState(we,R.id)):void this.fire(new t.j(new Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new t.j(new Error(`The source '${ae}' does not exist in the map's style.`)))}getTransition(){return t.e({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){if(!this._loaded)return;let R=t.aF(this.sourceCaches,Oe=>Oe.serialize()),ae=this._serializeByIds(this._order,!0),we=this.map.getTerrain()||void 0,Se=this.stylesheet;return t.aG({version:Se.version,name:Se.name,metadata:Se.metadata,light:Se.light,sky:Se.sky,center:Se.center,zoom:Se.zoom,bearing:Se.bearing,pitch:Se.pitch,sprite:Se.sprite,glyphs:Se.glyphs,transition:Se.transition,sources:R,layers:ae,terrain:we},Oe=>Oe!==void 0)}_updateLayer(R){this._updatedLayers[R.id]=!0,R.source&&!this._updatedSources[R.source]&&this.sourceCaches[R.source].getSource().type!=="raster"&&(this._updatedSources[R.source]="reload",this.sourceCaches[R.source].pause()),this._serializedLayers=null,this._changed=!0}_flattenAndSortRenderedFeatures(R){let ae=pt=>this._layers[pt].type==="fill-extrusion",we={},Se=[];for(let pt=this._order.length-1;pt>=0;pt--){let At=this._order[pt];if(ae(At)){we[At]=pt;for(let Bt of R){let $t=Bt[At];if($t)for(let br of $t)Se.push(br)}}}Se.sort((pt,At)=>At.intersectionZ-pt.intersectionZ);let Oe=[];for(let pt=this._order.length-1;pt>=0;pt--){let At=this._order[pt];if(ae(At))for(let Bt=Se.length-1;Bt>=0;Bt--){let $t=Se[Bt].feature;if(we[$t.layer.id]{let Br=dt.featureSortOrder;if(Br){let Qr=Br.indexOf(mr.featureIndex);return Br.indexOf(Er.featureIndex)-Qr}return Er.featureIndex-mr.featureIndex});for(let mr of ur)Dt.push(mr)}}for(let dt in He)He[dt].forEach(Ct=>{let wt=Ct.feature,Dt=$t[At[dt].source].getFeatureState(wt.layer["source-layer"],wt.id);wt.source=wt.layer.source,wt.layer["source-layer"]&&(wt.sourceLayer=wt.layer["source-layer"]),wt.state=Dt});return He}(this._layers,pt,this.sourceCaches,R,ae,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(Oe)}querySourceFeatures(R,ae){ae&&ae.filter&&this._validate(t.u.filter,"querySourceFeatures.filter",ae.filter,null,ae);let we=this.sourceCaches[R];return we?function(Se,Oe){let pt=Se.getRenderableIds().map($t=>Se.getTileByID($t)),At=[],Bt={};for(let $t=0;$tYr.getTileByID(sa)).sort((sa,He)=>He.tileID.overscaledZ-sa.tileID.overscaledZ||(sa.tileID.isLessThan(He.tileID)?-1:1))}let Ar=this.crossTileSymbolIndex.addLayer(br,Bt[br.source],R.center.lng);pt=pt||Ar}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((Oe=Oe||this._layerOrderChanged||we===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(i.now(),R.zoom))&&(this.pauseablePlacement=new ct(R,this.map.terrain,this._order,Oe,ae,we,Se,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,Bt),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(i.now()),At=!0),pt&&this.pauseablePlacement.placement.setStale()),At||pt)for(let $t of this._order){let br=this._layers[$t];br.type==="symbol"&&this.placement.updateLayerOpacities(br,Bt[br.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(i.now())}_releaseSymbolFadeTiles(){for(let R in this.sourceCaches)this.sourceCaches[R].releaseSymbolFadeTiles()}getImages(R,ae){return t._(this,void 0,void 0,function*(){let we=yield this.imageManager.getImages(ae.icons);this._updateTilesForChangedImages();let Se=this.sourceCaches[ae.source];return Se&&Se.setDependencies(ae.tileID.key,ae.type,ae.icons),we})}getGlyphs(R,ae){return t._(this,void 0,void 0,function*(){let we=yield this.glyphManager.getGlyphs(ae.stacks),Se=this.sourceCaches[ae.source];return Se&&Se.setDependencies(ae.tileID.key,ae.type,[""]),we})}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(R,ae={}){this._checkLoaded(),R&&this._validate(t.u.glyphs,"glyphs",R,null,ae)||(this._glyphsDidChange=!0,this.stylesheet.glyphs=R,this.glyphManager.entries={},this.glyphManager.setURL(R))}addSprite(R,ae,we={},Se){this._checkLoaded();let Oe=[{id:R,url:ae}],pt=[...b(this.stylesheet.sprite),...Oe];this._validate(t.u.sprite,"sprite",pt,null,we)||(this.stylesheet.sprite=pt,this._loadSprite(Oe,!0,Se))}removeSprite(R){this._checkLoaded();let ae=b(this.stylesheet.sprite);if(ae.find(we=>we.id===R)){if(this._spritesImagesIds[R])for(let we of this._spritesImagesIds[R])this.imageManager.removeImage(we),this._changedImages[we]=!0;ae.splice(ae.findIndex(we=>we.id===R),1),this.stylesheet.sprite=ae.length>0?ae:void 0,delete this._spritesImagesIds[R],this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new t.k("data",{dataType:"style"}))}else this.fire(new t.j(new Error(`Sprite "${R}" doesn't exists on this map.`)))}getSprite(){return b(this.stylesheet.sprite)}setSprite(R,ae={},we){this._checkLoaded(),R&&this._validate(t.u.sprite,"sprite",R,null,ae)||(this.stylesheet.sprite=R,R?this._loadSprite(R,!0,we):(this._unloadSprite(),we&&we(null)))}}var da=t.Y([{name:"a_pos",type:"Int16",components:2}]);let fa={prelude:It(`#ifdef GL_ES precision mediump float; #else #if !defined(lowp) #define lowp #endif #if !defined(mediump) #define mediump #endif #if !defined(highp) #define highp #endif #endif `,`#ifdef GL_ES precision highp float; #else #if !defined(lowp) #define lowp #endif #if !defined(mediump) #define mediump #endif #if !defined(highp) #define highp #endif #endif vec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0 );}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;} #ifdef TERRAIN3D uniform sampler2D u_terrain;uniform float u_terrain_dim;uniform mat4 u_terrain_matrix;uniform vec4 u_terrain_unpack;uniform float u_terrain_exaggeration;uniform highp sampler2D u_depth; #endif const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitShifts=vec4(1.)/bitSh;highp float unpack(highp vec4 color) {return dot(color,bitShifts);}highp float depthOpacity(vec3 frag) { #ifdef TERRAIN3D highp float d=unpack(texture2D(u_depth,frag.xy*0.5+0.5))+0.0001-frag.z;return 1.0-max(0.0,min(1.0,-d*500.0)); #else return 1.0; #endif }float calculate_visibility(vec4 pos) { #ifdef TERRAIN3D vec3 frag=pos.xyz/pos.w;highp float d=depthOpacity(frag);if (d > 0.95) return 1.0;return (d+depthOpacity(frag+vec3(0.0,0.01,0.0)))/2.0; #else return 1.0; #endif }float ele(vec2 pos) { #ifdef TERRAIN3D vec4 rgb=(texture2D(u_terrain,pos)*255.0)*u_terrain_unpack;return rgb.r+rgb.g+rgb.b-u_terrain_unpack.a; #else return 0.0; #endif }float get_elevation(vec2 pos) { #ifdef TERRAIN3D vec2 coord=(u_terrain_matrix*vec4(pos,0.0,1.0)).xy*u_terrain_dim+1.0;vec2 f=fract(coord);vec2 c=(floor(coord)+0.5)/(u_terrain_dim+2.0);float d=1.0/(u_terrain_dim+2.0);float tl=ele(c);float tr=ele(c+vec2(d,0.0));float bl=ele(c+vec2(0.0,d));float br=ele(c+vec2(d,d));float elevation=mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);return elevation*u_terrain_exaggeration; #else return 0.0; #endif }`),background:It(`uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,"attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),backgroundPattern:It(`uniform vec2 u_pattern_tl_a;uniform vec2 u_pattern_br_a;uniform vec2 u_pattern_tl_b;uniform vec2 u_pattern_br_b;uniform vec2 u_texsize;uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_mix)*u_opacity; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,"uniform mat4 u_matrix;uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);}"),circle:It(`varying vec3 v_data;varying float v_visibility; #pragma mapbox: define highp vec4 color #pragma mapbox: define mediump float radius #pragma mapbox: define lowp float blur #pragma mapbox: define lowp float opacity #pragma mapbox: define highp vec4 stroke_color #pragma mapbox: define mediump float stroke_width #pragma mapbox: define lowp float stroke_opacity void main() { #pragma mapbox: initialize highp vec4 color #pragma mapbox: initialize mediump float radius #pragma mapbox: initialize lowp float blur #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize highp vec4 stroke_color #pragma mapbox: initialize mediump float stroke_width #pragma mapbox: initialize lowp float stroke_opacity vec2 extrude=v_data.xy;float extrude_length=length(extrude);float antialiased_blur=v_data.z;float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width));gl_FragColor=v_visibility*opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t); #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,`uniform mat4 u_matrix;uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;varying vec3 v_data;varying float v_visibility; #pragma mapbox: define highp vec4 color #pragma mapbox: define mediump float radius #pragma mapbox: define lowp float blur #pragma mapbox: define lowp float opacity #pragma mapbox: define highp vec4 stroke_color #pragma mapbox: define mediump float stroke_width #pragma mapbox: define lowp float stroke_opacity void main(void) { #pragma mapbox: initialize highp vec4 color #pragma mapbox: initialize mediump float radius #pragma mapbox: initialize lowp float blur #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize highp vec4 stroke_color #pragma mapbox: initialize mediump float stroke_width #pragma mapbox: initialize lowp float stroke_opacity vec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);float ele=get_elevation(circle_center);v_visibility=calculate_visibility(u_matrix*vec4(circle_center,ele,1.0));if (u_pitch_with_map) {vec2 corner_position=circle_center;if (u_scale_with_map) {corner_position+=extrude*(radius+stroke_width)*u_extrude_scale;} else {vec4 projected_center=u_matrix*vec4(circle_center,0,1);corner_position+=extrude*(radius+stroke_width)*u_extrude_scale*(projected_center.w/u_camera_to_center_distance);}gl_Position=u_matrix*vec4(corner_position,ele,1);} else {gl_Position=u_matrix*vec4(circle_center,ele,1);if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}float antialiasblur=-max(1.0/u_device_pixel_ratio/(radius+stroke_width),blur);v_data=vec3(extrude.x,extrude.y,antialiasblur);}`),clippingMask:It("void main() {gl_FragColor=vec4(1.0);}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),heatmap:It(`uniform highp float u_intensity;varying vec2 v_extrude; #pragma mapbox: define highp float weight #define GAUSS_COEF 0.3989422804014327 void main() { #pragma mapbox: initialize highp float weight float d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);gl_FragColor=vec4(val,1.0,1.0,1.0); #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,`uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos;varying vec2 v_extrude; #pragma mapbox: define highp float weight #pragma mapbox: define mediump float radius const highp float ZERO=1.0/255.0/16.0; #define GAUSS_COEF 0.3989422804014327 void main(void) { #pragma mapbox: initialize highp float weight #pragma mapbox: initialize mediump float radius vec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec4 pos=vec4(floor(a_pos*0.5)+extrude,get_elevation(floor(a_pos*0.5)),1);gl_Position=u_matrix*pos;}`),heatmapTexture:It(`uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;varying vec2 v_pos;void main() {float t=texture2D(u_image,v_pos).r;vec4 color=texture2D(u_color_ramp,vec2(t,0.5));gl_FragColor=color*u_opacity; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(0.0); #endif }`,"uniform mat4 u_matrix;uniform vec2 u_world;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"),collisionBox:It("varying float v_placed;varying float v_notUsed;void main() {float alpha=0.5;gl_FragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}","attribute vec2 a_anchor_pos;attribute vec2 a_placed;attribute vec2 a_box_real;uniform mat4 u_matrix;uniform vec2 u_pixel_extrude_scale;varying float v_placed;varying float v_notUsed;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);}void main() {gl_Position=projectTileWithElevation(a_anchor_pos,get_elevation(a_anchor_pos));gl_Position.xy=((a_box_real+0.5)*u_pixel_extrude_scale*2.0-1.0)*vec2(1.0,-1.0)*gl_Position.w;if (gl_Position.z/gl_Position.w < 1.1) {gl_Position.z=0.5;}v_placed=a_placed.x;v_notUsed=a_placed.y;}"),collisionCircle:It("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),debug:It("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}","attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,get_elevation(a_pos),1);}"),fill:It(`#pragma mapbox: define highp vec4 color #pragma mapbox: define lowp float opacity void main() { #pragma mapbox: initialize highp vec4 color #pragma mapbox: initialize lowp float opacity gl_FragColor=color*opacity; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,`attribute vec2 a_pos;uniform mat4 u_matrix; #pragma mapbox: define highp vec4 color #pragma mapbox: define lowp float opacity void main() { #pragma mapbox: initialize highp vec4 color #pragma mapbox: initialize lowp float opacity gl_Position=u_matrix*vec4(a_pos,0,1);}`),fillOutline:It(`varying vec2 v_pos; #pragma mapbox: define highp vec4 outline_color #pragma mapbox: define lowp float opacity void main() { #pragma mapbox: initialize highp vec4 outline_color #pragma mapbox: initialize lowp float opacity float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity); #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,`attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos; #pragma mapbox: define highp vec4 outline_color #pragma mapbox: define lowp float opacity void main() { #pragma mapbox: initialize highp vec4 outline_color #pragma mapbox: initialize lowp float opacity gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),fillOutlinePattern:It(`uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos; #pragma mapbox: define lowp float opacity #pragma mapbox: define lowp vec4 pattern_from #pragma mapbox: define lowp vec4 pattern_to void main() { #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize mediump vec4 pattern_from #pragma mapbox: initialize mediump vec4 pattern_to vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,`uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos; #pragma mapbox: define lowp float opacity #pragma mapbox: define lowp vec4 pattern_from #pragma mapbox: define lowp vec4 pattern_to #pragma mapbox: define lowp float pixel_ratio_from #pragma mapbox: define lowp float pixel_ratio_to void main() { #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize mediump vec4 pattern_from #pragma mapbox: initialize mediump vec4 pattern_to #pragma mapbox: initialize lowp float pixel_ratio_from #pragma mapbox: initialize lowp float pixel_ratio_to vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),fillPattern:It(`#ifdef GL_ES precision highp float; #endif uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b; #pragma mapbox: define lowp float opacity #pragma mapbox: define lowp vec4 pattern_from #pragma mapbox: define lowp vec4 pattern_to void main() { #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize mediump vec4 pattern_from #pragma mapbox: initialize mediump vec4 pattern_to vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b; #pragma mapbox: define lowp float opacity #pragma mapbox: define lowp vec4 pattern_from #pragma mapbox: define lowp vec4 pattern_to #pragma mapbox: define lowp float pixel_ratio_from #pragma mapbox: define lowp float pixel_ratio_to void main() { #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize mediump vec4 pattern_from #pragma mapbox: initialize mediump vec4 pattern_to #pragma mapbox: initialize lowp float pixel_ratio_from #pragma mapbox: initialize lowp float pixel_ratio_to vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}`),fillExtrusion:It(`varying vec4 v_color;void main() {gl_FragColor=v_color; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,`uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed; #ifdef TERRAIN3D attribute vec2 a_centroid; #endif varying vec4 v_color; #pragma mapbox: define highp float base #pragma mapbox: define highp float height #pragma mapbox: define highp vec4 color void main() { #pragma mapbox: initialize highp float base #pragma mapbox: initialize highp float height #pragma mapbox: initialize highp vec4 color vec3 normal=a_normal_ed.xyz; #ifdef TERRAIN3D float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0); #else float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0; #endif base=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}`),fillExtrusionPattern:It(`uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting; #pragma mapbox: define lowp float base #pragma mapbox: define lowp float height #pragma mapbox: define lowp vec4 pattern_from #pragma mapbox: define lowp vec4 pattern_to #pragma mapbox: define lowp float pixel_ratio_from #pragma mapbox: define lowp float pixel_ratio_to void main() { #pragma mapbox: initialize lowp float base #pragma mapbox: initialize lowp float height #pragma mapbox: initialize mediump vec4 pattern_from #pragma mapbox: initialize mediump vec4 pattern_to #pragma mapbox: initialize lowp float pixel_ratio_from #pragma mapbox: initialize lowp float pixel_ratio_to vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed; #ifdef TERRAIN3D attribute vec2 a_centroid; #endif varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting; #pragma mapbox: define lowp float base #pragma mapbox: define lowp float height #pragma mapbox: define lowp vec4 pattern_from #pragma mapbox: define lowp vec4 pattern_to #pragma mapbox: define lowp float pixel_ratio_from #pragma mapbox: define lowp float pixel_ratio_to void main() { #pragma mapbox: initialize lowp float base #pragma mapbox: initialize lowp float height #pragma mapbox: initialize mediump vec4 pattern_from #pragma mapbox: initialize mediump vec4 pattern_to #pragma mapbox: initialize lowp float pixel_ratio_from #pragma mapbox: initialize lowp float pixel_ratio_to vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to; #ifdef TERRAIN3D float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0); #else float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0; #endif base=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0 ? a_pos : vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}`),hillshadePrepare:It(`#ifdef GL_ES precision highp float; #endif uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0); #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,"uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),hillshade:It(`uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent; #define PI 3.141592653589793 void main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,"uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}"),line:It(`uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale; #pragma mapbox: define highp vec4 color #pragma mapbox: define lowp float blur #pragma mapbox: define lowp float opacity void main() { #pragma mapbox: initialize highp vec4 color #pragma mapbox: initialize lowp float blur #pragma mapbox: initialize lowp float opacity float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity); #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,` #define scale 0.015873016 attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar; #pragma mapbox: define highp vec4 color #pragma mapbox: define lowp float blur #pragma mapbox: define lowp float opacity #pragma mapbox: define mediump float gapwidth #pragma mapbox: define lowp float offset #pragma mapbox: define mediump float width void main() { #pragma mapbox: initialize highp vec4 color #pragma mapbox: initialize lowp float blur #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize mediump float gapwidth #pragma mapbox: initialize lowp float offset #pragma mapbox: initialize mediump float width float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude; #ifdef TERRAIN3D v_gamma_scale=1.0; #else float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; #endif v_width2=vec2(outset,inset);}`),lineGradient:It(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv; #pragma mapbox: define lowp float blur #pragma mapbox: define lowp float opacity void main() { #pragma mapbox: initialize lowp float blur #pragma mapbox: initialize lowp float opacity float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,v_uv);gl_FragColor=color*(alpha*opacity); #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,` #define scale 0.015873016 attribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv; #pragma mapbox: define lowp float blur #pragma mapbox: define lowp float opacity #pragma mapbox: define mediump float gapwidth #pragma mapbox: define lowp float offset #pragma mapbox: define mediump float width void main() { #pragma mapbox: initialize lowp float blur #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize mediump float gapwidth #pragma mapbox: initialize lowp float offset #pragma mapbox: initialize mediump float width float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude; #ifdef TERRAIN3D v_gamma_scale=1.0; #else float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; #endif v_width2=vec2(outset,inset);}`),linePattern:It(`#ifdef GL_ES precision highp float; #endif uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width; #pragma mapbox: define lowp vec4 pattern_from #pragma mapbox: define lowp vec4 pattern_to #pragma mapbox: define lowp float pixel_ratio_from #pragma mapbox: define lowp float pixel_ratio_to #pragma mapbox: define lowp float blur #pragma mapbox: define lowp float opacity void main() { #pragma mapbox: initialize mediump vec4 pattern_from #pragma mapbox: initialize mediump vec4 pattern_to #pragma mapbox: initialize lowp float pixel_ratio_from #pragma mapbox: initialize lowp float pixel_ratio_to #pragma mapbox: initialize lowp float blur #pragma mapbox: initialize lowp float opacity vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,` #define scale 0.015873016 #define LINE_DISTANCE_SCALE 2.0 attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width; #pragma mapbox: define lowp float blur #pragma mapbox: define lowp float opacity #pragma mapbox: define lowp float offset #pragma mapbox: define mediump float gapwidth #pragma mapbox: define mediump float width #pragma mapbox: define lowp float floorwidth #pragma mapbox: define lowp vec4 pattern_from #pragma mapbox: define lowp vec4 pattern_to #pragma mapbox: define lowp float pixel_ratio_from #pragma mapbox: define lowp float pixel_ratio_to void main() { #pragma mapbox: initialize lowp float blur #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize lowp float offset #pragma mapbox: initialize mediump float gapwidth #pragma mapbox: initialize mediump float width #pragma mapbox: initialize lowp float floorwidth #pragma mapbox: initialize mediump vec4 pattern_from #pragma mapbox: initialize mediump vec4 pattern_to #pragma mapbox: initialize lowp float pixel_ratio_from #pragma mapbox: initialize lowp float pixel_ratio_to float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude; #ifdef TERRAIN3D v_gamma_scale=1.0; #else float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; #endif v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}`),lineSDF:It(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale; #pragma mapbox: define highp vec4 color #pragma mapbox: define lowp float blur #pragma mapbox: define lowp float opacity #pragma mapbox: define mediump float width #pragma mapbox: define lowp float floorwidth void main() { #pragma mapbox: initialize highp vec4 color #pragma mapbox: initialize lowp float blur #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize mediump float width #pragma mapbox: initialize lowp float floorwidth float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity); #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,` #define scale 0.015873016 #define LINE_DISTANCE_SCALE 2.0 attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale; #pragma mapbox: define highp vec4 color #pragma mapbox: define lowp float blur #pragma mapbox: define lowp float opacity #pragma mapbox: define mediump float gapwidth #pragma mapbox: define lowp float offset #pragma mapbox: define mediump float width #pragma mapbox: define lowp float floorwidth void main() { #pragma mapbox: initialize highp vec4 color #pragma mapbox: initialize lowp float blur #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize mediump float gapwidth #pragma mapbox: initialize lowp float offset #pragma mapbox: initialize mediump float width #pragma mapbox: initialize lowp float floorwidth float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude; #ifdef TERRAIN3D v_gamma_scale=1.0; #else float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; #endif v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}`),raster:It(`uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a); #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,"uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}"),symbolIcon:It(`uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity; #pragma mapbox: define lowp float opacity void main() { #pragma mapbox: initialize lowp float opacity lowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,`attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform vec2 u_translation;uniform float u_pitched_scale;varying vec2 v_tex;varying float v_fade_opacity;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);} #pragma mapbox: define lowp float opacity void main() { #pragma mapbox: initialize lowp float opacity vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? camera_to_anchor_distance/u_camera_to_center_distance : u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}gl_Position=finalPos;v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float visibility=calculate_visibility(projectedPoint);v_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));}`),symbolSDF:It(`#define SDF_PX 8.0 uniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1; #pragma mapbox: define highp vec4 fill_color #pragma mapbox: define highp vec4 halo_color #pragma mapbox: define lowp float opacity #pragma mapbox: define lowp float halo_width #pragma mapbox: define lowp float halo_blur void main() { #pragma mapbox: initialize highp vec4 fill_color #pragma mapbox: initialize highp vec4 halo_color #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize lowp float halo_width #pragma mapbox: initialize lowp float halo_blur float EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float inner_edge=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);inner_edge=inner_edge+gamma*gamma_scale;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(inner_edge-gamma_scaled,inner_edge+gamma_scaled,dist);if (u_is_halo) {lowp float halo_edge=(6.0-halo_width/fontScale)/SDF_PX;alpha=min(smoothstep(halo_edge-gamma_scaled,halo_edge+gamma_scaled,dist),1.0-alpha);}gl_FragColor=color*(alpha*opacity*fade_opacity); #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,`attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_translation;uniform float u_pitched_scale;varying vec2 v_data0;varying vec3 v_data1;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);} #pragma mapbox: define highp vec4 fill_color #pragma mapbox: define highp vec4 halo_color #pragma mapbox: define lowp float opacity #pragma mapbox: define lowp float halo_width #pragma mapbox: define lowp float halo_blur void main() { #pragma mapbox: initialize highp vec4 fill_color #pragma mapbox: initialize highp vec4 halo_color #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize lowp float halo_width #pragma mapbox: initialize lowp float halo_blur vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? camera_to_anchor_distance/u_camera_to_center_distance : u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}float gamma_scale=finalPos.w;gl_Position=finalPos;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}`),symbolTextAndIcon:It(`#define SDF_PX 8.0 #define SDF 1.0 #define ICON 0.0 uniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1; #pragma mapbox: define highp vec4 fill_color #pragma mapbox: define highp vec4 halo_color #pragma mapbox: define lowp float opacity #pragma mapbox: define lowp float halo_width #pragma mapbox: define lowp float halo_blur void main() { #pragma mapbox: initialize highp vec4 fill_color #pragma mapbox: initialize highp vec4 halo_color #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize lowp float halo_width #pragma mapbox: initialize lowp float halo_blur float fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif return;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity); #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,`attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform vec2 u_translation;uniform float u_pitched_scale;varying vec4 v_data0;varying vec4 v_data1;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);} #pragma mapbox: define highp vec4 fill_color #pragma mapbox: define highp vec4 halo_color #pragma mapbox: define lowp float opacity #pragma mapbox: define lowp float halo_width #pragma mapbox: define lowp float halo_blur void main() { #pragma mapbox: initialize highp vec4 fill_color #pragma mapbox: initialize highp vec4 halo_color #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize lowp float halo_width #pragma mapbox: initialize lowp float halo_blur vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? camera_to_anchor_distance/u_camera_to_center_distance : u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}float gamma_scale=finalPos.w;gl_Position=finalPos;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}`),terrain:It("uniform sampler2D u_texture;uniform vec4 u_fog_color;uniform vec4 u_horizon_color;uniform float u_fog_ground_blend;uniform float u_fog_ground_blend_opacity;uniform float u_horizon_fog_blend;varying vec2 v_texture_pos;varying float v_fog_depth;const float gamma=2.2;vec4 gammaToLinear(vec4 color) {return pow(color,vec4(gamma));}vec4 linearToGamma(vec4 color) {return pow(color,vec4(1.0/gamma));}void main() {vec4 surface_color=texture2D(u_texture,v_texture_pos);if (v_fog_depth > u_fog_ground_blend) {vec4 surface_color_linear=gammaToLinear(surface_color);float blend_color=smoothstep(0.0,1.0,max((v_fog_depth-u_horizon_fog_blend)/(1.0-u_horizon_fog_blend),0.0));vec4 fog_horizon_color_linear=mix(gammaToLinear(u_fog_color),gammaToLinear(u_horizon_color),blend_color);float factor_fog=max(v_fog_depth-u_fog_ground_blend,0.0)/(1.0-u_fog_ground_blend);gl_FragColor=linearToGamma(mix(surface_color_linear,fog_horizon_color_linear,pow(factor_fog,2.0)*u_fog_ground_blend_opacity));} else {gl_FragColor=surface_color;}}","attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform mat4 u_fog_matrix;uniform float u_ele_delta;varying vec2 v_texture_pos;varying float v_fog_depth;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/8192.0;gl_Position=u_matrix*vec4(a_pos3d.xy,ele-ele_delta,1.0);vec4 pos=u_fog_matrix*vec4(a_pos3d.xy,ele,1.0);v_fog_depth=pos.z/pos.w*0.5+0.5;}"),terrainDepth:It("varying float v_depth;const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitMsk=vec4(0.,vec3(1./256.0));highp vec4 pack(highp float value) {highp vec4 comp=fract(value*bitSh);comp-=comp.xxyz*bitMsk;return comp;}void main() {gl_FragColor=pack(v_depth);}","attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform float u_ele_delta;varying float v_depth;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;gl_Position=u_matrix*vec4(a_pos3d.xy,ele-ele_delta,1.0);v_depth=gl_Position.z/gl_Position.w;}"),terrainCoords:It("precision mediump float;uniform sampler2D u_texture;uniform float u_terrain_coords_id;varying vec2 v_texture_pos;void main() {vec4 rgba=texture2D(u_texture,v_texture_pos);gl_FragColor=vec4(rgba.r,rgba.g,rgba.b,u_terrain_coords_id);}","attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform float u_ele_delta;varying vec2 v_texture_pos;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/8192.0;gl_Position=u_matrix*vec4(a_pos3d.xy,ele-ele_delta,1.0);}"),sky:It("uniform vec4 u_sky_color;uniform vec4 u_horizon_color;uniform float u_horizon;uniform float u_sky_horizon_blend;void main() {float y=gl_FragCoord.y;if (y > u_horizon) {float blend=y-u_horizon;if (blend < u_sky_horizon_blend) {gl_FragColor=mix(u_sky_color,u_horizon_color,pow(1.0-blend/u_sky_horizon_blend,2.0));} else {gl_FragColor=u_sky_color;}}}","attribute vec2 a_pos;void main() {gl_Position=vec4(a_pos,1.0,1.0);}")};function It(Ne,R){let ae=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,we=R.match(/attribute ([\w]+) ([\w]+)/g),Se=Ne.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),Oe=R.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),pt=Oe?Oe.concat(Se):Se,At={};return{fragmentSource:Ne=Ne.replace(ae,(Bt,$t,br,Ar,Yr)=>(At[Yr]=!0,$t==="define"?` #ifndef HAS_UNIFORM_u_${Yr} varying ${br} ${Ar} ${Yr}; #else uniform ${br} ${Ar} u_${Yr}; #endif `:` #ifdef HAS_UNIFORM_u_${Yr} ${br} ${Ar} ${Yr} = u_${Yr}; #endif `)),vertexSource:R=R.replace(ae,(Bt,$t,br,Ar,Yr)=>{let sa=Ar==="float"?"vec2":"vec4",He=Yr.match(/color/)?"color":sa;return At[Yr]?$t==="define"?` #ifndef HAS_UNIFORM_u_${Yr} uniform lowp float u_${Yr}_t; attribute ${br} ${sa} a_${Yr}; varying ${br} ${Ar} ${Yr}; #else uniform ${br} ${Ar} u_${Yr}; #endif `:He==="vec4"?` #ifndef HAS_UNIFORM_u_${Yr} ${Yr} = a_${Yr}; #else ${br} ${Ar} ${Yr} = u_${Yr}; #endif `:` #ifndef HAS_UNIFORM_u_${Yr} ${Yr} = unpack_mix_${He}(a_${Yr}, u_${Yr}_t); #else ${br} ${Ar} ${Yr} = u_${Yr}; #endif `:$t==="define"?` #ifndef HAS_UNIFORM_u_${Yr} uniform lowp float u_${Yr}_t; attribute ${br} ${sa} a_${Yr}; #else uniform ${br} ${Ar} u_${Yr}; #endif `:He==="vec4"?` #ifndef HAS_UNIFORM_u_${Yr} ${br} ${Ar} ${Yr} = a_${Yr}; #else ${br} ${Ar} ${Yr} = u_${Yr}; #endif `:` #ifndef HAS_UNIFORM_u_${Yr} ${br} ${Ar} ${Yr} = unpack_mix_${He}(a_${Yr}, u_${Yr}_t); #else ${br} ${Ar} ${Yr} = u_${Yr}; #endif `}),staticAttributes:we,staticUniforms:pt}}class dr{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(R,ae,we,Se,Oe,pt,At,Bt,$t){this.context=R;let br=this.boundPaintVertexBuffers.length!==Se.length;for(let Ar=0;!br&&Ar({u_matrix:Ne,u_texture:0,u_ele_delta:R,u_fog_matrix:ae,u_fog_color:we?we.properties.get("fog-color"):t.aM.white,u_fog_ground_blend:we?we.properties.get("fog-ground-blend"):1,u_fog_ground_blend_opacity:we?we.calculateFogBlendOpacity(Se):0,u_horizon_color:we?we.properties.get("horizon-color"):t.aM.white,u_horizon_fog_blend:we?we.properties.get("horizon-fog-blend"):1});function ia(Ne){let R=[];for(let ae=0;ae({u_depth:new t.aH(mr,Er.u_depth),u_terrain:new t.aH(mr,Er.u_terrain),u_terrain_dim:new t.aI(mr,Er.u_terrain_dim),u_terrain_matrix:new t.aJ(mr,Er.u_terrain_matrix),u_terrain_unpack:new t.aK(mr,Er.u_terrain_unpack),u_terrain_exaggeration:new t.aI(mr,Er.u_terrain_exaggeration)}))(R,ur),this.binderUniforms=we?we.getUniforms(R,ur):[]}draw(R,ae,we,Se,Oe,pt,At,Bt,$t,br,Ar,Yr,sa,He,Je,ut,dt,Ct){let wt=R.gl;if(this.failedToCreate)return;if(R.program.set(this.program),R.setDepthMode(we),R.setStencilMode(Se),R.setColorMode(Oe),R.setCullFace(pt),Bt){R.activeTexture.set(wt.TEXTURE2),wt.bindTexture(wt.TEXTURE_2D,Bt.depthTexture),R.activeTexture.set(wt.TEXTURE3),wt.bindTexture(wt.TEXTURE_2D,Bt.texture);for(let ur in this.terrainUniforms)this.terrainUniforms[ur].set(Bt[ur])}for(let ur in this.fixedUniforms)this.fixedUniforms[ur].set(At[ur]);Je&&Je.setUniforms(R,this.binderUniforms,sa,{zoom:He});let Dt=0;switch(ae){case wt.LINES:Dt=2;break;case wt.TRIANGLES:Dt=3;break;case wt.LINE_STRIP:Dt=1}for(let ur of Yr.get()){let mr=ur.vaos||(ur.vaos={});(mr[$t]||(mr[$t]=new dr)).bind(R,this,br,Je?Je.getPaintVertexBuffers():[],Ar,ur.vertexOffset,ut,dt,Ct),wt.drawElements(ae,ur.primitiveLength*Dt,wt.UNSIGNED_SHORT,ur.primitiveOffset*Dt*2)}}}function Fa(Ne,R,ae){let we=1/Ua(ae,1,R.transform.tileZoom),Se=Math.pow(2,ae.tileID.overscaledZ),Oe=ae.tileSize*Math.pow(2,R.transform.tileZoom)/Se,pt=Oe*(ae.tileID.canonical.x+ae.tileID.wrap*Se),At=Oe*ae.tileID.canonical.y;return{u_image:0,u_texsize:ae.imageAtlasTexture.size,u_scale:[we,Ne.fromScale,Ne.toScale],u_fade:Ne.t,u_pixel_coord_upper:[pt>>16,At>>16],u_pixel_coord_lower:[65535&pt,65535&At]}}let Ya=(Ne,R,ae,we)=>{let Se=R.style.light,Oe=Se.properties.get("position"),pt=[Oe.x,Oe.y,Oe.z],At=function(){var $t=new t.A(9);return t.A!=Float32Array&&($t[1]=0,$t[2]=0,$t[3]=0,$t[5]=0,$t[6]=0,$t[7]=0),$t[0]=1,$t[4]=1,$t[8]=1,$t}();Se.properties.get("anchor")==="viewport"&&function($t,br){var Ar=Math.sin(br),Yr=Math.cos(br);$t[0]=Yr,$t[1]=Ar,$t[2]=0,$t[3]=-Ar,$t[4]=Yr,$t[5]=0,$t[6]=0,$t[7]=0,$t[8]=1}(At,-R.transform.angle),function($t,br,Ar){var Yr=br[0],sa=br[1],He=br[2];$t[0]=Yr*Ar[0]+sa*Ar[3]+He*Ar[6],$t[1]=Yr*Ar[1]+sa*Ar[4]+He*Ar[7],$t[2]=Yr*Ar[2]+sa*Ar[5]+He*Ar[8]}(pt,pt,At);let Bt=Se.properties.get("color");return{u_matrix:Ne,u_lightpos:pt,u_lightintensity:Se.properties.get("intensity"),u_lightcolor:[Bt.r,Bt.g,Bt.b],u_vertical_gradient:+ae,u_opacity:we}},ha=(Ne,R,ae,we,Se,Oe,pt)=>t.e(Ya(Ne,R,ae,we),Fa(Oe,R,pt),{u_height_factor:-Math.pow(2,Se.overscaledZ)/pt.tileSize/8}),Da=Ne=>({u_matrix:Ne}),Xi=(Ne,R,ae,we)=>t.e(Da(Ne),Fa(ae,R,we)),Li=(Ne,R)=>({u_matrix:Ne,u_world:R}),fn=(Ne,R,ae,we,Se)=>t.e(Xi(Ne,R,ae,we),{u_world:Se}),An=(Ne,R,ae,we)=>{let Se=Ne.transform,Oe,pt;if(we.paint.get("circle-pitch-alignment")==="map"){let At=Ua(ae,1,Se.zoom);Oe=!0,pt=[At,At]}else Oe=!1,pt=Se.pixelsToGLUnits;return{u_camera_to_center_distance:Se.cameraToCenterDistance,u_scale_with_map:+(we.paint.get("circle-pitch-scale")==="map"),u_matrix:Ne.translatePosMatrix(R.posMatrix,ae,we.paint.get("circle-translate"),we.paint.get("circle-translate-anchor")),u_pitch_with_map:+Oe,u_device_pixel_ratio:Ne.pixelRatio,u_extrude_scale:pt}},kn=(Ne,R,ae)=>({u_matrix:Ne,u_inv_matrix:R,u_camera_to_center_distance:ae.cameraToCenterDistance,u_viewport_size:[ae.width,ae.height]}),zn=(Ne,R,ae=1)=>({u_matrix:Ne,u_color:R,u_overlay:0,u_overlay_scale:ae}),Xn=Ne=>({u_matrix:Ne}),to=(Ne,R,ae,we)=>({u_matrix:Ne,u_extrude_scale:Ua(R,1,ae),u_intensity:we}),mo=(Ne,R,ae,we)=>{let Se=t.H();t.aP(Se,0,Ne.width,Ne.height,0,0,1);let Oe=Ne.context.gl;return{u_matrix:Se,u_world:[Oe.drawingBufferWidth,Oe.drawingBufferHeight],u_image:ae,u_color_ramp:we,u_opacity:R.paint.get("heatmap-opacity")}};function pn(Ne,R){let ae=Math.pow(2,R.canonical.z),we=R.canonical.y;return[new t.Z(0,we/ae).toLngLat().lat,new t.Z(0,(we+1)/ae).toLngLat().lat]}let Jo=(Ne,R,ae,we)=>{let Se=Ne.transform;return{u_matrix:Vn(Ne,R,ae,we),u_ratio:1/Ua(R,1,Se.zoom),u_device_pixel_ratio:Ne.pixelRatio,u_units_to_pixels:[1/Se.pixelsToGLUnits[0],1/Se.pixelsToGLUnits[1]]}},Xo=(Ne,R,ae,we,Se)=>t.e(Jo(Ne,R,ae,Se),{u_image:0,u_image_height:we}),Ts=(Ne,R,ae,we,Se)=>{let Oe=Ne.transform,pt=so(R,Oe);return{u_matrix:Vn(Ne,R,ae,Se),u_texsize:R.imageAtlasTexture.size,u_ratio:1/Ua(R,1,Oe.zoom),u_device_pixel_ratio:Ne.pixelRatio,u_image:0,u_scale:[pt,we.fromScale,we.toScale],u_fade:we.t,u_units_to_pixels:[1/Oe.pixelsToGLUnits[0],1/Oe.pixelsToGLUnits[1]]}},Po=(Ne,R,ae,we,Se,Oe)=>{let pt=Ne.lineAtlas,At=so(R,Ne.transform),Bt=ae.layout.get("line-cap")==="round",$t=pt.getDash(we.from,Bt),br=pt.getDash(we.to,Bt),Ar=$t.width*Se.fromScale,Yr=br.width*Se.toScale;return t.e(Jo(Ne,R,ae,Oe),{u_patternscale_a:[At/Ar,-$t.height/2],u_patternscale_b:[At/Yr,-br.height/2],u_sdfgamma:pt.width/(256*Math.min(Ar,Yr)*Ne.pixelRatio)/2,u_image:0,u_tex_y_a:$t.y,u_tex_y_b:br.y,u_mix:Se.t})};function so(Ne,R){return 1/Ua(Ne,1,R.tileZoom)}function Vn(Ne,R,ae,we){return Ne.translatePosMatrix(we?we.posMatrix:R.tileID.posMatrix,R,ae.paint.get("line-translate"),ae.paint.get("line-translate-anchor"))}let To=(Ne,R,ae,we,Se)=>{return{u_matrix:Ne,u_tl_parent:R,u_scale_parent:ae,u_buffer_scale:1,u_fade_t:we.mix,u_opacity:we.opacity*Se.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:Se.paint.get("raster-brightness-min"),u_brightness_high:Se.paint.get("raster-brightness-max"),u_saturation_factor:(pt=Se.paint.get("raster-saturation"),pt>0?1-1/(1.001-pt):-pt),u_contrast_factor:(Oe=Se.paint.get("raster-contrast"),Oe>0?1/(1-Oe):1+Oe),u_spin_weights:qo(Se.paint.get("raster-hue-rotate"))};var Oe,pt};function qo(Ne){Ne*=Math.PI/180;let R=Math.sin(Ne),ae=Math.cos(Ne);return[(2*ae+1)/3,(-Math.sqrt(3)*R-ae+1)/3,(Math.sqrt(3)*R-ae+1)/3]}let Oo=(Ne,R,ae,we,Se,Oe,pt,At,Bt,$t,br,Ar,Yr,sa)=>{let He=pt.transform;return{u_is_size_zoom_constant:+(Ne==="constant"||Ne==="source"),u_is_size_feature_constant:+(Ne==="constant"||Ne==="camera"),u_size_t:R?R.uSizeT:0,u_size:R?R.uSize:0,u_camera_to_center_distance:He.cameraToCenterDistance,u_pitch:He.pitch/360*2*Math.PI,u_rotate_symbol:+ae,u_aspect_ratio:He.width/He.height,u_fade_change:pt.options.fadeDuration?pt.symbolFadeChange:1,u_matrix:At,u_label_plane_matrix:Bt,u_coord_matrix:$t,u_is_text:+Ar,u_pitch_with_map:+we,u_is_along_line:Se,u_is_variable_anchor:Oe,u_texsize:Yr,u_texture:0,u_translation:br,u_pitched_scale:sa}},lo=(Ne,R,ae,we,Se,Oe,pt,At,Bt,$t,br,Ar,Yr,sa,He)=>{let Je=pt.transform;return t.e(Oo(Ne,R,ae,we,Se,Oe,pt,At,Bt,$t,br,Ar,Yr,He),{u_gamma_scale:we?Math.cos(Je._pitch)*Je.cameraToCenterDistance:1,u_device_pixel_ratio:pt.pixelRatio,u_is_halo:+sa})},Co=(Ne,R,ae,we,Se,Oe,pt,At,Bt,$t,br,Ar,Yr,sa)=>t.e(lo(Ne,R,ae,we,Se,Oe,pt,At,Bt,$t,br,!0,Ar,!0,sa),{u_texsize_icon:Yr,u_texture_icon:1}),os=(Ne,R,ae)=>({u_matrix:Ne,u_opacity:R,u_color:ae}),Ys=(Ne,R,ae,we,Se,Oe)=>t.e(function(pt,At,Bt,$t){let br=Bt.imageManager.getPattern(pt.from.toString()),Ar=Bt.imageManager.getPattern(pt.to.toString()),{width:Yr,height:sa}=Bt.imageManager.getPixelSize(),He=Math.pow(2,$t.tileID.overscaledZ),Je=$t.tileSize*Math.pow(2,Bt.transform.tileZoom)/He,ut=Je*($t.tileID.canonical.x+$t.tileID.wrap*He),dt=Je*$t.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:br.tl,u_pattern_br_a:br.br,u_pattern_tl_b:Ar.tl,u_pattern_br_b:Ar.br,u_texsize:[Yr,sa],u_mix:At.t,u_pattern_size_a:br.displaySize,u_pattern_size_b:Ar.displaySize,u_scale_a:At.fromScale,u_scale_b:At.toScale,u_tile_units_to_pixels:1/Ua($t,1,Bt.transform.tileZoom),u_pixel_coord_upper:[ut>>16,dt>>16],u_pixel_coord_lower:[65535&ut,65535&dt]}}(we,Oe,ae,Se),{u_matrix:Ne,u_opacity:R}),Os={fillExtrusion:(Ne,R)=>({u_matrix:new t.aJ(Ne,R.u_matrix),u_lightpos:new t.aN(Ne,R.u_lightpos),u_lightintensity:new t.aI(Ne,R.u_lightintensity),u_lightcolor:new t.aN(Ne,R.u_lightcolor),u_vertical_gradient:new t.aI(Ne,R.u_vertical_gradient),u_opacity:new t.aI(Ne,R.u_opacity)}),fillExtrusionPattern:(Ne,R)=>({u_matrix:new t.aJ(Ne,R.u_matrix),u_lightpos:new t.aN(Ne,R.u_lightpos),u_lightintensity:new t.aI(Ne,R.u_lightintensity),u_lightcolor:new t.aN(Ne,R.u_lightcolor),u_vertical_gradient:new t.aI(Ne,R.u_vertical_gradient),u_height_factor:new t.aI(Ne,R.u_height_factor),u_image:new t.aH(Ne,R.u_image),u_texsize:new t.aO(Ne,R.u_texsize),u_pixel_coord_upper:new t.aO(Ne,R.u_pixel_coord_upper),u_pixel_coord_lower:new t.aO(Ne,R.u_pixel_coord_lower),u_scale:new t.aN(Ne,R.u_scale),u_fade:new t.aI(Ne,R.u_fade),u_opacity:new t.aI(Ne,R.u_opacity)}),fill:(Ne,R)=>({u_matrix:new t.aJ(Ne,R.u_matrix)}),fillPattern:(Ne,R)=>({u_matrix:new t.aJ(Ne,R.u_matrix),u_image:new t.aH(Ne,R.u_image),u_texsize:new t.aO(Ne,R.u_texsize),u_pixel_coord_upper:new t.aO(Ne,R.u_pixel_coord_upper),u_pixel_coord_lower:new t.aO(Ne,R.u_pixel_coord_lower),u_scale:new t.aN(Ne,R.u_scale),u_fade:new t.aI(Ne,R.u_fade)}),fillOutline:(Ne,R)=>({u_matrix:new t.aJ(Ne,R.u_matrix),u_world:new t.aO(Ne,R.u_world)}),fillOutlinePattern:(Ne,R)=>({u_matrix:new t.aJ(Ne,R.u_matrix),u_world:new t.aO(Ne,R.u_world),u_image:new t.aH(Ne,R.u_image),u_texsize:new t.aO(Ne,R.u_texsize),u_pixel_coord_upper:new t.aO(Ne,R.u_pixel_coord_upper),u_pixel_coord_lower:new t.aO(Ne,R.u_pixel_coord_lower),u_scale:new t.aN(Ne,R.u_scale),u_fade:new t.aI(Ne,R.u_fade)}),circle:(Ne,R)=>({u_camera_to_center_distance:new t.aI(Ne,R.u_camera_to_center_distance),u_scale_with_map:new t.aH(Ne,R.u_scale_with_map),u_pitch_with_map:new t.aH(Ne,R.u_pitch_with_map),u_extrude_scale:new t.aO(Ne,R.u_extrude_scale),u_device_pixel_ratio:new t.aI(Ne,R.u_device_pixel_ratio),u_matrix:new t.aJ(Ne,R.u_matrix)}),collisionBox:(Ne,R)=>({u_matrix:new t.aJ(Ne,R.u_matrix),u_pixel_extrude_scale:new t.aO(Ne,R.u_pixel_extrude_scale)}),collisionCircle:(Ne,R)=>({u_matrix:new t.aJ(Ne,R.u_matrix),u_inv_matrix:new t.aJ(Ne,R.u_inv_matrix),u_camera_to_center_distance:new t.aI(Ne,R.u_camera_to_center_distance),u_viewport_size:new t.aO(Ne,R.u_viewport_size)}),debug:(Ne,R)=>({u_color:new t.aL(Ne,R.u_color),u_matrix:new t.aJ(Ne,R.u_matrix),u_overlay:new t.aH(Ne,R.u_overlay),u_overlay_scale:new t.aI(Ne,R.u_overlay_scale)}),clippingMask:(Ne,R)=>({u_matrix:new t.aJ(Ne,R.u_matrix)}),heatmap:(Ne,R)=>({u_extrude_scale:new t.aI(Ne,R.u_extrude_scale),u_intensity:new t.aI(Ne,R.u_intensity),u_matrix:new t.aJ(Ne,R.u_matrix)}),heatmapTexture:(Ne,R)=>({u_matrix:new t.aJ(Ne,R.u_matrix),u_world:new t.aO(Ne,R.u_world),u_image:new t.aH(Ne,R.u_image),u_color_ramp:new t.aH(Ne,R.u_color_ramp),u_opacity:new t.aI(Ne,R.u_opacity)}),hillshade:(Ne,R)=>({u_matrix:new t.aJ(Ne,R.u_matrix),u_image:new t.aH(Ne,R.u_image),u_latrange:new t.aO(Ne,R.u_latrange),u_light:new t.aO(Ne,R.u_light),u_shadow:new t.aL(Ne,R.u_shadow),u_highlight:new t.aL(Ne,R.u_highlight),u_accent:new t.aL(Ne,R.u_accent)}),hillshadePrepare:(Ne,R)=>({u_matrix:new t.aJ(Ne,R.u_matrix),u_image:new t.aH(Ne,R.u_image),u_dimension:new t.aO(Ne,R.u_dimension),u_zoom:new t.aI(Ne,R.u_zoom),u_unpack:new t.aK(Ne,R.u_unpack)}),line:(Ne,R)=>({u_matrix:new t.aJ(Ne,R.u_matrix),u_ratio:new t.aI(Ne,R.u_ratio),u_device_pixel_ratio:new t.aI(Ne,R.u_device_pixel_ratio),u_units_to_pixels:new t.aO(Ne,R.u_units_to_pixels)}),lineGradient:(Ne,R)=>({u_matrix:new t.aJ(Ne,R.u_matrix),u_ratio:new t.aI(Ne,R.u_ratio),u_device_pixel_ratio:new t.aI(Ne,R.u_device_pixel_ratio),u_units_to_pixels:new t.aO(Ne,R.u_units_to_pixels),u_image:new t.aH(Ne,R.u_image),u_image_height:new t.aI(Ne,R.u_image_height)}),linePattern:(Ne,R)=>({u_matrix:new t.aJ(Ne,R.u_matrix),u_texsize:new t.aO(Ne,R.u_texsize),u_ratio:new t.aI(Ne,R.u_ratio),u_device_pixel_ratio:new t.aI(Ne,R.u_device_pixel_ratio),u_image:new t.aH(Ne,R.u_image),u_units_to_pixels:new t.aO(Ne,R.u_units_to_pixels),u_scale:new t.aN(Ne,R.u_scale),u_fade:new t.aI(Ne,R.u_fade)}),lineSDF:(Ne,R)=>({u_matrix:new t.aJ(Ne,R.u_matrix),u_ratio:new t.aI(Ne,R.u_ratio),u_device_pixel_ratio:new t.aI(Ne,R.u_device_pixel_ratio),u_units_to_pixels:new t.aO(Ne,R.u_units_to_pixels),u_patternscale_a:new t.aO(Ne,R.u_patternscale_a),u_patternscale_b:new t.aO(Ne,R.u_patternscale_b),u_sdfgamma:new t.aI(Ne,R.u_sdfgamma),u_image:new t.aH(Ne,R.u_image),u_tex_y_a:new t.aI(Ne,R.u_tex_y_a),u_tex_y_b:new t.aI(Ne,R.u_tex_y_b),u_mix:new t.aI(Ne,R.u_mix)}),raster:(Ne,R)=>({u_matrix:new t.aJ(Ne,R.u_matrix),u_tl_parent:new t.aO(Ne,R.u_tl_parent),u_scale_parent:new t.aI(Ne,R.u_scale_parent),u_buffer_scale:new t.aI(Ne,R.u_buffer_scale),u_fade_t:new t.aI(Ne,R.u_fade_t),u_opacity:new t.aI(Ne,R.u_opacity),u_image0:new t.aH(Ne,R.u_image0),u_image1:new t.aH(Ne,R.u_image1),u_brightness_low:new t.aI(Ne,R.u_brightness_low),u_brightness_high:new t.aI(Ne,R.u_brightness_high),u_saturation_factor:new t.aI(Ne,R.u_saturation_factor),u_contrast_factor:new t.aI(Ne,R.u_contrast_factor),u_spin_weights:new t.aN(Ne,R.u_spin_weights)}),symbolIcon:(Ne,R)=>({u_is_size_zoom_constant:new t.aH(Ne,R.u_is_size_zoom_constant),u_is_size_feature_constant:new t.aH(Ne,R.u_is_size_feature_constant),u_size_t:new t.aI(Ne,R.u_size_t),u_size:new t.aI(Ne,R.u_size),u_camera_to_center_distance:new t.aI(Ne,R.u_camera_to_center_distance),u_pitch:new t.aI(Ne,R.u_pitch),u_rotate_symbol:new t.aH(Ne,R.u_rotate_symbol),u_aspect_ratio:new t.aI(Ne,R.u_aspect_ratio),u_fade_change:new t.aI(Ne,R.u_fade_change),u_matrix:new t.aJ(Ne,R.u_matrix),u_label_plane_matrix:new t.aJ(Ne,R.u_label_plane_matrix),u_coord_matrix:new t.aJ(Ne,R.u_coord_matrix),u_is_text:new t.aH(Ne,R.u_is_text),u_pitch_with_map:new t.aH(Ne,R.u_pitch_with_map),u_is_along_line:new t.aH(Ne,R.u_is_along_line),u_is_variable_anchor:new t.aH(Ne,R.u_is_variable_anchor),u_texsize:new t.aO(Ne,R.u_texsize),u_texture:new t.aH(Ne,R.u_texture),u_translation:new t.aO(Ne,R.u_translation),u_pitched_scale:new t.aI(Ne,R.u_pitched_scale)}),symbolSDF:(Ne,R)=>({u_is_size_zoom_constant:new t.aH(Ne,R.u_is_size_zoom_constant),u_is_size_feature_constant:new t.aH(Ne,R.u_is_size_feature_constant),u_size_t:new t.aI(Ne,R.u_size_t),u_size:new t.aI(Ne,R.u_size),u_camera_to_center_distance:new t.aI(Ne,R.u_camera_to_center_distance),u_pitch:new t.aI(Ne,R.u_pitch),u_rotate_symbol:new t.aH(Ne,R.u_rotate_symbol),u_aspect_ratio:new t.aI(Ne,R.u_aspect_ratio),u_fade_change:new t.aI(Ne,R.u_fade_change),u_matrix:new t.aJ(Ne,R.u_matrix),u_label_plane_matrix:new t.aJ(Ne,R.u_label_plane_matrix),u_coord_matrix:new t.aJ(Ne,R.u_coord_matrix),u_is_text:new t.aH(Ne,R.u_is_text),u_pitch_with_map:new t.aH(Ne,R.u_pitch_with_map),u_is_along_line:new t.aH(Ne,R.u_is_along_line),u_is_variable_anchor:new t.aH(Ne,R.u_is_variable_anchor),u_texsize:new t.aO(Ne,R.u_texsize),u_texture:new t.aH(Ne,R.u_texture),u_gamma_scale:new t.aI(Ne,R.u_gamma_scale),u_device_pixel_ratio:new t.aI(Ne,R.u_device_pixel_ratio),u_is_halo:new t.aH(Ne,R.u_is_halo),u_translation:new t.aO(Ne,R.u_translation),u_pitched_scale:new t.aI(Ne,R.u_pitched_scale)}),symbolTextAndIcon:(Ne,R)=>({u_is_size_zoom_constant:new t.aH(Ne,R.u_is_size_zoom_constant),u_is_size_feature_constant:new t.aH(Ne,R.u_is_size_feature_constant),u_size_t:new t.aI(Ne,R.u_size_t),u_size:new t.aI(Ne,R.u_size),u_camera_to_center_distance:new t.aI(Ne,R.u_camera_to_center_distance),u_pitch:new t.aI(Ne,R.u_pitch),u_rotate_symbol:new t.aH(Ne,R.u_rotate_symbol),u_aspect_ratio:new t.aI(Ne,R.u_aspect_ratio),u_fade_change:new t.aI(Ne,R.u_fade_change),u_matrix:new t.aJ(Ne,R.u_matrix),u_label_plane_matrix:new t.aJ(Ne,R.u_label_plane_matrix),u_coord_matrix:new t.aJ(Ne,R.u_coord_matrix),u_is_text:new t.aH(Ne,R.u_is_text),u_pitch_with_map:new t.aH(Ne,R.u_pitch_with_map),u_is_along_line:new t.aH(Ne,R.u_is_along_line),u_is_variable_anchor:new t.aH(Ne,R.u_is_variable_anchor),u_texsize:new t.aO(Ne,R.u_texsize),u_texsize_icon:new t.aO(Ne,R.u_texsize_icon),u_texture:new t.aH(Ne,R.u_texture),u_texture_icon:new t.aH(Ne,R.u_texture_icon),u_gamma_scale:new t.aI(Ne,R.u_gamma_scale),u_device_pixel_ratio:new t.aI(Ne,R.u_device_pixel_ratio),u_is_halo:new t.aH(Ne,R.u_is_halo),u_translation:new t.aO(Ne,R.u_translation),u_pitched_scale:new t.aI(Ne,R.u_pitched_scale)}),background:(Ne,R)=>({u_matrix:new t.aJ(Ne,R.u_matrix),u_opacity:new t.aI(Ne,R.u_opacity),u_color:new t.aL(Ne,R.u_color)}),backgroundPattern:(Ne,R)=>({u_matrix:new t.aJ(Ne,R.u_matrix),u_opacity:new t.aI(Ne,R.u_opacity),u_image:new t.aH(Ne,R.u_image),u_pattern_tl_a:new t.aO(Ne,R.u_pattern_tl_a),u_pattern_br_a:new t.aO(Ne,R.u_pattern_br_a),u_pattern_tl_b:new t.aO(Ne,R.u_pattern_tl_b),u_pattern_br_b:new t.aO(Ne,R.u_pattern_br_b),u_texsize:new t.aO(Ne,R.u_texsize),u_mix:new t.aI(Ne,R.u_mix),u_pattern_size_a:new t.aO(Ne,R.u_pattern_size_a),u_pattern_size_b:new t.aO(Ne,R.u_pattern_size_b),u_scale_a:new t.aI(Ne,R.u_scale_a),u_scale_b:new t.aI(Ne,R.u_scale_b),u_pixel_coord_upper:new t.aO(Ne,R.u_pixel_coord_upper),u_pixel_coord_lower:new t.aO(Ne,R.u_pixel_coord_lower),u_tile_units_to_pixels:new t.aI(Ne,R.u_tile_units_to_pixels)}),terrain:(Ne,R)=>({u_matrix:new t.aJ(Ne,R.u_matrix),u_texture:new t.aH(Ne,R.u_texture),u_ele_delta:new t.aI(Ne,R.u_ele_delta),u_fog_matrix:new t.aJ(Ne,R.u_fog_matrix),u_fog_color:new t.aL(Ne,R.u_fog_color),u_fog_ground_blend:new t.aI(Ne,R.u_fog_ground_blend),u_fog_ground_blend_opacity:new t.aI(Ne,R.u_fog_ground_blend_opacity),u_horizon_color:new t.aL(Ne,R.u_horizon_color),u_horizon_fog_blend:new t.aI(Ne,R.u_horizon_fog_blend)}),terrainDepth:(Ne,R)=>({u_matrix:new t.aJ(Ne,R.u_matrix),u_ele_delta:new t.aI(Ne,R.u_ele_delta)}),terrainCoords:(Ne,R)=>({u_matrix:new t.aJ(Ne,R.u_matrix),u_texture:new t.aH(Ne,R.u_texture),u_terrain_coords_id:new t.aI(Ne,R.u_terrain_coords_id),u_ele_delta:new t.aI(Ne,R.u_ele_delta)}),sky:(Ne,R)=>({u_sky_color:new t.aL(Ne,R.u_sky_color),u_horizon_color:new t.aL(Ne,R.u_horizon_color),u_horizon:new t.aI(Ne,R.u_horizon),u_sky_horizon_blend:new t.aI(Ne,R.u_sky_horizon_blend)})};class Yo{constructor(R,ae,we){this.context=R;let Se=R.gl;this.buffer=Se.createBuffer(),this.dynamicDraw=!!we,this.context.unbindVAO(),R.bindElementBuffer.set(this.buffer),Se.bufferData(Se.ELEMENT_ARRAY_BUFFER,ae.arrayBuffer,this.dynamicDraw?Se.DYNAMIC_DRAW:Se.STATIC_DRAW),this.dynamicDraw||delete ae.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(R){let ae=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),ae.bufferSubData(ae.ELEMENT_ARRAY_BUFFER,0,R.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}let Ui={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class Cn{constructor(R,ae,we,Se){this.length=ae.length,this.attributes=we,this.itemSize=ae.bytesPerElement,this.dynamicDraw=Se,this.context=R;let Oe=R.gl;this.buffer=Oe.createBuffer(),R.bindVertexBuffer.set(this.buffer),Oe.bufferData(Oe.ARRAY_BUFFER,ae.arrayBuffer,this.dynamicDraw?Oe.DYNAMIC_DRAW:Oe.STATIC_DRAW),this.dynamicDraw||delete ae.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(R){if(R.length!==this.length)throw new Error(`Length of new data is ${R.length}, which doesn't match current length of ${this.length}`);let ae=this.context.gl;this.bind(),ae.bufferSubData(ae.ARRAY_BUFFER,0,R.arrayBuffer)}enableAttributes(R,ae){for(let we=0;we0){let mr=t.H();t.aQ(mr,wt.placementInvProjMatrix,Ne.transform.glCoordMatrix),t.aQ(mr,mr,wt.placementViewportMatrix),Bt.push({circleArray:ur,circleOffset:br,transform:Ct.posMatrix,invTransform:mr,coord:Ct}),$t+=ur.length/4,br=$t}Dt&&At.draw(Oe,pt.LINES,ls.disabled,Ss.disabled,Ne.colorModeForRenderPass(),Qn.disabled,{u_matrix:Ct.posMatrix,u_pixel_extrude_scale:[1/(Ar=Ne.transform).width,1/Ar.height]},Ne.style.map.terrain&&Ne.style.map.terrain.getTerrainData(Ct),ae.id,Dt.layoutVertexBuffer,Dt.indexBuffer,Dt.segments,null,Ne.transform.zoom,null,null,Dt.collisionVertexBuffer)}var Ar;if(!Se||!Bt.length)return;let Yr=Ne.useProgram("collisionCircle"),sa=new t.aR;sa.resize(4*$t),sa._trim();let He=0;for(let dt of Bt)for(let Ct=0;Ct=0&&(dt[wt.associatedIconIndex]={shiftedAnchor:Tn,angle:Wn})}else rr(wt.numGlyphs,Je)}if($t){ut.clear();let Ct=Ne.icon.placedSymbolArray;for(let wt=0;wtNe.style.map.terrain.getElevation(Sa,zt,gr):null,ar=ae.layout.get("text-rotation-alignment")==="map";Ue(di,Sa.posMatrix,Ne,Se,$l,hu,dt,$t,ar,Je,Sa.toUnwrapped(),He.width,He.height,wl,St)}let ql=Sa.posMatrix,Vl=Se&&Br||uc,de=Ct||Vl?Ul:$l,De=Ru,et=on&&ae.paint.get(Se?"text-halo-width":"icon-halo-width").constantOr(1)!==0,vt;vt=on?di.iconsInText?Co(Tn.kind,Ao,wt,dt,Ct,Vl,Ne,ql,de,De,wl,So,Js,ga):lo(Tn.kind,Ao,wt,dt,Ct,Vl,Ne,ql,de,De,wl,Se,So,!0,ga):Oo(Tn.kind,Ao,wt,dt,Ct,Vl,Ne,ql,de,De,wl,Se,So,ga);let _t={program:Bn,buffers:Wi,uniformValues:vt,atlasTexture:Ko,atlasTextureIcon:es,atlasInterpolation:hs,atlasInterpolationIcon:ll,isSDF:on,hasHalo:et};if(ur&&di.canOverlap){mr=!0;let St=Wi.segments.get();for(let ar of St)Qr.push({segments:new t.a0([ar]),sortKey:ar.sortKey,state:_t,terrainData:ss})}else Qr.push({segments:Wi.segments,sortKey:0,state:_t,terrainData:ss})}mr&&Qr.sort((Sa,Oa)=>Sa.sortKey-Oa.sortKey);for(let Sa of Qr){let Oa=Sa.state;if(Yr.activeTexture.set(sa.TEXTURE0),Oa.atlasTexture.bind(Oa.atlasInterpolation,sa.CLAMP_TO_EDGE),Oa.atlasTextureIcon&&(Yr.activeTexture.set(sa.TEXTURE1),Oa.atlasTextureIcon&&Oa.atlasTextureIcon.bind(Oa.atlasInterpolationIcon,sa.CLAMP_TO_EDGE)),Oa.isSDF){let di=Oa.uniformValues;Oa.hasHalo&&(di.u_is_halo=1,zf(Oa.buffers,Sa.segments,ae,Ne,Oa.program,Er,br,Ar,di,Sa.terrainData)),di.u_is_halo=0}zf(Oa.buffers,Sa.segments,ae,Ne,Oa.program,Er,br,Ar,Oa.uniformValues,Sa.terrainData)}}function zf(Ne,R,ae,we,Se,Oe,pt,At,Bt,$t){let br=we.context;Se.draw(br,br.gl.TRIANGLES,Oe,pt,At,Qn.disabled,Bt,$t,ae.id,Ne.layoutVertexBuffer,Ne.indexBuffer,R,ae.paint,we.transform.zoom,Ne.programConfigurations.get(ae.id),Ne.dynamicLayoutVertexBuffer,Ne.opacityVertexBuffer)}function af(Ne,R,ae,we){let Se=Ne.context,Oe=Se.gl,pt=Ss.disabled,At=new cl([Oe.ONE,Oe.ONE],t.aM.transparent,[!0,!0,!0,!0]),Bt=R.getBucket(ae);if(!Bt)return;let $t=we.key,br=ae.heatmapFbos.get($t);br||(br=Ff(Se,R.tileSize,R.tileSize),ae.heatmapFbos.set($t,br)),Se.bindFramebuffer.set(br.framebuffer),Se.viewport.set([0,0,R.tileSize,R.tileSize]),Se.clear({color:t.aM.transparent});let Ar=Bt.programConfigurations.get(ae.id),Yr=Ne.useProgram("heatmap",Ar),sa=Ne.style.map.terrain.getTerrainData(we);Yr.draw(Se,Oe.TRIANGLES,ls.disabled,pt,At,Qn.disabled,to(we.posMatrix,R,Ne.transform.zoom,ae.paint.get("heatmap-intensity")),sa,ae.id,Bt.layoutVertexBuffer,Bt.indexBuffer,Bt.segments,ae.paint,Ne.transform.zoom,Ar)}function Nc(Ne,R,ae){let we=Ne.context,Se=we.gl;we.setColorMode(Ne.colorModeForRenderPass());let Oe=Of(we,R),pt=ae.key,At=R.heatmapFbos.get(pt);At&&(we.activeTexture.set(Se.TEXTURE0),Se.bindTexture(Se.TEXTURE_2D,At.colorAttachment.get()),we.activeTexture.set(Se.TEXTURE1),Oe.bind(Se.LINEAR,Se.CLAMP_TO_EDGE),Ne.useProgram("heatmapTexture").draw(we,Se.TRIANGLES,ls.disabled,Ss.disabled,Ne.colorModeForRenderPass(),Qn.disabled,mo(Ne,R,0,1),null,R.id,Ne.rasterBoundsBuffer,Ne.quadTriangleIndexBuffer,Ne.rasterBoundsSegments,R.paint,Ne.transform.zoom),At.destroy(),R.heatmapFbos.delete(pt))}function Ff(Ne,R,ae){var we,Se;let Oe=Ne.gl,pt=Oe.createTexture();Oe.bindTexture(Oe.TEXTURE_2D,pt),Oe.texParameteri(Oe.TEXTURE_2D,Oe.TEXTURE_WRAP_S,Oe.CLAMP_TO_EDGE),Oe.texParameteri(Oe.TEXTURE_2D,Oe.TEXTURE_WRAP_T,Oe.CLAMP_TO_EDGE),Oe.texParameteri(Oe.TEXTURE_2D,Oe.TEXTURE_MIN_FILTER,Oe.LINEAR),Oe.texParameteri(Oe.TEXTURE_2D,Oe.TEXTURE_MAG_FILTER,Oe.LINEAR);let At=(we=Ne.HALF_FLOAT)!==null&&we!==void 0?we:Oe.UNSIGNED_BYTE,Bt=(Se=Ne.RGBA16F)!==null&&Se!==void 0?Se:Oe.RGBA;Oe.texImage2D(Oe.TEXTURE_2D,0,Bt,R,ae,0,Oe.RGBA,At,null);let $t=Ne.createFramebuffer(R,ae,!1,!1);return $t.colorAttachment.set(pt),$t}function Of(Ne,R){return R.colorRampTexture||(R.colorRampTexture=new u(Ne,R.colorRamp,Ne.gl.RGBA)),R.colorRampTexture}function Gu(Ne,R,ae,we,Se){if(!ae||!we||!we.imageAtlas)return;let Oe=we.imageAtlas.patternPositions,pt=Oe[ae.to.toString()],At=Oe[ae.from.toString()];if(!pt&&At&&(pt=At),!At&&pt&&(At=pt),!pt||!At){let Bt=Se.getPaintProperty(R);pt=Oe[Bt],At=Oe[Bt]}pt&&At&&Ne.setConstantPatternPositions(pt,At)}function Ef(Ne,R,ae,we,Se,Oe,pt){let At=Ne.context.gl,Bt="fill-pattern",$t=ae.paint.get(Bt),br=$t&&$t.constantOr(1),Ar=ae.getCrossfadeParameters(),Yr,sa,He,Je,ut;pt?(sa=br&&!ae.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",Yr=At.LINES):(sa=br?"fillPattern":"fill",Yr=At.TRIANGLES);let dt=$t.constantOr(null);for(let Ct of we){let wt=R.getTile(Ct);if(br&&!wt.patternsLoaded())continue;let Dt=wt.getBucket(ae);if(!Dt)continue;let ur=Dt.programConfigurations.get(ae.id),mr=Ne.useProgram(sa,ur),Er=Ne.style.map.terrain&&Ne.style.map.terrain.getTerrainData(Ct);br&&(Ne.context.activeTexture.set(At.TEXTURE0),wt.imageAtlasTexture.bind(At.LINEAR,At.CLAMP_TO_EDGE),ur.updatePaintBuffers(Ar)),Gu(ur,Bt,dt,wt,ae);let Br=Er?Ct:null,Qr=Ne.translatePosMatrix(Br?Br.posMatrix:Ct.posMatrix,wt,ae.paint.get("fill-translate"),ae.paint.get("fill-translate-anchor"));if(pt){Je=Dt.indexBuffer2,ut=Dt.segments2;let ga=[At.drawingBufferWidth,At.drawingBufferHeight];He=sa==="fillOutlinePattern"&&br?fn(Qr,Ne,Ar,wt,ga):Li(Qr,ga)}else Je=Dt.indexBuffer,ut=Dt.segments,He=br?Xi(Qr,Ne,Ar,wt):Da(Qr);mr.draw(Ne.context,Yr,Se,Ne.stencilModeForClipping(Ct),Oe,Qn.disabled,He,Er,ae.id,Dt.layoutVertexBuffer,Je,ut,ae.paint,Ne.transform.zoom,ur)}}function oc(Ne,R,ae,we,Se,Oe,pt){let At=Ne.context,Bt=At.gl,$t="fill-extrusion-pattern",br=ae.paint.get($t),Ar=br.constantOr(1),Yr=ae.getCrossfadeParameters(),sa=ae.paint.get("fill-extrusion-opacity"),He=br.constantOr(null);for(let Je of we){let ut=R.getTile(Je),dt=ut.getBucket(ae);if(!dt)continue;let Ct=Ne.style.map.terrain&&Ne.style.map.terrain.getTerrainData(Je),wt=dt.programConfigurations.get(ae.id),Dt=Ne.useProgram(Ar?"fillExtrusionPattern":"fillExtrusion",wt);Ar&&(Ne.context.activeTexture.set(Bt.TEXTURE0),ut.imageAtlasTexture.bind(Bt.LINEAR,Bt.CLAMP_TO_EDGE),wt.updatePaintBuffers(Yr)),Gu(wt,$t,He,ut,ae);let ur=Ne.translatePosMatrix(Je.posMatrix,ut,ae.paint.get("fill-extrusion-translate"),ae.paint.get("fill-extrusion-translate-anchor")),mr=ae.paint.get("fill-extrusion-vertical-gradient"),Er=Ar?ha(ur,Ne,mr,sa,Je,Yr,ut):Ya(ur,Ne,mr,sa);Dt.draw(At,At.gl.TRIANGLES,Se,Oe,pt,Qn.backCCW,Er,Ct,ae.id,dt.layoutVertexBuffer,dt.indexBuffer,dt.segments,ae.paint,Ne.transform.zoom,wt,Ne.style.map.terrain&&dt.centroidVertexBuffer)}}function Hc(Ne,R,ae,we,Se,Oe,pt){let At=Ne.context,Bt=At.gl,$t=ae.fbo;if(!$t)return;let br=Ne.useProgram("hillshade"),Ar=Ne.style.map.terrain&&Ne.style.map.terrain.getTerrainData(R);At.activeTexture.set(Bt.TEXTURE0),Bt.bindTexture(Bt.TEXTURE_2D,$t.colorAttachment.get()),br.draw(At,Bt.TRIANGLES,Se,Oe,pt,Qn.disabled,((Yr,sa,He,Je)=>{let ut=He.paint.get("hillshade-shadow-color"),dt=He.paint.get("hillshade-highlight-color"),Ct=He.paint.get("hillshade-accent-color"),wt=He.paint.get("hillshade-illumination-direction")*(Math.PI/180);He.paint.get("hillshade-illumination-anchor")==="viewport"&&(wt-=Yr.transform.angle);let Dt=!Yr.options.moving;return{u_matrix:Je?Je.posMatrix:Yr.transform.calculatePosMatrix(sa.tileID.toUnwrapped(),Dt),u_image:0,u_latrange:pn(0,sa.tileID),u_light:[He.paint.get("hillshade-exaggeration"),wt],u_shadow:ut,u_highlight:dt,u_accent:Ct}})(Ne,ae,we,Ar?R:null),Ar,we.id,Ne.rasterBoundsBuffer,Ne.quadTriangleIndexBuffer,Ne.rasterBoundsSegments)}function Jl(Ne,R,ae,we,Se,Oe){let pt=Ne.context,At=pt.gl,Bt=R.dem;if(Bt&&Bt.data){let $t=Bt.dim,br=Bt.stride,Ar=Bt.getPixels();if(pt.activeTexture.set(At.TEXTURE1),pt.pixelStoreUnpackPremultiplyAlpha.set(!1),R.demTexture=R.demTexture||Ne.getTileTexture(br),R.demTexture){let sa=R.demTexture;sa.update(Ar,{premultiply:!1}),sa.bind(At.NEAREST,At.CLAMP_TO_EDGE)}else R.demTexture=new u(pt,Ar,At.RGBA,{premultiply:!1}),R.demTexture.bind(At.NEAREST,At.CLAMP_TO_EDGE);pt.activeTexture.set(At.TEXTURE0);let Yr=R.fbo;if(!Yr){let sa=new u(pt,{width:$t,height:$t,data:null},At.RGBA);sa.bind(At.LINEAR,At.CLAMP_TO_EDGE),Yr=R.fbo=pt.createFramebuffer($t,$t,!0,!1),Yr.colorAttachment.set(sa.texture)}pt.bindFramebuffer.set(Yr.framebuffer),pt.viewport.set([0,0,$t,$t]),Ne.useProgram("hillshadePrepare").draw(pt,At.TRIANGLES,we,Se,Oe,Qn.disabled,((sa,He)=>{let Je=He.stride,ut=t.H();return t.aP(ut,0,t.X,-t.X,0,0,1),t.J(ut,ut,[0,-t.X,0]),{u_matrix:ut,u_image:1,u_dimension:[Je,Je],u_zoom:sa.overscaledZ,u_unpack:He.getUnpackVector()}})(R.tileID,Bt),null,ae.id,Ne.rasterBoundsBuffer,Ne.quadTriangleIndexBuffer,Ne.rasterBoundsSegments),R.needsHillshadePrepare=!1}}function Uc(Ne,R,ae,we,Se,Oe){let pt=we.paint.get("raster-fade-duration");if(!Oe&&pt>0){let At=i.now(),Bt=(At-Ne.timeAdded)/pt,$t=R?(At-R.timeAdded)/pt:-1,br=ae.getSource(),Ar=Se.coveringZoomLevel({tileSize:br.tileSize,roundZoom:br.roundZoom}),Yr=!R||Math.abs(R.tileID.overscaledZ-Ar)>Math.abs(Ne.tileID.overscaledZ-Ar),sa=Yr&&Ne.refreshedUponExpiration?1:t.ac(Yr?Bt:1-$t,0,1);return Ne.refreshedUponExpiration&&Bt>=1&&(Ne.refreshedUponExpiration=!1),R?{opacity:1,mix:1-sa}:{opacity:sa,mix:0}}return{opacity:1,mix:0}}let Tc=new t.aM(1,0,0,1),Gs=new t.aM(0,1,0,1),Cf=new t.aM(0,0,1,1),lh=new t.aM(1,0,1,1),Bf=new t.aM(0,1,1,1);function Wc(Ne,R,ae,we){ku(Ne,0,R+ae/2,Ne.transform.width,ae,we)}function Kf(Ne,R,ae,we){ku(Ne,R-ae/2,0,ae,Ne.transform.height,we)}function ku(Ne,R,ae,we,Se,Oe){let pt=Ne.context,At=pt.gl;At.enable(At.SCISSOR_TEST),At.scissor(R*Ne.pixelRatio,ae*Ne.pixelRatio,we*Ne.pixelRatio,Se*Ne.pixelRatio),pt.clear({color:Oe}),At.disable(At.SCISSOR_TEST)}function Nf(Ne,R,ae){let we=Ne.context,Se=we.gl,Oe=ae.posMatrix,pt=Ne.useProgram("debug"),At=ls.disabled,Bt=Ss.disabled,$t=Ne.colorModeForRenderPass(),br="$debug",Ar=Ne.style.map.terrain&&Ne.style.map.terrain.getTerrainData(ae);we.activeTexture.set(Se.TEXTURE0);let Yr=R.getTileByID(ae.key).latestRawTileData,sa=Math.floor((Yr&&Yr.byteLength||0)/1024),He=R.getTile(ae).tileSize,Je=512/Math.min(He,512)*(ae.overscaledZ/Ne.transform.zoom)*.5,ut=ae.canonical.toString();ae.overscaledZ!==ae.canonical.z&&(ut+=` => ${ae.overscaledZ}`),function(dt,Ct){dt.initDebugOverlayCanvas();let wt=dt.debugOverlayCanvas,Dt=dt.context.gl,ur=dt.debugOverlayCanvas.getContext("2d");ur.clearRect(0,0,wt.width,wt.height),ur.shadowColor="white",ur.shadowBlur=2,ur.lineWidth=1.5,ur.strokeStyle="white",ur.textBaseline="top",ur.font="bold 36px Open Sans, sans-serif",ur.fillText(Ct,5,5),ur.strokeText(Ct,5,5),dt.debugOverlayTexture.update(wt),dt.debugOverlayTexture.bind(Dt.LINEAR,Dt.CLAMP_TO_EDGE)}(Ne,`${ut} ${sa}kB`),pt.draw(we,Se.TRIANGLES,At,Bt,cl.alphaBlended,Qn.disabled,zn(Oe,t.aM.transparent,Je),null,br,Ne.debugBuffer,Ne.quadTriangleIndexBuffer,Ne.debugSegments),pt.draw(we,Se.LINE_STRIP,At,Bt,$t,Qn.disabled,zn(Oe,t.aM.red),Ar,br,Ne.debugBuffer,Ne.tileBorderIndexBuffer,Ne.debugSegments)}function ml(Ne,R,ae){let we=Ne.context,Se=we.gl,Oe=Ne.colorModeForRenderPass(),pt=new ls(Se.LEQUAL,ls.ReadWrite,Ne.depthRangeFor3D),At=Ne.useProgram("terrain"),Bt=R.getTerrainMesh();we.bindFramebuffer.set(null),we.viewport.set([0,0,Ne.width,Ne.height]);for(let $t of ae){let br=Ne.renderToTexture.getTexture($t),Ar=R.getTerrainData($t.tileID);we.activeTexture.set(Se.TEXTURE0),Se.bindTexture(Se.TEXTURE_2D,br.texture);let Yr=Ne.transform.calculatePosMatrix($t.tileID.toUnwrapped()),sa=R.getMeshFrameDelta(Ne.transform.zoom),He=Ne.transform.calculateFogMatrix($t.tileID.toUnwrapped()),Je=kr(Yr,sa,He,Ne.style.sky,Ne.transform.pitch);At.draw(we,Se.TRIANGLES,pt,Ss.disabled,Oe,Qn.backCCW,Je,Ar,"terrain",Bt.vertexBuffer,Bt.indexBuffer,Bt.segments)}}class Lu{constructor(R,ae,we){this.vertexBuffer=R,this.indexBuffer=ae,this.segments=we}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.vertexBuffer=null,this.indexBuffer=null,this.segments=null}}class Ac{constructor(R,ae){this.context=new yh(R),this.transform=ae,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:t.an(new Float64Array(16)),renderTime:0},this.setup(),this.numSublayers=kt.maxUnderzooming+kt.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new Gr}resize(R,ae,we){if(this.width=Math.floor(R*we),this.height=Math.floor(ae*we),this.pixelRatio=we,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(let Se of this.style._order)this.style._layers[Se].resize()}setup(){let R=this.context,ae=new t.aX;ae.emplaceBack(0,0),ae.emplaceBack(t.X,0),ae.emplaceBack(0,t.X),ae.emplaceBack(t.X,t.X),this.tileExtentBuffer=R.createVertexBuffer(ae,da.members),this.tileExtentSegments=t.a0.simpleSegment(0,0,4,2);let we=new t.aX;we.emplaceBack(0,0),we.emplaceBack(t.X,0),we.emplaceBack(0,t.X),we.emplaceBack(t.X,t.X),this.debugBuffer=R.createVertexBuffer(we,da.members),this.debugSegments=t.a0.simpleSegment(0,0,4,5);let Se=new t.$;Se.emplaceBack(0,0,0,0),Se.emplaceBack(t.X,0,t.X,0),Se.emplaceBack(0,t.X,0,t.X),Se.emplaceBack(t.X,t.X,t.X,t.X),this.rasterBoundsBuffer=R.createVertexBuffer(Se,Xe.members),this.rasterBoundsSegments=t.a0.simpleSegment(0,0,4,2);let Oe=new t.aX;Oe.emplaceBack(0,0),Oe.emplaceBack(1,0),Oe.emplaceBack(0,1),Oe.emplaceBack(1,1),this.viewportBuffer=R.createVertexBuffer(Oe,da.members),this.viewportSegments=t.a0.simpleSegment(0,0,4,2);let pt=new t.aZ;pt.emplaceBack(0),pt.emplaceBack(1),pt.emplaceBack(3),pt.emplaceBack(2),pt.emplaceBack(0),this.tileBorderIndexBuffer=R.createIndexBuffer(pt);let At=new t.aY;At.emplaceBack(0,1,2),At.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=R.createIndexBuffer(At);let Bt=this.context.gl;this.stencilClearMode=new Ss({func:Bt.ALWAYS,mask:0},0,255,Bt.ZERO,Bt.ZERO,Bt.ZERO)}clearStencil(){let R=this.context,ae=R.gl;this.nextStencilID=1,this.currentStencilSource=void 0;let we=t.H();t.aP(we,0,this.width,this.height,0,0,1),t.K(we,we,[ae.drawingBufferWidth,ae.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(R,ae.TRIANGLES,ls.disabled,this.stencilClearMode,cl.disabled,Qn.disabled,Xn(we),null,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(R,ae){if(this.currentStencilSource===R.source||!R.isTileClipped()||!ae||!ae.length)return;this.currentStencilSource=R.source;let we=this.context,Se=we.gl;this.nextStencilID+ae.length>256&&this.clearStencil(),we.setColorMode(cl.disabled),we.setDepthMode(ls.disabled);let Oe=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(let pt of ae){let At=this._tileClippingMaskIDs[pt.key]=this.nextStencilID++,Bt=this.style.map.terrain&&this.style.map.terrain.getTerrainData(pt);Oe.draw(we,Se.TRIANGLES,ls.disabled,new Ss({func:Se.ALWAYS,mask:0},At,255,Se.KEEP,Se.KEEP,Se.REPLACE),cl.disabled,Qn.disabled,Xn(pt.posMatrix),Bt,"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();let R=this.nextStencilID++,ae=this.context.gl;return new Ss({func:ae.NOTEQUAL,mask:255},R,255,ae.KEEP,ae.KEEP,ae.REPLACE)}stencilModeForClipping(R){let ae=this.context.gl;return new Ss({func:ae.EQUAL,mask:255},this._tileClippingMaskIDs[R.key],0,ae.KEEP,ae.KEEP,ae.REPLACE)}stencilConfigForOverlap(R){let ae=this.context.gl,we=R.sort((pt,At)=>At.overscaledZ-pt.overscaledZ),Se=we[we.length-1].overscaledZ,Oe=we[0].overscaledZ-Se+1;if(Oe>1){this.currentStencilSource=void 0,this.nextStencilID+Oe>256&&this.clearStencil();let pt={};for(let At=0;At({u_sky_color:dt.properties.get("sky-color"),u_horizon_color:dt.properties.get("horizon-color"),u_horizon:(Ct.height/2+Ct.getHorizon())*wt,u_sky_horizon_blend:dt.properties.get("sky-horizon-blend")*Ct.height/2*wt}))($t,Bt.style.map.transform,Bt.pixelRatio),sa=new ls(Ar.LEQUAL,ls.ReadWrite,[0,1]),He=Ss.disabled,Je=Bt.colorModeForRenderPass(),ut=Bt.useProgram("sky");if(!$t.mesh){let dt=new t.aX;dt.emplaceBack(-1,-1),dt.emplaceBack(1,-1),dt.emplaceBack(1,1),dt.emplaceBack(-1,1);let Ct=new t.aY;Ct.emplaceBack(0,1,2),Ct.emplaceBack(0,2,3),$t.mesh=new Lu(br.createVertexBuffer(dt,da.members),br.createIndexBuffer(Ct),t.a0.simpleSegment(0,0,dt.length,Ct.length))}ut.draw(br,Ar.TRIANGLES,sa,He,Je,Qn.disabled,Yr,void 0,"sky",$t.mesh.vertexBuffer,$t.mesh.indexBuffer,$t.mesh.segments)}(this,this.style.sky),this._showOverdrawInspector=ae.showOverdrawInspector,this.depthRangeFor3D=[0,1-(R._order.length+2)*this.numSublayers*this.depthEpsilon],!this.renderToTexture)for(this.renderPass="opaque",this.currentLayer=we.length-1;this.currentLayer>=0;this.currentLayer--){let Bt=this.style._layers[we[this.currentLayer]],$t=Se[Bt.source],br=Oe[Bt.source];this._renderTileClippingMasks(Bt,br),this.renderLayer(this,$t,Bt,br)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayerut.source&&!ut.isHidden(br)?[$t.sourceCaches[ut.source]]:[]),sa=Yr.filter(ut=>ut.getSource().type==="vector"),He=Yr.filter(ut=>ut.getSource().type!=="vector"),Je=ut=>{(!Ar||Ar.getSource().maxzoomJe(ut)),Ar||He.forEach(ut=>Je(ut)),Ar}(this.style,this.transform.zoom);Bt&&function($t,br,Ar){for(let Yr=0;Yr0),Se&&(t.b0(ae,we),this.terrainFacilitator.renderTime=Date.now(),this.terrainFacilitator.dirty=!1,function(Oe,pt){let At=Oe.context,Bt=At.gl,$t=cl.unblended,br=new ls(Bt.LEQUAL,ls.ReadWrite,[0,1]),Ar=pt.getTerrainMesh(),Yr=pt.sourceCache.getRenderableTiles(),sa=Oe.useProgram("terrainDepth");At.bindFramebuffer.set(pt.getFramebuffer("depth").framebuffer),At.viewport.set([0,0,Oe.width/devicePixelRatio,Oe.height/devicePixelRatio]),At.clear({color:t.aM.transparent,depth:1});for(let He of Yr){let Je=pt.getTerrainData(He.tileID),ut={u_matrix:Oe.transform.calculatePosMatrix(He.tileID.toUnwrapped()),u_ele_delta:pt.getMeshFrameDelta(Oe.transform.zoom)};sa.draw(At,Bt.TRIANGLES,br,Ss.disabled,$t,Qn.backCCW,ut,Je,"terrain",Ar.vertexBuffer,Ar.indexBuffer,Ar.segments)}At.bindFramebuffer.set(null),At.viewport.set([0,0,Oe.width,Oe.height])}(this,this.style.map.terrain),function(Oe,pt){let At=Oe.context,Bt=At.gl,$t=cl.unblended,br=new ls(Bt.LEQUAL,ls.ReadWrite,[0,1]),Ar=pt.getTerrainMesh(),Yr=pt.getCoordsTexture(),sa=pt.sourceCache.getRenderableTiles(),He=Oe.useProgram("terrainCoords");At.bindFramebuffer.set(pt.getFramebuffer("coords").framebuffer),At.viewport.set([0,0,Oe.width/devicePixelRatio,Oe.height/devicePixelRatio]),At.clear({color:t.aM.transparent,depth:1}),pt.coordsIndex=[];for(let Je of sa){let ut=pt.getTerrainData(Je.tileID);At.activeTexture.set(Bt.TEXTURE0),Bt.bindTexture(Bt.TEXTURE_2D,Yr.texture);let dt={u_matrix:Oe.transform.calculatePosMatrix(Je.tileID.toUnwrapped()),u_terrain_coords_id:(255-pt.coordsIndex.length)/255,u_texture:0,u_ele_delta:pt.getMeshFrameDelta(Oe.transform.zoom)};He.draw(At,Bt.TRIANGLES,br,Ss.disabled,$t,Qn.backCCW,dt,ut,"terrain",Ar.vertexBuffer,Ar.indexBuffer,Ar.segments),pt.coordsIndex.push(Je.tileID.key)}At.bindFramebuffer.set(null),At.viewport.set([0,0,Oe.width,Oe.height])}(this,this.style.map.terrain))}renderLayer(R,ae,we,Se){if(!we.isHidden(this.transform.zoom)&&(we.type==="background"||we.type==="custom"||(Se||[]).length))switch(this.id=we.id,we.type){case"symbol":(function(Oe,pt,At,Bt,$t){if(Oe.renderPass!=="translucent")return;let br=Ss.disabled,Ar=Oe.colorModeForRenderPass();(At._unevaluatedLayout.hasValue("text-variable-anchor")||At._unevaluatedLayout.hasValue("text-variable-anchor-offset"))&&function(Yr,sa,He,Je,ut,dt,Ct,wt,Dt){let ur=sa.transform,mr=mi(),Er=ut==="map",Br=dt==="map";for(let Qr of Yr){let ga=Je.getTile(Qr),Sa=ga.getBucket(He);if(!Sa||!Sa.text||!Sa.text.segments.get().length)continue;let Oa=t.ag(Sa.textSizeData,ur.zoom),di=Ua(ga,1,sa.transform.zoom),Wi=wr(Qr.posMatrix,Br,Er,sa.transform,di),Gi=He.layout.get("icon-text-fit")!=="none"&&Sa.hasIconData();if(Oa){let on=Math.pow(2,ur.zoom-ga.tileID.overscaledZ),Tn=sa.style.map.terrain?(Bn,Ao)=>sa.style.map.terrain.getElevation(Qr,Bn,Ao):null,Wn=mr.translatePosition(ur,ga,Ct,wt);rf(Sa,Er,Br,Dt,ur,Wi,Qr.posMatrix,on,Oa,Gi,mr,Wn,Qr.toUnwrapped(),Tn)}}}(Bt,Oe,At,pt,At.layout.get("text-rotation-alignment"),At.layout.get("text-pitch-alignment"),At.paint.get("text-translate"),At.paint.get("text-translate-anchor"),$t),At.paint.get("icon-opacity").constantOr(1)!==0&&Yf(Oe,pt,At,Bt,!1,At.paint.get("icon-translate"),At.paint.get("icon-translate-anchor"),At.layout.get("icon-rotation-alignment"),At.layout.get("icon-pitch-alignment"),At.layout.get("icon-keep-upright"),br,Ar),At.paint.get("text-opacity").constantOr(1)!==0&&Yf(Oe,pt,At,Bt,!0,At.paint.get("text-translate"),At.paint.get("text-translate-anchor"),At.layout.get("text-rotation-alignment"),At.layout.get("text-pitch-alignment"),At.layout.get("text-keep-upright"),br,Ar),pt.map.showCollisionBoxes&&(Vu(Oe,pt,At,Bt,!0),Vu(Oe,pt,At,Bt,!1))})(R,ae,we,Se,this.style.placement.variableOffsets);break;case"circle":(function(Oe,pt,At,Bt){if(Oe.renderPass!=="translucent")return;let $t=At.paint.get("circle-opacity"),br=At.paint.get("circle-stroke-width"),Ar=At.paint.get("circle-stroke-opacity"),Yr=!At.layout.get("circle-sort-key").isConstant();if($t.constantOr(1)===0&&(br.constantOr(1)===0||Ar.constantOr(1)===0))return;let sa=Oe.context,He=sa.gl,Je=Oe.depthModeForSublayer(0,ls.ReadOnly),ut=Ss.disabled,dt=Oe.colorModeForRenderPass(),Ct=[];for(let wt=0;wtwt.sortKey-Dt.sortKey);for(let wt of Ct){let{programConfiguration:Dt,program:ur,layoutVertexBuffer:mr,indexBuffer:Er,uniformValues:Br,terrainData:Qr}=wt.state;ur.draw(sa,He.TRIANGLES,Je,ut,dt,Qn.disabled,Br,Qr,At.id,mr,Er,wt.segments,At.paint,Oe.transform.zoom,Dt)}})(R,ae,we,Se);break;case"heatmap":(function(Oe,pt,At,Bt){if(At.paint.get("heatmap-opacity")===0)return;let $t=Oe.context;if(Oe.style.map.terrain){for(let br of Bt){let Ar=pt.getTile(br);pt.hasRenderableParent(br)||(Oe.renderPass==="offscreen"?af(Oe,Ar,At,br):Oe.renderPass==="translucent"&&Nc(Oe,At,br))}$t.viewport.set([0,0,Oe.width,Oe.height])}else Oe.renderPass==="offscreen"?function(br,Ar,Yr,sa){let He=br.context,Je=He.gl,ut=Ss.disabled,dt=new cl([Je.ONE,Je.ONE],t.aM.transparent,[!0,!0,!0,!0]);(function(Ct,wt,Dt){let ur=Ct.gl;Ct.activeTexture.set(ur.TEXTURE1),Ct.viewport.set([0,0,wt.width/4,wt.height/4]);let mr=Dt.heatmapFbos.get(t.aU);mr?(ur.bindTexture(ur.TEXTURE_2D,mr.colorAttachment.get()),Ct.bindFramebuffer.set(mr.framebuffer)):(mr=Ff(Ct,wt.width/4,wt.height/4),Dt.heatmapFbos.set(t.aU,mr))})(He,br,Yr),He.clear({color:t.aM.transparent});for(let Ct=0;Ct20&&br.texParameterf(br.TEXTURE_2D,$t.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,$t.extTextureFilterAnisotropicMax);let Sa=Oe.style.map.terrain&&Oe.style.map.terrain.getTerrainData(Ct),Oa=Sa?Ct:null,di=Oa?Oa.posMatrix:Oe.transform.calculatePosMatrix(Ct.toUnwrapped(),dt),Wi=To(di,Qr||[0,0],Br||1,Er,At);Ar instanceof it?Yr.draw($t,br.TRIANGLES,wt,Ss.disabled,sa,Qn.disabled,Wi,Sa,At.id,Ar.boundsBuffer,Oe.quadTriangleIndexBuffer,Ar.boundsSegments):Yr.draw($t,br.TRIANGLES,wt,He[Ct.overscaledZ],sa,Qn.disabled,Wi,Sa,At.id,Oe.rasterBoundsBuffer,Oe.quadTriangleIndexBuffer,Oe.rasterBoundsSegments)}})(R,ae,we,Se);break;case"background":(function(Oe,pt,At,Bt){let $t=At.paint.get("background-color"),br=At.paint.get("background-opacity");if(br===0)return;let Ar=Oe.context,Yr=Ar.gl,sa=Oe.transform,He=sa.tileSize,Je=At.paint.get("background-pattern");if(Oe.isPatternMissing(Je))return;let ut=!Je&&$t.a===1&&br===1&&Oe.opaquePassEnabledForLayer()?"opaque":"translucent";if(Oe.renderPass!==ut)return;let dt=Ss.disabled,Ct=Oe.depthModeForSublayer(0,ut==="opaque"?ls.ReadWrite:ls.ReadOnly),wt=Oe.colorModeForRenderPass(),Dt=Oe.useProgram(Je?"backgroundPattern":"background"),ur=Bt||sa.coveringTiles({tileSize:He,terrain:Oe.style.map.terrain});Je&&(Ar.activeTexture.set(Yr.TEXTURE0),Oe.imageManager.bind(Oe.context));let mr=At.getCrossfadeParameters();for(let Er of ur){let Br=Bt?Er.posMatrix:Oe.transform.calculatePosMatrix(Er.toUnwrapped()),Qr=Je?Ys(Br,br,Oe,Je,{tileID:Er,tileSize:He},mr):os(Br,br,$t),ga=Oe.style.map.terrain&&Oe.style.map.terrain.getTerrainData(Er);Dt.draw(Ar,Yr.TRIANGLES,Ct,dt,wt,Qn.disabled,Qr,ga,At.id,Oe.tileExtentBuffer,Oe.quadTriangleIndexBuffer,Oe.tileExtentSegments)}})(R,0,we,Se);break;case"custom":(function(Oe,pt,At){let Bt=Oe.context,$t=At.implementation;if(Oe.renderPass==="offscreen"){let br=$t.prerender;br&&(Oe.setCustomLayerDefaults(),Bt.setColorMode(Oe.colorModeForRenderPass()),br.call($t,Bt.gl,Oe.transform.customLayerMatrix()),Bt.setDirty(),Oe.setBaseState())}else if(Oe.renderPass==="translucent"){Oe.setCustomLayerDefaults(),Bt.setColorMode(Oe.colorModeForRenderPass()),Bt.setStencilMode(Ss.disabled);let br=$t.renderingMode==="3d"?new ls(Oe.context.gl.LEQUAL,ls.ReadWrite,Oe.depthRangeFor3D):Oe.depthModeForSublayer(0,ls.ReadOnly);Bt.setDepthMode(br),$t.render(Bt.gl,Oe.transform.customLayerMatrix(),{farZ:Oe.transform.farZ,nearZ:Oe.transform.nearZ,fov:Oe.transform._fov,modelViewProjectionMatrix:Oe.transform.modelViewProjectionMatrix,projectionMatrix:Oe.transform.projectionMatrix}),Bt.setDirty(),Oe.setBaseState(),Bt.bindFramebuffer.set(null)}})(R,0,we)}}translatePosMatrix(R,ae,we,Se,Oe){if(!we[0]&&!we[1])return R;let pt=Oe?Se==="map"?this.transform.angle:0:Se==="viewport"?-this.transform.angle:0;if(pt){let $t=Math.sin(pt),br=Math.cos(pt);we=[we[0]*br-we[1]*$t,we[0]*$t+we[1]*br]}let At=[Oe?we[0]:Ua(ae,we[0],this.transform.zoom),Oe?we[1]:Ua(ae,we[1],this.transform.zoom),0],Bt=new Float32Array(16);return t.J(Bt,R,At),Bt}saveTileTexture(R){let ae=this._tileTextures[R.size[0]];ae?ae.push(R):this._tileTextures[R.size[0]]=[R]}getTileTexture(R){let ae=this._tileTextures[R];return ae&&ae.length>0?ae.pop():null}isPatternMissing(R){if(!R)return!1;if(!R.from||!R.to)return!0;let ae=this.imageManager.getPattern(R.from.toString()),we=this.imageManager.getPattern(R.to.toString());return!ae||!we}useProgram(R,ae){this.cache=this.cache||{};let we=R+(ae?ae.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"")+(this.style.map.terrain?"/terrain":"");return this.cache[we]||(this.cache[we]=new Ca(this.context,fa[R],ae,Os[R],this._showOverdrawInspector,this.style.map.terrain)),this.cache[we]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){let R=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(R.FUNC_ADD)}initDebugOverlayCanvas(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new u(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}overLimit(){let{drawingBufferWidth:R,drawingBufferHeight:ae}=this.context.gl;return this.width!==R||this.height!==ae}}class nl{constructor(R,ae){this.points=R,this.planes=ae}static fromInvProjectionMatrix(R,ae,we){let Se=Math.pow(2,we),Oe=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map(At=>{let Bt=1/(At=t.af([],At,R))[3]/ae*Se;return t.b1(At,At,[Bt,Bt,1/At[3],Bt])}),pt=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(At=>{let Bt=function(Yr,sa){var He=sa[0],Je=sa[1],ut=sa[2],dt=He*He+Je*Je+ut*ut;return dt>0&&(dt=1/Math.sqrt(dt)),Yr[0]=sa[0]*dt,Yr[1]=sa[1]*dt,Yr[2]=sa[2]*dt,Yr}([],function(Yr,sa,He){var Je=sa[0],ut=sa[1],dt=sa[2],Ct=He[0],wt=He[1],Dt=He[2];return Yr[0]=ut*Dt-dt*wt,Yr[1]=dt*Ct-Je*Dt,Yr[2]=Je*wt-ut*Ct,Yr}([],E([],Oe[At[0]],Oe[At[1]]),E([],Oe[At[2]],Oe[At[1]]))),$t=-((br=Bt)[0]*(Ar=Oe[At[1]])[0]+br[1]*Ar[1]+br[2]*Ar[2]);var br,Ar;return Bt.concat($t)});return new nl(Oe,pt)}}class dc{constructor(R,ae){this.min=R,this.max=ae,this.center=function(we,Se,Oe){return we[0]=.5*Se[0],we[1]=.5*Se[1],we[2]=.5*Se[2],we}([],function(we,Se,Oe){return we[0]=Se[0]+Oe[0],we[1]=Se[1]+Oe[1],we[2]=Se[2]+Oe[2],we}([],this.min,this.max))}quadrant(R){let ae=[R%2==0,R<2],we=w(this.min),Se=w(this.max);for(let Oe=0;Oe=0&&pt++;if(pt===0)return 0;pt!==ae.length&&(we=!1)}if(we)return 2;for(let Se=0;Se<3;Se++){let Oe=Number.MAX_VALUE,pt=-Number.MAX_VALUE;for(let At=0;Atthis.max[Se]-this.min[Se])return 0}return 1}}class vu{constructor(R=0,ae=0,we=0,Se=0){if(isNaN(R)||R<0||isNaN(ae)||ae<0||isNaN(we)||we<0||isNaN(Se)||Se<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=R,this.bottom=ae,this.left=we,this.right=Se}interpolate(R,ae,we){return ae.top!=null&&R.top!=null&&(this.top=t.y.number(R.top,ae.top,we)),ae.bottom!=null&&R.bottom!=null&&(this.bottom=t.y.number(R.bottom,ae.bottom,we)),ae.left!=null&&R.left!=null&&(this.left=t.y.number(R.left,ae.left,we)),ae.right!=null&&R.right!=null&&(this.right=t.y.number(R.right,ae.right,we)),this}getCenter(R,ae){let we=t.ac((this.left+R-this.right)/2,0,R),Se=t.ac((this.top+ae-this.bottom)/2,0,ae);return new t.P(we,Se)}equals(R){return this.top===R.top&&this.bottom===R.bottom&&this.left===R.left&&this.right===R.right}clone(){return new vu(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}let bu=85.051129;class Ml{constructor(R,ae,we,Se,Oe){this.tileSize=512,this._renderWorldCopies=Oe===void 0||!!Oe,this._minZoom=R||0,this._maxZoom=ae||22,this._minPitch=we??0,this._maxPitch=Se??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new t.N(0,0),this._elevation=0,this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new vu,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={},this.minElevationForCurrentTile=0}clone(){let R=new Ml(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return R.apply(this),R}apply(R){this.tileSize=R.tileSize,this.latRange=R.latRange,this.lngRange=R.lngRange,this.width=R.width,this.height=R.height,this._center=R._center,this._elevation=R._elevation,this.minElevationForCurrentTile=R.minElevationForCurrentTile,this.zoom=R.zoom,this.angle=R.angle,this._fov=R._fov,this._pitch=R._pitch,this._unmodified=R._unmodified,this._edgeInsets=R._edgeInsets.clone(),this._calcMatrices()}get minZoom(){return this._minZoom}set minZoom(R){this._minZoom!==R&&(this._minZoom=R,this.zoom=Math.max(this.zoom,R))}get maxZoom(){return this._maxZoom}set maxZoom(R){this._maxZoom!==R&&(this._maxZoom=R,this.zoom=Math.min(this.zoom,R))}get minPitch(){return this._minPitch}set minPitch(R){this._minPitch!==R&&(this._minPitch=R,this.pitch=Math.max(this.pitch,R))}get maxPitch(){return this._maxPitch}set maxPitch(R){this._maxPitch!==R&&(this._maxPitch=R,this.pitch=Math.min(this.pitch,R))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(R){R===void 0?R=!0:R===null&&(R=!1),this._renderWorldCopies=R}get worldSize(){return this.tileSize*this.scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new t.P(this.width,this.height)}get bearing(){return-this.angle/Math.PI*180}set bearing(R){let ae=-t.b3(R,-180,180)*Math.PI/180;this.angle!==ae&&(this._unmodified=!1,this.angle=ae,this._calcMatrices(),this.rotationMatrix=function(){var we=new t.A(4);return t.A!=Float32Array&&(we[1]=0,we[2]=0),we[0]=1,we[3]=1,we}(),function(we,Se,Oe){var pt=Se[0],At=Se[1],Bt=Se[2],$t=Se[3],br=Math.sin(Oe),Ar=Math.cos(Oe);we[0]=pt*Ar+Bt*br,we[1]=At*Ar+$t*br,we[2]=pt*-br+Bt*Ar,we[3]=At*-br+$t*Ar}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(R){let ae=t.ac(R,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==ae&&(this._unmodified=!1,this._pitch=ae,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(R){R=Math.max(.01,Math.min(60,R)),this._fov!==R&&(this._unmodified=!1,this._fov=R/180*Math.PI,this._calcMatrices())}get zoom(){return this._zoom}set zoom(R){let ae=Math.min(Math.max(R,this.minZoom),this.maxZoom);this._zoom!==ae&&(this._unmodified=!1,this._zoom=ae,this.tileZoom=Math.max(0,Math.floor(ae)),this.scale=this.zoomScale(ae),this._constrain(),this._calcMatrices())}get center(){return this._center}set center(R){R.lat===this._center.lat&&R.lng===this._center.lng||(this._unmodified=!1,this._center=R,this._constrain(),this._calcMatrices())}get elevation(){return this._elevation}set elevation(R){R!==this._elevation&&(this._elevation=R,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}set padding(R){this._edgeInsets.equals(R)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,R,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}isPaddingEqual(R){return this._edgeInsets.equals(R)}interpolatePadding(R,ae,we){this._unmodified=!1,this._edgeInsets.interpolate(R,ae,we),this._constrain(),this._calcMatrices()}coveringZoomLevel(R){let ae=(R.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/R.tileSize));return Math.max(0,ae)}getVisibleUnwrappedCoordinates(R){let ae=[new t.b4(0,R)];if(this._renderWorldCopies){let we=this.pointCoordinate(new t.P(0,0)),Se=this.pointCoordinate(new t.P(this.width,0)),Oe=this.pointCoordinate(new t.P(this.width,this.height)),pt=this.pointCoordinate(new t.P(0,this.height)),At=Math.floor(Math.min(we.x,Se.x,Oe.x,pt.x)),Bt=Math.floor(Math.max(we.x,Se.x,Oe.x,pt.x)),$t=1;for(let br=At-$t;br<=Bt+$t;br++)br!==0&&ae.push(new t.b4(br,R))}return ae}coveringTiles(R){var ae,we;let Se=this.coveringZoomLevel(R),Oe=Se;if(R.minzoom!==void 0&&SeR.maxzoom&&(Se=R.maxzoom);let pt=this.pointCoordinate(this.getCameraPoint()),At=t.Z.fromLngLat(this.center),Bt=Math.pow(2,Se),$t=[Bt*pt.x,Bt*pt.y,0],br=[Bt*At.x,Bt*At.y,0],Ar=nl.fromInvProjectionMatrix(this.invModelViewProjectionMatrix,this.worldSize,Se),Yr=R.minzoom||0;!R.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(Yr=Se);let sa=R.terrain?2/Math.min(this.tileSize,R.tileSize)*this.tileSize:3,He=wt=>({aabb:new dc([wt*Bt,0,0],[(wt+1)*Bt,Bt,0]),zoom:0,x:0,y:0,wrap:wt,fullyVisible:!1}),Je=[],ut=[],dt=Se,Ct=R.reparseOverscaled?Oe:Se;if(this._renderWorldCopies)for(let wt=1;wt<=3;wt++)Je.push(He(-wt)),Je.push(He(wt));for(Je.push(He(0));Je.length>0;){let wt=Je.pop(),Dt=wt.x,ur=wt.y,mr=wt.fullyVisible;if(!mr){let Sa=wt.aabb.intersects(Ar);if(Sa===0)continue;mr=Sa===2}let Er=R.terrain?$t:br,Br=wt.aabb.distanceX(Er),Qr=wt.aabb.distanceY(Er),ga=Math.max(Math.abs(Br),Math.abs(Qr));if(wt.zoom===dt||ga>sa+(1<=Yr){let Sa=dt-wt.zoom,Oa=$t[0]-.5-(Dt<>1),Wi=wt.zoom+1,Gi=wt.aabb.quadrant(Sa);if(R.terrain){let on=new t.S(Wi,wt.wrap,Wi,Oa,di),Tn=R.terrain.getMinMaxElevation(on),Wn=(ae=Tn.minElevation)!==null&&ae!==void 0?ae:this.elevation,Bn=(we=Tn.maxElevation)!==null&&we!==void 0?we:this.elevation;Gi=new dc([Gi.min[0],Gi.min[1],Wn],[Gi.max[0],Gi.max[1],Bn])}Je.push({aabb:Gi,zoom:Wi,x:Oa,y:di,wrap:wt.wrap,fullyVisible:mr})}}return ut.sort((wt,Dt)=>wt.distanceSq-Dt.distanceSq).map(wt=>wt.tileID)}resize(R,ae){this.width=R,this.height=ae,this.pixelsToGLUnits=[2/R,-2/ae],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(R){return Math.pow(2,R)}scaleZoom(R){return Math.log(R)/Math.LN2}project(R){let ae=t.ac(R.lat,-85.051129,bu);return new t.P(t.O(R.lng)*this.worldSize,t.Q(ae)*this.worldSize)}unproject(R){return new t.Z(R.x/this.worldSize,R.y/this.worldSize).toLngLat()}get point(){return this.project(this.center)}getCameraPosition(){return{lngLat:this.pointLocation(this.getCameraPoint()),altitude:Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter+this.elevation}}recalculateZoom(R){let ae=this.elevation,we=Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter,Se=this.pointLocation(this.centerPoint,R),Oe=R.getElevationForLngLatZoom(Se,this.tileZoom);if(!(this.elevation-Oe))return;let pt=we+ae-Oe,At=Math.cos(this._pitch)*this.cameraToCenterDistance/pt/t.b5(1,Se.lat),Bt=this.scaleZoom(At/this.tileSize);this._elevation=Oe,this._center=Se,this.zoom=Bt}setLocationAtPoint(R,ae){let we=this.pointCoordinate(ae),Se=this.pointCoordinate(this.centerPoint),Oe=this.locationCoordinate(R),pt=new t.Z(Oe.x-(we.x-Se.x),Oe.y-(we.y-Se.y));this.center=this.coordinateLocation(pt),this._renderWorldCopies&&(this.center=this.center.wrap())}locationPoint(R,ae){return ae?this.coordinatePoint(this.locationCoordinate(R),ae.getElevationForLngLatZoom(R,this.tileZoom),this.pixelMatrix3D):this.coordinatePoint(this.locationCoordinate(R))}pointLocation(R,ae){return this.coordinateLocation(this.pointCoordinate(R,ae))}locationCoordinate(R){return t.Z.fromLngLat(R)}coordinateLocation(R){return R&&R.toLngLat()}pointCoordinate(R,ae){if(ae){let Yr=ae.pointCoordinate(R);if(Yr!=null)return Yr}let we=[R.x,R.y,0,1],Se=[R.x,R.y,1,1];t.af(we,we,this.pixelMatrixInverse),t.af(Se,Se,this.pixelMatrixInverse);let Oe=we[3],pt=Se[3],At=we[1]/Oe,Bt=Se[1]/pt,$t=we[2]/Oe,br=Se[2]/pt,Ar=$t===br?0:(0-$t)/(br-$t);return new t.Z(t.y.number(we[0]/Oe,Se[0]/pt,Ar)/this.worldSize,t.y.number(At,Bt,Ar)/this.worldSize)}coordinatePoint(R,ae=0,we=this.pixelMatrix){let Se=[R.x*this.worldSize,R.y*this.worldSize,ae,1];return t.af(Se,Se,we),new t.P(Se[0]/Se[3],Se[1]/Se[3])}getBounds(){let R=Math.max(0,this.height/2-this.getHorizon());return new re().extend(this.pointLocation(new t.P(0,R))).extend(this.pointLocation(new t.P(this.width,R))).extend(this.pointLocation(new t.P(this.width,this.height))).extend(this.pointLocation(new t.P(0,this.height)))}getMaxBounds(){return this.latRange&&this.latRange.length===2&&this.lngRange&&this.lngRange.length===2?new re([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null}getHorizon(){return Math.tan(Math.PI/2-this._pitch)*this.cameraToCenterDistance*.85}setMaxBounds(R){R?(this.lngRange=[R.getWest(),R.getEast()],this.latRange=[R.getSouth(),R.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-85.051129,bu])}calculateTileMatrix(R){let ae=R.canonical,we=this.worldSize/this.zoomScale(ae.z),Se=ae.x+Math.pow(2,ae.z)*R.wrap,Oe=t.an(new Float64Array(16));return t.J(Oe,Oe,[Se*we,ae.y*we,0]),t.K(Oe,Oe,[we/t.X,we/t.X,1]),Oe}calculatePosMatrix(R,ae=!1){let we=R.key,Se=ae?this._alignedPosMatrixCache:this._posMatrixCache;if(Se[we])return Se[we];let Oe=this.calculateTileMatrix(R);return t.L(Oe,ae?this.alignedModelViewProjectionMatrix:this.modelViewProjectionMatrix,Oe),Se[we]=new Float32Array(Oe),Se[we]}calculateFogMatrix(R){let ae=R.key,we=this._fogMatrixCache;if(we[ae])return we[ae];let Se=this.calculateTileMatrix(R);return t.L(Se,this.fogMatrix,Se),we[ae]=new Float32Array(Se),we[ae]}customLayerMatrix(){return this.mercatorMatrix.slice()}getConstrained(R,ae){ae=t.ac(+ae,this.minZoom,this.maxZoom);let we={center:new t.N(R.lng,R.lat),zoom:ae},Se=this.lngRange;if(!this._renderWorldCopies&&Se===null){let wt=179.9999999999;Se=[-wt,wt]}let Oe=this.tileSize*this.zoomScale(we.zoom),pt=0,At=Oe,Bt=0,$t=Oe,br=0,Ar=0,{x:Yr,y:sa}=this.size;if(this.latRange){let wt=this.latRange;pt=t.Q(wt[1])*Oe,At=t.Q(wt[0])*Oe,At-ptAt&&(dt=At-wt)}if(Se){let wt=(Bt+$t)/2,Dt=He;this._renderWorldCopies&&(Dt=t.b3(He,wt-Oe/2,wt+Oe/2));let ur=Yr/2;Dt-ur$t&&(ut=$t-ur)}if(ut!==void 0||dt!==void 0){let wt=new t.P(ut??He,dt??Je);we.center=this.unproject.call({worldSize:Oe},wt).wrap()}return we}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;let R=this._unmodified,{center:ae,zoom:we}=this.getConstrained(this.center,this.zoom);this.center=ae,this.zoom=we,this._unmodified=R,this._constraining=!1}_calcMatrices(){if(!this.height)return;let R=this.centerOffset,ae=this.point.x,we=this.point.y;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height,this._pixelPerMeter=t.b5(1,this.center.lat)*this.worldSize;let Se=t.an(new Float64Array(16));t.K(Se,Se,[this.width/2,-this.height/2,1]),t.J(Se,Se,[1,-1,0]),this.labelPlaneMatrix=Se,Se=t.an(new Float64Array(16)),t.K(Se,Se,[1,-1,1]),t.J(Se,Se,[-1,-1,0]),t.K(Se,Se,[2/this.width,2/this.height,1]),this.glCoordMatrix=Se;let Oe=this.cameraToCenterDistance+this._elevation*this._pixelPerMeter/Math.cos(this._pitch),pt=Math.min(this.elevation,this.minElevationForCurrentTile),At=Oe-pt*this._pixelPerMeter/Math.cos(this._pitch),Bt=pt<0?At:Oe,$t=Math.PI/2+this._pitch,br=this._fov*(.5+R.y/this.height),Ar=Math.sin(br)*Bt/Math.sin(t.ac(Math.PI-$t-br,.01,Math.PI-.01)),Yr=this.getHorizon(),sa=2*Math.atan(Yr/this.cameraToCenterDistance)*(.5+R.y/(2*Yr)),He=Math.sin(sa)*Bt/Math.sin(t.ac(Math.PI-$t-sa,.01,Math.PI-.01)),Je=Math.min(Ar,He);this.farZ=1.01*(Math.cos(Math.PI/2-this._pitch)*Je+Bt),this.nearZ=this.height/50,Se=new Float64Array(16),t.b6(Se,this._fov,this.width/this.height,this.nearZ,this.farZ),Se[8]=2*-R.x/this.width,Se[9]=2*R.y/this.height,this.projectionMatrix=t.ae(Se),t.K(Se,Se,[1,-1,1]),t.J(Se,Se,[0,0,-this.cameraToCenterDistance]),t.b7(Se,Se,this._pitch),t.ad(Se,Se,this.angle),t.J(Se,Se,[-ae,-we,0]),this.mercatorMatrix=t.K([],Se,[this.worldSize,this.worldSize,this.worldSize]),t.K(Se,Se,[1,1,this._pixelPerMeter]),this.pixelMatrix=t.L(new Float64Array(16),this.labelPlaneMatrix,Se),t.J(Se,Se,[0,0,-this.elevation]),this.modelViewProjectionMatrix=Se,this.invModelViewProjectionMatrix=t.as([],Se),this.fogMatrix=new Float64Array(16),t.b6(this.fogMatrix,this._fov,this.width/this.height,Oe,this.farZ),this.fogMatrix[8]=2*-R.x/this.width,this.fogMatrix[9]=2*R.y/this.height,t.K(this.fogMatrix,this.fogMatrix,[1,-1,1]),t.J(this.fogMatrix,this.fogMatrix,[0,0,-this.cameraToCenterDistance]),t.b7(this.fogMatrix,this.fogMatrix,this._pitch),t.ad(this.fogMatrix,this.fogMatrix,this.angle),t.J(this.fogMatrix,this.fogMatrix,[-ae,-we,0]),t.K(this.fogMatrix,this.fogMatrix,[1,1,this._pixelPerMeter]),t.J(this.fogMatrix,this.fogMatrix,[0,0,-this.elevation]),this.pixelMatrix3D=t.L(new Float64Array(16),this.labelPlaneMatrix,Se);let ut=this.width%2/2,dt=this.height%2/2,Ct=Math.cos(this.angle),wt=Math.sin(this.angle),Dt=ae-Math.round(ae)+Ct*ut+wt*dt,ur=we-Math.round(we)+Ct*dt+wt*ut,mr=new Float64Array(Se);if(t.J(mr,mr,[Dt>.5?Dt-1:Dt,ur>.5?ur-1:ur,0]),this.alignedModelViewProjectionMatrix=mr,Se=t.as(new Float64Array(16),this.pixelMatrix),!Se)throw new Error("failed to invert matrix");this.pixelMatrixInverse=Se,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;let R=this.pointCoordinate(new t.P(0,0)),ae=[R.x*this.worldSize,R.y*this.worldSize,0,1];return t.af(ae,ae,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){let R=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new t.P(0,R))}getCameraQueryGeometry(R){let ae=this.getCameraPoint();if(R.length===1)return[R[0],ae];{let we=ae.x,Se=ae.y,Oe=ae.x,pt=ae.y;for(let At of R)we=Math.min(we,At.x),Se=Math.min(Se,At.y),Oe=Math.max(Oe,At.x),pt=Math.max(pt,At.y);return[new t.P(we,Se),new t.P(Oe,Se),new t.P(Oe,pt),new t.P(we,pt),new t.P(we,Se)]}}lngLatToCameraDepth(R,ae){let we=this.locationCoordinate(R),Se=[we.x*this.worldSize,we.y*this.worldSize,ae,1];return t.af(Se,Se,this.modelViewProjectionMatrix),Se[2]/Se[3]}}function Uf(Ne,R){let ae,we=!1,Se=null,Oe=null,pt=()=>{Se=null,we&&(Ne.apply(Oe,ae),Se=setTimeout(pt,R),we=!1)};return(...At)=>(we=!0,Oe=this,ae=At,Se||pt(),Se)}class Jf{constructor(R){this._getCurrentHash=()=>{let ae=window.location.hash.replace("#","");if(this._hashName){let we;return ae.split("&").map(Se=>Se.split("=")).forEach(Se=>{Se[0]===this._hashName&&(we=Se)}),(we&&we[1]||"").split("/")}return ae.split("/")},this._onHashChange=()=>{let ae=this._getCurrentHash();if(ae.length>=3&&!ae.some(we=>isNaN(we))){let we=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(ae[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+ae[2],+ae[1]],zoom:+ae[0],bearing:we,pitch:+(ae[4]||0)}),!0}return!1},this._updateHashUnthrottled=()=>{let ae=window.location.href.replace(/(#.*)?$/,this.getHashString());window.history.replaceState(window.history.state,null,ae)},this._removeHash=()=>{let ae=this._getCurrentHash();if(ae.length===0)return;let we=ae.join("/"),Se=we;Se.split("&").length>0&&(Se=Se.split("&")[0]),this._hashName&&(Se=`${this._hashName}=${we}`);let Oe=window.location.hash.replace(Se,"");Oe.startsWith("#&")?Oe=Oe.slice(0,1)+Oe.slice(2):Oe==="#"&&(Oe="");let pt=window.location.href.replace(/(#.+)?$/,Oe);pt=pt.replace("&&","&"),window.history.replaceState(window.history.state,null,pt)},this._updateHash=Uf(this._updateHashUnthrottled,300),this._hashName=R&&encodeURIComponent(R)}addTo(R){return this._map=R,addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this}remove(){return removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),this._removeHash(),delete this._map,this}getHashString(R){let ae=this._map.getCenter(),we=Math.round(100*this._map.getZoom())/100,Se=Math.ceil((we*Math.LN2+Math.log(512/360/.5))/Math.LN10),Oe=Math.pow(10,Se),pt=Math.round(ae.lng*Oe)/Oe,At=Math.round(ae.lat*Oe)/Oe,Bt=this._map.getBearing(),$t=this._map.getPitch(),br="";if(br+=R?`/${pt}/${At}/${we}`:`${we}/${At}/${pt}`,(Bt||$t)&&(br+="/"+Math.round(10*Bt)/10),$t&&(br+=`/${Math.round($t)}`),this._hashName){let Ar=this._hashName,Yr=!1,sa=window.location.hash.slice(1).split("&").map(He=>{let Je=He.split("=")[0];return Je===Ar?(Yr=!0,`${Je}=${br}`):He}).filter(He=>He);return Yr||sa.push(`${Ar}=${br}`),`#${sa.join("&")}`}return`#${br}`}}let Bu={linearity:.3,easing:t.b8(0,0,.3,1)},Sc=t.e({deceleration:2500,maxSpeed:1400},Bu),vc=t.e({deceleration:20,maxSpeed:1400},Bu),Lh=t.e({deceleration:1e3,maxSpeed:360},Bu),nf=t.e({deceleration:1e3,maxSpeed:90},Bu);class df{constructor(R){this._map=R,this.clear()}clear(){this._inertiaBuffer=[]}record(R){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:i.now(),settings:R})}_drainInertiaBuffer(){let R=this._inertiaBuffer,ae=i.now();for(;R.length>0&&ae-R[0].time>160;)R.shift()}_onMoveEnd(R){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;let ae={zoom:0,bearing:0,pitch:0,pan:new t.P(0,0),pinchAround:void 0,around:void 0};for(let{settings:Oe}of this._inertiaBuffer)ae.zoom+=Oe.zoomDelta||0,ae.bearing+=Oe.bearingDelta||0,ae.pitch+=Oe.pitchDelta||0,Oe.panDelta&&ae.pan._add(Oe.panDelta),Oe.around&&(ae.around=Oe.around),Oe.pinchAround&&(ae.pinchAround=Oe.pinchAround);let we=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,Se={};if(ae.pan.mag()){let Oe=of(ae.pan.mag(),we,t.e({},Sc,R||{}));Se.offset=ae.pan.mult(Oe.amount/ae.pan.mag()),Se.center=this._map.transform.center,Nu(Se,Oe)}if(ae.zoom){let Oe=of(ae.zoom,we,vc);Se.zoom=this._map.transform.zoom+Oe.amount,Nu(Se,Oe)}if(ae.bearing){let Oe=of(ae.bearing,we,Lh);Se.bearing=this._map.transform.bearing+t.ac(Oe.amount,-179,179),Nu(Se,Oe)}if(ae.pitch){let Oe=of(ae.pitch,we,nf);Se.pitch=this._map.transform.pitch+Oe.amount,Nu(Se,Oe)}if(Se.zoom||Se.bearing){let Oe=ae.pinchAround===void 0?ae.around:ae.pinchAround;Se.around=Oe?this._map.unproject(Oe):this._map.getCenter()}return this.clear(),t.e(Se,{noMoveStart:!0})}}function Nu(Ne,R){(!Ne.duration||Ne.durationae.unproject(Bt)),At=Oe.reduce((Bt,$t,br,Ar)=>Bt.add($t.div(Ar.length)),new t.P(0,0));super(R,{points:Oe,point:At,lngLats:pt,lngLat:ae.unproject(At),originalEvent:we}),this._defaultPrevented=!1}}class uh extends t.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(R,ae,we){super(R,{originalEvent:we}),this._defaultPrevented=!1}}class vf{constructor(R,ae){this._map=R,this._clickTolerance=ae.clickTolerance}reset(){delete this._mousedownPos}wheel(R){return this._firePreventable(new uh(R.type,this._map,R))}mousedown(R,ae){return this._mousedownPos=ae,this._firePreventable(new tu(R.type,this._map,R))}mouseup(R){this._map.fire(new tu(R.type,this._map,R))}click(R,ae){this._mousedownPos&&this._mousedownPos.dist(ae)>=this._clickTolerance||this._map.fire(new tu(R.type,this._map,R))}dblclick(R){return this._firePreventable(new tu(R.type,this._map,R))}mouseover(R){this._map.fire(new tu(R.type,this._map,R))}mouseout(R){this._map.fire(new tu(R.type,this._map,R))}touchstart(R){return this._firePreventable(new Xc(R.type,this._map,R))}touchmove(R){this._map.fire(new Xc(R.type,this._map,R))}touchend(R){this._map.fire(new Xc(R.type,this._map,R))}touchcancel(R){this._map.fire(new Xc(R.type,this._map,R))}_firePreventable(R){if(this._map.fire(R),R.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class ol{constructor(R){this._map=R}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(R){this._map.fire(new tu(R.type,this._map,R))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new tu("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(R){this._delayContextMenu?this._contextMenuEvent=R:this._ignoreContextMenu||this._map.fire(new tu(R.type,this._map,R)),this._map.listens("contextmenu")&&R.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class mu{constructor(R){this._map=R}get transform(){return this._map._requestedCameraState||this._map.transform}get center(){return{lng:this.transform.center.lng,lat:this.transform.center.lat}}get zoom(){return this.transform.zoom}get pitch(){return this.transform.pitch}get bearing(){return this.transform.bearing}unproject(R){return this.transform.pointLocation(t.P.convert(R),this._map.terrain)}}class Pu{constructor(R,ae){this._map=R,this._tr=new mu(R),this._el=R.getCanvasContainer(),this._container=R.getContainer(),this._clickTolerance=ae.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(R,ae){this.isEnabled()&&R.shiftKey&&R.button===0&&(n.disableDrag(),this._startPos=this._lastPos=ae,this._active=!0)}mousemoveWindow(R,ae){if(!this._active)return;let we=ae;if(this._lastPos.equals(we)||!this._box&&we.dist(this._startPos)Oe.fitScreenCoordinates(we,Se,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",R)}keydown(R){this._active&&R.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",R))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(n.remove(this._box),this._box=null),n.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(R,ae){return this._map.fire(new t.k(R,{originalEvent:ae}))}}function kf(Ne,R){if(Ne.length!==R.length)throw new Error(`The number of touches and points are not equal - touches ${Ne.length}, points ${R.length}`);let ae={};for(let we=0;wethis.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=R.timeStamp),we.length===this.numTouches&&(this.centroid=function(Se){let Oe=new t.P(0,0);for(let pt of Se)Oe._add(pt);return Oe.div(Se.length)}(ae),this.touches=kf(we,ae)))}touchmove(R,ae,we){if(this.aborted||!this.centroid)return;let Se=kf(we,ae);for(let Oe in this.touches){let pt=Se[Oe];(!pt||pt.dist(this.touches[Oe])>30)&&(this.aborted=!0)}}touchend(R,ae,we){if((!this.centroid||R.timeStamp-this.startTime>500)&&(this.aborted=!0),we.length===0){let Se=!this.aborted&&this.centroid;if(this.reset(),Se)return Se}}}class sf{constructor(R){this.singleTap=new hl(R),this.numTaps=R.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(R,ae,we){this.singleTap.touchstart(R,ae,we)}touchmove(R,ae,we){this.singleTap.touchmove(R,ae,we)}touchend(R,ae,we){let Se=this.singleTap.touchend(R,ae,we);if(Se){let Oe=R.timeStamp-this.lastTime<500,pt=!this.lastTap||this.lastTap.dist(Se)<30;if(Oe&&pt||this.reset(),this.count++,this.lastTime=R.timeStamp,this.lastTap=Se,this.count===this.numTaps)return this.reset(),Se}}}class Mc{constructor(R){this._tr=new mu(R),this._zoomIn=new sf({numTouches:1,numTaps:2}),this._zoomOut=new sf({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(R,ae,we){this._zoomIn.touchstart(R,ae,we),this._zoomOut.touchstart(R,ae,we)}touchmove(R,ae,we){this._zoomIn.touchmove(R,ae,we),this._zoomOut.touchmove(R,ae,we)}touchend(R,ae,we){let Se=this._zoomIn.touchend(R,ae,we),Oe=this._zoomOut.touchend(R,ae,we),pt=this._tr;return Se?(this._active=!0,R.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:At=>At.easeTo({duration:300,zoom:pt.zoom+1,around:pt.unproject(Se)},{originalEvent:R})}):Oe?(this._active=!0,R.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:At=>At.easeTo({duration:300,zoom:pt.zoom-1,around:pt.unproject(Oe)},{originalEvent:R})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Hu{constructor(R){this._enabled=!!R.enable,this._moveStateManager=R.moveStateManager,this._clickTolerance=R.clickTolerance||1,this._moveFunction=R.move,this._activateOnStart=!!R.activateOnStart,R.assignEvents(this),this.reset()}reset(R){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(R)}_move(...R){let ae=this._moveFunction(...R);if(ae.bearingDelta||ae.pitchDelta||ae.around||ae.panDelta)return this._active=!0,ae}dragStart(R,ae){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(R)&&(this._moveStateManager.startMove(R),this._lastPoint=ae.length?ae[0]:ae,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(R,ae){if(!this.isEnabled())return;let we=this._lastPoint;if(!we)return;if(R.preventDefault(),!this._moveStateManager.isValidMoveEvent(R))return void this.reset(R);let Se=ae.length?ae[0]:ae;return!this._moved&&Se.dist(we){Ne.mousedown=Ne.dragStart,Ne.mousemoveWindow=Ne.dragMove,Ne.mouseup=Ne.dragEnd,Ne.contextmenu=R=>{R.preventDefault()}},ru=({enable:Ne,clickTolerance:R,bearingDegreesPerPixelMoved:ae=.8})=>{let we=new Wu({checkCorrectEvent:Se=>n.mouseButton(Se)===0&&Se.ctrlKey||n.mouseButton(Se)===2});return new Hu({clickTolerance:R,move:(Se,Oe)=>({bearingDelta:(Oe.x-Se.x)*ae}),moveStateManager:we,enable:Ne,assignEvents:Lf})},jf=({enable:Ne,clickTolerance:R,pitchDegreesPerPixelMoved:ae=-.5})=>{let we=new Wu({checkCorrectEvent:Se=>n.mouseButton(Se)===0&&Se.ctrlKey||n.mouseButton(Se)===2});return new Hu({clickTolerance:R,move:(Se,Oe)=>({pitchDelta:(Oe.y-Se.y)*ae}),moveStateManager:we,enable:Ne,assignEvents:Lf})};class Xu{constructor(R,ae){this._clickTolerance=R.clickTolerance||1,this._map=ae,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new t.P(0,0)}_shouldBePrevented(R){return R<(this._map.cooperativeGestures.isEnabled()?2:1)}touchstart(R,ae,we){return this._calculateTransform(R,ae,we)}touchmove(R,ae,we){if(this._active){if(!this._shouldBePrevented(we.length))return R.preventDefault(),this._calculateTransform(R,ae,we);this._map.cooperativeGestures.notifyGestureBlocked("touch_pan",R)}}touchend(R,ae,we){this._calculateTransform(R,ae,we),this._active&&this._shouldBePrevented(we.length)&&this.reset()}touchcancel(){this.reset()}_calculateTransform(R,ae,we){we.length>0&&(this._active=!0);let Se=kf(we,ae),Oe=new t.P(0,0),pt=new t.P(0,0),At=0;for(let $t in Se){let br=Se[$t],Ar=this._touches[$t];Ar&&(Oe._add(br),pt._add(br.sub(Ar)),At++,Se[$t]=br)}if(this._touches=Se,this._shouldBePrevented(At)||!pt.mag())return;let Bt=pt.div(At);return this._sum._add(Bt),this._sum.mag()Math.abs(Ne.x)}class kc extends Ec{constructor(R){super(),this._currentTouchCount=0,this._map=R}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(R,ae,we){super.touchstart(R,ae,we),this._currentTouchCount=we.length}_start(R){this._lastPoints=R,sc(R[0].sub(R[1]))&&(this._valid=!1)}_move(R,ae,we){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;let Se=R[0].sub(this._lastPoints[0]),Oe=R[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(Se,Oe,we.timeStamp),this._valid?(this._lastPoints=R,this._active=!0,{pitchDelta:(Se.y+Oe.y)/2*-.5}):void 0}gestureBeginsVertically(R,ae,we){if(this._valid!==void 0)return this._valid;let Se=R.mag()>=2,Oe=ae.mag()>=2;if(!Se&&!Oe)return;if(!Se||!Oe)return this._firstMove===void 0&&(this._firstMove=we),we-this._firstMove<100&&void 0;let pt=R.y>0==ae.y>0;return sc(R)&&sc(ae)&&pt}}let er={panStep:100,bearingStep:15,pitchStep:10};class yr{constructor(R){this._tr=new mu(R);let ae=er;this._panStep=ae.panStep,this._bearingStep=ae.bearingStep,this._pitchStep=ae.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(R){if(R.altKey||R.ctrlKey||R.metaKey)return;let ae=0,we=0,Se=0,Oe=0,pt=0;switch(R.keyCode){case 61:case 107:case 171:case 187:ae=1;break;case 189:case 109:case 173:ae=-1;break;case 37:R.shiftKey?we=-1:(R.preventDefault(),Oe=-1);break;case 39:R.shiftKey?we=1:(R.preventDefault(),Oe=1);break;case 38:R.shiftKey?Se=1:(R.preventDefault(),pt=-1);break;case 40:R.shiftKey?Se=-1:(R.preventDefault(),pt=1);break;default:return}return this._rotationDisabled&&(we=0,Se=0),{cameraAnimation:At=>{let Bt=this._tr;At.easeTo({duration:300,easeId:"keyboardHandler",easing:na,zoom:ae?Math.round(Bt.zoom)+ae*(R.shiftKey?2:1):Bt.zoom,bearing:Bt.bearing+we*this._bearingStep,pitch:Bt.pitch+Se*this._pitchStep,offset:[-Oe*this._panStep,-pt*this._panStep],center:Bt.center},{originalEvent:R})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}disableRotation(){this._rotationDisabled=!0}enableRotation(){this._rotationDisabled=!1}}function na(Ne){return Ne*(2-Ne)}let $r=4.000244140625;class La{constructor(R,ae){this._onTimeout=we=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(we)},this._map=R,this._tr=new mu(R),this._triggerRenderFrame=ae,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222}setZoomRate(R){this._defaultZoomRate=R}setWheelZoomRate(R){this._wheelZoomRate=R}isEnabled(){return!!this._enabled}isActive(){return!!this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(R){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!R&&R.around==="center")}disable(){this.isEnabled()&&(this._enabled=!1)}_shouldBePrevented(R){return!!this._map.cooperativeGestures.isEnabled()&&!(R.ctrlKey||this._map.cooperativeGestures.isBypassed(R))}wheel(R){if(!this.isEnabled())return;if(this._shouldBePrevented(R))return void this._map.cooperativeGestures.notifyGestureBlocked("wheel_zoom",R);let ae=R.deltaMode===WheelEvent.DOM_DELTA_LINE?40*R.deltaY:R.deltaY,we=i.now(),Se=we-(this._lastWheelEventTime||0);this._lastWheelEventTime=we,ae!==0&&ae%$r==0?this._type="wheel":ae!==0&&Math.abs(ae)<4?this._type="trackpad":Se>400?(this._type=null,this._lastValue=ae,this._timeout=setTimeout(this._onTimeout,40,R)):this._type||(this._type=Math.abs(Se*ae)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,ae+=this._lastValue)),R.shiftKey&&ae&&(ae/=4),this._type&&(this._lastWheelEvent=R,this._delta-=ae,this._active||this._start(R)),R.preventDefault()}_start(R){if(!this._delta)return;this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);let ae=n.mousePos(this._map.getCanvas(),R),we=this._tr;this._around=ae.y>we.transform.height/2-we.transform.getHorizon()?t.N.convert(this._aroundCenter?we.center:we.unproject(ae)):t.N.convert(we.center),this._aroundPoint=we.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;let R=this._tr.transform;if(this._delta!==0){let Bt=this._type==="wheel"&&Math.abs(this._delta)>$r?this._wheelZoomRate:this._defaultZoomRate,$t=2/(1+Math.exp(-Math.abs(this._delta*Bt)));this._delta<0&&$t!==0&&($t=1/$t);let br=typeof this._targetZoom=="number"?R.zoomScale(this._targetZoom):R.scale;this._targetZoom=Math.min(R.maxZoom,Math.max(R.minZoom,R.scaleZoom(br*$t))),this._type==="wheel"&&(this._startZoom=R.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}let ae=typeof this._targetZoom=="number"?this._targetZoom:R.zoom,we=this._startZoom,Se=this._easing,Oe,pt=!1,At=i.now()-this._lastWheelEventTime;if(this._type==="wheel"&&we&&Se&&At){let Bt=Math.min(At/200,1),$t=Se(Bt);Oe=t.y.number(we,ae,$t),Bt<1?this._frameId||(this._frameId=!0):pt=!0}else Oe=ae,pt=!0;return this._active=!0,pt&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!pt,zoomDelta:Oe-R.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(R){let ae=t.b9;if(this._prevEase){let we=this._prevEase,Se=(i.now()-we.start)/we.duration,Oe=we.easing(Se+.01)-we.easing(Se),pt=.27/Math.sqrt(Oe*Oe+1e-4)*.01,At=Math.sqrt(.0729-pt*pt);ae=t.b8(pt,At,.25,1)}return this._prevEase={start:i.now(),duration:R,easing:ae},ae}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class hi{constructor(R,ae){this._clickZoom=R,this._tapZoom=ae}enable(){this._clickZoom.enable(),this._tapZoom.enable()}disable(){this._clickZoom.disable(),this._tapZoom.disable()}isEnabled(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()}isActive(){return this._clickZoom.isActive()||this._tapZoom.isActive()}}class Pi{constructor(R){this._tr=new mu(R),this.reset()}reset(){this._active=!1}dblclick(R,ae){return R.preventDefault(),{cameraAnimation:we=>{we.easeTo({duration:300,zoom:this._tr.zoom+(R.shiftKey?-1:1),around:this._tr.unproject(ae)},{originalEvent:R})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Zi{constructor(){this._tap=new sf({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,delete this._tapPoint,this._tap.reset()}touchstart(R,ae,we){if(!this._swipePoint)if(this._tapTime){let Se=ae[0],Oe=R.timeStamp-this._tapTime<500,pt=this._tapPoint.dist(Se)<30;Oe&&pt?we.length>0&&(this._swipePoint=Se,this._swipeTouch=we[0].identifier):this.reset()}else this._tap.touchstart(R,ae,we)}touchmove(R,ae,we){if(this._tapTime){if(this._swipePoint){if(we[0].identifier!==this._swipeTouch)return;let Se=ae[0],Oe=Se.y-this._swipePoint.y;return this._swipePoint=Se,R.preventDefault(),this._active=!0,{zoomDelta:Oe/128}}}else this._tap.touchmove(R,ae,we)}touchend(R,ae,we){if(this._tapTime)this._swipePoint&&we.length===0&&this.reset();else{let Se=this._tap.touchend(R,ae,we);Se&&(this._tapTime=R.timeStamp,this._tapPoint=Se)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class tn{constructor(R,ae,we){this._el=R,this._mousePan=ae,this._touchPan=we}enable(R){this._inertiaOptions=R||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("maplibregl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("maplibregl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class dn{constructor(R,ae,we){this._pitchWithRotate=R.pitchWithRotate,this._mouseRotate=ae,this._mousePitch=we}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()}}class Ri{constructor(R,ae,we,Se){this._el=R,this._touchZoom=ae,this._touchRotate=we,this._tapDragZoom=Se,this._rotationDisabled=!1,this._enabled=!0}enable(R){this._touchZoom.enable(R),this._rotationDisabled||this._touchRotate.enable(R),this._tapDragZoom.enable(),this._el.classList.add("maplibregl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}class Fi{constructor(R,ae){this._bypassKey=navigator.userAgent.indexOf("Mac")!==-1?"metaKey":"ctrlKey",this._map=R,this._options=ae,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;let R=this._map.getCanvasContainer();R.classList.add("maplibregl-cooperative-gestures"),this._container=n.create("div","maplibregl-cooperative-gesture-screen",R);let ae=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");this._bypassKey==="metaKey"&&(ae=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));let we=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),Se=document.createElement("div");Se.className="maplibregl-desktop-message",Se.textContent=ae,this._container.appendChild(Se);let Oe=document.createElement("div");Oe.className="maplibregl-mobile-message",Oe.textContent=we,this._container.appendChild(Oe),this._container.setAttribute("aria-hidden","true")}_destroyUI(){this._container&&(n.remove(this._container),this._map.getCanvasContainer().classList.remove("maplibregl-cooperative-gestures")),delete this._container}enable(){this._setupUI(),this._enabled=!0}disable(){this._enabled=!1,this._destroyUI()}isEnabled(){return this._enabled}isBypassed(R){return R[this._bypassKey]}notifyGestureBlocked(R,ae){this._enabled&&(this._map.fire(new t.k("cooperativegestureprevented",{gestureType:R,originalEvent:ae})),this._container.classList.add("maplibregl-show"),setTimeout(()=>{this._container.classList.remove("maplibregl-show")},100))}}let qi=Ne=>Ne.zoom||Ne.drag||Ne.pitch||Ne.rotate;class _i extends t.k{}function Mn(Ne){return Ne.panDelta&&Ne.panDelta.mag()||Ne.zoomDelta||Ne.bearingDelta||Ne.pitchDelta}class Kn{constructor(R,ae){this.handleWindowEvent=Se=>{this.handleEvent(Se,`${Se.type}Window`)},this.handleEvent=(Se,Oe)=>{if(Se.type==="blur")return void this.stop(!0);this._updatingCamera=!0;let pt=Se.type==="renderFrame"?void 0:Se,At={needsRenderFrame:!1},Bt={},$t={},br=Se.touches,Ar=br?this._getMapTouches(br):void 0,Yr=Ar?n.touchPos(this._map.getCanvas(),Ar):n.mousePos(this._map.getCanvas(),Se);for(let{handlerName:Je,handler:ut,allowed:dt}of this._handlers){if(!ut.isEnabled())continue;let Ct;this._blockedByActive($t,dt,Je)?ut.reset():ut[Oe||Se.type]&&(Ct=ut[Oe||Se.type](Se,Yr,Ar),this.mergeHandlerResult(At,Bt,Ct,Je,pt),Ct&&Ct.needsRenderFrame&&this._triggerRenderFrame()),(Ct||ut.isActive())&&($t[Je]=ut)}let sa={};for(let Je in this._previousActiveHandlers)$t[Je]||(sa[Je]=pt);this._previousActiveHandlers=$t,(Object.keys(sa).length||Mn(At))&&(this._changes.push([At,Bt,sa]),this._triggerRenderFrame()),(Object.keys($t).length||Mn(At))&&this._map._stop(!0),this._updatingCamera=!1;let{cameraAnimation:He}=At;He&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],He(this._map))},this._map=R,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new df(R),this._bearingSnap=ae.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(ae);let we=this._el;this._listeners=[[we,"touchstart",{passive:!0}],[we,"touchmove",{passive:!1}],[we,"touchend",void 0],[we,"touchcancel",void 0],[we,"mousedown",void 0],[we,"mousemove",void 0],[we,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[we,"mouseover",void 0],[we,"mouseout",void 0],[we,"dblclick",void 0],[we,"click",void 0],[we,"keydown",{capture:!1}],[we,"keyup",void 0],[we,"wheel",{passive:!1}],[we,"contextmenu",void 0],[window,"blur",void 0]];for(let[Se,Oe,pt]of this._listeners)n.addEventListener(Se,Oe,Se===document?this.handleWindowEvent:this.handleEvent,pt)}destroy(){for(let[R,ae,we]of this._listeners)n.removeEventListener(R,ae,R===document?this.handleWindowEvent:this.handleEvent,we)}_addDefaultHandlers(R){let ae=this._map,we=ae.getCanvasContainer();this._add("mapEvent",new vf(ae,R));let Se=ae.boxZoom=new Pu(ae,R);this._add("boxZoom",Se),R.interactive&&R.boxZoom&&Se.enable();let Oe=ae.cooperativeGestures=new Fi(ae,R.cooperativeGestures);this._add("cooperativeGestures",Oe),R.cooperativeGestures&&Oe.enable();let pt=new Mc(ae),At=new Pi(ae);ae.doubleClickZoom=new hi(At,pt),this._add("tapZoom",pt),this._add("clickZoom",At),R.interactive&&R.doubleClickZoom&&ae.doubleClickZoom.enable();let Bt=new Zi;this._add("tapDragZoom",Bt);let $t=ae.touchPitch=new kc(ae);this._add("touchPitch",$t),R.interactive&&R.touchPitch&&ae.touchPitch.enable(R.touchPitch);let br=ru(R),Ar=jf(R);ae.dragRotate=new dn(R,br,Ar),this._add("mouseRotate",br,["mousePitch"]),this._add("mousePitch",Ar,["mouseRotate"]),R.interactive&&R.dragRotate&&ae.dragRotate.enable();let Yr=(({enable:Ct,clickTolerance:wt})=>{let Dt=new Wu({checkCorrectEvent:ur=>n.mouseButton(ur)===0&&!ur.ctrlKey});return new Hu({clickTolerance:wt,move:(ur,mr)=>({around:mr,panDelta:mr.sub(ur)}),activateOnStart:!0,moveStateManager:Dt,enable:Ct,assignEvents:Lf})})(R),sa=new Xu(R,ae);ae.dragPan=new tn(we,Yr,sa),this._add("mousePan",Yr),this._add("touchPan",sa,["touchZoom","touchRotate"]),R.interactive&&R.dragPan&&ae.dragPan.enable(R.dragPan);let He=new Yc,Je=new gu;ae.touchZoomRotate=new Ri(we,Je,He,Bt),this._add("touchRotate",He,["touchPan","touchZoom"]),this._add("touchZoom",Je,["touchPan","touchRotate"]),R.interactive&&R.touchZoomRotate&&ae.touchZoomRotate.enable(R.touchZoomRotate);let ut=ae.scrollZoom=new La(ae,()=>this._triggerRenderFrame());this._add("scrollZoom",ut,["mousePan"]),R.interactive&&R.scrollZoom&&ae.scrollZoom.enable(R.scrollZoom);let dt=ae.keyboard=new yr(ae);this._add("keyboard",dt),R.interactive&&R.keyboard&&ae.keyboard.enable(),this._add("blockableMapEvent",new ol(ae))}_add(R,ae,we){this._handlers.push({handlerName:R,handler:ae,allowed:we}),this._handlersById[R]=ae}stop(R){if(!this._updatingCamera){for(let{handler:ae}of this._handlers)ae.reset();this._inertia.clear(),this._fireEvents({},{},R),this._changes=[]}}isActive(){for(let{handler:R}of this._handlers)if(R.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!qi(this._eventsInProgress)||this.isZooming()}_blockedByActive(R,ae,we){for(let Se in R)if(Se!==we&&(!ae||ae.indexOf(Se)<0))return!0;return!1}_getMapTouches(R){let ae=[];for(let we of R)this._el.contains(we.target)&&ae.push(we);return ae}mergeHandlerResult(R,ae,we,Se,Oe){if(!we)return;t.e(R,we);let pt={handlerName:Se,originalEvent:we.originalEvent||Oe};we.zoomDelta!==void 0&&(ae.zoom=pt),we.panDelta!==void 0&&(ae.drag=pt),we.pitchDelta!==void 0&&(ae.pitch=pt),we.bearingDelta!==void 0&&(ae.rotate=pt)}_applyChanges(){let R={},ae={},we={};for(let[Se,Oe,pt]of this._changes)Se.panDelta&&(R.panDelta=(R.panDelta||new t.P(0,0))._add(Se.panDelta)),Se.zoomDelta&&(R.zoomDelta=(R.zoomDelta||0)+Se.zoomDelta),Se.bearingDelta&&(R.bearingDelta=(R.bearingDelta||0)+Se.bearingDelta),Se.pitchDelta&&(R.pitchDelta=(R.pitchDelta||0)+Se.pitchDelta),Se.around!==void 0&&(R.around=Se.around),Se.pinchAround!==void 0&&(R.pinchAround=Se.pinchAround),Se.noInertia&&(R.noInertia=Se.noInertia),t.e(ae,Oe),t.e(we,pt);this._updateMapTransform(R,ae,we),this._changes=[]}_updateMapTransform(R,ae,we){let Se=this._map,Oe=Se._getTransformForUpdate(),pt=Se.terrain;if(!(Mn(R)||pt&&this._terrainMovement))return this._fireEvents(ae,we,!0);let{panDelta:At,zoomDelta:Bt,bearingDelta:$t,pitchDelta:br,around:Ar,pinchAround:Yr}=R;Yr!==void 0&&(Ar=Yr),Se._stop(!0),Ar=Ar||Se.transform.centerPoint;let sa=Oe.pointLocation(At?Ar.sub(At):Ar);$t&&(Oe.bearing+=$t),br&&(Oe.pitch+=br),Bt&&(Oe.zoom+=Bt),pt?this._terrainMovement||!ae.drag&&!ae.zoom?ae.drag&&this._terrainMovement?Oe.center=Oe.pointLocation(Oe.centerPoint.sub(At)):Oe.setLocationAtPoint(sa,Ar):(this._terrainMovement=!0,this._map._elevationFreeze=!0,Oe.setLocationAtPoint(sa,Ar)):Oe.setLocationAtPoint(sa,Ar),Se._applyUpdatedTransform(Oe),this._map._update(),R.noInertia||this._inertia.record(R),this._fireEvents(ae,we,!0)}_fireEvents(R,ae,we){let Se=qi(this._eventsInProgress),Oe=qi(R),pt={};for(let Ar in R){let{originalEvent:Yr}=R[Ar];this._eventsInProgress[Ar]||(pt[`${Ar}start`]=Yr),this._eventsInProgress[Ar]=R[Ar]}!Se&&Oe&&this._fireEvent("movestart",Oe.originalEvent);for(let Ar in pt)this._fireEvent(Ar,pt[Ar]);Oe&&this._fireEvent("move",Oe.originalEvent);for(let Ar in R){let{originalEvent:Yr}=R[Ar];this._fireEvent(Ar,Yr)}let At={},Bt;for(let Ar in this._eventsInProgress){let{handlerName:Yr,originalEvent:sa}=this._eventsInProgress[Ar];this._handlersById[Yr].isActive()||(delete this._eventsInProgress[Ar],Bt=ae[Yr]||sa,At[`${Ar}end`]=Bt)}for(let Ar in At)this._fireEvent(Ar,At[Ar]);let $t=qi(this._eventsInProgress),br=(Se||Oe)&&!$t;if(br&&this._terrainMovement){this._map._elevationFreeze=!1,this._terrainMovement=!1;let Ar=this._map._getTransformForUpdate();Ar.recalculateZoom(this._map.terrain),this._map._applyUpdatedTransform(Ar)}if(we&&br){this._updatingCamera=!0;let Ar=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),Yr=sa=>sa!==0&&-this._bearingSnap{delete this._frameId,this.handleEvent(new _i("renderFrame",{timeStamp:R})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}class ao extends t.E{constructor(R,ae){super(),this._renderFrameCallback=()=>{let we=Math.min((i.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(we)),we<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=R,this._bearingSnap=ae.bearingSnap,this.on("moveend",()=>{delete this._requestedCameraState})}getCenter(){return new t.N(this.transform.center.lng,this.transform.center.lat)}setCenter(R,ae){return this.jumpTo({center:R},ae)}panBy(R,ae,we){return R=t.P.convert(R).mult(-1),this.panTo(this.transform.center,t.e({offset:R},ae),we)}panTo(R,ae,we){return this.easeTo(t.e({center:R},ae),we)}getZoom(){return this.transform.zoom}setZoom(R,ae){return this.jumpTo({zoom:R},ae),this}zoomTo(R,ae,we){return this.easeTo(t.e({zoom:R},ae),we)}zoomIn(R,ae){return this.zoomTo(this.getZoom()+1,R,ae),this}zoomOut(R,ae){return this.zoomTo(this.getZoom()-1,R,ae),this}getBearing(){return this.transform.bearing}setBearing(R,ae){return this.jumpTo({bearing:R},ae),this}getPadding(){return this.transform.padding}setPadding(R,ae){return this.jumpTo({padding:R},ae),this}rotateTo(R,ae,we){return this.easeTo(t.e({bearing:R},ae),we)}resetNorth(R,ae){return this.rotateTo(0,t.e({duration:1e3},R),ae),this}resetNorthPitch(R,ae){return this.easeTo(t.e({bearing:0,pitch:0,duration:1e3},R),ae),this}snapToNorth(R,ae){return Math.abs(this.getBearing()){if(this._zooming&&(Se.zoom=t.y.number(Oe,ut,Er)),this._rotating&&(Se.bearing=t.y.number(pt,$t,Er)),this._pitching&&(Se.pitch=t.y.number(At,br,Er)),this._padding&&(Se.interpolatePadding(Bt,Ar,Er),sa=Se.centerPoint.add(Yr)),this.terrain&&!R.freezeElevation&&this._updateElevation(Er),Dt)Se.setLocationAtPoint(Dt,ur);else{let Br=Se.zoomScale(Se.zoom-Oe),Qr=ut>Oe?Math.min(2,wt):Math.max(.5,wt),ga=Math.pow(Qr,1-Er),Sa=Se.unproject(dt.add(Ct.mult(Er*ga)).mult(Br));Se.setLocationAtPoint(Se.renderWorldCopies?Sa.wrap():Sa,sa)}this._applyUpdatedTransform(Se),this._fireMoveEvents(ae)},Er=>{this.terrain&&R.freezeElevation&&this._finalizeElevation(),this._afterEase(ae,Er)},R),this}_prepareEase(R,ae,we={}){this._moving=!0,ae||we.moving||this.fire(new t.k("movestart",R)),this._zooming&&!we.zooming&&this.fire(new t.k("zoomstart",R)),this._rotating&&!we.rotating&&this.fire(new t.k("rotatestart",R)),this._pitching&&!we.pitching&&this.fire(new t.k("pitchstart",R))}_prepareElevation(R){this._elevationCenter=R,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLatZoom(R,this.transform.tileZoom),this._elevationFreeze=!0}_updateElevation(R){this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);let ae=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(R<1&&ae!==this._elevationTarget){let we=this._elevationTarget-this._elevationStart;this._elevationStart+=R*(we-(ae-(we*R+this._elevationStart))/(1-R)),this._elevationTarget=ae}this.transform.elevation=t.y.number(this._elevationStart,this._elevationTarget,R)}_finalizeElevation(){this._elevationFreeze=!1,this.transform.recalculateZoom(this.terrain)}_getTransformForUpdate(){return this.transformCameraUpdate||this.terrain?(this._requestedCameraState||(this._requestedCameraState=this.transform.clone()),this._requestedCameraState):this.transform}_elevateCameraIfInsideTerrain(R){let ae=R.getCameraPosition(),we=this.terrain.getElevationForLngLatZoom(ae.lngLat,R.zoom);if(ae.altitudethis._elevateCameraIfInsideTerrain(Se)),this.transformCameraUpdate&&ae.push(Se=>this.transformCameraUpdate(Se)),!ae.length)return;let we=R.clone();for(let Se of ae){let Oe=we.clone(),{center:pt,zoom:At,pitch:Bt,bearing:$t,elevation:br}=Se(Oe);pt&&(Oe.center=pt),At!==void 0&&(Oe.zoom=At),Bt!==void 0&&(Oe.pitch=Bt),$t!==void 0&&(Oe.bearing=$t),br!==void 0&&(Oe.elevation=br),we.apply(Oe)}this.transform.apply(we)}_fireMoveEvents(R){this.fire(new t.k("move",R)),this._zooming&&this.fire(new t.k("zoom",R)),this._rotating&&this.fire(new t.k("rotate",R)),this._pitching&&this.fire(new t.k("pitch",R))}_afterEase(R,ae){if(this._easeId&&ae&&this._easeId===ae)return;delete this._easeId;let we=this._zooming,Se=this._rotating,Oe=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,we&&this.fire(new t.k("zoomend",R)),Se&&this.fire(new t.k("rotateend",R)),Oe&&this.fire(new t.k("pitchend",R)),this.fire(new t.k("moveend",R))}flyTo(R,ae){var we;if(!R.essential&&i.prefersReducedMotion){let on=t.M(R,["center","zoom","bearing","pitch","around"]);return this.jumpTo(on,ae)}this.stop(),R=t.e({offset:[0,0],speed:1.2,curve:1.42,easing:t.b9},R);let Se=this._getTransformForUpdate(),Oe=Se.zoom,pt=Se.bearing,At=Se.pitch,Bt=Se.padding,$t="bearing"in R?this._normalizeBearing(R.bearing,pt):pt,br="pitch"in R?+R.pitch:At,Ar="padding"in R?R.padding:Se.padding,Yr=t.P.convert(R.offset),sa=Se.centerPoint.add(Yr),He=Se.pointLocation(sa),{center:Je,zoom:ut}=Se.getConstrained(t.N.convert(R.center||He),(we=R.zoom)!==null&&we!==void 0?we:Oe);this._normalizeCenter(Je,Se);let dt=Se.zoomScale(ut-Oe),Ct=Se.project(He),wt=Se.project(Je).sub(Ct),Dt=R.curve,ur=Math.max(Se.width,Se.height),mr=ur/dt,Er=wt.mag();if("minZoom"in R){let on=t.ac(Math.min(R.minZoom,Oe,ut),Se.minZoom,Se.maxZoom),Tn=ur/Se.zoomScale(on-Oe);Dt=Math.sqrt(Tn/Er*2)}let Br=Dt*Dt;function Qr(on){let Tn=(mr*mr-ur*ur+(on?-1:1)*Br*Br*Er*Er)/(2*(on?mr:ur)*Br*Er);return Math.log(Math.sqrt(Tn*Tn+1)-Tn)}function ga(on){return(Math.exp(on)-Math.exp(-on))/2}function Sa(on){return(Math.exp(on)+Math.exp(-on))/2}let Oa=Qr(!1),di=function(on){return Sa(Oa)/Sa(Oa+Dt*on)},Wi=function(on){return ur*((Sa(Oa)*(ga(Tn=Oa+Dt*on)/Sa(Tn))-ga(Oa))/Br)/Er;var Tn},Gi=(Qr(!0)-Oa)/Dt;if(Math.abs(Er)<1e-6||!isFinite(Gi)){if(Math.abs(ur-mr)<1e-6)return this.easeTo(R,ae);let on=mr0,di=Tn=>Math.exp(on*Dt*Tn)}return R.duration="duration"in R?+R.duration:1e3*Gi/("screenSpeed"in R?+R.screenSpeed/Dt:+R.speed),R.maxDuration&&R.duration>R.maxDuration&&(R.duration=0),this._zooming=!0,this._rotating=pt!==$t,this._pitching=br!==At,this._padding=!Se.isPaddingEqual(Ar),this._prepareEase(ae,!1),this.terrain&&this._prepareElevation(Je),this._ease(on=>{let Tn=on*Gi,Wn=1/di(Tn);Se.zoom=on===1?ut:Oe+Se.scaleZoom(Wn),this._rotating&&(Se.bearing=t.y.number(pt,$t,on)),this._pitching&&(Se.pitch=t.y.number(At,br,on)),this._padding&&(Se.interpolatePadding(Bt,Ar,on),sa=Se.centerPoint.add(Yr)),this.terrain&&!R.freezeElevation&&this._updateElevation(on);let Bn=on===1?Je:Se.unproject(Ct.add(wt.mult(Wi(Tn))).mult(Wn));Se.setLocationAtPoint(Se.renderWorldCopies?Bn.wrap():Bn,sa),this._applyUpdatedTransform(Se),this._fireMoveEvents(ae)},()=>{this.terrain&&R.freezeElevation&&this._finalizeElevation(),this._afterEase(ae)},R),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(R,ae){var we;if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){let Se=this._onEaseEnd;delete this._onEaseEnd,Se.call(this,ae)}return R||(we=this.handlers)===null||we===void 0||we.stop(!1),this}_ease(R,ae,we){we.animate===!1||we.duration===0?(R(1),ae()):(this._easeStart=i.now(),this._easeOptions=we,this._onEaseFrame=R,this._onEaseEnd=ae,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(R,ae){R=t.b3(R,-180,180);let we=Math.abs(R-ae);return Math.abs(R-360-ae)180?-360:we<-180?360:0}queryTerrainElevation(R){return this.terrain?this.terrain.getElevationForLngLatZoom(t.N.convert(R),this.transform.tileZoom)-this.transform.elevation:null}}let Jn={compact:!0,customAttribution:'MapLibre'};class co{constructor(R=Jn){this._toggleAttribution=()=>{this._container.classList.contains("maplibregl-compact")&&(this._container.classList.contains("maplibregl-compact-show")?(this._container.setAttribute("open",""),this._container.classList.remove("maplibregl-compact-show")):(this._container.classList.add("maplibregl-compact-show"),this._container.removeAttribute("open")))},this._updateData=ae=>{!ae||ae.sourceDataType!=="metadata"&&ae.sourceDataType!=="visibility"&&ae.dataType!=="style"&&ae.type!=="terrain"||this._updateAttributions()},this._updateCompact=()=>{this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact===!1?this._container.setAttribute("open",""):this._container.classList.contains("maplibregl-compact")||this._container.classList.contains("maplibregl-attrib-empty")||(this._container.setAttribute("open",""),this._container.classList.add("maplibregl-compact","maplibregl-compact-show")):(this._container.setAttribute("open",""),this._container.classList.contains("maplibregl-compact")&&this._container.classList.remove("maplibregl-compact","maplibregl-compact-show"))},this._updateCompactMinimize=()=>{this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show")},this.options=R}getDefaultPosition(){return"bottom-right"}onAdd(R){return this._map=R,this._compact=this.options.compact,this._container=n.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=n.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=n.create("div","maplibregl-ctrl-attrib-inner",this._container),this._updateAttributions(),this._updateCompact(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("terrain",this._updateData),this._map.on("resize",this._updateCompact),this._map.on("drag",this._updateCompactMinimize),this._container}onRemove(){n.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("terrain",this._updateData),this._map.off("resize",this._updateCompact),this._map.off("drag",this._updateCompactMinimize),this._map=void 0,this._compact=void 0,this._attribHTML=void 0}_setElementTitle(R,ae){let we=this._map._getUIString(`AttributionControl.${ae}`);R.title=we,R.setAttribute("aria-label",we)}_updateAttributions(){if(!this._map.style)return;let R=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?R=R.concat(this.options.customAttribution.map(Se=>typeof Se!="string"?"":Se)):typeof this.options.customAttribution=="string"&&R.push(this.options.customAttribution)),this._map.style.stylesheet){let Se=this._map.style.stylesheet;this.styleOwner=Se.owner,this.styleId=Se.id}let ae=this._map.style.sourceCaches;for(let Se in ae){let Oe=ae[Se];if(Oe.used||Oe.usedForTerrain){let pt=Oe.getSource();pt.attribution&&R.indexOf(pt.attribution)<0&&R.push(pt.attribution)}}R=R.filter(Se=>String(Se).trim()),R.sort((Se,Oe)=>Se.length-Oe.length),R=R.filter((Se,Oe)=>{for(let pt=Oe+1;pt=0)return!1;return!0});let we=R.join(" | ");we!==this._attribHTML&&(this._attribHTML=we,R.length?(this._innerContainer.innerHTML=we,this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}}class wn{constructor(R={}){this._updateCompact=()=>{let ae=this._container.children;if(ae.length){let we=ae[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&we.classList.add("maplibregl-compact"):we.classList.remove("maplibregl-compact")}},this.options=R}getDefaultPosition(){return"bottom-left"}onAdd(R){this._map=R,this._compact=this.options&&this.options.compact,this._container=n.create("div","maplibregl-ctrl");let ae=n.create("a","maplibregl-ctrl-logo");return ae.target="_blank",ae.rel="noopener nofollow",ae.href="https://maplibre.org/",ae.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),ae.setAttribute("rel","noopener nofollow"),this._container.appendChild(ae),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){n.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}}class un{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(R){let ae=++this._id;return this._queue.push({callback:R,id:ae,cancelled:!1}),ae}remove(R){let ae=this._currentlyRunning,we=ae?this._queue.concat(ae):this._queue;for(let Se of we)if(Se.id===R)return void(Se.cancelled=!0)}run(R=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");let ae=this._currentlyRunning=this._queue;this._queue=[];for(let we of ae)if(!we.cancelled&&(we.callback(R),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}var _o=t.Y([{name:"a_pos3d",type:"Int16",components:3}]);class Qo extends t.E{constructor(R){super(),this.sourceCache=R,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.deltaZoom=1,R.usedForTerrain=!0,R.tileSize=this.tileSize*2**this.deltaZoom}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null}update(R,ae){this.sourceCache.update(R,ae),this._renderableTilesKeys=[];let we={};for(let Se of R.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:ae}))we[Se.key]=!0,this._renderableTilesKeys.push(Se.key),this._tiles[Se.key]||(Se.posMatrix=new Float64Array(16),t.aP(Se.posMatrix,0,t.X,0,t.X,0,1),this._tiles[Se.key]=new st(Se,this.tileSize));for(let Se in this._tiles)we[Se]||delete this._tiles[Se]}freeRtt(R){for(let ae in this._tiles){let we=this._tiles[ae];(!R||we.tileID.equals(R)||we.tileID.isChildOf(R)||R.isChildOf(we.tileID))&&(we.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map(R=>this.getTileByID(R))}getTileByID(R){return this._tiles[R]}getTerrainCoords(R){let ae={};for(let we of this._renderableTilesKeys){let Se=this._tiles[we].tileID;if(Se.canonical.equals(R.canonical)){let Oe=R.clone();Oe.posMatrix=new Float64Array(16),t.aP(Oe.posMatrix,0,t.X,0,t.X,0,1),ae[we]=Oe}else if(Se.canonical.isChildOf(R.canonical)){let Oe=R.clone();Oe.posMatrix=new Float64Array(16);let pt=Se.canonical.z-R.canonical.z,At=Se.canonical.x-(Se.canonical.x>>pt<>pt<>pt;t.aP(Oe.posMatrix,0,$t,0,$t,0,1),t.J(Oe.posMatrix,Oe.posMatrix,[-At*$t,-Bt*$t,0]),ae[we]=Oe}else if(R.canonical.isChildOf(Se.canonical)){let Oe=R.clone();Oe.posMatrix=new Float64Array(16);let pt=R.canonical.z-Se.canonical.z,At=R.canonical.x-(R.canonical.x>>pt<>pt<>pt;t.aP(Oe.posMatrix,0,t.X,0,t.X,0,1),t.J(Oe.posMatrix,Oe.posMatrix,[At*$t,Bt*$t,0]),t.K(Oe.posMatrix,Oe.posMatrix,[1/2**pt,1/2**pt,0]),ae[we]=Oe}}return ae}getSourceTile(R,ae){let we=this.sourceCache._source,Se=R.overscaledZ-this.deltaZoom;if(Se>we.maxzoom&&(Se=we.maxzoom),Se=we.minzoom&&(!Oe||!Oe.dem);)Oe=this.sourceCache.getTileByID(R.scaledTo(Se--).key);return Oe}tilesAfterTime(R=Date.now()){return Object.values(this._tiles).filter(ae=>ae.timeAdded>=R)}}class xs{constructor(R,ae,we){this.painter=R,this.sourceCache=new Qo(ae),this.options=we,this.exaggeration=typeof we.exaggeration=="number"?we.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(R,ae,we,Se=t.X){var Oe;if(!(ae>=0&&ae=0&&weR.canonical.z&&(R.canonical.z>=Se?Oe=R.canonical.z-Se:t.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));let pt=R.canonical.x-(R.canonical.x>>Oe<>Oe<>8<<4|Oe>>8,ae[pt+3]=0;let we=new t.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(ae.buffer)),Se=new u(R,we,R.gl.RGBA,{premultiply:!1});return Se.bind(R.gl.NEAREST,R.gl.CLAMP_TO_EDGE),this._coordsTexture=Se,Se}pointCoordinate(R){this.painter.maybeDrawDepthAndCoords(!0);let ae=new Uint8Array(4),we=this.painter.context,Se=we.gl,Oe=Math.round(R.x*this.painter.pixelRatio/devicePixelRatio),pt=Math.round(R.y*this.painter.pixelRatio/devicePixelRatio),At=Math.round(this.painter.height/devicePixelRatio);we.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),Se.readPixels(Oe,At-pt-1,1,1,Se.RGBA,Se.UNSIGNED_BYTE,ae),we.bindFramebuffer.set(null);let Bt=ae[0]+(ae[2]>>4<<8),$t=ae[1]+((15&ae[2])<<8),br=this.coordsIndex[255-ae[3]],Ar=br&&this.sourceCache.getTileByID(br);if(!Ar)return null;let Yr=this._coordsTextureSize,sa=(1<R.id!==ae),this._recentlyUsed.push(R.id)}stampObject(R){R.stamp=++this._stamp}getOrCreateFreeObject(){for(let ae of this._recentlyUsed)if(!this._objects[ae].inUse)return this._objects[ae];if(this._objects.length>=this._size)throw new Error("No free RenderPool available, call freeAllObjects() required!");let R=this._createObject(this._objects.length);return this._objects.push(R),R}freeObject(R){R.inUse=!1}freeAllObjects(){for(let R of this._objects)this.freeObject(R)}isFull(){return!(this._objects.length!R.inUse)===!1}}let Rs={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0};class Ks{constructor(R,ae){this.painter=R,this.terrain=ae,this.pool=new Qs(R.context,30,ae.sourceCache.tileSize*ae.qualityFactor)}destruct(){this.pool.destruct()}getTexture(R){return this.pool.getObjectForId(R.rtt[this._stacks.length-1].id).texture}prepareForRender(R,ae){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=R._order.filter(we=>!R._layers[we].isHidden(ae)),this._coordsDescendingInv={};for(let we in R.sourceCaches){this._coordsDescendingInv[we]={};let Se=R.sourceCaches[we].getVisibleCoordinates();for(let Oe of Se){let pt=this.terrain.sourceCache.getTerrainCoords(Oe);for(let At in pt)this._coordsDescendingInv[we][At]||(this._coordsDescendingInv[we][At]=[]),this._coordsDescendingInv[we][At].push(pt[At])}}this._coordsDescendingInvStr={};for(let we of R._order){let Se=R._layers[we],Oe=Se.source;if(Rs[Se.type]&&!this._coordsDescendingInvStr[Oe]){this._coordsDescendingInvStr[Oe]={};for(let pt in this._coordsDescendingInv[Oe])this._coordsDescendingInvStr[Oe][pt]=this._coordsDescendingInv[Oe][pt].map(At=>At.key).sort().join()}}for(let we of this._renderableTiles)for(let Se in this._coordsDescendingInvStr){let Oe=this._coordsDescendingInvStr[Se][we.tileID.key];Oe&&Oe!==we.rttCoords[Se]&&(we.rtt=[])}}renderLayer(R){if(R.isHidden(this.painter.transform.zoom))return!1;let ae=R.type,we=this.painter,Se=this._renderableLayerIds[this._renderableLayerIds.length-1]===R.id;if(Rs[ae]&&(this._prevType&&Rs[this._prevType]||this._stacks.push([]),this._prevType=ae,this._stacks[this._stacks.length-1].push(R.id),!Se))return!0;if(Rs[this._prevType]||Rs[ae]&&Se){this._prevType=ae;let Oe=this._stacks.length-1,pt=this._stacks[Oe]||[];for(let At of this._renderableTiles){if(this.pool.isFull()&&(ml(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(At),At.rtt[Oe]){let $t=this.pool.getObjectForId(At.rtt[Oe].id);if($t.stamp===At.rtt[Oe].stamp){this.pool.useObject($t);continue}}let Bt=this.pool.getOrCreateFreeObject();this.pool.useObject(Bt),this.pool.stampObject(Bt),At.rtt[Oe]={id:Bt.id,stamp:Bt.stamp},we.context.bindFramebuffer.set(Bt.fbo.framebuffer),we.context.clear({color:t.aM.transparent,stencil:0}),we.currentStencilSource=void 0;for(let $t=0;$t{Ne.touchstart=Ne.dragStart,Ne.touchmoveWindow=Ne.dragMove,Ne.touchend=Ne.dragEnd},Un={showCompass:!0,showZoom:!0,visualizePitch:!1};class Io{constructor(R,ae,we=!1){this.mousedown=pt=>{this.startMouse(t.e({},pt,{ctrlKey:!0,preventDefault:()=>pt.preventDefault()}),n.mousePos(this.element,pt)),n.addEventListener(window,"mousemove",this.mousemove),n.addEventListener(window,"mouseup",this.mouseup)},this.mousemove=pt=>{this.moveMouse(pt,n.mousePos(this.element,pt))},this.mouseup=pt=>{this.mouseRotate.dragEnd(pt),this.mousePitch&&this.mousePitch.dragEnd(pt),this.offTemp()},this.touchstart=pt=>{pt.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=n.touchPos(this.element,pt.targetTouches)[0],this.startTouch(pt,this._startPos),n.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),n.addEventListener(window,"touchend",this.touchend))},this.touchmove=pt=>{pt.targetTouches.length!==1?this.reset():(this._lastPos=n.touchPos(this.element,pt.targetTouches)[0],this.moveTouch(pt,this._lastPos))},this.touchend=pt=>{pt.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),this.touchRotate.reset(),this.touchPitch&&this.touchPitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()},this._clickTolerance=10;let Se=R.dragRotate._mouseRotate.getClickTolerance(),Oe=R.dragRotate._mousePitch.getClickTolerance();this.element=ae,this.mouseRotate=ru({clickTolerance:Se,enable:!0}),this.touchRotate=(({enable:pt,clickTolerance:At,bearingDegreesPerPixelMoved:Bt=.8})=>{let $t=new Zc;return new Hu({clickTolerance:At,move:(br,Ar)=>({bearingDelta:(Ar.x-br.x)*Bt}),moveStateManager:$t,enable:pt,assignEvents:sl})})({clickTolerance:Se,enable:!0}),this.map=R,we&&(this.mousePitch=jf({clickTolerance:Oe,enable:!0}),this.touchPitch=(({enable:pt,clickTolerance:At,pitchDegreesPerPixelMoved:Bt=-.5})=>{let $t=new Zc;return new Hu({clickTolerance:At,move:(br,Ar)=>({pitchDelta:(Ar.y-br.y)*Bt}),moveStateManager:$t,enable:pt,assignEvents:sl})})({clickTolerance:Oe,enable:!0})),n.addEventListener(ae,"mousedown",this.mousedown),n.addEventListener(ae,"touchstart",this.touchstart,{passive:!1}),n.addEventListener(ae,"touchcancel",this.reset)}startMouse(R,ae){this.mouseRotate.dragStart(R,ae),this.mousePitch&&this.mousePitch.dragStart(R,ae),n.disableDrag()}startTouch(R,ae){this.touchRotate.dragStart(R,ae),this.touchPitch&&this.touchPitch.dragStart(R,ae),n.disableDrag()}moveMouse(R,ae){let we=this.map,{bearingDelta:Se}=this.mouseRotate.dragMove(R,ae)||{};if(Se&&we.setBearing(we.getBearing()+Se),this.mousePitch){let{pitchDelta:Oe}=this.mousePitch.dragMove(R,ae)||{};Oe&&we.setPitch(we.getPitch()+Oe)}}moveTouch(R,ae){let we=this.map,{bearingDelta:Se}=this.touchRotate.dragMove(R,ae)||{};if(Se&&we.setBearing(we.getBearing()+Se),this.touchPitch){let{pitchDelta:Oe}=this.touchPitch.dragMove(R,ae)||{};Oe&&we.setPitch(we.getPitch()+Oe)}}off(){let R=this.element;n.removeEventListener(R,"mousedown",this.mousedown),n.removeEventListener(R,"touchstart",this.touchstart,{passive:!1}),n.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),n.removeEventListener(window,"touchend",this.touchend),n.removeEventListener(R,"touchcancel",this.reset),this.offTemp()}offTemp(){n.enableDrag(),n.removeEventListener(window,"mousemove",this.mousemove),n.removeEventListener(window,"mouseup",this.mouseup),n.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),n.removeEventListener(window,"touchend",this.touchend)}}let Xs;function Ls(Ne,R,ae){let we=new t.N(Ne.lng,Ne.lat);if(Ne=new t.N(Ne.lng,Ne.lat),R){let Se=new t.N(Ne.lng-360,Ne.lat),Oe=new t.N(Ne.lng+360,Ne.lat),pt=ae.locationPoint(Ne).distSqr(R);ae.locationPoint(Se).distSqr(R)180;){let Se=ae.locationPoint(Ne);if(Se.x>=0&&Se.y>=0&&Se.x<=ae.width&&Se.y<=ae.height)break;Ne.lng>ae.center.lng?Ne.lng-=360:Ne.lng+=360}return Ne.lng!==we.lng&&ae.locationPoint(Ne).y>ae.height/2-ae.getHorizon()?Ne:we}let ou={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function Iu(Ne,R,ae){let we=Ne.classList;for(let Se in ou)we.remove(`maplibregl-${ae}-anchor-${Se}`);we.add(`maplibregl-${ae}-anchor-${R}`)}class Zu extends t.E{constructor(R){if(super(),this._onKeyPress=ae=>{let we=ae.code,Se=ae.charCode||ae.keyCode;we!=="Space"&&we!=="Enter"&&Se!==32&&Se!==13||this.togglePopup()},this._onMapClick=ae=>{let we=ae.originalEvent.target,Se=this._element;this._popup&&(we===Se||Se.contains(we))&&this.togglePopup()},this._update=ae=>{var we;if(!this._map)return;let Se=this._map.loaded()&&!this._map.isMoving();(ae?.type==="terrain"||ae?.type==="render"&&!Se)&&this._map.once("render",this._update),this._lngLat=this._map.transform.renderWorldCopies?Ls(this._lngLat,this._flatPos,this._map.transform):(we=this._lngLat)===null||we===void 0?void 0:we.wrap(),this._flatPos=this._pos=this._map.project(this._lngLat)._add(this._offset),this._map.terrain&&(this._flatPos=this._map.transform.locationPoint(this._lngLat)._add(this._offset));let Oe="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?Oe=`rotateZ(${this._rotation}deg)`:this._rotationAlignment==="map"&&(Oe=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let pt="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?pt="rotateX(0deg)":this._pitchAlignment==="map"&&(pt=`rotateX(${this._map.getPitch()}deg)`),this._subpixelPositioning||ae&&ae.type!=="moveend"||(this._pos=this._pos.round()),n.setTransform(this._element,`${ou[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${pt} ${Oe}`),i.frameAsync(new AbortController).then(()=>{this._updateOpacity(ae&&ae.type==="moveend")}).catch(()=>{})},this._onMove=ae=>{if(!this._isDragging){let we=this._clickTolerance||this._map._clickTolerance;this._isDragging=ae.point.dist(this._pointerdownPos)>=we}this._isDragging&&(this._pos=ae.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new t.k("dragstart"))),this.fire(new t.k("drag")))},this._onUp=()=>{this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new t.k("dragend")),this._state="inactive"},this._addDragHandler=ae=>{this._element.contains(ae.originalEvent.target)&&(ae.preventDefault(),this._positionDelta=ae.point.sub(this._pos).add(this._offset),this._pointerdownPos=ae.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},this._anchor=R&&R.anchor||"center",this._color=R&&R.color||"#3FB1CE",this._scale=R&&R.scale||1,this._draggable=R&&R.draggable||!1,this._clickTolerance=R&&R.clickTolerance||0,this._subpixelPositioning=R&&R.subpixelPositioning||!1,this._isDragging=!1,this._state="inactive",this._rotation=R&&R.rotation||0,this._rotationAlignment=R&&R.rotationAlignment||"auto",this._pitchAlignment=R&&R.pitchAlignment&&R.pitchAlignment!=="auto"?R.pitchAlignment:this._rotationAlignment,this.setOpacity(),this.setOpacity(R?.opacity,R?.opacityWhenCovered),R&&R.element)this._element=R.element,this._offset=t.P.convert(R&&R.offset||[0,0]);else{this._defaultMarker=!0,this._element=n.create("div");let ae=n.createNS("http://www.w3.org/2000/svg","svg"),we=41,Se=27;ae.setAttributeNS(null,"display","block"),ae.setAttributeNS(null,"height",`${we}px`),ae.setAttributeNS(null,"width",`${Se}px`),ae.setAttributeNS(null,"viewBox",`0 0 ${Se} ${we}`);let Oe=n.createNS("http://www.w3.org/2000/svg","g");Oe.setAttributeNS(null,"stroke","none"),Oe.setAttributeNS(null,"stroke-width","1"),Oe.setAttributeNS(null,"fill","none"),Oe.setAttributeNS(null,"fill-rule","evenodd");let pt=n.createNS("http://www.w3.org/2000/svg","g");pt.setAttributeNS(null,"fill-rule","nonzero");let At=n.createNS("http://www.w3.org/2000/svg","g");At.setAttributeNS(null,"transform","translate(3.0, 29.0)"),At.setAttributeNS(null,"fill","#000000");let Bt=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];for(let dt of Bt){let Ct=n.createNS("http://www.w3.org/2000/svg","ellipse");Ct.setAttributeNS(null,"opacity","0.04"),Ct.setAttributeNS(null,"cx","10.5"),Ct.setAttributeNS(null,"cy","5.80029008"),Ct.setAttributeNS(null,"rx",dt.rx),Ct.setAttributeNS(null,"ry",dt.ry),At.appendChild(Ct)}let $t=n.createNS("http://www.w3.org/2000/svg","g");$t.setAttributeNS(null,"fill",this._color);let br=n.createNS("http://www.w3.org/2000/svg","path");br.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),$t.appendChild(br);let Ar=n.createNS("http://www.w3.org/2000/svg","g");Ar.setAttributeNS(null,"opacity","0.25"),Ar.setAttributeNS(null,"fill","#000000");let Yr=n.createNS("http://www.w3.org/2000/svg","path");Yr.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),Ar.appendChild(Yr);let sa=n.createNS("http://www.w3.org/2000/svg","g");sa.setAttributeNS(null,"transform","translate(6.0, 7.0)"),sa.setAttributeNS(null,"fill","#FFFFFF");let He=n.createNS("http://www.w3.org/2000/svg","g");He.setAttributeNS(null,"transform","translate(8.0, 8.0)");let Je=n.createNS("http://www.w3.org/2000/svg","circle");Je.setAttributeNS(null,"fill","#000000"),Je.setAttributeNS(null,"opacity","0.25"),Je.setAttributeNS(null,"cx","5.5"),Je.setAttributeNS(null,"cy","5.5"),Je.setAttributeNS(null,"r","5.4999962");let ut=n.createNS("http://www.w3.org/2000/svg","circle");ut.setAttributeNS(null,"fill","#FFFFFF"),ut.setAttributeNS(null,"cx","5.5"),ut.setAttributeNS(null,"cy","5.5"),ut.setAttributeNS(null,"r","5.4999962"),He.appendChild(Je),He.appendChild(ut),pt.appendChild(At),pt.appendChild($t),pt.appendChild(Ar),pt.appendChild(sa),pt.appendChild(He),ae.appendChild(pt),ae.setAttributeNS(null,"height",we*this._scale+"px"),ae.setAttributeNS(null,"width",Se*this._scale+"px"),this._element.appendChild(ae),this._offset=t.P.convert(R&&R.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",ae=>{ae.preventDefault()}),this._element.addEventListener("mousedown",ae=>{ae.preventDefault()}),Iu(this._element,this._anchor,"marker"),R&&R.className)for(let ae of R.className.split(" "))this._element.classList.add(ae);this._popup=null}addTo(R){return this.remove(),this._map=R,this._element.setAttribute("aria-label",R._getUIString("Marker.Title")),R.getCanvasContainer().appendChild(this._element),R.on("move",this._update),R.on("moveend",this._update),R.on("terrain",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return this._opacityTimeout&&(clearTimeout(this._opacityTimeout),delete this._opacityTimeout),this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("terrain",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),n.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(R){return this._lngLat=t.N.convert(R),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(R){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),R){if(!("offset"in R.options)){let Se=Math.abs(13.5)/Math.SQRT2;R.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[Se,-1*(38.1-13.5+Se)],"bottom-right":[-Se,-1*(38.1-13.5+Se)],left:[13.5,-1*(38.1-13.5)],right:[-13.5,-1*(38.1-13.5)]}:this._offset}this._popup=R,this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}setSubpixelPositioning(R){return this._subpixelPositioning=R,this}getPopup(){return this._popup}togglePopup(){let R=this._popup;return this._element.style.opacity===this._opacityWhenCovered?this:R?(R.isOpen()?R.remove():(R.setLngLat(this._lngLat),R.addTo(this._map)),this):this}_updateOpacity(R=!1){var ae,we;if(!(!((ae=this._map)===null||ae===void 0)&&ae.terrain))return void(this._element.style.opacity!==this._opacity&&(this._element.style.opacity=this._opacity));if(R)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout(()=>{this._opacityTimeout=null},100)}let Se=this._map,Oe=Se.terrain.depthAtPoint(this._pos),pt=Se.terrain.getElevationForLngLatZoom(this._lngLat,Se.transform.tileZoom);if(Se.transform.lngLatToCameraDepth(this._lngLat,pt)-Oe<.006)return void(this._element.style.opacity=this._opacity);let At=-this._offset.y/Se.transform._pixelPerMeter,Bt=Math.sin(Se.getPitch()*Math.PI/180)*At,$t=Se.terrain.depthAtPoint(new t.P(this._pos.x,this._pos.y-this._offset.y)),br=Se.transform.lngLatToCameraDepth(this._lngLat,pt+Bt)-$t>.006;!((we=this._popup)===null||we===void 0)&&we.isOpen()&&br&&this._popup.remove(),this._element.style.opacity=br?this._opacityWhenCovered:this._opacity}getOffset(){return this._offset}setOffset(R){return this._offset=t.P.convert(R),this._update(),this}addClassName(R){this._element.classList.add(R)}removeClassName(R){this._element.classList.remove(R)}toggleClassName(R){return this._element.classList.toggle(R)}setDraggable(R){return this._draggable=!!R,this._map&&(R?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(R){return this._rotation=R||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(R){return this._rotationAlignment=R||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(R){return this._pitchAlignment=R&&R!=="auto"?R:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(R,ae){return R===void 0&&ae===void 0&&(this._opacity="1",this._opacityWhenCovered="0.2"),R!==void 0&&(this._opacity=R),ae!==void 0&&(this._opacityWhenCovered=ae),this._map&&this._updateOpacity(!0),this}}let Lc={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},yu=0,Pc=!1,wu={maxWidth:100,unit:"metric"};function gc(Ne,R,ae){let we=ae&&ae.maxWidth||100,Se=Ne._container.clientHeight/2,Oe=Ne.unproject([0,Se]),pt=Ne.unproject([we,Se]),At=Oe.distanceTo(pt);if(ae&&ae.unit==="imperial"){let Bt=3.2808*At;Bt>5280?fo(R,we,Bt/5280,Ne._getUIString("ScaleControl.Miles")):fo(R,we,Bt,Ne._getUIString("ScaleControl.Feet"))}else ae&&ae.unit==="nautical"?fo(R,we,At/1852,Ne._getUIString("ScaleControl.NauticalMiles")):At>=1e3?fo(R,we,At/1e3,Ne._getUIString("ScaleControl.Kilometers")):fo(R,we,At,Ne._getUIString("ScaleControl.Meters"))}function fo(Ne,R,ae,we){let Se=function(Oe){let pt=Math.pow(10,`${Math.floor(Oe)}`.length-1),At=Oe/pt;return At=At>=10?10:At>=5?5:At>=3?3:At>=2?2:At>=1?1:function(Bt){let $t=Math.pow(10,Math.ceil(-Math.log(Bt)/Math.LN10));return Math.round(Bt*$t)/$t}(At),pt*At}(ae);Ne.style.width=R*(Se/ae)+"px",Ne.innerHTML=`${Se} ${we}`}let zo={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",subpixelPositioning:!1},Ic=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function lc(Ne){if(Ne){if(typeof Ne=="number"){let R=Math.round(Math.abs(Ne)/Math.SQRT2);return{center:new t.P(0,0),top:new t.P(0,Ne),"top-left":new t.P(R,R),"top-right":new t.P(-R,R),bottom:new t.P(0,-Ne),"bottom-left":new t.P(R,-R),"bottom-right":new t.P(-R,-R),left:new t.P(Ne,0),right:new t.P(-Ne,0)}}if(Ne instanceof t.P||Array.isArray(Ne)){let R=t.P.convert(Ne);return{center:R,top:R,"top-left":R,"top-right":R,bottom:R,"bottom-left":R,"bottom-right":R,left:R,right:R}}return{center:t.P.convert(Ne.center||[0,0]),top:t.P.convert(Ne.top||[0,0]),"top-left":t.P.convert(Ne["top-left"]||[0,0]),"top-right":t.P.convert(Ne["top-right"]||[0,0]),bottom:t.P.convert(Ne.bottom||[0,0]),"bottom-left":t.P.convert(Ne["bottom-left"]||[0,0]),"bottom-right":t.P.convert(Ne["bottom-right"]||[0,0]),left:t.P.convert(Ne.left||[0,0]),right:t.P.convert(Ne.right||[0,0])}}return lc(new t.P(0,0))}let Yu=r;e.AJAXError=t.bh,e.Evented=t.E,e.LngLat=t.N,e.MercatorCoordinate=t.Z,e.Point=t.P,e.addProtocol=t.bi,e.config=t.a,e.removeProtocol=t.bj,e.AttributionControl=co,e.BoxZoomHandler=Pu,e.CanvasSource=tt,e.CooperativeGesturesHandler=Fi,e.DoubleClickZoomHandler=hi,e.DragPanHandler=tn,e.DragRotateHandler=dn,e.EdgeInsets=vu,e.FullscreenControl=class extends t.E{constructor(Ne={}){super(),this._onFullscreenChange=()=>{var R;let ae=window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement;for(;!((R=ae?.shadowRoot)===null||R===void 0)&&R.fullscreenElement;)ae=ae.shadowRoot.fullscreenElement;ae===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,Ne&&Ne.container&&(Ne.container instanceof HTMLElement?this._container=Ne.container:t.w("Full screen control 'container' must be a DOM element.")),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in document&&(this._fullscreenchange="MSFullscreenChange")}onAdd(Ne){return this._map=Ne,this._container||(this._container=this._map.getContainer()),this._controlContainer=n.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){n.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){let Ne=this._fullscreenButton=n.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);n.create("span","maplibregl-ctrl-icon",Ne).setAttribute("aria-hidden","true"),Ne.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){let Ne=this._getTitle();this._fullscreenButton.setAttribute("aria-label",Ne),this._fullscreenButton.title=Ne}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_handleFullscreenChange(){this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("maplibregl-ctrl-shrink"),this._fullscreenButton.classList.toggle("maplibregl-ctrl-fullscreen"),this._updateTitle(),this._fullscreen?(this.fire(new t.k("fullscreenstart")),this._prevCooperativeGesturesEnabled=this._map.cooperativeGestures.isEnabled(),this._map.cooperativeGestures.disable()):(this.fire(new t.k("fullscreenend")),this._prevCooperativeGesturesEnabled&&this._map.cooperativeGestures.enable())}_exitFullscreen(){window.document.exitFullscreen?window.document.exitFullscreen():window.document.mozCancelFullScreen?window.document.mozCancelFullScreen():window.document.msExitFullscreen?window.document.msExitFullscreen():window.document.webkitCancelFullScreen?window.document.webkitCancelFullScreen():this._togglePseudoFullScreen()}_requestFullscreen(){this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen?this._container.webkitRequestFullscreen():this._togglePseudoFullScreen()}_togglePseudoFullScreen(){this._container.classList.toggle("maplibregl-pseudo-fullscreen"),this._handleFullscreenChange(),this._map.resize()}},e.GeoJSONSource=Re,e.GeolocateControl=class extends t.E{constructor(Ne){super(),this._onSuccess=R=>{if(this._map){if(this._isOutOfMapMaxBounds(R))return this._setErrorState(),this.fire(new t.k("outofmaxbounds",R)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=R,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background");break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(R),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(R),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new t.k("geolocate",R)),this._finish()}},this._updateCamera=R=>{let ae=new t.N(R.coords.longitude,R.coords.latitude),we=R.coords.accuracy,Se=this._map.getBearing(),Oe=t.e({bearing:Se},this.options.fitBoundsOptions),pt=re.fromLngLat(ae,we);this._map.fitBounds(pt,Oe,{geolocateSource:!0})},this._updateMarker=R=>{if(R){let ae=new t.N(R.coords.longitude,R.coords.latitude);this._accuracyCircleMarker.setLngLat(ae).addTo(this._map),this._userLocationDotMarker.setLngLat(ae).addTo(this._map),this._accuracy=R.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},this._onZoom=()=>{this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},this._onError=R=>{if(this._map){if(this.options.trackUserLocation)if(R.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;let ae=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=ae,this._geolocateButton.setAttribute("aria-label",ae),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(R.code===3&&Pc)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new t.k("error",R)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._setupUI=()=>{this._map&&(this._container.addEventListener("contextmenu",R=>R.preventDefault()),this._geolocateButton=n.create("button","maplibregl-ctrl-geolocate",this._container),n.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",this._geolocateButton.disabled=!0)},this._finishSetupUI=R=>{if(this._map){if(R===!1){t.w("Geolocation support is not available so the GeolocateControl will be disabled.");let ae=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=ae,this._geolocateButton.setAttribute("aria-label",ae)}else{let ae=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.disabled=!1,this._geolocateButton.title=ae,this._geolocateButton.setAttribute("aria-label",ae)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=n.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new Zu({element:this._dotElement}),this._circleElement=n.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Zu({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",()=>this.trigger()),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",ae=>{ae.geolocateSource||this._watchState!=="ACTIVE_LOCK"||ae.originalEvent&&ae.originalEvent.type==="resize"||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new t.k("trackuserlocationend")),this.fire(new t.k("userlocationlostfocus")))})}},this.options=t.e({},Lc,Ne)}onAdd(Ne){return this._map=Ne,this._container=n.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),function(){return t._(this,arguments,void 0,function*(R=!1){if(Xs!==void 0&&!R)return Xs;if(window.navigator.permissions===void 0)return Xs=!!window.navigator.geolocation,Xs;try{Xs=(yield window.navigator.permissions.query({name:"geolocation"})).state!=="denied"}catch{Xs=!!window.navigator.geolocation}return Xs})}().then(R=>this._finishSetupUI(R)),this._container}onRemove(){this._geolocationWatchID!==void 0&&(window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),n.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,yu=0,Pc=!1}_isOutOfMapMaxBounds(Ne){let R=this._map.getMaxBounds(),ae=Ne.coords;return R&&(ae.longitudeR.getEast()||ae.latitudeR.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"ACTIVE_ERROR":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}}_updateCircleRadius(){let Ne=this._map.getBounds(),R=Ne.getSouthEast(),ae=Ne.getNorthEast(),we=R.distanceTo(ae),Se=Math.ceil(this._accuracy/(we/this._map._container.clientHeight)*2);this._circleElement.style.width=`${Se}px`,this._circleElement.style.height=`${Se}px`}trigger(){if(!this._setup)return t.w("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new t.k("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":yu--,Pc=!1,this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this.fire(new t.k("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new t.k("trackuserlocationstart")),this.fire(new t.k("userlocationfocus"));break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"OFF":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){let Ne;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),yu++,yu>1?(Ne={maximumAge:6e5,timeout:0},Pc=!0):(Ne=this.options.positionOptions,Pc=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,Ne)}}else window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_clearWatch(){window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},e.Hash=Jf,e.ImageSource=it,e.KeyboardHandler=yr,e.LngLatBounds=re,e.LogoControl=wn,e.Map=class extends ao{constructor(Ne){t.bf.mark(t.bg.create);let R=Object.assign(Object.assign({},yl),Ne);if(R.minZoom!=null&&R.maxZoom!=null&&R.minZoom>R.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(R.minPitch!=null&&R.maxPitch!=null&&R.minPitch>R.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(R.minPitch!=null&&R.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(R.maxPitch!=null&&R.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(super(new Ml(R.minZoom,R.maxZoom,R.minPitch,R.maxPitch,R.renderWorldCopies),{bearingSnap:R.bearingSnap}),this._idleTriggered=!1,this._crossFadingFactor=1,this._renderTaskQueue=new un,this._controls=[],this._mapId=t.a4(),this._contextLost=ae=>{ae.preventDefault(),this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this.fire(new t.k("webglcontextlost",{originalEvent:ae}))},this._contextRestored=ae=>{this._setupPainter(),this.resize(),this._update(),this.fire(new t.k("webglcontextrestored",{originalEvent:ae}))},this._onMapScroll=ae=>{if(ae.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()},this._interactive=R.interactive,this._maxTileCacheSize=R.maxTileCacheSize,this._maxTileCacheZoomLevels=R.maxTileCacheZoomLevels,this._failIfMajorPerformanceCaveat=R.failIfMajorPerformanceCaveat===!0,this._preserveDrawingBuffer=R.preserveDrawingBuffer===!0,this._antialias=R.antialias===!0,this._trackResize=R.trackResize===!0,this._bearingSnap=R.bearingSnap,this._refreshExpiredTiles=R.refreshExpiredTiles===!0,this._fadeDuration=R.fadeDuration,this._crossSourceCollisions=R.crossSourceCollisions===!0,this._collectResourceTiming=R.collectResourceTiming===!0,this._locale=Object.assign(Object.assign({},ys),R.locale),this._clickTolerance=R.clickTolerance,this._overridePixelRatio=R.pixelRatio,this._maxCanvasSize=R.maxCanvasSize,this.transformCameraUpdate=R.transformCameraUpdate,this.cancelPendingTileRequestsWhileZooming=R.cancelPendingTileRequestsWhileZooming===!0,this._imageQueueHandle=l.addThrottleControl(()=>this.isMoving()),this._requestManager=new _(R.transformRequest),typeof R.container=="string"){if(this._container=document.getElementById(R.container),!this._container)throw new Error(`Container '${R.container}' not found.`)}else{if(!(R.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=R.container}if(R.maxBounds&&this.setMaxBounds(R.maxBounds),this._setupContainer(),this._setupPainter(),this.on("move",()=>this._update(!1)).on("moveend",()=>this._update(!1)).on("zoom",()=>this._update(!0)).on("terrain",()=>{this.painter.terrainFacilitator.dirty=!0,this._update(!0)}).once("idle",()=>{this._idleTriggered=!0}),typeof window<"u"){addEventListener("online",this._onWindowOnline,!1);let ae=!1,we=Uf(Se=>{this._trackResize&&!this._removed&&(this.resize(Se),this.redraw())},50);this._resizeObserver=new ResizeObserver(Se=>{ae?we(Se):ae=!0}),this._resizeObserver.observe(this._container)}this.handlers=new Kn(this,R),this._hash=R.hash&&new Jf(typeof R.hash=="string"&&R.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:R.center,zoom:R.zoom,bearing:R.bearing,pitch:R.pitch}),R.bounds&&(this.resize(),this.fitBounds(R.bounds,t.e({},R.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=R.localIdeographFontFamily,this._validateStyle=R.validateStyle,R.style&&this.setStyle(R.style,{localIdeographFontFamily:R.localIdeographFontFamily}),R.attributionControl&&this.addControl(new co(typeof R.attributionControl=="boolean"?void 0:R.attributionControl)),R.maplibreLogo&&this.addControl(new wn,R.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",ae=>{this._update(ae.dataType==="style"),this.fire(new t.k(`${ae.dataType}data`,ae))}),this.on("dataloading",ae=>{this.fire(new t.k(`${ae.dataType}dataloading`,ae))}),this.on("dataabort",ae=>{this.fire(new t.k("sourcedataabort",ae))})}_getMapId(){return this._mapId}addControl(Ne,R){if(R===void 0&&(R=Ne.getDefaultPosition?Ne.getDefaultPosition():"top-right"),!Ne||!Ne.onAdd)return this.fire(new t.j(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));let ae=Ne.onAdd(this);this._controls.push(Ne);let we=this._controlPositions[R];return R.indexOf("bottom")!==-1?we.insertBefore(ae,we.firstChild):we.appendChild(ae),this}removeControl(Ne){if(!Ne||!Ne.onRemove)return this.fire(new t.j(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));let R=this._controls.indexOf(Ne);return R>-1&&this._controls.splice(R,1),Ne.onRemove(this),this}hasControl(Ne){return this._controls.indexOf(Ne)>-1}calculateCameraOptionsFromTo(Ne,R,ae,we){return we==null&&this.terrain&&(we=this.terrain.getElevationForLngLatZoom(ae,this.transform.tileZoom)),super.calculateCameraOptionsFromTo(Ne,R,ae,we)}resize(Ne){var R;let ae=this._containerDimensions(),we=ae[0],Se=ae[1],Oe=this._getClampedPixelRatio(we,Se);if(this._resizeCanvas(we,Se,Oe),this.painter.resize(we,Se,Oe),this.painter.overLimit()){let At=this.painter.context.gl;this._maxCanvasSize=[At.drawingBufferWidth,At.drawingBufferHeight];let Bt=this._getClampedPixelRatio(we,Se);this._resizeCanvas(we,Se,Bt),this.painter.resize(we,Se,Bt)}this.transform.resize(we,Se),(R=this._requestedCameraState)===null||R===void 0||R.resize(we,Se);let pt=!this._moving;return pt&&(this.stop(),this.fire(new t.k("movestart",Ne)).fire(new t.k("move",Ne))),this.fire(new t.k("resize",Ne)),pt&&this.fire(new t.k("moveend",Ne)),this}_getClampedPixelRatio(Ne,R){let{0:ae,1:we}=this._maxCanvasSize,Se=this.getPixelRatio(),Oe=Ne*Se,pt=R*Se;return Math.min(Oe>ae?ae/Oe:1,pt>we?we/pt:1)*Se}getPixelRatio(){var Ne;return(Ne=this._overridePixelRatio)!==null&&Ne!==void 0?Ne:devicePixelRatio}setPixelRatio(Ne){this._overridePixelRatio=Ne,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(Ne){return this.transform.setMaxBounds(re.convert(Ne)),this._update()}setMinZoom(Ne){if((Ne=Ne??-2)>=-2&&Ne<=this.transform.maxZoom)return this.transform.minZoom=Ne,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=Ne,this._update(),this.getZoom()>Ne&&this.setZoom(Ne),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(Ne){if((Ne=Ne??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(Ne>=0&&Ne<=this.transform.maxPitch)return this.transform.minPitch=Ne,this._update(),this.getPitch()85)throw new Error("maxPitch must be less than or equal to 85");if(Ne>=this.transform.minPitch)return this.transform.maxPitch=Ne,this._update(),this.getPitch()>Ne&&this.setPitch(Ne),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(Ne){return this.transform.renderWorldCopies=Ne,this._update()}project(Ne){return this.transform.locationPoint(t.N.convert(Ne),this.style&&this.terrain)}unproject(Ne){return this.transform.pointLocation(t.P.convert(Ne),this.terrain)}isMoving(){var Ne;return this._moving||((Ne=this.handlers)===null||Ne===void 0?void 0:Ne.isMoving())}isZooming(){var Ne;return this._zooming||((Ne=this.handlers)===null||Ne===void 0?void 0:Ne.isZooming())}isRotating(){var Ne;return this._rotating||((Ne=this.handlers)===null||Ne===void 0?void 0:Ne.isRotating())}_createDelegatedListener(Ne,R,ae){if(Ne==="mouseenter"||Ne==="mouseover"){let we=!1;return{layers:R,listener:ae,delegates:{mousemove:Oe=>{let pt=R.filter(Bt=>this.getLayer(Bt)),At=pt.length!==0?this.queryRenderedFeatures(Oe.point,{layers:pt}):[];At.length?we||(we=!0,ae.call(this,new tu(Ne,this,Oe.originalEvent,{features:At}))):we=!1},mouseout:()=>{we=!1}}}}if(Ne==="mouseleave"||Ne==="mouseout"){let we=!1;return{layers:R,listener:ae,delegates:{mousemove:pt=>{let At=R.filter(Bt=>this.getLayer(Bt));(At.length!==0?this.queryRenderedFeatures(pt.point,{layers:At}):[]).length?we=!0:we&&(we=!1,ae.call(this,new tu(Ne,this,pt.originalEvent)))},mouseout:pt=>{we&&(we=!1,ae.call(this,new tu(Ne,this,pt.originalEvent)))}}}}{let we=Se=>{let Oe=R.filter(At=>this.getLayer(At)),pt=Oe.length!==0?this.queryRenderedFeatures(Se.point,{layers:Oe}):[];pt.length&&(Se.features=pt,ae.call(this,Se),delete Se.features)};return{layers:R,listener:ae,delegates:{[Ne]:we}}}}_saveDelegatedListener(Ne,R){this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[Ne]=this._delegatedListeners[Ne]||[],this._delegatedListeners[Ne].push(R)}_removeDelegatedListener(Ne,R,ae){if(!this._delegatedListeners||!this._delegatedListeners[Ne])return;let we=this._delegatedListeners[Ne];for(let Se=0;SeR.includes(pt))){for(let pt in Oe.delegates)this.off(pt,Oe.delegates[pt]);return void we.splice(Se,1)}}}on(Ne,R,ae){if(ae===void 0)return super.on(Ne,R);let we=this._createDelegatedListener(Ne,typeof R=="string"?[R]:R,ae);this._saveDelegatedListener(Ne,we);for(let Se in we.delegates)this.on(Se,we.delegates[Se]);return this}once(Ne,R,ae){if(ae===void 0)return super.once(Ne,R);let we=typeof R=="string"?[R]:R,Se=this._createDelegatedListener(Ne,we,ae);for(let Oe in Se.delegates){let pt=Se.delegates[Oe];Se.delegates[Oe]=(...At)=>{this._removeDelegatedListener(Ne,we,ae),pt(...At)}}this._saveDelegatedListener(Ne,Se);for(let Oe in Se.delegates)this.once(Oe,Se.delegates[Oe]);return this}off(Ne,R,ae){return ae===void 0?super.off(Ne,R):(this._removeDelegatedListener(Ne,typeof R=="string"?[R]:R,ae),this)}queryRenderedFeatures(Ne,R){if(!this.style)return[];let ae,we=Ne instanceof t.P||Array.isArray(Ne),Se=we?Ne:[[0,0],[this.transform.width,this.transform.height]];if(R=R||(we?{}:Ne)||{},Se instanceof t.P||typeof Se[0]=="number")ae=[t.P.convert(Se)];else{let Oe=t.P.convert(Se[0]),pt=t.P.convert(Se[1]);ae=[Oe,new t.P(pt.x,Oe.y),pt,new t.P(Oe.x,pt.y),Oe]}return this.style.queryRenderedFeatures(ae,R,this.transform)}querySourceFeatures(Ne,R){return this.style.querySourceFeatures(Ne,R)}setStyle(Ne,R){return(R=t.e({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._validateStyle},R)).diff!==!1&&R.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&Ne?(this._diffStyle(Ne,R),this):(this._localIdeographFontFamily=R.localIdeographFontFamily,this._updateStyle(Ne,R))}setTransformRequest(Ne){return this._requestManager.setTransformRequest(Ne),this}_getUIString(Ne){let R=this._locale[Ne];if(R==null)throw new Error(`Missing UI string '${Ne}'`);return R}_updateStyle(Ne,R){if(R.transformStyle&&this.style&&!this.style._loaded)return void this.style.once("style.load",()=>this._updateStyle(Ne,R));let ae=this.style&&R.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!Ne)),Ne?(this.style=new aa(this,R||{}),this.style.setEventedParent(this,{style:this.style}),typeof Ne=="string"?this.style.loadURL(Ne,R,ae):this.style.loadJSON(Ne,R,ae),this):(delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new aa(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(Ne,R){if(typeof Ne=="string"){let ae=this._requestManager.transformRequest(Ne,"Style");t.h(ae,new AbortController).then(we=>{this._updateDiff(we.data,R)}).catch(we=>{we&&this.fire(new t.j(we))})}else typeof Ne=="object"&&this._updateDiff(Ne,R)}_updateDiff(Ne,R){try{this.style.setState(Ne,R)&&this._update(!0)}catch(ae){t.w(`Unable to perform style diff: ${ae.message||ae.error||ae}. Rebuilding the style from scratch.`),this._updateStyle(Ne,R)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():t.w("There is no style added to the map.")}addSource(Ne,R){return this._lazyInitEmptyStyle(),this.style.addSource(Ne,R),this._update(!0)}isSourceLoaded(Ne){let R=this.style&&this.style.sourceCaches[Ne];if(R!==void 0)return R.loaded();this.fire(new t.j(new Error(`There is no source with ID '${Ne}'`)))}setTerrain(Ne){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),Ne){let R=this.style.sourceCaches[Ne.source];if(!R)throw new Error(`cannot load terrain, because there exists no source with ID: ${Ne.source}`);this.terrain===null&&R.reload();for(let ae in this.style._layers){let we=this.style._layers[ae];we.type==="hillshade"&&we.source===Ne.source&&t.w("You are using the same source for a hillshade layer and for 3D terrain. Please consider using two separate sources to improve rendering quality.")}this.terrain=new xs(this.painter,R,Ne),this.painter.renderToTexture=new Ks(this.painter,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._terrainDataCallback=ae=>{ae.dataType==="style"?this.terrain.sourceCache.freeRtt():ae.dataType==="source"&&ae.tile&&(ae.sourceId!==Ne.source||this._elevationFreeze||(this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this.terrain.sourceCache.freeRtt(ae.tile.tileID))},this.style.on("data",this._terrainDataCallback)}else this.terrain&&this.terrain.sourceCache.destruct(),this.terrain=null,this.painter.renderToTexture&&this.painter.renderToTexture.destruct(),this.painter.renderToTexture=null,this.transform.minElevationForCurrentTile=0,this.transform.elevation=0;return this.fire(new t.k("terrain",{terrain:Ne})),this}getTerrain(){var Ne,R;return(R=(Ne=this.terrain)===null||Ne===void 0?void 0:Ne.options)!==null&&R!==void 0?R:null}areTilesLoaded(){let Ne=this.style&&this.style.sourceCaches;for(let R in Ne){let ae=Ne[R]._tiles;for(let we in ae){let Se=ae[we];if(Se.state!=="loaded"&&Se.state!=="errored")return!1}}return!0}removeSource(Ne){return this.style.removeSource(Ne),this._update(!0)}getSource(Ne){return this.style.getSource(Ne)}addImage(Ne,R,ae={}){let{pixelRatio:we=1,sdf:Se=!1,stretchX:Oe,stretchY:pt,content:At,textFitWidth:Bt,textFitHeight:$t}=ae;if(this._lazyInitEmptyStyle(),!(R instanceof HTMLImageElement||t.b(R))){if(R.width===void 0||R.height===void 0)return this.fire(new t.j(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));{let{width:br,height:Ar,data:Yr}=R,sa=R;return this.style.addImage(Ne,{data:new t.R({width:br,height:Ar},new Uint8Array(Yr)),pixelRatio:we,stretchX:Oe,stretchY:pt,content:At,textFitWidth:Bt,textFitHeight:$t,sdf:Se,version:0,userImage:sa}),sa.onAdd&&sa.onAdd(this,Ne),this}}{let{width:br,height:Ar,data:Yr}=i.getImageData(R);this.style.addImage(Ne,{data:new t.R({width:br,height:Ar},Yr),pixelRatio:we,stretchX:Oe,stretchY:pt,content:At,textFitWidth:Bt,textFitHeight:$t,sdf:Se,version:0})}}updateImage(Ne,R){let ae=this.style.getImage(Ne);if(!ae)return this.fire(new t.j(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));let we=R instanceof HTMLImageElement||t.b(R)?i.getImageData(R):R,{width:Se,height:Oe,data:pt}=we;if(Se===void 0||Oe===void 0)return this.fire(new t.j(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));if(Se!==ae.data.width||Oe!==ae.data.height)return this.fire(new t.j(new Error("The width and height of the updated image must be that same as the previous version of the image")));let At=!(R instanceof HTMLImageElement||t.b(R));return ae.data.replace(pt,At),this.style.updateImage(Ne,ae),this}getImage(Ne){return this.style.getImage(Ne)}hasImage(Ne){return Ne?!!this.style.getImage(Ne):(this.fire(new t.j(new Error("Missing required image id"))),!1)}removeImage(Ne){this.style.removeImage(Ne)}loadImage(Ne){return l.getImage(this._requestManager.transformRequest(Ne,"Image"),new AbortController)}listImages(){return this.style.listImages()}addLayer(Ne,R){return this._lazyInitEmptyStyle(),this.style.addLayer(Ne,R),this._update(!0)}moveLayer(Ne,R){return this.style.moveLayer(Ne,R),this._update(!0)}removeLayer(Ne){return this.style.removeLayer(Ne),this._update(!0)}getLayer(Ne){return this.style.getLayer(Ne)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(Ne,R,ae){return this.style.setLayerZoomRange(Ne,R,ae),this._update(!0)}setFilter(Ne,R,ae={}){return this.style.setFilter(Ne,R,ae),this._update(!0)}getFilter(Ne){return this.style.getFilter(Ne)}setPaintProperty(Ne,R,ae,we={}){return this.style.setPaintProperty(Ne,R,ae,we),this._update(!0)}getPaintProperty(Ne,R){return this.style.getPaintProperty(Ne,R)}setLayoutProperty(Ne,R,ae,we={}){return this.style.setLayoutProperty(Ne,R,ae,we),this._update(!0)}getLayoutProperty(Ne,R){return this.style.getLayoutProperty(Ne,R)}setGlyphs(Ne,R={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(Ne,R),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(Ne,R,ae={}){return this._lazyInitEmptyStyle(),this.style.addSprite(Ne,R,ae,we=>{we||this._update(!0)}),this}removeSprite(Ne){return this._lazyInitEmptyStyle(),this.style.removeSprite(Ne),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(Ne,R={}){return this._lazyInitEmptyStyle(),this.style.setSprite(Ne,R,ae=>{ae||this._update(!0)}),this}setLight(Ne,R={}){return this._lazyInitEmptyStyle(),this.style.setLight(Ne,R),this._update(!0)}getLight(){return this.style.getLight()}setSky(Ne){return this._lazyInitEmptyStyle(),this.style.setSky(Ne),this._update(!0)}getSky(){return this.style.getSky()}setFeatureState(Ne,R){return this.style.setFeatureState(Ne,R),this._update()}removeFeatureState(Ne,R){return this.style.removeFeatureState(Ne,R),this._update()}getFeatureState(Ne){return this.style.getFeatureState(Ne)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let Ne=0,R=0;return this._container&&(Ne=this._container.clientWidth||400,R=this._container.clientHeight||300),[Ne,R]}_setupContainer(){let Ne=this._container;Ne.classList.add("maplibregl-map");let R=this._canvasContainer=n.create("div","maplibregl-canvas-container",Ne);this._interactive&&R.classList.add("maplibregl-interactive"),this._canvas=n.create("canvas","maplibregl-canvas",R),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex",this._interactive?"0":"-1"),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","region");let ae=this._containerDimensions(),we=this._getClampedPixelRatio(ae[0],ae[1]);this._resizeCanvas(ae[0],ae[1],we);let Se=this._controlContainer=n.create("div","maplibregl-control-container",Ne),Oe=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(pt=>{Oe[pt]=n.create("div",`maplibregl-ctrl-${pt} `,Se)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(Ne,R,ae){this._canvas.width=Math.floor(ae*Ne),this._canvas.height=Math.floor(ae*R),this._canvas.style.width=`${Ne}px`,this._canvas.style.height=`${R}px`}_setupPainter(){let Ne={alpha:!0,stencil:!0,depth:!0,failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1},R=null;this._canvas.addEventListener("webglcontextcreationerror",we=>{R={requestedAttributes:Ne},we&&(R.statusMessage=we.statusMessage,R.type=we.type)},{once:!0});let ae=this._canvas.getContext("webgl2",Ne)||this._canvas.getContext("webgl",Ne);if(!ae){let we="Failed to initialize WebGL";throw R?(R.message=we,new Error(JSON.stringify(R))):new Error(we)}this.painter=new Ac(ae,this.transform),s.testSupport(ae)}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(Ne){return this.style&&this.style._loaded?(this._styleDirty=this._styleDirty||Ne,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(Ne){return this._update(),this._renderTaskQueue.add(Ne)}_cancelRenderFrame(Ne){this._renderTaskQueue.remove(Ne)}_render(Ne){let R=this._idleTriggered?this._fadeDuration:0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(Ne),this._removed)return;let ae=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;let Se=this.transform.zoom,Oe=i.now();this.style.zoomHistory.update(Se,Oe);let pt=new t.z(Se,{now:Oe,fadeDuration:R,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),At=pt.crossFadingFactor();At===1&&At===this._crossFadingFactor||(ae=!0,this._crossFadingFactor=At),this.style.update(pt)}this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.terrain?(this.terrain.sourceCache.update(this.transform,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._elevationFreeze||(this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))):(this.transform.minElevationForCurrentTile=0,this.transform.elevation=0),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,R,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:R,showPadding:this.showPadding}),this.fire(new t.k("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,t.bf.mark(t.bg.load),this.fire(new t.k("load"))),this.style&&(this.style.hasTransitions()||ae)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();let we=this._sourcesDirty||this._styleDirty||this._placementDirty;return we||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new t.k("idle")),!this._loaded||this._fullyLoaded||we||(this._fullyLoaded=!0,t.bf.mark(t.bg.fullLoad)),this}redraw(){return this.style&&(this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._render(0)),this}remove(){var Ne;this._hash&&this._hash.remove();for(let ae of this._controls)ae.onRemove(this);this._controls=[],this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),typeof window<"u"&&removeEventListener("online",this._onWindowOnline,!1),l.removeThrottleControl(this._imageQueueHandle),(Ne=this._resizeObserver)===null||Ne===void 0||Ne.disconnect();let R=this.painter.context.gl.getExtension("WEBGL_lose_context");R?.loseContext&&R.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),n.remove(this._canvasContainer),n.remove(this._controlContainer),this._container.classList.remove("maplibregl-map"),t.bf.clearMetrics(),this._removed=!0,this.fire(new t.k("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,i.frameAsync(this._frameRequest).then(Ne=>{t.bf.frame(Ne),this._frameRequest=null,this._render(Ne)}).catch(()=>{}))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(Ne){this._showTileBoundaries!==Ne&&(this._showTileBoundaries=Ne,this._update())}get showPadding(){return!!this._showPadding}set showPadding(Ne){this._showPadding!==Ne&&(this._showPadding=Ne,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(Ne){this._showCollisionBoxes!==Ne&&(this._showCollisionBoxes=Ne,Ne?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(Ne){this._showOverdrawInspector!==Ne&&(this._showOverdrawInspector=Ne,this._update())}get repaint(){return!!this._repaint}set repaint(Ne){this._repaint!==Ne&&(this._repaint=Ne,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(Ne){this._vertices=Ne,this._update()}get version(){return Fl}getCameraTargetElevation(){return this.transform.elevation}},e.MapMouseEvent=tu,e.MapTouchEvent=Xc,e.MapWheelEvent=uh,e.Marker=Zu,e.NavigationControl=class{constructor(Ne){this._updateZoomButtons=()=>{let R=this._map.getZoom(),ae=R===this._map.getMaxZoom(),we=R===this._map.getMinZoom();this._zoomInButton.disabled=ae,this._zoomOutButton.disabled=we,this._zoomInButton.setAttribute("aria-disabled",ae.toString()),this._zoomOutButton.setAttribute("aria-disabled",we.toString())},this._rotateCompassArrow=()=>{let R=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)}) rotateX(${this._map.transform.pitch}deg) rotateZ(${this._map.transform.angle*(180/Math.PI)}deg)`:`rotate(${this._map.transform.angle*(180/Math.PI)}deg)`;this._compassIcon.style.transform=R},this._setButtonTitle=(R,ae)=>{let we=this._map._getUIString(`NavigationControl.${ae}`);R.title=we,R.setAttribute("aria-label",we)},this.options=t.e({},Un,Ne),this._container=n.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",R=>R.preventDefault()),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",R=>this._map.zoomIn({},{originalEvent:R})),n.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",R=>this._map.zoomOut({},{originalEvent:R})),n.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",R=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:R}):this._map.resetNorth({},{originalEvent:R})}),this._compassIcon=n.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(Ne){return this._map=Ne,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new Io(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){n.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map}_createButton(Ne,R){let ae=n.create("button",Ne,this._container);return ae.type="button",ae.addEventListener("click",R),ae}},e.Popup=class extends t.E{constructor(Ne){super(),this.remove=()=>(this._content&&n.remove(this._content),this._container&&(n.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),this._map._canvasContainer.classList.remove("maplibregl-track-pointer"),delete this._map,this.fire(new t.k("close"))),this),this._onMouseUp=R=>{this._update(R.point)},this._onMouseMove=R=>{this._update(R.point)},this._onDrag=R=>{this._update(R.point)},this._update=R=>{var ae;if(!this._map||!this._lngLat&&!this._trackPointer||!this._content)return;if(!this._container){if(this._container=n.create("div","maplibregl-popup",this._map.getContainer()),this._tip=n.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(let At of this.options.className.split(" "))this._container.classList.add(At);this._closeButton&&this._closeButton.setAttribute("aria-label",this._map._getUIString("Popup.Close")),this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer")}if(this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._lngLat=this._map.transform.renderWorldCopies&&!this._trackPointer?Ls(this._lngLat,this._flatPos,this._map.transform):(ae=this._lngLat)===null||ae===void 0?void 0:ae.wrap(),this._trackPointer&&!R)return;let we=this._flatPos=this._pos=this._trackPointer&&R?R:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&R?R:this._map.transform.locationPoint(this._lngLat));let Se=this.options.anchor,Oe=lc(this.options.offset);if(!Se){let At=this._container.offsetWidth,Bt=this._container.offsetHeight,$t;$t=we.y+Oe.bottom.ythis._map.transform.height-Bt?["bottom"]:[],we.xthis._map.transform.width-At/2&&$t.push("right"),Se=$t.length===0?"bottom":$t.join("-")}let pt=we.add(Oe[Se]);this.options.subpixelPositioning||(pt=pt.round()),n.setTransform(this._container,`${ou[Se]} translate(${pt.x}px,${pt.y}px)`),Iu(this._container,Se,"popup")},this._onClose=()=>{this.remove()},this.options=t.e(Object.create(zo),Ne)}addTo(Ne){return this._map&&this.remove(),this._map=Ne,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")):this._map.on("move",this._update),this.fire(new t.k("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(Ne){return this._lngLat=t.N.convert(Ne),this._pos=null,this._flatPos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-track-pointer")),this}trackPointer(){return this._trackPointer=!0,this._pos=null,this._flatPos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")),this}getElement(){return this._container}setText(Ne){return this.setDOMContent(document.createTextNode(Ne))}setHTML(Ne){let R=document.createDocumentFragment(),ae=document.createElement("body"),we;for(ae.innerHTML=Ne;we=ae.firstChild,we;)R.appendChild(we);return this.setDOMContent(R)}getMaxWidth(){var Ne;return(Ne=this._container)===null||Ne===void 0?void 0:Ne.style.maxWidth}setMaxWidth(Ne){return this.options.maxWidth=Ne,this._update(),this}setDOMContent(Ne){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=n.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(Ne),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(Ne){return this._container&&this._container.classList.add(Ne),this}removeClassName(Ne){return this._container&&this._container.classList.remove(Ne),this}setOffset(Ne){return this.options.offset=Ne,this._update(),this}toggleClassName(Ne){if(this._container)return this._container.classList.toggle(Ne)}setSubpixelPositioning(Ne){this.options.subpixelPositioning=Ne}_createCloseButton(){this.options.closeButton&&(this._closeButton=n.create("button","maplibregl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;let Ne=this._container.querySelector(Ic);Ne&&Ne.focus()}},e.RasterDEMTileSource=ze,e.RasterTileSource=Ae,e.ScaleControl=class{constructor(Ne){this._onMove=()=>{gc(this._map,this._container,this.options)},this.setUnit=R=>{this.options.unit=R,gc(this._map,this._container,this.options)},this.options=Object.assign(Object.assign({},wu),Ne)}getDefaultPosition(){return"bottom-left"}onAdd(Ne){return this._map=Ne,this._container=n.create("div","maplibregl-ctrl maplibregl-ctrl-scale",Ne.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){n.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}},e.ScrollZoomHandler=La,e.Style=aa,e.TerrainControl=class{constructor(Ne){this._toggleTerrain=()=>{this._map.getTerrain()?this._map.setTerrain(null):this._map.setTerrain(this.options),this._updateTerrainIcon()},this._updateTerrainIcon=()=>{this._terrainButton.classList.remove("maplibregl-ctrl-terrain"),this._terrainButton.classList.remove("maplibregl-ctrl-terrain-enabled"),this._map.terrain?(this._terrainButton.classList.add("maplibregl-ctrl-terrain-enabled"),this._terrainButton.title=this._map._getUIString("TerrainControl.Disable")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.Enable"))},this.options=Ne}onAdd(Ne){return this._map=Ne,this._container=n.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=n.create("button","maplibregl-ctrl-terrain",this._container),n.create("span","maplibregl-ctrl-icon",this._terrainButton).setAttribute("aria-hidden","true"),this._terrainButton.type="button",this._terrainButton.addEventListener("click",this._toggleTerrain),this._updateTerrainIcon(),this._map.on("terrain",this._updateTerrainIcon),this._container}onRemove(){n.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},e.TwoFingersTouchPitchHandler=kc,e.TwoFingersTouchRotateHandler=Yc,e.TwoFingersTouchZoomHandler=gu,e.TwoFingersTouchZoomRotateHandler=Ri,e.VectorTileSource=be,e.VideoSource=ot,e.addSourceType=(Ne,R)=>t._(void 0,void 0,void 0,function*(){if(Ee(Ne))throw new Error(`A source type called "${Ne}" already exists.`);((ae,we)=>{lt[ae]=we})(Ne,R)}),e.clearPrewarmedResources=function(){let Ne=he;Ne&&(Ne.isPreloaded()&&Ne.numActive()===1?(Ne.release(Q),he=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},e.getMaxParallelImageRequests=function(){return t.a.MAX_PARALLEL_IMAGE_REQUESTS},e.getRTLTextPluginStatus=function(){return rt().getRTLTextPluginStatus()},e.getVersion=function(){return Yu},e.getWorkerCount=function(){return ue.workerCount},e.getWorkerUrl=function(){return t.a.WORKER_URL},e.importScriptInWorkers=function(Ne){return X().broadcast("IS",Ne)},e.prewarm=function(){$().acquire(Q)},e.setMaxParallelImageRequests=function(Ne){t.a.MAX_PARALLEL_IMAGE_REQUESTS=Ne},e.setRTLTextPlugin=function(Ne,R){return rt().setRTLTextPlugin(Ne,R)},e.setWorkerCount=function(Ne){ue.workerCount=Ne},e.setWorkerUrl=function(Ne){t.a.WORKER_URL=Ne}});var M=d;return M})}}),jV=Ze({"src/plots/map/layers.js"(Z,q){"use strict";var d=ca(),x=fu().sanitizeHTML,A=R6(),M=_0();function e(i,n){this.subplot=i,this.uid=i.uid+"-"+n,this.index=n,this.idSource="source-"+this.uid,this.idLayer=M.layoutLayerPrefix+this.uid,this.sourceType=null,this.source=null,this.layerType=null,this.below=null,this.visible=!1}var t=e.prototype;t.update=function(n){this.visible?this.needsNewImage(n)?this.updateImage(n):this.needsNewSource(n)?(this.removeLayer(),this.updateSource(n),this.updateLayer(n)):this.needsNewLayer(n)?this.updateLayer(n):this.updateStyle(n):(this.updateSource(n),this.updateLayer(n)),this.visible=r(n)},t.needsNewImage=function(i){var n=this.subplot.map;return n.getSource(this.idSource)&&this.sourceType==="image"&&i.sourcetype==="image"&&(this.source!==i.source||JSON.stringify(this.coordinates)!==JSON.stringify(i.coordinates))},t.needsNewSource=function(i){return this.sourceType!==i.sourcetype||JSON.stringify(this.source)!==JSON.stringify(i.source)||this.layerType!==i.type},t.needsNewLayer=function(i){return this.layerType!==i.type||this.below!==this.subplot.belowLookup["layout-"+this.index]},t.lookupBelow=function(){return this.subplot.belowLookup["layout-"+this.index]},t.updateImage=function(i){var n=this.subplot.map;n.getSource(this.idSource).updateImage({url:i.source,coordinates:i.coordinates});var s=this.findFollowingMapLayerId(this.lookupBelow());s!==null&&this.subplot.map.moveLayer(this.idLayer,s)},t.updateSource=function(i){var n=this.subplot.map;if(n.getSource(this.idSource)&&n.removeSource(this.idSource),this.sourceType=i.sourcetype,this.source=i.source,!!r(i)){var s=a(i);n.addSource(this.idSource,s)}},t.findFollowingMapLayerId=function(i){if(i==="traces")for(var n=this.subplot.getMapLayers(),s=0;s0){for(var s=0;s0}function o(i){var n={},s={};switch(i.type){case"circle":d.extendFlat(s,{"circle-radius":i.circle.radius,"circle-color":i.color,"circle-opacity":i.opacity});break;case"line":d.extendFlat(s,{"line-width":i.line.width,"line-color":i.color,"line-opacity":i.opacity,"line-dasharray":i.line.dash});break;case"fill":d.extendFlat(s,{"fill-color":i.color,"fill-outline-color":i.fill.outlinecolor,"fill-opacity":i.opacity});break;case"symbol":var c=i.symbol,f=A(c.textposition,c.iconsize);d.extendFlat(n,{"icon-image":c.icon+"-15","icon-size":c.iconsize/10,"text-field":c.text,"text-size":c.textfont.size,"text-anchor":f.anchor,"text-offset":f.offset,"symbol-placement":c.placement}),d.extendFlat(s,{"icon-color":i.color,"text-color":c.textfont.color,"text-opacity":i.opacity});break;case"raster":d.extendFlat(s,{"raster-fade-duration":0,"raster-opacity":i.opacity});break}return{layout:n,paint:s}}function a(i){var n=i.sourcetype,s=i.source,c={type:n},f;return n==="geojson"?f="data":n==="vector"?f=typeof s=="string"?"url":"tiles":n==="raster"?(f="tiles",c.tileSize=256):n==="image"&&(f="url",c.coordinates=i.coordinates),c[f]=s,i.sourceattribution&&(c.attribution=x(i.sourceattribution)),c}q.exports=function(n,s,c){var f=new e(n,s);return f.update(c),f}}}),qV=Ze({"src/plots/map/map.js"(Z,q){"use strict";var d=UV(),x=ca(),A=v0(),M=oo(),e=Wo(),t=Tp(),r=ef(),o=Jd(),a=o.drawMode,i=o.selectMode,n=Tf().prepSelect,s=Tf().clearOutline,c=Tf().clearSelectionsCache,f=Tf().selectOnClick,g=_0(),v=jV();function T(y,b){this.id=b,this.gd=y;var p=y._fullLayout,u=y._context;this.container=p._glcontainer.node(),this.isStatic=u.staticPlot,this.uid=p._uid+"-"+this.id,this.div=null,this.xaxis=null,this.yaxis=null,this.createFramework(p),this.map=null,this.styleObj=null,this.traceHash={},this.layerList=[],this.belowLookup={},this.dragging=!1,this.wheeling=!1}var l=T.prototype;l.plot=function(y,b,p){var u=this,m;u.map?m=new Promise(function(h,P){u.updateMap(y,b,h,P)}):m=new Promise(function(h,P){u.createMap(y,b,h,P)}),p.push(m)},l.createMap=function(y,b,p,u){var m=this,h=b[m.id],P=m.styleObj=w(h.style),L=h.bounds,z=L?[[L.west,L.south],[L.east,L.north]]:null,F=m.map=new d.Map({container:m.div,style:P.style,center:E(h.center),zoom:h.zoom,bearing:h.bearing,pitch:h.pitch,maxBounds:z,interactive:!m.isStatic,preserveDrawingBuffer:m.isStatic,doubleClickZoom:!1,boxZoom:!1,attributionControl:!1}).addControl(new d.AttributionControl({compact:!0})),B={};F.on("styleimagemissing",function(I){var N=I.id;if(!B[N]&&N.includes("-15")){B[N]=!0;var U=new Image(15,15);U.onload=function(){F.addImage(N,U)},U.crossOrigin="Anonymous",U.src="https://unpkg.com/maki@2.1.0/icons/"+N+".svg"}}),F.setTransformRequest(function(I){return I=I.replace("https://fonts.openmaptiles.org/Open Sans Extrabold","https://fonts.openmaptiles.org/Open Sans Extra Bold"),I=I.replace("https://tiles.basemaps.cartocdn.com/fonts/Open Sans Extrabold","https://fonts.openmaptiles.org/Open Sans Extra Bold"),I=I.replace("https://fonts.openmaptiles.org/Open Sans Regular,Arial Unicode MS Regular","https://fonts.openmaptiles.org/Klokantech Noto Sans Regular"),{url:I}}),F._canvas.style.left="0px",F._canvas.style.top="0px",m.rejectOnError(u),m.isStatic||m.initFx(y,b);var O=[];O.push(new Promise(function(I){F.once("load",I)})),O=O.concat(A.fetchTraceGeoData(y)),Promise.all(O).then(function(){m.fillBelowLookup(y,b),m.updateData(y),m.updateLayout(b),m.resolveOnRender(p)}).catch(u)},l.updateMap=function(y,b,p,u){var m=this,h=m.map,P=b[this.id];m.rejectOnError(u);var L=[],z=w(P.style);JSON.stringify(m.styleObj)!==JSON.stringify(z)&&(m.styleObj=z,h.setStyle(z.style),m.traceHash={},L.push(new Promise(function(F){h.once("styledata",F)}))),L=L.concat(A.fetchTraceGeoData(y)),Promise.all(L).then(function(){m.fillBelowLookup(y,b),m.updateData(y),m.updateLayout(b),m.resolveOnRender(p)}).catch(u)},l.fillBelowLookup=function(y,b){var p=b[this.id],u=p.layers,m,h,P=this.belowLookup={},L=!1;for(m=0;m1)for(m=0;m-1&&f(z.originalEvent,u,[p.xaxis],[p.yaxis],p.id,L),F.indexOf("event")>-1&&r.click(u,z.originalEvent)}}},l.updateFx=function(y){var b=this,p=b.map,u=b.gd;if(b.isStatic)return;function m(z){var F=b.map.unproject(z);return[F.lng,F.lat]}var h=y.dragmode,P;P=function(z,F){if(F.isRect){var B=z.range={};B[b.id]=[m([F.xmin,F.ymin]),m([F.xmax,F.ymax])]}else{var O=z.lassoPoints={};O[b.id]=F.map(m)}};var L=b.dragOptions;b.dragOptions=x.extendDeep(L||{},{dragmode:y.dragmode,element:b.div,gd:u,plotinfo:{id:b.id,domain:y[b.id].domain,xaxis:b.xaxis,yaxis:b.yaxis,fillRangeItems:P},xaxes:[b.xaxis],yaxes:[b.yaxis],subplot:b.id}),p.off("click",b.onClickInPanHandler),i(h)||a(h)?(p.dragPan.disable(),p.on("zoomstart",b.clearOutline),b.dragOptions.prepFn=function(z,F,B){n(z,F,B,b.dragOptions,h)},t.init(b.dragOptions)):(p.dragPan.enable(),p.off("zoomstart",b.clearOutline),b.div.onmousedown=null,b.div.ontouchstart=null,b.div.removeEventListener("touchstart",b.div._ontouchstart),b.onClickInPanHandler=b.onClickInPanFn(b.dragOptions),p.on("click",b.onClickInPanHandler))},l.updateFramework=function(y){var b=y[this.id].domain,p=y._size,u=this.div.style;u.width=p.w*(b.x[1]-b.x[0])+"px",u.height=p.h*(b.y[1]-b.y[0])+"px",u.left=p.l+b.x[0]*p.w+"px",u.top=p.t+(1-b.y[1])*p.h+"px",this.xaxis._offset=p.l+b.x[0]*p.w,this.xaxis._length=p.w*(b.x[1]-b.x[0]),this.yaxis._offset=p.t+(1-b.y[1])*p.h,this.yaxis._length=p.h*(b.y[1]-b.y[0])},l.updateLayers=function(y){var b=y[this.id],p=b.layers,u=this.layerList,m;if(p.length!==u.length){for(m=0;mp/2){var u=S.split("|").join("
");y.text(u).attr("data-unformatted",u).call(r.convertToTspans,i),b=t.bBox(y.node())}y.attr("transform",d(-3,-b.height+8)),E.insert("rect",".static-attribution").attr({x:-b.width-6,y:-b.height-3,width:b.width+6,height:b.height+3,fill:"rgba(255, 255, 255, 0.75)"});var m=1;b.width+6>p&&(m=p/(b.width+6));var h=[c.l+c.w*v.x[1],c.t+c.h*(1-v.y[0])];E.attr("transform",d(h[0],h[1])+x(m))}},Z.updateFx=function(i){for(var n=i._fullLayout,s=n._subplots[a],c=0;c=0;o--)t.removeLayer(r[o][1])},e.dispose=function(){var t=this.subplot.map;this._removeLayers(),t.removeSource(this.sourceId)},q.exports=function(r,o){var a=o[0].trace,i=new M(r,a.uid),n=i.sourceId,s=d(o),c=i.below=r.belowLookup["trace-"+a.uid];return r.map.addSource(n,{type:"geojson",data:s.geojson}),i._addLayers(s,c),o[0].trace._glTrace=i,i}}}),ZV=Ze({"src/traces/choroplethmap/index.js"(Z,q){"use strict";q.exports={attributes:D6(),supplyDefaults:WV(),colorbar:a0(),calc:lT(),plot:XV(),hoverPoints:cT(),eventData:fT(),selectPoints:hT(),styleOnSelect:function(d,x){if(x){var A=x[0].trace;A._glTrace.updateOnSelect(x)}},getBelow:function(d,x){for(var A=x.getMapLayers(),M=A.length-2;M>=0;M--){var e=A[M].id;if(typeof e=="string"&&e.indexOf("water")===0){for(var t=M+1;t0?+v[f]:0),c.push({type:"Feature",geometry:{type:"Point",coordinates:w},properties:S})}}var y=M.extractOpts(a),b=y.reversescale?M.flipScale(y.colorscale):y.colorscale,p=b[0][1],u=A.opacity(p)<1?p:A.addOpacity(p,0),m=["interpolate",["linear"],["heatmap-density"],0,u];for(f=1;f=0;r--)e.removeLayer(t[r][1])},M.dispose=function(){var e=this.subplot.map;this._removeLayers(),e.removeSource(this.sourceId)},q.exports=function(t,r){var o=r[0].trace,a=new A(t,o.uid),i=a.sourceId,n=d(r),s=a.below=t.belowLookup["trace-"+o.uid];return t.map.addSource(i,{type:"geojson",data:n.geojson}),a._addLayers(n,s),a}}}),eG=Ze({"src/traces/densitymap/hover.js"(Z,q){"use strict";var d=Wo(),x=CT().hoverPoints,A=CT().getExtraText;q.exports=function(e,t,r){var o=x(e,t,r);if(o){var a=o[0],i=a.cd,n=i[0].trace,s=i[a.index];if(delete a.color,"z"in s){var c=a.subplot.mockAxis;a.z=s.z,a.zLabel=d.tickText(c,c.c2l(s.z),"hover").text}return a.extraText=A(n,s,i[0].t.labels),[a]}}}}),tG=Ze({"src/traces/densitymap/event_data.js"(Z,q){"use strict";q.exports=function(x,A){return x.lon=A.lon,x.lat=A.lat,x.z=A.z,x}}}),rG=Ze({"src/traces/densitymap/index.js"(Z,q){"use strict";q.exports={attributes:F6(),supplyDefaults:KV(),colorbar:a0(),formatLabels:I6(),calc:JV(),plot:QV(),hoverPoints:eG(),eventData:tG(),getBelow:function(d,x){for(var A=x.getMapLayers(),M=0;M0;){l=w[w.length-1];var S=x[l];if(r[l]=0&&a[l].push(o[y])}r[l]=E}else{if(e[l]===M[l]){for(var b=[],p=[],u=0,E=_.length-1;E>=0;--E){var m=_[E];if(t[m]=!1,b.push(m),p.push(a[m]),u+=a[m].length,o[m]=s.length,m===l){_.length=E;break}}s.push(b);for(var h=new Array(u),E=0;Ey&&(y=n.source[_]),n.target[_]>y&&(y=n.target[_]);var b=y+1;a.node._count=b;var p,u=a.node.groups,m={};for(_=0;_0&&e(B,b)&&e(O,b)&&!(m.hasOwnProperty(B)&&m.hasOwnProperty(O)&&m[B]===m[O])){m.hasOwnProperty(O)&&(O=m[O]),m.hasOwnProperty(B)&&(B=m[B]),B=+B,O=+O,v[B]=v[O]=!0;var I="";n.label&&n.label[_]&&(I=n.label[_]);var N=null;I&&T.hasOwnProperty(I)&&(N=T[I]),s.push({pointNumber:_,label:I,color:c?n.color[_]:n.color,hovercolor:f?n.hovercolor[_]:n.hovercolor,customdata:g?n.customdata[_]:n.customdata,concentrationscale:N,source:B,target:O,value:+F}),z.source.push(B),z.target.push(O)}}var U=b+u.length,W=M(i.color),Q=M(i.customdata),ue=[];for(_=0;_b-1,childrenNodes:[],pointNumber:_,label:le,color:W?i.color[_]:i.color,customdata:Q?i.customdata[_]:i.customdata})}var he=!1;return o(U,z.source,z.target)&&(he=!0),{circular:he,links:s,nodes:ue,groups:u,groupLookup:m}}function o(a,i,n){for(var s=x.init2dArray(a,0),c=0;c1})}q.exports=function(i,n){var s=r(n);return A({circular:s.circular,_nodes:s.nodes,_links:s.links,_groups:s.groups,_groupLookup:s.groupLookup})}}}),oG=Ze({"node_modules/d3-quadtree/dist/d3-quadtree.js"(Z,q){(function(d,x){typeof Z=="object"&&typeof q<"u"?x(Z):(d=d||self,x(d.d3=d.d3||{}))})(Z,function(d){"use strict";function x(b){var p=+this._x.call(null,b),u=+this._y.call(null,b);return A(this.cover(p,u),p,u,b)}function A(b,p,u,m){if(isNaN(p)||isNaN(u))return b;var h,P=b._root,L={data:m},z=b._x0,F=b._y0,B=b._x1,O=b._y1,I,N,U,W,Q,ue,le,he;if(!P)return b._root=L,b;for(;P.length;)if((Q=p>=(I=(z+B)/2))?z=I:B=I,(ue=u>=(N=(F+O)/2))?F=N:O=N,h=P,!(P=P[le=ue<<1|Q]))return h[le]=L,b;if(U=+b._x.call(null,P.data),W=+b._y.call(null,P.data),p===U&&u===W)return L.next=P,h?h[le]=L:b._root=L,b;do h=h?h[le]=new Array(4):b._root=new Array(4),(Q=p>=(I=(z+B)/2))?z=I:B=I,(ue=u>=(N=(F+O)/2))?F=N:O=N;while((le=ue<<1|Q)===(he=(W>=N)<<1|U>=I));return h[he]=P,h[le]=L,b}function M(b){var p,u,m=b.length,h,P,L=new Array(m),z=new Array(m),F=1/0,B=1/0,O=-1/0,I=-1/0;for(u=0;uO&&(O=h),PI&&(I=P));if(F>O||B>I)return this;for(this.cover(F,B).cover(O,I),u=0;ub||b>=h||m>p||p>=P;)switch(B=(pO||(z=W.y0)>I||(F=W.x1)=le)<<1|b>=ue)&&(W=N[N.length-1],N[N.length-1]=N[N.length-1-Q],N[N.length-1-Q]=W)}else{var he=b-+this._x.call(null,U.data),G=p-+this._y.call(null,U.data),$=he*he+G*G;if($=(N=(L+F)/2))?L=N:F=N,(Q=I>=(U=(z+B)/2))?z=U:B=U,p=u,!(u=u[ue=Q<<1|W]))return this;if(!u.length)break;(p[ue+1&3]||p[ue+2&3]||p[ue+3&3])&&(m=p,le=ue)}for(;u.data!==b;)if(h=u,!(u=u.next))return this;return(P=u.next)&&delete u.next,h?(P?h.next=P:delete h.next,this):p?(P?p[ue]=P:delete p[ue],(u=p[0]||p[1]||p[2]||p[3])&&u===(p[3]||p[2]||p[1]||p[0])&&!u.length&&(m?m[le]=u:this._root=u),this):(this._root=P,this)}function n(b){for(var p=0,u=b.length;p=v.length)return l!=null&&y.sort(l),_!=null?_(y):y;for(var m=-1,h=y.length,P=v[b++],L,z,F=M(),B,O=p();++mv.length)return y;var p,u=T[b-1];return _!=null&&b>=v.length?p=y.entries():(p=[],y.each(function(m,h){p.push({key:h,values:E(m,b)})})),u!=null?p.sort(function(m,h){return u(m.key,h.key)}):p}return w={object:function(y){return S(y,0,t,r)},map:function(y){return S(y,0,o,a)},entries:function(y){return E(S(y,0,o,a),0)},key:function(y){return v.push(y),w},sortKeys:function(y){return T[v.length-1]=y,w},sortValues:function(y){return l=y,w},rollup:function(y){return _=y,w}}}function t(){return{}}function r(v,T,l){v[T]=l}function o(){return M()}function a(v,T,l){v.set(T,l)}function i(){}var n=M.prototype;i.prototype=s.prototype={constructor:i,has:n.has,add:function(v){return v+="",this[x+v]=v,this},remove:n.remove,clear:n.clear,values:n.keys,size:n.size,empty:n.empty,each:n.each};function s(v,T){var l=new i;if(v instanceof i)v.each(function(S){l.add(S)});else if(v){var _=-1,w=v.length;if(T==null)for(;++_=0&&(n=i.slice(s+1),i=i.slice(0,s)),i&&!a.hasOwnProperty(i))throw new Error("unknown type: "+i);return{type:i,name:n}})}M.prototype=A.prototype={constructor:M,on:function(o,a){var i=this._,n=e(o+"",i),s,c=-1,f=n.length;if(arguments.length<2){for(;++c0)for(var i=new Array(s),n=0,s,c;n=0&&b._call.call(null,p),b=b._next;--x}function l(){a=(o=n.now())+i,x=A=0;try{T()}finally{x=0,w(),a=0}}function _(){var b=n.now(),p=b-o;p>e&&(i-=p,o=b)}function w(){for(var b,p=t,u,m=1/0;p;)p._call?(m>p._time&&(m=p._time),b=p,p=p._next):(u=p._next,p._next=null,p=b?b._next=u:t=u);r=b,S(m)}function S(b){if(!x){A&&(A=clearTimeout(A));var p=b-a;p>24?(b<1/0&&(A=setTimeout(l,b-n.now()-i)),M&&(M=clearInterval(M))):(M||(o=n.now(),M=setInterval(_,e)),x=1,s(l))}}function E(b,p,u){var m=new g;return p=p==null?0:+p,m.restart(function(h){m.stop(),b(h+p)},p,u),m}function y(b,p,u){var m=new g,h=p;return p==null?(m.restart(b,p,u),m):(p=+p,u=u==null?c():+u,m.restart(function P(L){L+=h,m.restart(P,h+=p,u),b(L)},p,u),m)}d.interval=y,d.now=c,d.timeout=E,d.timer=v,d.timerFlush=T,Object.defineProperty(d,"__esModule",{value:!0})})}}),uG=Ze({"node_modules/d3-force/dist/d3-force.js"(Z,q){(function(d,x){typeof Z=="object"&&typeof q<"u"?x(Z,oG(),LT(),sG(),lG()):x(d.d3=d.d3||{},d.d3,d.d3,d.d3,d.d3)})(Z,function(d,x,A,M,e){"use strict";function t(b,p){var u;b==null&&(b=0),p==null&&(p=0);function m(){var h,P=u.length,L,z=0,F=0;for(h=0;hI.index){var ee=N-oe.x-oe.vx,re=U-oe.y-oe.vy,ce=ee*ee+re*re;ceN+j||JU+j||XF.r&&(F.r=F[B].r)}function z(){if(p){var F,B=p.length,O;for(u=new Array(B),F=0;F1?(Q==null?z.remove(W):z.set(W,U(Q)),p):z.get(W)},find:function(W,Q,ue){var le=0,he=b.length,G,$,J,X,oe;for(ue==null?ue=1/0:ue*=ue,le=0;le1?(B.on(W,Q),p):B.on(W)}}}function w(){var b,p,u,m=r(-30),h,P=1,L=1/0,z=.81;function F(N){var U,W=b.length,Q=x.quadtree(b,g,v).visitAfter(O);for(u=N,U=0;U=L)return;(N.data!==p||N.next)&&(ue===0&&(ue=o(),G+=ue*ue),le===0&&(le=o(),G+=le*le),GM)if(!(Math.abs(l*g-v*T)>M)||!s)this._+="L"+(this._x1=o)+","+(this._y1=a);else{var w=i-c,S=n-f,E=g*g+v*v,y=w*w+S*S,b=Math.sqrt(E),p=Math.sqrt(_),u=s*Math.tan((x-Math.acos((E+_-y)/(2*b*p)))/2),m=u/p,h=u/b;Math.abs(m-1)>M&&(this._+="L"+(o+m*T)+","+(a+m*l)),this._+="A"+s+","+s+",0,0,"+ +(l*w>T*S)+","+(this._x1=o+h*g)+","+(this._y1=a+h*v)}},arc:function(o,a,i,n,s,c){o=+o,a=+a,i=+i,c=!!c;var f=i*Math.cos(n),g=i*Math.sin(n),v=o+f,T=a+g,l=1^c,_=c?n-s:s-n;if(i<0)throw new Error("negative radius: "+i);this._x1===null?this._+="M"+v+","+T:(Math.abs(this._x1-v)>M||Math.abs(this._y1-T)>M)&&(this._+="L"+v+","+T),i&&(_<0&&(_=_%A+A),_>e?this._+="A"+i+","+i+",0,1,"+l+","+(o-f)+","+(a-g)+"A"+i+","+i+",0,1,"+l+","+(this._x1=v)+","+(this._y1=T):_>M&&(this._+="A"+i+","+i+",0,"+ +(_>=x)+","+l+","+(this._x1=o+i*Math.cos(s))+","+(this._y1=a+i*Math.sin(s))))},rect:function(o,a,i,n){this._+="M"+(this._x0=this._x1=+o)+","+(this._y0=this._y1=+a)+"h"+ +i+"v"+ +n+"h"+-i+"Z"},toString:function(){return this._}},d.path=r,Object.defineProperty(d,"__esModule",{value:!0})})}}),N6=Ze({"node_modules/d3-shape/dist/d3-shape.js"(Z,q){(function(d,x){typeof Z=="object"&&typeof q<"u"?x(Z,cG()):(d=d||self,x(d.d3=d.d3||{},d.d3))})(Z,function(d,x){"use strict";function A(It){return function(){return It}}var M=Math.abs,e=Math.atan2,t=Math.cos,r=Math.max,o=Math.min,a=Math.sin,i=Math.sqrt,n=1e-12,s=Math.PI,c=s/2,f=2*s;function g(It){return It>1?0:It<-1?s:Math.acos(It)}function v(It){return It>=1?c:It<=-1?-c:Math.asin(It)}function T(It){return It.innerRadius}function l(It){return It.outerRadius}function _(It){return It.startAngle}function w(It){return It.endAngle}function S(It){return It&&It.padAngle}function E(It,dr,kr,ia,Ca,Fa,Ya,ha){var Da=kr-It,Xi=ia-dr,Li=Ya-Ca,fn=ha-Fa,An=fn*Da-Li*Xi;if(!(An*Anos*os+Ys*Ys&&(Vn=qo,To=Oo),{cx:Vn,cy:To,x01:-Li,y01:-fn,x11:Vn*(Ca/Ts-1),y11:To*(Ca/Ts-1)}}function b(){var It=T,dr=l,kr=A(0),ia=null,Ca=_,Fa=w,Ya=S,ha=null;function Da(){var Xi,Li,fn=+It.apply(this,arguments),An=+dr.apply(this,arguments),kn=Ca.apply(this,arguments)-c,zn=Fa.apply(this,arguments)-c,Xn=M(zn-kn),to=zn>kn;if(ha||(ha=Xi=x.path()),Ann))ha.moveTo(0,0);else if(Xn>f-n)ha.moveTo(An*t(kn),An*a(kn)),ha.arc(0,0,An,kn,zn,!to),fn>n&&(ha.moveTo(fn*t(zn),fn*a(zn)),ha.arc(0,0,fn,zn,kn,to));else{var mo=kn,pn=zn,Jo=kn,Xo=zn,Ts=Xn,Po=Xn,so=Ya.apply(this,arguments)/2,Vn=so>n&&(ia?+ia.apply(this,arguments):i(fn*fn+An*An)),To=o(M(An-fn)/2,+kr.apply(this,arguments)),qo=To,Oo=To,lo,Co;if(Vn>n){var os=v(Vn/fn*a(so)),Ys=v(Vn/An*a(so));(Ts-=os*2)>n?(os*=to?1:-1,Jo+=os,Xo-=os):(Ts=0,Jo=Xo=(kn+zn)/2),(Po-=Ys*2)>n?(Ys*=to?1:-1,mo+=Ys,pn-=Ys):(Po=0,mo=pn=(kn+zn)/2)}var Os=An*t(mo),Yo=An*a(mo),Ui=fn*t(Xo),Cn=fn*a(Xo);if(To>n){var tl=An*t(pn),Bs=An*a(pn),uo=fn*t(Jo),$s=fn*a(Jo),ms;if(Xnn?Oo>n?(lo=y(uo,$s,Os,Yo,An,Oo,to),Co=y(tl,Bs,Ui,Cn,An,Oo,to),ha.moveTo(lo.cx+lo.x01,lo.cy+lo.y01),Oon)||!(Ts>n)?ha.lineTo(Ui,Cn):qo>n?(lo=y(Ui,Cn,tl,Bs,fn,-qo,to),Co=y(Os,Yo,uo,$s,fn,-qo,to),ha.lineTo(lo.cx+lo.x01,lo.cy+lo.y01),qo=An;--kn)ha.point(pn[kn],Jo[kn]);ha.lineEnd(),ha.areaEnd()}to&&(pn[fn]=+It(Xn,fn,Li),Jo[fn]=+kr(Xn,fn,Li),ha.point(dr?+dr(Xn,fn,Li):pn[fn],ia?+ia(Xn,fn,Li):Jo[fn]))}if(mo)return ha=null,mo+""||null}function Xi(){return P().defined(Ca).curve(Ya).context(Fa)}return Da.x=function(Li){return arguments.length?(It=typeof Li=="function"?Li:A(+Li),dr=null,Da):It},Da.x0=function(Li){return arguments.length?(It=typeof Li=="function"?Li:A(+Li),Da):It},Da.x1=function(Li){return arguments.length?(dr=Li==null?null:typeof Li=="function"?Li:A(+Li),Da):dr},Da.y=function(Li){return arguments.length?(kr=typeof Li=="function"?Li:A(+Li),ia=null,Da):kr},Da.y0=function(Li){return arguments.length?(kr=typeof Li=="function"?Li:A(+Li),Da):kr},Da.y1=function(Li){return arguments.length?(ia=Li==null?null:typeof Li=="function"?Li:A(+Li),Da):ia},Da.lineX0=Da.lineY0=function(){return Xi().x(It).y(kr)},Da.lineY1=function(){return Xi().x(It).y(ia)},Da.lineX1=function(){return Xi().x(dr).y(kr)},Da.defined=function(Li){return arguments.length?(Ca=typeof Li=="function"?Li:A(!!Li),Da):Ca},Da.curve=function(Li){return arguments.length?(Ya=Li,Fa!=null&&(ha=Ya(Fa)),Da):Ya},Da.context=function(Li){return arguments.length?(Li==null?Fa=ha=null:ha=Ya(Fa=Li),Da):Fa},Da}function z(It,dr){return drIt?1:dr>=It?0:NaN}function F(It){return It}function B(){var It=F,dr=z,kr=null,ia=A(0),Ca=A(f),Fa=A(0);function Ya(ha){var Da,Xi=ha.length,Li,fn,An=0,kn=new Array(Xi),zn=new Array(Xi),Xn=+ia.apply(this,arguments),to=Math.min(f,Math.max(-f,Ca.apply(this,arguments)-Xn)),mo,pn=Math.min(Math.abs(to)/Xi,Fa.apply(this,arguments)),Jo=pn*(to<0?-1:1),Xo;for(Da=0;Da0&&(An+=Xo);for(dr!=null?kn.sort(function(Ts,Po){return dr(zn[Ts],zn[Po])}):kr!=null&&kn.sort(function(Ts,Po){return kr(ha[Ts],ha[Po])}),Da=0,fn=An?(to-Xi*Jo)/An:0;Da0?Xo*fn:0)+Jo,zn[Li]={data:ha[Li],index:Da,value:Xo,startAngle:Xn,endAngle:mo,padAngle:pn};return zn}return Ya.value=function(ha){return arguments.length?(It=typeof ha=="function"?ha:A(+ha),Ya):It},Ya.sortValues=function(ha){return arguments.length?(dr=ha,kr=null,Ya):dr},Ya.sort=function(ha){return arguments.length?(kr=ha,dr=null,Ya):kr},Ya.startAngle=function(ha){return arguments.length?(ia=typeof ha=="function"?ha:A(+ha),Ya):ia},Ya.endAngle=function(ha){return arguments.length?(Ca=typeof ha=="function"?ha:A(+ha),Ya):Ca},Ya.padAngle=function(ha){return arguments.length?(Fa=typeof ha=="function"?ha:A(+ha),Ya):Fa},Ya}var O=N(u);function I(It){this._curve=It}I.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(It,dr){this._curve.point(dr*Math.sin(It),dr*-Math.cos(It))}};function N(It){function dr(kr){return new I(It(kr))}return dr._curve=It,dr}function U(It){var dr=It.curve;return It.angle=It.x,delete It.x,It.radius=It.y,delete It.y,It.curve=function(kr){return arguments.length?dr(N(kr)):dr()._curve},It}function W(){return U(P().curve(O))}function Q(){var It=L().curve(O),dr=It.curve,kr=It.lineX0,ia=It.lineX1,Ca=It.lineY0,Fa=It.lineY1;return It.angle=It.x,delete It.x,It.startAngle=It.x0,delete It.x0,It.endAngle=It.x1,delete It.x1,It.radius=It.y,delete It.y,It.innerRadius=It.y0,delete It.y0,It.outerRadius=It.y1,delete It.y1,It.lineStartAngle=function(){return U(kr())},delete It.lineX0,It.lineEndAngle=function(){return U(ia())},delete It.lineX1,It.lineInnerRadius=function(){return U(Ca())},delete It.lineY0,It.lineOuterRadius=function(){return U(Fa())},delete It.lineY1,It.curve=function(Ya){return arguments.length?dr(N(Ya)):dr()._curve},It}function ue(It,dr){return[(dr=+dr)*Math.cos(It-=Math.PI/2),dr*Math.sin(It)]}var le=Array.prototype.slice;function he(It){return It.source}function G(It){return It.target}function $(It){var dr=he,kr=G,ia=m,Ca=h,Fa=null;function Ya(){var ha,Da=le.call(arguments),Xi=dr.apply(this,Da),Li=kr.apply(this,Da);if(Fa||(Fa=ha=x.path()),It(Fa,+ia.apply(this,(Da[0]=Xi,Da)),+Ca.apply(this,Da),+ia.apply(this,(Da[0]=Li,Da)),+Ca.apply(this,Da)),ha)return Fa=null,ha+""||null}return Ya.source=function(ha){return arguments.length?(dr=ha,Ya):dr},Ya.target=function(ha){return arguments.length?(kr=ha,Ya):kr},Ya.x=function(ha){return arguments.length?(ia=typeof ha=="function"?ha:A(+ha),Ya):ia},Ya.y=function(ha){return arguments.length?(Ca=typeof ha=="function"?ha:A(+ha),Ya):Ca},Ya.context=function(ha){return arguments.length?(Fa=ha??null,Ya):Fa},Ya}function J(It,dr,kr,ia,Ca){It.moveTo(dr,kr),It.bezierCurveTo(dr=(dr+ia)/2,kr,dr,Ca,ia,Ca)}function X(It,dr,kr,ia,Ca){It.moveTo(dr,kr),It.bezierCurveTo(dr,kr=(kr+Ca)/2,ia,kr,ia,Ca)}function oe(It,dr,kr,ia,Ca){var Fa=ue(dr,kr),Ya=ue(dr,kr=(kr+Ca)/2),ha=ue(ia,kr),Da=ue(ia,Ca);It.moveTo(Fa[0],Fa[1]),It.bezierCurveTo(Ya[0],Ya[1],ha[0],ha[1],Da[0],Da[1])}function ie(){return $(J)}function j(){return $(X)}function ee(){var It=$(oe);return It.angle=It.x,delete It.x,It.radius=It.y,delete It.y,It}var re={draw:function(It,dr){var kr=Math.sqrt(dr/s);It.moveTo(kr,0),It.arc(0,0,kr,0,f)}},ce={draw:function(It,dr){var kr=Math.sqrt(dr/5)/2;It.moveTo(-3*kr,-kr),It.lineTo(-kr,-kr),It.lineTo(-kr,-3*kr),It.lineTo(kr,-3*kr),It.lineTo(kr,-kr),It.lineTo(3*kr,-kr),It.lineTo(3*kr,kr),It.lineTo(kr,kr),It.lineTo(kr,3*kr),It.lineTo(-kr,3*kr),It.lineTo(-kr,kr),It.lineTo(-3*kr,kr),It.closePath()}},be=Math.sqrt(1/3),Ae=be*2,ze={draw:function(It,dr){var kr=Math.sqrt(dr/Ae),ia=kr*be;It.moveTo(0,-kr),It.lineTo(ia,0),It.lineTo(0,kr),It.lineTo(-ia,0),It.closePath()}},Re=.8908130915292852,Xe=Math.sin(s/10)/Math.sin(7*s/10),it=Math.sin(f/10)*Xe,ot=-Math.cos(f/10)*Xe,tt={draw:function(It,dr){var kr=Math.sqrt(dr*Re),ia=it*kr,Ca=ot*kr;It.moveTo(0,-kr),It.lineTo(ia,Ca);for(var Fa=1;Fa<5;++Fa){var Ya=f*Fa/5,ha=Math.cos(Ya),Da=Math.sin(Ya);It.lineTo(Da*kr,-ha*kr),It.lineTo(ha*ia-Da*Ca,Da*ia+ha*Ca)}It.closePath()}},lt={draw:function(It,dr){var kr=Math.sqrt(dr),ia=-kr/2;It.rect(ia,ia,kr,kr)}},Ee=Math.sqrt(3),_e={draw:function(It,dr){var kr=-Math.sqrt(dr/(Ee*3));It.moveTo(0,kr*2),It.lineTo(-Ee*kr,-kr),It.lineTo(Ee*kr,-kr),It.closePath()}},fe=-.5,Fe=Math.sqrt(3)/2,rt=1/Math.sqrt(12),st=(rt/2+1)*3,Qe={draw:function(It,dr){var kr=Math.sqrt(dr/st),ia=kr/2,Ca=kr*rt,Fa=ia,Ya=kr*rt+kr,ha=-Fa,Da=Ya;It.moveTo(ia,Ca),It.lineTo(Fa,Ya),It.lineTo(ha,Da),It.lineTo(fe*ia-Fe*Ca,Fe*ia+fe*Ca),It.lineTo(fe*Fa-Fe*Ya,Fe*Fa+fe*Ya),It.lineTo(fe*ha-Fe*Da,Fe*ha+fe*Da),It.lineTo(fe*ia+Fe*Ca,fe*Ca-Fe*ia),It.lineTo(fe*Fa+Fe*Ya,fe*Ya-Fe*Fa),It.lineTo(fe*ha+Fe*Da,fe*Da-Fe*ha),It.closePath()}},Lt=[re,ce,ze,lt,tt,_e,Qe];function kt(){var It=A(re),dr=A(64),kr=null;function ia(){var Ca;if(kr||(kr=Ca=x.path()),It.apply(this,arguments).draw(kr,+dr.apply(this,arguments)),Ca)return kr=null,Ca+""||null}return ia.type=function(Ca){return arguments.length?(It=typeof Ca=="function"?Ca:A(Ca),ia):It},ia.size=function(Ca){return arguments.length?(dr=typeof Ca=="function"?Ca:A(+Ca),ia):dr},ia.context=function(Ca){return arguments.length?(kr=Ca??null,ia):kr},ia}function Vt(){}function Zt(It,dr,kr){It._context.bezierCurveTo((2*It._x0+It._x1)/3,(2*It._y0+It._y1)/3,(It._x0+2*It._x1)/3,(It._y0+2*It._y1)/3,(It._x0+4*It._x1+dr)/6,(It._y0+4*It._y1+kr)/6)}function Sr(It){this._context=It}Sr.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Zt(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(It,dr){switch(It=+It,dr=+dr,this._point){case 0:this._point=1,this._line?this._context.lineTo(It,dr):this._context.moveTo(It,dr);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Zt(this,It,dr);break}this._x0=this._x1,this._x1=It,this._y0=this._y1,this._y1=dr}};function xr(It){return new Sr(It)}function jr(It){this._context=It}jr.prototype={areaStart:Vt,areaEnd:Vt,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(It,dr){switch(It=+It,dr=+dr,this._point){case 0:this._point=1,this._x2=It,this._y2=dr;break;case 1:this._point=2,this._x3=It,this._y3=dr;break;case 2:this._point=3,this._x4=It,this._y4=dr,this._context.moveTo((this._x0+4*this._x1+It)/6,(this._y0+4*this._y1+dr)/6);break;default:Zt(this,It,dr);break}this._x0=this._x1,this._x1=It,this._y0=this._y1,this._y1=dr}};function wr(It){return new jr(It)}function Ir(It){this._context=It}Ir.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(It,dr){switch(It=+It,dr=+dr,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var kr=(this._x0+4*this._x1+It)/6,ia=(this._y0+4*this._y1+dr)/6;this._line?this._context.lineTo(kr,ia):this._context.moveTo(kr,ia);break;case 3:this._point=4;default:Zt(this,It,dr);break}this._x0=this._x1,this._x1=It,this._y0=this._y1,this._y1=dr}};function bt(It){return new Ir(It)}function Be(It,dr){this._basis=new Sr(It),this._beta=dr}Be.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var It=this._x,dr=this._y,kr=It.length-1;if(kr>0)for(var ia=It[0],Ca=dr[0],Fa=It[kr]-ia,Ya=dr[kr]-Ca,ha=-1,Da;++ha<=kr;)Da=ha/kr,this._basis.point(this._beta*It[ha]+(1-this._beta)*(ia+Da*Fa),this._beta*dr[ha]+(1-this._beta)*(Ca+Da*Ya));this._x=this._y=null,this._basis.lineEnd()},point:function(It,dr){this._x.push(+It),this._y.push(+dr)}};var Ke=function It(dr){function kr(ia){return dr===1?new Sr(ia):new Be(ia,dr)}return kr.beta=function(ia){return It(+ia)},kr}(.85);function Ue(It,dr,kr){It._context.bezierCurveTo(It._x1+It._k*(It._x2-It._x0),It._y1+It._k*(It._y2-It._y0),It._x2+It._k*(It._x1-dr),It._y2+It._k*(It._y1-kr),It._x2,It._y2)}function Me(It,dr){this._context=It,this._k=(1-dr)/6}Me.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:Ue(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(It,dr){switch(It=+It,dr=+dr,this._point){case 0:this._point=1,this._line?this._context.lineTo(It,dr):this._context.moveTo(It,dr);break;case 1:this._point=2,this._x1=It,this._y1=dr;break;case 2:this._point=3;default:Ue(this,It,dr);break}this._x0=this._x1,this._x1=this._x2,this._x2=It,this._y0=this._y1,this._y1=this._y2,this._y2=dr}};var qe=function It(dr){function kr(ia){return new Me(ia,dr)}return kr.tension=function(ia){return It(+ia)},kr}(0);function Ce(It,dr){this._context=It,this._k=(1-dr)/6}Ce.prototype={areaStart:Vt,areaEnd:Vt,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(It,dr){switch(It=+It,dr=+dr,this._point){case 0:this._point=1,this._x3=It,this._y3=dr;break;case 1:this._point=2,this._context.moveTo(this._x4=It,this._y4=dr);break;case 2:this._point=3,this._x5=It,this._y5=dr;break;default:Ue(this,It,dr);break}this._x0=this._x1,this._x1=this._x2,this._x2=It,this._y0=this._y1,this._y1=this._y2,this._y2=dr}};var Te=function It(dr){function kr(ia){return new Ce(ia,dr)}return kr.tension=function(ia){return It(+ia)},kr}(0);function Pe(It,dr){this._context=It,this._k=(1-dr)/6}Pe.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(It,dr){switch(It=+It,dr=+dr,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Ue(this,It,dr);break}this._x0=this._x1,this._x1=this._x2,this._x2=It,this._y0=this._y1,this._y1=this._y2,this._y2=dr}};var at=function It(dr){function kr(ia){return new Pe(ia,dr)}return kr.tension=function(ia){return It(+ia)},kr}(0);function yt(It,dr,kr){var ia=It._x1,Ca=It._y1,Fa=It._x2,Ya=It._y2;if(It._l01_a>n){var ha=2*It._l01_2a+3*It._l01_a*It._l12_a+It._l12_2a,Da=3*It._l01_a*(It._l01_a+It._l12_a);ia=(ia*ha-It._x0*It._l12_2a+It._x2*It._l01_2a)/Da,Ca=(Ca*ha-It._y0*It._l12_2a+It._y2*It._l01_2a)/Da}if(It._l23_a>n){var Xi=2*It._l23_2a+3*It._l23_a*It._l12_a+It._l12_2a,Li=3*It._l23_a*(It._l23_a+It._l12_a);Fa=(Fa*Xi+It._x1*It._l23_2a-dr*It._l12_2a)/Li,Ya=(Ya*Xi+It._y1*It._l23_2a-kr*It._l12_2a)/Li}It._context.bezierCurveTo(ia,Ca,Fa,Ya,It._x2,It._y2)}function Tt(It,dr){this._context=It,this._alpha=dr}Tt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(It,dr){if(It=+It,dr=+dr,this._point){var kr=this._x2-It,ia=this._y2-dr;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(kr*kr+ia*ia,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(It,dr):this._context.moveTo(It,dr);break;case 1:this._point=2;break;case 2:this._point=3;default:yt(this,It,dr);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=It,this._y0=this._y1,this._y1=this._y2,this._y2=dr}};var Ot=function It(dr){function kr(ia){return dr?new Tt(ia,dr):new Me(ia,0)}return kr.alpha=function(ia){return It(+ia)},kr}(.5);function Gt(It,dr){this._context=It,this._alpha=dr}Gt.prototype={areaStart:Vt,areaEnd:Vt,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(It,dr){if(It=+It,dr=+dr,this._point){var kr=this._x2-It,ia=this._y2-dr;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(kr*kr+ia*ia,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=It,this._y3=dr;break;case 1:this._point=2,this._context.moveTo(this._x4=It,this._y4=dr);break;case 2:this._point=3,this._x5=It,this._y5=dr;break;default:yt(this,It,dr);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=It,this._y0=this._y1,this._y1=this._y2,this._y2=dr}};var rr=function It(dr){function kr(ia){return dr?new Gt(ia,dr):new Ce(ia,0)}return kr.alpha=function(ia){return It(+ia)},kr}(.5);function Qt(It,dr){this._context=It,this._alpha=dr}Qt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(It,dr){if(It=+It,dr=+dr,this._point){var kr=this._x2-It,ia=this._y2-dr;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(kr*kr+ia*ia,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:yt(this,It,dr);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=It,this._y0=this._y1,this._y1=this._y2,this._y2=dr}};var Tr=function It(dr){function kr(ia){return dr?new Qt(ia,dr):new Pe(ia,0)}return kr.alpha=function(ia){return It(+ia)},kr}(.5);function la(It){this._context=It}la.prototype={areaStart:Vt,areaEnd:Vt,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(It,dr){It=+It,dr=+dr,this._point?this._context.lineTo(It,dr):(this._point=1,this._context.moveTo(It,dr))}};function Ua(It){return new la(It)}function Ba(It){return It<0?-1:1}function Ra(It,dr,kr){var ia=It._x1-It._x0,Ca=dr-It._x1,Fa=(It._y1-It._y0)/(ia||Ca<0&&-0),Ya=(kr-It._y1)/(Ca||ia<0&&-0),ha=(Fa*Ca+Ya*ia)/(ia+Ca);return(Ba(Fa)+Ba(Ya))*Math.min(Math.abs(Fa),Math.abs(Ya),.5*Math.abs(ha))||0}function ei(It,dr){var kr=It._x1-It._x0;return kr?(3*(It._y1-It._y0)/kr-dr)/2:dr}function za(It,dr,kr){var ia=It._x0,Ca=It._y0,Fa=It._x1,Ya=It._y1,ha=(Fa-ia)/3;It._context.bezierCurveTo(ia+ha,Ca+ha*dr,Fa-ha,Ya-ha*kr,Fa,Ya)}function ti(It){this._context=It}ti.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:za(this,this._t0,ei(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(It,dr){var kr=NaN;if(It=+It,dr=+dr,!(It===this._x1&&dr===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(It,dr):this._context.moveTo(It,dr);break;case 1:this._point=2;break;case 2:this._point=3,za(this,ei(this,kr=Ra(this,It,dr)),kr);break;default:za(this,this._t0,kr=Ra(this,It,dr));break}this._x0=this._x1,this._x1=It,this._y0=this._y1,this._y1=dr,this._t0=kr}}};function Ci(It){this._context=new Jt(It)}(Ci.prototype=Object.create(ti.prototype)).point=function(It,dr){ti.prototype.point.call(this,dr,It)};function Jt(It){this._context=It}Jt.prototype={moveTo:function(It,dr){this._context.moveTo(dr,It)},closePath:function(){this._context.closePath()},lineTo:function(It,dr){this._context.lineTo(dr,It)},bezierCurveTo:function(It,dr,kr,ia,Ca,Fa){this._context.bezierCurveTo(dr,It,ia,kr,Fa,Ca)}};function Nt(It){return new ti(It)}function Kt(It){return new Ci(It)}function Wt(It){this._context=It}Wt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var It=this._x,dr=this._y,kr=It.length;if(kr)if(this._line?this._context.lineTo(It[0],dr[0]):this._context.moveTo(It[0],dr[0]),kr===2)this._context.lineTo(It[1],dr[1]);else for(var ia=Pr(It),Ca=Pr(dr),Fa=0,Ya=1;Ya=0;--dr)Ca[dr]=(Ya[dr]-Ca[dr+1])/Fa[dr];for(Fa[kr-1]=(It[kr]+Ca[kr-1])/2,dr=0;dr=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(It,dr){switch(It=+It,dr=+dr,this._point){case 0:this._point=1,this._line?this._context.lineTo(It,dr):this._context.moveTo(It,dr);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,dr),this._context.lineTo(It,dr);else{var kr=this._x*(1-this._t)+It*this._t;this._context.lineTo(kr,this._y),this._context.lineTo(kr,dr)}break}}this._x=It,this._y=dr}};function ra(It){return new ma(It,.5)}function Ia(It){return new ma(It,0)}function Ha(It){return new ma(It,1)}function $a(It,dr){if((Ya=It.length)>1)for(var kr=1,ia,Ca,Fa=It[dr[0]],Ya,ha=Fa.length;kr=0;)kr[dr]=dr;return kr}function mi(It,dr){return It[dr]}function xt(){var It=A([]),dr=ai,kr=$a,ia=mi;function Ca(Fa){var Ya=It.apply(this,arguments),ha,Da=Fa.length,Xi=Ya.length,Li=new Array(Xi),fn;for(ha=0;ha0){for(var kr,ia,Ca=0,Fa=It[0].length,Ya;Ca0)for(var kr,ia=0,Ca,Fa,Ya,ha,Da,Xi=It[dr[0]].length;ia0?(Ca[0]=Ya,Ca[1]=Ya+=Fa):Fa<0?(Ca[1]=ha,Ca[0]=ha+=Fa):(Ca[0]=0,Ca[1]=Fa)}function Or(It,dr){if((Ca=It.length)>0){for(var kr=0,ia=It[dr[0]],Ca,Fa=ia.length;kr0)||!((Fa=(Ca=It[dr[0]]).length)>0))){for(var kr=0,ia=1,Ca,Fa,Ya;iaFa&&(Fa=Ca,kr=dr);return kr}function Kr(It){var dr=It.map(Ur);return ai(It).sort(function(kr,ia){return dr[kr]-dr[ia]})}function Ur(It){for(var dr=0,kr=-1,ia=It.length,Ca;++kr0;--oe)ee(X*=.99),re(),j(X),re();function ie(){var ce=x.max(J,function(ze){return ze.length}),be=U*(P-m)/(ce-1);z>be&&(z=be);var Ae=x.min(J,function(ze){return(P-m-(ze.length-1)*z)/x.sum(ze,f)});J.forEach(function(ze){ze.forEach(function(Re,Xe){Re.y1=(Re.y0=Xe)+Re.value*Ae})}),$.links.forEach(function(ze){ze.width=ze.value*Ae})}function j(ce){J.forEach(function(be){be.forEach(function(Ae){if(Ae.targetLinks.length){var ze=(x.sum(Ae.targetLinks,v)/x.sum(Ae.targetLinks,f)-g(Ae))*ce;Ae.y0+=ze,Ae.y1+=ze}})})}function ee(ce){J.slice().reverse().forEach(function(be){be.forEach(function(Ae){if(Ae.sourceLinks.length){var ze=(x.sum(Ae.sourceLinks,T)/x.sum(Ae.sourceLinks,f)-g(Ae))*ce;Ae.y0+=ze,Ae.y1+=ze}})})}function re(){J.forEach(function(ce){var be,Ae,ze=m,Re=ce.length,Xe;for(ce.sort(c),Xe=0;Xe0&&(be.y0+=Ae,be.y1+=Ae),ze=be.y1+z;if(Ae=ze-z-P,Ae>0)for(ze=be.y0-=Ae,be.y1-=Ae,Xe=Re-2;Xe>=0;--Xe)be=ce[Xe],Ae=be.y1+z-ze,Ae>0&&(be.y0-=Ae,be.y1-=Ae),ze=be.y0})}}function G($){$.nodes.forEach(function(J){J.sourceLinks.sort(s),J.targetLinks.sort(n)}),$.nodes.forEach(function(J){var X=J.y0,oe=X;J.sourceLinks.forEach(function(ie){ie.y0=X+ie.width/2,X+=ie.width}),J.targetLinks.forEach(function(ie){ie.y1=oe+ie.width/2,oe+=ie.width})})}return W};function y(u){return[u.source.x1,u.y0]}function b(u){return[u.target.x0,u.y1]}var p=function(){return M.linkHorizontal().source(y).target(b)};d.sankey=E,d.sankeyCenter=a,d.sankeyLeft=t,d.sankeyRight=r,d.sankeyJustify=o,d.sankeyLinkHorizontal=p,Object.defineProperty(d,"__esModule",{value:!0})})}}),hG=Ze({"node_modules/elementary-circuits-directed-graph/johnson.js"(Z,q){var d=B6();q.exports=function(A,M){var e=[],t=[],r=[],o={},a=[],i;function n(S){r[S]=!1,o.hasOwnProperty(S)&&Object.keys(o[S]).forEach(function(E){delete o[S][E],r[E]&&n(E)})}function s(S){var E=!1;t.push(S),r[S]=!0;var y,b;for(y=0;y=S})}function g(S){f(S);for(var E=A,y=d(E),b=y.components.filter(function(z){return z.length>1}),p=1/0,u,m=0;m"u"?"undefined":s(Me))!=="object"&&(Me=Ke.source=y(Be,Me)),(typeof qe>"u"?"undefined":s(qe))!=="object"&&(qe=Ke.target=y(Be,qe)),Me.sourceLinks.push(Ke),qe.targetLinks.push(Ke)}),bt}function Zt(bt){bt.nodes.forEach(function(Be){Be.partOfCycle=!1,Be.value=Math.max(x.sum(Be.sourceLinks,v),x.sum(Be.targetLinks,v)),Be.sourceLinks.forEach(function(Ke){Ke.circular&&(Be.partOfCycle=!0,Be.circularLinkType=Ke.circularLinkType)}),Be.targetLinks.forEach(function(Ke){Ke.circular&&(Be.partOfCycle=!0,Be.circularLinkType=Ke.circularLinkType)})})}function Sr(bt){var Be=0,Ke=0,Ue=0,Me=0,qe=x.max(bt.nodes,function(Ce){return Ce.column});return bt.links.forEach(function(Ce){Ce.circular&&(Ce.circularLinkType=="top"?Be=Be+Ce.width:Ke=Ke+Ce.width,Ce.target.column==0&&(Me=Me+Ce.width),Ce.source.column==qe&&(Ue=Ue+Ce.width))}),Be=Be>0?Be+p+u:Be,Ke=Ke>0?Ke+p+u:Ke,Ue=Ue>0?Ue+p+u:Ue,Me=Me>0?Me+p+u:Me,{top:Be,bottom:Ke,left:Me,right:Ue}}function xr(bt,Be){var Ke=x.max(bt.nodes,function(at){return at.column}),Ue=it-Re,Me=ot-Xe,qe=Ue+Be.right+Be.left,Ce=Me+Be.top+Be.bottom,Te=Ue/qe,Pe=Me/Ce;return Re=Re*Te+Be.left,it=Be.right==0?it:it*Te,Xe=Xe*Pe+Be.top,ot=ot*Pe,bt.nodes.forEach(function(at){at.x0=Re+at.column*((it-Re-tt)/Ke),at.x1=at.x0+tt}),Pe}function jr(bt){var Be,Ke,Ue;for(Be=bt.nodes,Ke=[],Ue=0;Be.length;++Ue,Be=Ke,Ke=[])Be.forEach(function(Me){Me.depth=Ue,Me.sourceLinks.forEach(function(qe){Ke.indexOf(qe.target)<0&&!qe.circular&&Ke.push(qe.target)})});for(Be=bt.nodes,Ke=[],Ue=0;Be.length;++Ue,Be=Ke,Ke=[])Be.forEach(function(Me){Me.height=Ue,Me.targetLinks.forEach(function(qe){Ke.indexOf(qe.source)<0&&!qe.circular&&Ke.push(qe.source)})});bt.nodes.forEach(function(Me){Me.column=Math.floor(_e.call(null,Me,Ue))})}function wr(bt,Be,Ke){var Ue=A.nest().key(function(at){return at.column}).sortKeys(x.ascending).entries(bt.nodes).map(function(at){return at.values});Ce(Ke),Pe();for(var Me=1,qe=Be;qe>0;--qe)Te(Me*=.99,Ke),Pe();function Ce(at){if(Qe){var yt=1/0;Ue.forEach(function(rr){var Qt=ot*Qe/(rr.length+1);yt=Qt0))if(rr==0&&Gt==1)Tr=Qt.y1-Qt.y0,Qt.y0=ot/2-Tr/2,Qt.y1=ot/2+Tr/2;else if(rr==Tt-1&&Gt==1)Tr=Qt.y1-Qt.y0,Qt.y0=ot/2-Tr/2,Qt.y1=ot/2+Tr/2;else{var la=0,Ua=x.mean(Qt.sourceLinks,_),Ba=x.mean(Qt.targetLinks,l);Ua&&Ba?la=(Ua+Ba)/2:la=Ua||Ba;var Ra=(la-T(Qt))*at;Qt.y0+=Ra,Qt.y1+=Ra}})})}function Pe(){Ue.forEach(function(at){var yt,Tt,Ot=Xe,Gt=at.length,rr;for(at.sort(g),rr=0;rr0&&(yt.y0+=Tt,yt.y1+=Tt),Ot=yt.y1+lt;if(Tt=Ot-lt-ot,Tt>0)for(Ot=yt.y0-=Tt,yt.y1-=Tt,rr=Gt-2;rr>=0;--rr)yt=at[rr],Tt=yt.y1+lt-Ot,Tt>0&&(yt.y0-=Tt,yt.y1-=Tt),Ot=yt.y0})}}function Ir(bt){bt.nodes.forEach(function(Be){Be.sourceLinks.sort(f),Be.targetLinks.sort(c)}),bt.nodes.forEach(function(Be){var Ke=Be.y0,Ue=Ke,Me=Be.y1,qe=Me;Be.sourceLinks.forEach(function(Ce){Ce.circular?(Ce.y0=Me-Ce.width/2,Me=Me-Ce.width):(Ce.y0=Ke+Ce.width/2,Ke+=Ce.width)}),Be.targetLinks.forEach(function(Ce){Ce.circular?(Ce.y1=qe-Ce.width/2,qe=qe-Ce.width):(Ce.y1=Ue+Ce.width/2,Ue+=Ce.width)})})}return kt}function P(Re,Xe,it){var ot=0;if(it===null){for(var tt=[],lt=0;ltXe.source.column)}function B(Re,Xe){var it=0;Re.sourceLinks.forEach(function(tt){it=tt.circular&&!Ae(tt,Xe)?it+1:it});var ot=0;return Re.targetLinks.forEach(function(tt){ot=tt.circular&&!Ae(tt,Xe)?ot+1:ot}),it+ot}function O(Re){var Xe=Re.source.sourceLinks,it=0;Xe.forEach(function(lt){it=lt.circular?it+1:it});var ot=Re.target.targetLinks,tt=0;return ot.forEach(function(lt){tt=lt.circular?tt+1:tt}),!(it>1||tt>1)}function I(Re,Xe,it){return Re.sort(W),Re.forEach(function(ot,tt){var lt=0;if(Ae(ot,it)&&O(ot))ot.circularPathData.verticalBuffer=lt+ot.width/2;else{var Ee=0;for(Ee;Eelt?_e:lt}ot.circularPathData.verticalBuffer=lt+ot.width/2}}),Re}function N(Re,Xe,it,ot){var tt=5,lt=x.min(Re.links,function(fe){return fe.source.y0});Re.links.forEach(function(fe){fe.circular&&(fe.circularPathData={})});var Ee=Re.links.filter(function(fe){return fe.circularLinkType=="top"});I(Ee,Xe,ot);var _e=Re.links.filter(function(fe){return fe.circularLinkType=="bottom"});I(_e,Xe,ot),Re.links.forEach(function(fe){if(fe.circular){if(fe.circularPathData.arcRadius=fe.width+u,fe.circularPathData.leftNodeBuffer=tt,fe.circularPathData.rightNodeBuffer=tt,fe.circularPathData.sourceWidth=fe.source.x1-fe.source.x0,fe.circularPathData.sourceX=fe.source.x0+fe.circularPathData.sourceWidth,fe.circularPathData.targetX=fe.target.x0,fe.circularPathData.sourceY=fe.y0,fe.circularPathData.targetY=fe.y1,Ae(fe,ot)&&O(fe))fe.circularPathData.leftSmallArcRadius=u+fe.width/2,fe.circularPathData.leftLargeArcRadius=u+fe.width/2,fe.circularPathData.rightSmallArcRadius=u+fe.width/2,fe.circularPathData.rightLargeArcRadius=u+fe.width/2,fe.circularLinkType=="bottom"?(fe.circularPathData.verticalFullExtent=fe.source.y1+p+fe.circularPathData.verticalBuffer,fe.circularPathData.verticalLeftInnerExtent=fe.circularPathData.verticalFullExtent-fe.circularPathData.leftLargeArcRadius,fe.circularPathData.verticalRightInnerExtent=fe.circularPathData.verticalFullExtent-fe.circularPathData.rightLargeArcRadius):(fe.circularPathData.verticalFullExtent=fe.source.y0-p-fe.circularPathData.verticalBuffer,fe.circularPathData.verticalLeftInnerExtent=fe.circularPathData.verticalFullExtent+fe.circularPathData.leftLargeArcRadius,fe.circularPathData.verticalRightInnerExtent=fe.circularPathData.verticalFullExtent+fe.circularPathData.rightLargeArcRadius);else{var Fe=fe.source.column,rt=fe.circularLinkType,st=Re.links.filter(function(kt){return kt.source.column==Fe&&kt.circularLinkType==rt});fe.circularLinkType=="bottom"?st.sort(ue):st.sort(Q);var Qe=0;st.forEach(function(kt,Vt){kt.circularLinkID==fe.circularLinkID&&(fe.circularPathData.leftSmallArcRadius=u+fe.width/2+Qe,fe.circularPathData.leftLargeArcRadius=u+fe.width/2+Vt*Xe+Qe),Qe=Qe+kt.width}),Fe=fe.target.column,st=Re.links.filter(function(kt){return kt.target.column==Fe&&kt.circularLinkType==rt}),fe.circularLinkType=="bottom"?st.sort(he):st.sort(le),Qe=0,st.forEach(function(kt,Vt){kt.circularLinkID==fe.circularLinkID&&(fe.circularPathData.rightSmallArcRadius=u+fe.width/2+Qe,fe.circularPathData.rightLargeArcRadius=u+fe.width/2+Vt*Xe+Qe),Qe=Qe+kt.width}),fe.circularLinkType=="bottom"?(fe.circularPathData.verticalFullExtent=Math.max(it,fe.source.y1,fe.target.y1)+p+fe.circularPathData.verticalBuffer,fe.circularPathData.verticalLeftInnerExtent=fe.circularPathData.verticalFullExtent-fe.circularPathData.leftLargeArcRadius,fe.circularPathData.verticalRightInnerExtent=fe.circularPathData.verticalFullExtent-fe.circularPathData.rightLargeArcRadius):(fe.circularPathData.verticalFullExtent=lt-p-fe.circularPathData.verticalBuffer,fe.circularPathData.verticalLeftInnerExtent=fe.circularPathData.verticalFullExtent+fe.circularPathData.leftLargeArcRadius,fe.circularPathData.verticalRightInnerExtent=fe.circularPathData.verticalFullExtent+fe.circularPathData.rightLargeArcRadius)}fe.circularPathData.leftInnerExtent=fe.circularPathData.sourceX+fe.circularPathData.leftNodeBuffer,fe.circularPathData.rightInnerExtent=fe.circularPathData.targetX-fe.circularPathData.rightNodeBuffer,fe.circularPathData.leftFullExtent=fe.circularPathData.sourceX+fe.circularPathData.leftLargeArcRadius+fe.circularPathData.leftNodeBuffer,fe.circularPathData.rightFullExtent=fe.circularPathData.targetX-fe.circularPathData.rightLargeArcRadius-fe.circularPathData.rightNodeBuffer}if(fe.circular)fe.path=U(fe);else{var Lt=M.linkHorizontal().source(function(kt){var Vt=kt.source.x0+(kt.source.x1-kt.source.x0),Zt=kt.y0;return[Vt,Zt]}).target(function(kt){var Vt=kt.target.x0,Zt=kt.y1;return[Vt,Zt]});fe.path=Lt(fe)}})}function U(Re){var Xe="";return Re.circularLinkType=="top"?Xe="M"+Re.circularPathData.sourceX+" "+Re.circularPathData.sourceY+" L"+Re.circularPathData.leftInnerExtent+" "+Re.circularPathData.sourceY+" A"+Re.circularPathData.leftLargeArcRadius+" "+Re.circularPathData.leftSmallArcRadius+" 0 0 0 "+Re.circularPathData.leftFullExtent+" "+(Re.circularPathData.sourceY-Re.circularPathData.leftSmallArcRadius)+" L"+Re.circularPathData.leftFullExtent+" "+Re.circularPathData.verticalLeftInnerExtent+" A"+Re.circularPathData.leftLargeArcRadius+" "+Re.circularPathData.leftLargeArcRadius+" 0 0 0 "+Re.circularPathData.leftInnerExtent+" "+Re.circularPathData.verticalFullExtent+" L"+Re.circularPathData.rightInnerExtent+" "+Re.circularPathData.verticalFullExtent+" A"+Re.circularPathData.rightLargeArcRadius+" "+Re.circularPathData.rightLargeArcRadius+" 0 0 0 "+Re.circularPathData.rightFullExtent+" "+Re.circularPathData.verticalRightInnerExtent+" L"+Re.circularPathData.rightFullExtent+" "+(Re.circularPathData.targetY-Re.circularPathData.rightSmallArcRadius)+" A"+Re.circularPathData.rightLargeArcRadius+" "+Re.circularPathData.rightSmallArcRadius+" 0 0 0 "+Re.circularPathData.rightInnerExtent+" "+Re.circularPathData.targetY+" L"+Re.circularPathData.targetX+" "+Re.circularPathData.targetY:Xe="M"+Re.circularPathData.sourceX+" "+Re.circularPathData.sourceY+" L"+Re.circularPathData.leftInnerExtent+" "+Re.circularPathData.sourceY+" A"+Re.circularPathData.leftLargeArcRadius+" "+Re.circularPathData.leftSmallArcRadius+" 0 0 1 "+Re.circularPathData.leftFullExtent+" "+(Re.circularPathData.sourceY+Re.circularPathData.leftSmallArcRadius)+" L"+Re.circularPathData.leftFullExtent+" "+Re.circularPathData.verticalLeftInnerExtent+" A"+Re.circularPathData.leftLargeArcRadius+" "+Re.circularPathData.leftLargeArcRadius+" 0 0 1 "+Re.circularPathData.leftInnerExtent+" "+Re.circularPathData.verticalFullExtent+" L"+Re.circularPathData.rightInnerExtent+" "+Re.circularPathData.verticalFullExtent+" A"+Re.circularPathData.rightLargeArcRadius+" "+Re.circularPathData.rightLargeArcRadius+" 0 0 1 "+Re.circularPathData.rightFullExtent+" "+Re.circularPathData.verticalRightInnerExtent+" L"+Re.circularPathData.rightFullExtent+" "+(Re.circularPathData.targetY+Re.circularPathData.rightSmallArcRadius)+" A"+Re.circularPathData.rightLargeArcRadius+" "+Re.circularPathData.rightSmallArcRadius+" 0 0 1 "+Re.circularPathData.rightInnerExtent+" "+Re.circularPathData.targetY+" L"+Re.circularPathData.targetX+" "+Re.circularPathData.targetY,Xe}function W(Re,Xe){return G(Re)==G(Xe)?Re.circularLinkType=="bottom"?ue(Re,Xe):Q(Re,Xe):G(Xe)-G(Re)}function Q(Re,Xe){return Re.y0-Xe.y0}function ue(Re,Xe){return Xe.y0-Re.y0}function le(Re,Xe){return Re.y1-Xe.y1}function he(Re,Xe){return Xe.y1-Re.y1}function G(Re){return Re.target.column-Re.source.column}function $(Re){return Re.target.x0-Re.source.x1}function J(Re,Xe){var it=z(Re),ot=$(Xe)/Math.tan(it),tt=be(Re)=="up"?Re.y1+ot:Re.y1-ot;return tt}function X(Re,Xe){var it=z(Re),ot=$(Xe)/Math.tan(it),tt=be(Re)=="up"?Re.y1-ot:Re.y1+ot;return tt}function oe(Re,Xe,it,ot){Re.links.forEach(function(tt){if(!tt.circular&&tt.target.column-tt.source.column>1){var lt=tt.source.column+1,Ee=tt.target.column-1,_e=1,fe=Ee-lt+1;for(_e=1;lt<=Ee;lt++,_e++)Re.nodes.forEach(function(Fe){if(Fe.column==lt){var rt=_e/(fe+1),st=Math.pow(1-rt,3),Qe=3*rt*Math.pow(1-rt,2),Lt=3*Math.pow(rt,2)*(1-rt),kt=Math.pow(rt,3),Vt=st*tt.y0+Qe*tt.y0+Lt*tt.y1+kt*tt.y1,Zt=Vt-tt.width/2,Sr=Vt+tt.width/2,xr;Zt>Fe.y0&&ZtFe.y0&&SrFe.y1&&j(jr,xr,Xe,it)})):ZtFe.y1&&(xr=Sr-Fe.y0+10,Fe=j(Fe,xr,Xe,it),Re.nodes.forEach(function(jr){b(jr,ot)==b(Fe,ot)||jr.column!=Fe.column||jr.y0Fe.y1&&j(jr,xr,Xe,it)}))}})}})}function ie(Re,Xe){return Re.y0>Xe.y0&&Re.y0Xe.y0&&Re.y1Xe.y1}function j(Re,Xe,it,ot){return Re.y0+Xe>=it&&Re.y1+Xe<=ot&&(Re.y0=Re.y0+Xe,Re.y1=Re.y1+Xe,Re.targetLinks.forEach(function(tt){tt.y1=tt.y1+Xe}),Re.sourceLinks.forEach(function(tt){tt.y0=tt.y0+Xe})),Re}function ee(Re,Xe,it,ot){Re.nodes.forEach(function(tt){ot&&tt.y+(tt.y1-tt.y0)>Xe&&(tt.y=tt.y-(tt.y+(tt.y1-tt.y0)-Xe));var lt=Re.links.filter(function(fe){return b(fe.source,it)==b(tt,it)}),Ee=lt.length;Ee>1&<.sort(function(fe,Fe){if(!fe.circular&&!Fe.circular){if(fe.target.column==Fe.target.column)return fe.y1-Fe.y1;if(ce(fe,Fe)){if(fe.target.column>Fe.target.column){var rt=X(Fe,fe);return fe.y1-rt}if(Fe.target.column>fe.target.column){var st=X(fe,Fe);return st-Fe.y1}}else return fe.y1-Fe.y1}if(fe.circular&&!Fe.circular)return fe.circularLinkType=="top"?-1:1;if(Fe.circular&&!fe.circular)return Fe.circularLinkType=="top"?1:-1;if(fe.circular&&Fe.circular)return fe.circularLinkType===Fe.circularLinkType&&fe.circularLinkType=="top"?fe.target.column===Fe.target.column?fe.target.y1-Fe.target.y1:Fe.target.column-fe.target.column:fe.circularLinkType===Fe.circularLinkType&&fe.circularLinkType=="bottom"?fe.target.column===Fe.target.column?Fe.target.y1-fe.target.y1:fe.target.column-Fe.target.column:fe.circularLinkType=="top"?-1:1});var _e=tt.y0;lt.forEach(function(fe){fe.y0=_e+fe.width/2,_e=_e+fe.width}),lt.forEach(function(fe,Fe){if(fe.circularLinkType=="bottom"){var rt=Fe+1,st=0;for(rt;rt1&&tt.sort(function(_e,fe){if(!_e.circular&&!fe.circular){if(_e.source.column==fe.source.column)return _e.y0-fe.y0;if(ce(_e,fe)){if(fe.source.column<_e.source.column){var Fe=J(fe,_e);return _e.y0-Fe}if(_e.source.column0?"up":"down"}function Ae(Re,Xe){return b(Re.source,Xe)==b(Re.target,Xe)}function ze(Re,Xe,it){var ot=Re.nodes,tt=Re.links,lt=!1,Ee=!1;if(tt.forEach(function(Qe){Qe.circularLinkType=="top"?lt=!0:Qe.circularLinkType=="bottom"&&(Ee=!0)}),lt==!1||Ee==!1){var _e=x.min(ot,function(Qe){return Qe.y0}),fe=x.max(ot,function(Qe){return Qe.y1}),Fe=fe-_e,rt=it-Xe,st=rt/Fe;ot.forEach(function(Qe){var Lt=(Qe.y1-Qe.y0)*st;Qe.y0=(Qe.y0-_e)*st,Qe.y1=Qe.y0+Lt}),tt.forEach(function(Qe){Qe.y0=(Qe.y0-_e)*st,Qe.y1=(Qe.y1-_e)*st,Qe.width=Qe.width*st})}}d.sankeyCircular=h,d.sankeyCenter=i,d.sankeyLeft=r,d.sankeyRight=o,d.sankeyJustify=a,Object.defineProperty(d,"__esModule",{value:!0})})}}),U6=Ze({"src/traces/sankey/constants.js"(Z,q){"use strict";q.exports={nodeTextOffsetHorizontal:4,nodeTextOffsetVertical:3,nodePadAcross:10,sankeyIterations:50,forceIterations:5,forceTicksPerFrame:10,duration:500,ease:"linear",cn:{sankey:"sankey",sankeyLinks:"sankey-links",sankeyLink:"sankey-link",sankeyNodeSet:"sankey-node-set",sankeyNode:"sankey-node",nodeRect:"node-rect",nodeLabel:"node-label"}}}}),dG=Ze({"src/traces/sankey/render.js"(Z,q){"use strict";var d=uG(),x=(hg(),nh(f0)).interpolateNumber,A=On(),M=fG(),e=pG(),t=U6(),r=Ch(),o=Yn(),a=as(),i=ca(),n=i.strTranslate,s=i.strRotate,c=Cv(),f=c.keyFun,g=c.repeat,v=c.unwrap,T=fu(),l=oo(),_=mh(),w=_.CAP_SHIFT,S=_.LINE_SPACING,E=3;function y(J,X,oe){var ie=v(X),j=ie.trace,ee=j.domain,re=j.orientation==="h",ce=j.node.pad,be=j.node.thickness,Ae={justify:M.sankeyJustify,left:M.sankeyLeft,right:M.sankeyRight,center:M.sankeyCenter}[j.node.align],ze=J.width*(ee.x[1]-ee.x[0]),Re=J.height*(ee.y[1]-ee.y[0]),Xe=ie._nodes,it=ie._links,ot=ie.circular,tt;ot?tt=e.sankeyCircular().circularLinkGap(0):tt=M.sankey(),tt.iterations(t.sankeyIterations).size(re?[ze,Re]:[Re,ze]).nodeWidth(be).nodePadding(ce).nodeId(function(jr){return jr.pointNumber}).nodeAlign(Ae).nodes(Xe).links(it);var lt=tt();tt.nodePadding()=Be||(bt=Be-Ir.y0,bt>1e-6&&(Ir.y0+=bt,Ir.y1+=bt)),Be=Ir.y1+ce})}function Vt(jr){var wr=jr.map(function(qe,Ce){return{x0:qe.x0,index:Ce}}).sort(function(qe,Ce){return qe.x0-Ce.x0}),Ir=[],bt=-1,Be,Ke=-1/0,Ue;for(Ee=0;EeKe+be&&(bt+=1,Be=Me.x0),Ke=Me.x0,Ir[bt]||(Ir[bt]=[]),Ir[bt].push(Me),Ue=Be-Me.x0,Me.x0+=Ue,Me.x1+=Ue}return Ir}if(j.node.x.length&&j.node.y.length){for(Ee=0;Ee0?" L "+j.targetX+" "+j.targetY:"")+"Z"):(oe="M "+(j.targetX-X)+" "+(j.targetY-ie)+" L "+(j.rightInnerExtent-X)+" "+(j.targetY-ie)+" A "+(j.rightLargeArcRadius+ie)+" "+(j.rightSmallArcRadius+ie)+" 0 0 0 "+(j.rightFullExtent-ie-X)+" "+(j.targetY+j.rightSmallArcRadius)+" L "+(j.rightFullExtent-ie-X)+" "+j.verticalRightInnerExtent,ee&&re?oe+=" A "+(j.rightLargeArcRadius+ie)+" "+(j.rightLargeArcRadius+ie)+" 0 0 0 "+(j.rightInnerExtent-ie-X)+" "+(j.verticalFullExtent+ie)+" L "+(j.rightFullExtent+ie-X-(j.rightLargeArcRadius-ie))+" "+(j.verticalFullExtent+ie)+" A "+(j.rightLargeArcRadius+ie)+" "+(j.rightLargeArcRadius+ie)+" 0 0 0 "+(j.leftFullExtent+ie)+" "+j.verticalLeftInnerExtent:ee?oe+=" A "+(j.rightLargeArcRadius-ie)+" "+(j.rightSmallArcRadius-ie)+" 0 0 1 "+(j.rightFullExtent-X-ie-(j.rightLargeArcRadius-ie))+" "+(j.verticalFullExtent-ie)+" L "+(j.leftFullExtent+ie+(j.rightLargeArcRadius-ie))+" "+(j.verticalFullExtent-ie)+" A "+(j.rightLargeArcRadius-ie)+" "+(j.rightSmallArcRadius-ie)+" 0 0 1 "+(j.leftFullExtent+ie)+" "+j.verticalLeftInnerExtent:oe+=" A "+(j.rightLargeArcRadius+ie)+" "+(j.rightLargeArcRadius+ie)+" 0 0 0 "+(j.rightInnerExtent-X)+" "+(j.verticalFullExtent+ie)+" L "+j.leftInnerExtent+" "+(j.verticalFullExtent+ie)+" A "+(j.leftLargeArcRadius+ie)+" "+(j.leftLargeArcRadius+ie)+" 0 0 0 "+(j.leftFullExtent+ie)+" "+j.verticalLeftInnerExtent,oe+=" L "+(j.leftFullExtent+ie)+" "+(j.sourceY+j.leftSmallArcRadius)+" A "+(j.leftLargeArcRadius+ie)+" "+(j.leftSmallArcRadius+ie)+" 0 0 0 "+j.leftInnerExtent+" "+(j.sourceY-ie)+" L "+j.sourceX+" "+(j.sourceY-ie)+" L "+j.sourceX+" "+(j.sourceY+ie)+" L "+j.leftInnerExtent+" "+(j.sourceY+ie)+" A "+(j.leftLargeArcRadius-ie)+" "+(j.leftSmallArcRadius-ie)+" 0 0 1 "+(j.leftFullExtent-ie)+" "+(j.sourceY+j.leftSmallArcRadius)+" L "+(j.leftFullExtent-ie)+" "+j.verticalLeftInnerExtent,ee&&re?oe+=" A "+(j.rightLargeArcRadius-ie)+" "+(j.rightSmallArcRadius-ie)+" 0 0 1 "+(j.leftFullExtent-ie-(j.rightLargeArcRadius-ie))+" "+(j.verticalFullExtent-ie)+" L "+(j.rightFullExtent+ie-X+(j.rightLargeArcRadius-ie))+" "+(j.verticalFullExtent-ie)+" A "+(j.rightLargeArcRadius-ie)+" "+(j.rightSmallArcRadius-ie)+" 0 0 1 "+(j.rightFullExtent+ie-X)+" "+j.verticalRightInnerExtent:ee?oe+=" A "+(j.rightLargeArcRadius+ie)+" "+(j.rightLargeArcRadius+ie)+" 0 0 0 "+(j.leftFullExtent+ie)+" "+(j.verticalFullExtent+ie)+" L "+(j.rightFullExtent-X-ie)+" "+(j.verticalFullExtent+ie)+" A "+(j.rightLargeArcRadius+ie)+" "+(j.rightLargeArcRadius+ie)+" 0 0 0 "+(j.rightFullExtent+ie-X)+" "+j.verticalRightInnerExtent:oe+=" A "+(j.leftLargeArcRadius-ie)+" "+(j.leftLargeArcRadius-ie)+" 0 0 1 "+j.leftInnerExtent+" "+(j.verticalFullExtent-ie)+" L "+(j.rightInnerExtent-X)+" "+(j.verticalFullExtent-ie)+" A "+(j.rightLargeArcRadius-ie)+" "+(j.rightLargeArcRadius-ie)+" 0 0 1 "+(j.rightFullExtent+ie-X)+" "+j.verticalRightInnerExtent,oe+=" L "+(j.rightFullExtent+ie-X)+" "+(j.targetY+j.rightSmallArcRadius)+" A "+(j.rightLargeArcRadius-ie)+" "+(j.rightSmallArcRadius-ie)+" 0 0 1 "+(j.rightInnerExtent-X)+" "+(j.targetY+ie)+" L "+(j.targetX-X)+" "+(j.targetY+ie)+(X>0?" L "+j.targetX+" "+j.targetY:"")+"Z"),oe}function u(){var J=.5;function X(oe){var ie=oe.linkArrowLength;if(oe.link.circular)return p(oe.link,ie);var j=Math.abs((oe.link.target.x0-oe.link.source.x1)/2);ie>j&&(ie=j);var ee=oe.link.source.x1,re=oe.link.target.x0-ie,ce=x(ee,re),be=ce(J),Ae=ce(1-J),ze=oe.link.y0-oe.link.width/2,Re=oe.link.y0+oe.link.width/2,Xe=oe.link.y1-oe.link.width/2,it=oe.link.y1+oe.link.width/2,ot="M"+ee+","+ze,tt="C"+be+","+ze+" "+Ae+","+Xe+" "+re+","+Xe,lt="C"+Ae+","+it+" "+be+","+Re+" "+ee+","+Re,Ee=ie>0?"L"+(re+ie)+","+(Xe+oe.link.width/2):"";return Ee+="L"+re+","+it,ot+tt+Ee+lt+"Z"}return X}function m(J,X){var oe=r(X.color),ie=t.nodePadAcross,j=J.nodePad/2;X.dx=X.x1-X.x0,X.dy=X.y1-X.y0;var ee=X.dx,re=Math.max(.5,X.dy),ce="node_"+X.pointNumber;return X.group&&(ce=i.randstr()),X.trace=J.trace,X.curveNumber=J.trace.index,{index:X.pointNumber,key:ce,partOfGroup:X.partOfGroup||!1,group:X.group,traceId:J.key,trace:J.trace,node:X,nodePad:J.nodePad,nodeLineColor:J.nodeLineColor,nodeLineWidth:J.nodeLineWidth,textFont:J.textFont,size:J.horizontal?J.height:J.width,visibleWidth:Math.ceil(ee),visibleHeight:re,zoneX:-ie,zoneY:-j,zoneWidth:ee+2*ie,zoneHeight:re+2*j,labelY:J.horizontal?X.dy/2+1:X.dx/2+1,left:X.originalLayer===1,sizeAcross:J.width,forceLayouts:J.forceLayouts,horizontal:J.horizontal,darkBackground:oe.getBrightness()<=128,tinyColorHue:o.tinyRGB(oe),tinyColorAlpha:oe.getAlpha(),valueFormat:J.valueFormat,valueSuffix:J.valueSuffix,sankey:J.sankey,graph:J.graph,arrangement:J.arrangement,uniqueNodeLabelPathId:[J.guid,J.key,ce].join("_"),interactionState:J.interactionState,figure:J}}function h(J){J.attr("transform",function(X){return n(X.node.x0.toFixed(3),X.node.y0.toFixed(3))})}function P(J){J.call(h)}function L(J,X){J.call(P),X.attr("d",u())}function z(J){J.attr("width",function(X){return X.node.x1-X.node.x0}).attr("height",function(X){return X.visibleHeight})}function F(J){return J.link.width>1||J.linkLineWidth>0}function B(J){var X=n(J.translateX,J.translateY);return X+(J.horizontal?"matrix(1 0 0 1 0 0)":"matrix(0 1 1 0 0 0)")}function O(J,X,oe){J.on(".basic",null).on("mouseover.basic",function(ie){!ie.interactionState.dragInProgress&&!ie.partOfGroup&&(oe.hover(this,ie,X),ie.interactionState.hovered=[this,ie])}).on("mousemove.basic",function(ie){!ie.interactionState.dragInProgress&&!ie.partOfGroup&&(oe.follow(this,ie),ie.interactionState.hovered=[this,ie])}).on("mouseout.basic",function(ie){!ie.interactionState.dragInProgress&&!ie.partOfGroup&&(oe.unhover(this,ie,X),ie.interactionState.hovered=!1)}).on("click.basic",function(ie){ie.interactionState.hovered&&(oe.unhover(this,ie,X),ie.interactionState.hovered=!1),!ie.interactionState.dragInProgress&&!ie.partOfGroup&&oe.select(this,ie,X)})}function I(J,X,oe,ie){var j=A.behavior.drag().origin(function(ee){return{x:ee.node.x0+ee.visibleWidth/2,y:ee.node.y0+ee.visibleHeight/2}}).on("dragstart",function(ee){if(ee.arrangement!=="fixed"&&(i.ensureSingle(ie._fullLayout._infolayer,"g","dragcover",function(ce){ie._fullLayout._dragCover=ce}),i.raiseToTop(this),ee.interactionState.dragInProgress=ee.node,le(ee.node),ee.interactionState.hovered&&(oe.nodeEvents.unhover.apply(0,ee.interactionState.hovered),ee.interactionState.hovered=!1),ee.arrangement==="snap")){var re=ee.traceId+"|"+ee.key;ee.forceLayouts[re]?ee.forceLayouts[re].alpha(1):N(J,re,ee,ie),U(J,X,ee,re,ie)}}).on("drag",function(ee){if(ee.arrangement!=="fixed"){var re=A.event.x,ce=A.event.y;ee.arrangement==="snap"?(ee.node.x0=re-ee.visibleWidth/2,ee.node.x1=re+ee.visibleWidth/2,ee.node.y0=ce-ee.visibleHeight/2,ee.node.y1=ce+ee.visibleHeight/2):(ee.arrangement==="freeform"&&(ee.node.x0=re-ee.visibleWidth/2,ee.node.x1=re+ee.visibleWidth/2),ce=Math.max(0,Math.min(ee.size-ee.visibleHeight/2,ce)),ee.node.y0=ce-ee.visibleHeight/2,ee.node.y1=ce+ee.visibleHeight/2),le(ee.node),ee.arrangement!=="snap"&&(ee.sankey.update(ee.graph),L(J.filter(he(ee)),X))}}).on("dragend",function(ee){if(ee.arrangement!=="fixed"){ee.interactionState.dragInProgress=!1;for(var re=0;re0)window.requestAnimationFrame(ee);else{var be=oe.node.originalX;oe.node.x0=be-oe.visibleWidth/2,oe.node.x1=be+oe.visibleWidth/2,Q(oe,j)}})}function W(J,X,oe,ie){return function(){for(var ee=0,re=0;re0&&ie.forceLayouts[X].alpha(0)}}function Q(J,X){for(var oe=[],ie=[],j=0;j"),color:_(G,"bgcolor")||t.addOpacity(ie.color,1),borderColor:_(G,"bordercolor"),fontFamily:_(G,"font.family"),fontSize:_(G,"font.size"),fontColor:_(G,"font.color"),fontWeight:_(G,"font.weight"),fontStyle:_(G,"font.style"),fontVariant:_(G,"font.variant"),fontTextcase:_(G,"font.textcase"),fontLineposition:_(G,"font.lineposition"),fontShadow:_(G,"font.shadow"),nameLength:_(G,"namelength"),textAlign:_(G,"align"),idealAlign:d.event.x"),color:_(G,"bgcolor")||he.tinyColorHue,borderColor:_(G,"bordercolor"),fontFamily:_(G,"font.family"),fontSize:_(G,"font.size"),fontColor:_(G,"font.color"),fontWeight:_(G,"font.weight"),fontStyle:_(G,"font.style"),fontVariant:_(G,"font.variant"),fontTextcase:_(G,"font.textcase"),fontLineposition:_(G,"font.lineposition"),fontShadow:_(G,"font.shadow"),nameLength:_(G,"namelength"),textAlign:_(G,"align"),idealAlign:"left",hovertemplate:G.hovertemplate,hovertemplateLabels:ee,eventData:[he.node]},{container:y._hoverlayer.node(),outerContainer:y._paper.node(),gd:S});n(be,.85),s(be)}}},ue=function(le,he,G){S._fullLayout.hovermode!==!1&&(d.select(le).call(v,he,G),he.node.trace.node.hoverinfo!=="skip"&&(he.node.fullData=he.node.trace,S.emit("plotly_unhover",{event:d.event,points:[he.node]})),e.loneUnhover(y._hoverlayer.node()))};M(S,b,E,{width:p.w,height:p.h,margin:{t:p.t,r:p.r,b:p.b,l:p.l}},{linkEvents:{hover:P,follow:I,unhover:N,select:h},nodeEvents:{hover:W,follow:Q,unhover:ue,select:U}})}}}),vG=Ze({"src/traces/sankey/base_plot.js"(Z){"use strict";var q=pc().overrideAll,d=Hh().getModuleCalcData,x=j6(),A=Xm(),M=Kd(),e=Tp(),t=Tf().prepSelect,r=ca(),o=oo(),a="sankey";Z.name=a,Z.baseLayoutAttrOverrides=q({hoverlabel:A.hoverlabel},"plot","nested"),Z.plot=function(n){var s=d(n.calcdata,a)[0];x(n,s),Z.updateFx(n)},Z.clean=function(n,s,c,f){var g=f._has&&f._has(a),v=s._has&&s._has(a);g&&!v&&(f._paperdiv.selectAll(".sankey").remove(),f._paperdiv.selectAll(".bgsankey").remove())},Z.updateFx=function(n){for(var s=0;s0}q.exports=function(F,B,O,I){var N=F._fullLayout,U;w(O)&&I&&(U=I()),M.makeTraceGroups(N._indicatorlayer,B,"trace").each(function(W){var Q=W[0],ue=Q.trace,le=d.select(this),he=ue._hasGauge,G=ue._isAngular,$=ue._isBullet,J=ue.domain,X={w:N._size.w*(J.x[1]-J.x[0]),h:N._size.h*(J.y[1]-J.y[0]),l:N._size.l+N._size.w*J.x[0],r:N._size.r+N._size.w*(1-J.x[1]),t:N._size.t+N._size.h*(1-J.y[1]),b:N._size.b+N._size.h*J.y[0]},oe=X.l+X.w/2,ie=X.t+X.h/2,j=Math.min(X.w/2,X.h),ee=i.innerRadius*j,re,ce,be,Ae=ue.align||"center";if(ce=ie,!he)re=X.l+l[Ae]*X.w,be=function(fe){return m(fe,X.w,X.h)};else if(G&&(re=oe,ce=ie+j/2,be=function(fe){return h(fe,.9*ee)}),$){var ze=i.bulletPadding,Re=1-i.bulletNumberDomainSize+ze;re=X.l+(Re+(1-Re)*l[Ae])*X.w,be=function(fe){return m(fe,(i.bulletNumberDomainSize-ze)*X.w,X.h)}}y(F,le,W,{numbersX:re,numbersY:ce,numbersScaler:be,transitionOpts:O,onComplete:U});var Xe,it;he&&(Xe={range:ue.gauge.axis.range,color:ue.gauge.bgcolor,line:{color:ue.gauge.bordercolor,width:0},thickness:1},it={range:ue.gauge.axis.range,color:"rgba(0, 0, 0, 0)",line:{color:ue.gauge.bordercolor,width:ue.gauge.borderwidth},thickness:1});var ot=le.selectAll("g.angular").data(G?W:[]);ot.exit().remove();var tt=le.selectAll("g.angularaxis").data(G?W:[]);tt.exit().remove(),G&&E(F,le,W,{radius:j,innerRadius:ee,gauge:ot,layer:tt,size:X,gaugeBg:Xe,gaugeOutline:it,transitionOpts:O,onComplete:U});var lt=le.selectAll("g.bullet").data($?W:[]);lt.exit().remove();var Ee=le.selectAll("g.bulletaxis").data($?W:[]);Ee.exit().remove(),$&&S(F,le,W,{gauge:lt,layer:Ee,size:X,gaugeBg:Xe,gaugeOutline:it,transitionOpts:O,onComplete:U});var _e=le.selectAll("text.title").data(W);_e.exit().remove(),_e.enter().append("text").classed("title",!0),_e.attr("text-anchor",function(){return $?T.right:T[ue.title.align]}).text(ue.title.text).call(a.font,ue.title.font).call(n.convertToTspans,F),_e.attr("transform",function(){var fe=X.l+X.w*l[ue.title.align],Fe,rt=i.titlePadding,st=a.bBox(_e.node());if(he){if(G)if(ue.gauge.axis.visible){var Qe=a.bBox(tt.node());Fe=Qe.top-rt-st.bottom}else Fe=X.t+X.h/2-j/2-st.bottom-rt;$&&(Fe=ce-(st.top+st.bottom)/2,fe=X.l-i.bulletPadding*X.w)}else Fe=ue._numbersTop-rt-st.bottom;return t(fe,Fe)})})};function S(z,F,B,O){var I=B[0].trace,N=O.gauge,U=O.layer,W=O.gaugeBg,Q=O.gaugeOutline,ue=O.size,le=I.domain,he=O.transitionOpts,G=O.onComplete,$,J,X,oe,ie;N.enter().append("g").classed("bullet",!0),N.attr("transform",t(ue.l,ue.t)),U.enter().append("g").classed("bulletaxis",!0).classed("crisp",!0),U.selectAll("g.xbulletaxistick,path,text").remove();var j=ue.h,ee=I.gauge.bar.thickness*j,re=le.x[0],ce=le.x[0]+(le.x[1]-le.x[0])*(I._hasNumber||I._hasDelta?1-i.bulletNumberDomainSize:1);$=u(z,I.gauge.axis),$._id="xbulletaxis",$.domain=[re,ce],$.setScale(),J=s.calcTicks($),X=s.makeTransTickFn($),oe=s.getTickSigns($)[2],ie=ue.t+ue.h,$.visible&&(s.drawTicks(z,$,{vals:$.ticks==="inside"?s.clipEnds($,J):J,layer:U,path:s.makeTickPath($,ie,oe),transFn:X}),s.drawLabels(z,$,{vals:J,layer:U,transFn:X,labelFns:s.makeLabelFns($,ie)}));function be(tt){tt.attr("width",function(lt){return Math.max(0,$.c2p(lt.range[1])-$.c2p(lt.range[0]))}).attr("x",function(lt){return $.c2p(lt.range[0])}).attr("y",function(lt){return .5*(1-lt.thickness)*j}).attr("height",function(lt){return lt.thickness*j})}var Ae=[W].concat(I.gauge.steps),ze=N.selectAll("g.bg-bullet").data(Ae);ze.enter().append("g").classed("bg-bullet",!0).append("rect"),ze.select("rect").call(be).call(b),ze.exit().remove();var Re=N.selectAll("g.value-bullet").data([I.gauge.bar]);Re.enter().append("g").classed("value-bullet",!0).append("rect"),Re.select("rect").attr("height",ee).attr("y",(j-ee)/2).call(b),w(he)?Re.select("rect").transition().duration(he.duration).ease(he.easing).each("end",function(){G&&G()}).each("interrupt",function(){G&&G()}).attr("width",Math.max(0,$.c2p(Math.min(I.gauge.axis.range[1],B[0].y)))):Re.select("rect").attr("width",typeof B[0].y=="number"?Math.max(0,$.c2p(Math.min(I.gauge.axis.range[1],B[0].y))):0),Re.exit().remove();var Xe=B.filter(function(){return I.gauge.threshold.value||I.gauge.threshold.value===0}),it=N.selectAll("g.threshold-bullet").data(Xe);it.enter().append("g").classed("threshold-bullet",!0).append("line"),it.select("line").attr("x1",$.c2p(I.gauge.threshold.value)).attr("x2",$.c2p(I.gauge.threshold.value)).attr("y1",(1-I.gauge.threshold.thickness)/2*j).attr("y2",(1-(1-I.gauge.threshold.thickness)/2)*j).call(v.stroke,I.gauge.threshold.line.color).style("stroke-width",I.gauge.threshold.line.width),it.exit().remove();var ot=N.selectAll("g.gauge-outline").data([Q]);ot.enter().append("g").classed("gauge-outline",!0).append("rect"),ot.select("rect").call(be).call(b),ot.exit().remove()}function E(z,F,B,O){var I=B[0].trace,N=O.size,U=O.radius,W=O.innerRadius,Q=O.gaugeBg,ue=O.gaugeOutline,le=[N.l+N.w/2,N.t+N.h/2+U/2],he=O.gauge,G=O.layer,$=O.transitionOpts,J=O.onComplete,X=Math.PI/2;function oe(Lt){var kt=I.gauge.axis.range[0],Vt=I.gauge.axis.range[1],Zt=(Lt-kt)/(Vt-kt)*Math.PI-X;return Zt<-X?-X:Zt>X?X:Zt}function ie(Lt){return d.svg.arc().innerRadius((W+U)/2-Lt/2*(U-W)).outerRadius((W+U)/2+Lt/2*(U-W)).startAngle(-X)}function j(Lt){Lt.attr("d",function(kt){return ie(kt.thickness).startAngle(oe(kt.range[0])).endAngle(oe(kt.range[1]))()})}var ee,re,ce,be;he.enter().append("g").classed("angular",!0),he.attr("transform",t(le[0],le[1])),G.enter().append("g").classed("angularaxis",!0).classed("crisp",!0),G.selectAll("g.xangularaxistick,path,text").remove(),ee=u(z,I.gauge.axis),ee.type="linear",ee.range=I.gauge.axis.range,ee._id="xangularaxis",ee.ticklabeloverflow="allow",ee.setScale();var Ae=function(Lt){return(ee.range[0]-Lt.x)/(ee.range[1]-ee.range[0])*Math.PI+Math.PI},ze={},Re=s.makeLabelFns(ee,0),Xe=Re.labelStandoff;ze.xFn=function(Lt){var kt=Ae(Lt);return Math.cos(kt)*Xe},ze.yFn=function(Lt){var kt=Ae(Lt),Vt=Math.sin(kt)>0?.2:1;return-Math.sin(kt)*(Xe+Lt.fontSize*Vt)+Math.abs(Math.cos(kt))*(Lt.fontSize*o)},ze.anchorFn=function(Lt){var kt=Ae(Lt),Vt=Math.cos(kt);return Math.abs(Vt)<.1?"middle":Vt>0?"start":"end"},ze.heightFn=function(Lt,kt,Vt){var Zt=Ae(Lt);return-.5*(1+Math.sin(Zt))*Vt};var it=function(Lt){return t(le[0]+U*Math.cos(Lt),le[1]-U*Math.sin(Lt))};ce=function(Lt){return it(Ae(Lt))};var ot=function(Lt){var kt=Ae(Lt);return it(kt)+"rotate("+-r(kt)+")"};if(re=s.calcTicks(ee),be=s.getTickSigns(ee)[2],ee.visible){be=ee.ticks==="inside"?-1:1;var tt=(ee.linewidth||1)/2;s.drawTicks(z,ee,{vals:re,layer:G,path:"M"+be*tt+",0h"+be*ee.ticklen,transFn:ot}),s.drawLabels(z,ee,{vals:re,layer:G,transFn:ce,labelFns:ze})}var lt=[Q].concat(I.gauge.steps),Ee=he.selectAll("g.bg-arc").data(lt);Ee.enter().append("g").classed("bg-arc",!0).append("path"),Ee.select("path").call(j).call(b),Ee.exit().remove();var _e=ie(I.gauge.bar.thickness),fe=he.selectAll("g.value-arc").data([I.gauge.bar]);fe.enter().append("g").classed("value-arc",!0).append("path");var Fe=fe.select("path");w($)?(Fe.transition().duration($.duration).ease($.easing).each("end",function(){J&&J()}).each("interrupt",function(){J&&J()}).attrTween("d",p(_e,oe(B[0].lastY),oe(B[0].y))),I._lastValue=B[0].y):Fe.attr("d",typeof B[0].y=="number"?_e.endAngle(oe(B[0].y)):"M0,0Z"),Fe.call(b),fe.exit().remove(),lt=[];var rt=I.gauge.threshold.value;(rt||rt===0)&<.push({range:[rt,rt],color:I.gauge.threshold.color,line:{color:I.gauge.threshold.line.color,width:I.gauge.threshold.line.width},thickness:I.gauge.threshold.thickness});var st=he.selectAll("g.threshold-arc").data(lt);st.enter().append("g").classed("threshold-arc",!0).append("path"),st.select("path").call(j).call(b),st.exit().remove();var Qe=he.selectAll("g.gauge-outline").data([ue]);Qe.enter().append("g").classed("gauge-outline",!0).append("path"),Qe.select("path").call(j).call(b),Qe.exit().remove()}function y(z,F,B,O){var I=B[0].trace,N=O.numbersX,U=O.numbersY,W=I.align||"center",Q=T[W],ue=O.transitionOpts,le=O.onComplete,he=M.ensureSingle(F,"g","numbers"),G,$,J,X=[];I._hasNumber&&X.push("number"),I._hasDelta&&(X.push("delta"),I.delta.position==="left"&&X.reverse());var oe=he.selectAll("text").data(X);oe.enter().append("text"),oe.attr("text-anchor",function(){return Q}).attr("class",function(it){return it}).attr("x",null).attr("y",null).attr("dx",null).attr("dy",null),oe.exit().remove();function ie(it,ot,tt,lt){if(it.match("s")&&tt>=0!=lt>=0&&!ot(tt).slice(-1).match(_)&&!ot(lt).slice(-1).match(_)){var Ee=it.slice().replace("s","f").replace(/\d+/,function(fe){return parseInt(fe)-1}),_e=u(z,{tickformat:Ee});return function(fe){return Math.abs(fe)<1?s.tickText(_e,fe).text:ot(fe)}}else return ot}function j(){var it=u(z,{tickformat:I.number.valueformat},I._range);it.setScale(),s.prepTicks(it);var ot=function(fe){return s.tickText(it,fe).text},tt=I.number.suffix,lt=I.number.prefix,Ee=he.select("text.number");function _e(){var fe=typeof B[0].y=="number"?lt+ot(B[0].y)+tt:"-";Ee.text(fe).call(a.font,I.number.font).call(n.convertToTspans,z)}return w(ue)?Ee.transition().duration(ue.duration).ease(ue.easing).each("end",function(){_e(),le&&le()}).each("interrupt",function(){_e(),le&&le()}).attrTween("text",function(){var fe=d.select(this),Fe=A(B[0].lastY,B[0].y);I._lastValue=B[0].y;var rt=ie(I.number.valueformat,ot,B[0].lastY,B[0].y);return function(st){fe.text(lt+rt(Fe(st))+tt)}}):_e(),G=P(lt+ot(B[0].y)+tt,I.number.font,Q,z),Ee}function ee(){var it=u(z,{tickformat:I.delta.valueformat},I._range);it.setScale(),s.prepTicks(it);var ot=function(st){return s.tickText(it,st).text},tt=I.delta.suffix,lt=I.delta.prefix,Ee=function(st){var Qe=I.delta.relative?st.relativeDelta:st.delta;return Qe},_e=function(st,Qe){return st===0||typeof st!="number"||isNaN(st)?"-":(st>0?I.delta.increasing.symbol:I.delta.decreasing.symbol)+lt+Qe(st)+tt},fe=function(st){return st.delta>=0?I.delta.increasing.color:I.delta.decreasing.color};I._deltaLastValue===void 0&&(I._deltaLastValue=Ee(B[0]));var Fe=he.select("text.delta");Fe.call(a.font,I.delta.font).call(v.fill,fe({delta:I._deltaLastValue}));function rt(){Fe.text(_e(Ee(B[0]),ot)).call(v.fill,fe(B[0])).call(n.convertToTspans,z)}return w(ue)?Fe.transition().duration(ue.duration).ease(ue.easing).tween("text",function(){var st=d.select(this),Qe=Ee(B[0]),Lt=I._deltaLastValue,kt=ie(I.delta.valueformat,ot,Lt,Qe),Vt=A(Lt,Qe);return I._deltaLastValue=Qe,function(Zt){st.text(_e(Vt(Zt),kt)),st.call(v.fill,fe({delta:Vt(Zt)}))}}).each("end",function(){rt(),le&&le()}).each("interrupt",function(){rt(),le&&le()}):rt(),$=P(_e(Ee(B[0]),ot),I.delta.font,Q,z),Fe}var re=I.mode+I.align,ce;if(I._hasDelta&&(ce=ee(),re+=I.delta.position+I.delta.font.size+I.delta.font.family+I.delta.valueformat,re+=I.delta.increasing.symbol+I.delta.decreasing.symbol,J=$),I._hasNumber&&(j(),re+=I.number.font.size+I.number.font.family+I.number.valueformat+I.number.suffix+I.number.prefix,J=G),I._hasDelta&&I._hasNumber){var be=[(G.left+G.right)/2,(G.top+G.bottom)/2],Ae=[($.left+$.right)/2,($.top+$.bottom)/2],ze,Re,Xe=.75*I.delta.font.size;I.delta.position==="left"&&(ze=L(I,"deltaPos",0,-1*(G.width*l[I.align]+$.width*(1-l[I.align])+Xe),re,Math.min),Re=be[1]-Ae[1],J={width:G.width+$.width+Xe,height:Math.max(G.height,$.height),left:$.left+ze,right:G.right,top:Math.min(G.top,$.top+Re),bottom:Math.max(G.bottom,$.bottom+Re)}),I.delta.position==="right"&&(ze=L(I,"deltaPos",0,G.width*(1-l[I.align])+$.width*l[I.align]+Xe,re,Math.max),Re=be[1]-Ae[1],J={width:G.width+$.width+Xe,height:Math.max(G.height,$.height),left:G.left,right:$.right+ze,top:Math.min(G.top,$.top+Re),bottom:Math.max(G.bottom,$.bottom+Re)}),I.delta.position==="bottom"&&(ze=null,Re=$.height,J={width:Math.max(G.width,$.width),height:G.height+$.height,left:Math.min(G.left,$.left),right:Math.max(G.right,$.right),top:G.bottom-G.height,bottom:G.bottom+$.height}),I.delta.position==="top"&&(ze=null,Re=G.top,J={width:Math.max(G.width,$.width),height:G.height+$.height,left:Math.min(G.left,$.left),right:Math.max(G.right,$.right),top:G.bottom-G.height-$.height,bottom:G.bottom}),ce.attr({dx:ze,dy:Re})}(I._hasNumber||I._hasDelta)&&he.attr("transform",function(){var it=O.numbersScaler(J);re+=it[2];var ot=L(I,"numbersScale",1,it[0],re,Math.min),tt;I._scaleNumbers||(ot=1),I._isAngular?tt=U-ot*J.bottom:tt=U-ot*(J.top+J.bottom)/2,I._numbersTop=ot*J.top+tt;var lt=J[W];W==="center"&&(lt=(J.left+J.right)/2);var Ee=N-ot*lt;return Ee=L(I,"numbersTranslate",0,Ee,re,Math.max),t(Ee,tt)+e(ot)})}function b(z){z.each(function(F){v.stroke(d.select(this),F.line.color)}).each(function(F){v.fill(d.select(this),F.color)}).style("stroke-width",function(F){return F.line.width})}function p(z,F,B){return function(){var O=x(F,B);return function(I){return z.endAngle(O(I))()}}}function u(z,F,B){var O=z._fullLayout,I=M.extendFlat({type:"linear",ticks:"outside",range:B,showline:!0},F),N={type:"linear",_id:"x"+F._id},U={letter:"x",font:O.font,noAutotickangles:!0,noHover:!0,noTickson:!0};function W(Q,ue){return M.coerce(I,N,g,Q,ue)}return c(I,N,W,U,O),f(I,N,W,U),N}function m(z,F,B){var O=Math.min(F/z.width,B/z.height);return[O,z,F+"x"+B]}function h(z,F){var B=Math.sqrt(z.width/2*(z.width/2)+z.height*z.height),O=F/B;return[O,z,F]}function P(z,F,B,O){var I=document.createElementNS("http://www.w3.org/2000/svg","text"),N=d.select(I);return N.text(z).attr("x",0).attr("y",0).attr("text-anchor",B).attr("data-unformatted",z).call(n.convertToTspans,O).call(a.font,F),a.bBox(N.node())}function L(z,F,B,O,I,N){var U="_cache"+F;z[U]&&z[U].key===I||(z[U]={key:I,value:B});var W=M.aggNums(N,null,[z[U].value,O],2);return z[U].value=W,W}}}),TG=Ze({"src/traces/indicator/index.js"(Z,q){"use strict";q.exports={moduleType:"trace",name:"indicator",basePlotModule:_G(),categories:["svg","noOpacity","noHover"],animatable:!0,attributes:q6(),supplyDefaults:xG().supplyDefaults,calc:bG().calc,plot:wG(),meta:{}}}}),AG=Ze({"lib/indicator.js"(Z,q){"use strict";q.exports=TG()}}),G6=Ze({"src/traces/table/attributes.js"(Z,q){"use strict";var d=K0(),x=rs().extendFlat,A=pc().overrideAll,M=tc(),e=bc().attributes,t=Qc().descriptionOnlyNumbers,r=q.exports=A({domain:e({name:"table",trace:!0}),columnwidth:{valType:"number",arrayOk:!0,dflt:null},columnorder:{valType:"data_array"},header:{values:{valType:"data_array",dflt:[]},format:{valType:"data_array",dflt:[],description:t("cell value")},prefix:{valType:"string",arrayOk:!0,dflt:null},suffix:{valType:"string",arrayOk:!0,dflt:null},height:{valType:"number",dflt:28},align:x({},d.align,{arrayOk:!0}),line:{width:{valType:"number",arrayOk:!0,dflt:1},color:{valType:"color",arrayOk:!0,dflt:"grey"}},fill:{color:{valType:"color",arrayOk:!0,dflt:"white"}},font:x({},M({arrayOk:!0}))},cells:{values:{valType:"data_array",dflt:[]},format:{valType:"data_array",dflt:[],description:t("cell value")},prefix:{valType:"string",arrayOk:!0,dflt:null},suffix:{valType:"string",arrayOk:!0,dflt:null},height:{valType:"number",dflt:20},align:x({},d.align,{arrayOk:!0}),line:{width:{valType:"number",arrayOk:!0,dflt:1},color:{valType:"color",arrayOk:!0,dflt:"grey"}},fill:{color:{valType:"color",arrayOk:!0,dflt:"white"}},font:x({},M({arrayOk:!0}))}},"calc","from-root")}}),SG=Ze({"src/traces/table/defaults.js"(Z,q){"use strict";var d=ca(),x=G6(),A=bc().defaults;function M(e,t){for(var r=e.columnorder||[],o=e.header.values.length,a=r.slice(0,o),i=a.slice().sort(function(c,f){return c-f}),n=a.map(function(c){return i.indexOf(c)}),s=n.length;s",maxDimensionCount:60,overdrag:45,releaseTransitionDuration:120,releaseTransitionEase:"cubic-out",scrollbarCaptureWidth:18,scrollbarHideDelay:1e3,scrollbarHideDuration:1e3,scrollbarOffset:5,scrollbarWidth:8,transitionDuration:100,transitionEase:"cubic-out",uplift:5,wrapSpacer:" ",wrapSplitCharacter:" ",cn:{table:"table",tableControlView:"table-control-view",scrollBackground:"scroll-background",yColumn:"y-column",columnBlock:"column-block",scrollAreaClip:"scroll-area-clip",scrollAreaClipRect:"scroll-area-clip-rect",columnBoundary:"column-boundary",columnBoundaryClippath:"column-boundary-clippath",columnBoundaryRect:"column-boundary-rect",columnCells:"column-cells",columnCell:"column-cell",cellRect:"cell-rect",cellText:"cell-text",cellTextHolder:"cell-text-holder",scrollbarKit:"scrollbar-kit",scrollbar:"scrollbar",scrollbarSlider:"scrollbar-slider",scrollbarGlyph:"scrollbar-glyph",scrollbarCaptureZone:"scrollbar-capture-zone"}}}}),EG=Ze({"src/traces/table/data_preparation_helper.js"(Z,q){"use strict";var d=H6(),x=rs().extendFlat,A=ns(),M=xp().isTypedArray,e=xp().isArrayOrTypedArray;q.exports=function(g,v){var T=o(v.cells.values),l=function(Q){return Q.slice(v.header.values.length,Q.length)},_=o(v.header.values);_.length&&!_[0].length&&(_[0]=[""],_=o(_));var w=_.concat(l(T).map(function(){return a((_[0]||[""]).length)})),S=v.domain,E=Math.floor(g._fullLayout._size.w*(S.x[1]-S.x[0])),y=Math.floor(g._fullLayout._size.h*(S.y[1]-S.y[0])),b=v.header.values.length?w[0].map(function(){return v.header.height}):[d.emptyHeaderHeight],p=T.length?T[0].map(function(){return v.cells.height}):[],u=b.reduce(r,0),m=y-u,h=m+d.uplift,P=s(p,h),L=s(b,u),z=n(L,[]),F=n(P,z),B={},O=v._fullInput.columnorder;e(O)&&(O=Array.from(O)),O=O.concat(l(T.map(function(Q,ue){return ue})));var I=w.map(function(Q,ue){var le=e(v.columnwidth)?v.columnwidth[Math.min(ue,v.columnwidth.length-1)]:v.columnwidth;return A(le)?Number(le):1}),N=I.reduce(r,0);I=I.map(function(Q){return Q/N*E});var U=Math.max(t(v.header.line.width),t(v.cells.line.width)),W={key:v.uid+g._context.staticPlot,translateX:S.x[0]*g._fullLayout._size.w,translateY:g._fullLayout._size.h*(1-S.y[1]),size:g._fullLayout._size,width:E,maxLineWidth:U,height:y,columnOrder:O,groupHeight:y,rowBlocks:F,headerRowBlocks:z,scrollY:0,cells:x({},v.cells,{values:T}),headerCells:x({},v.header,{values:w}),gdColumns:w.map(function(Q){return Q[0]}),gdColumnsOriginalOrder:w.map(function(Q){return Q[0]}),prevPages:[0,0],scrollbarState:{scrollbarScrollInProgress:!1},columns:w.map(function(Q,ue){var le=B[Q];B[Q]=(le||0)+1;var he=Q+"__"+B[Q];return{key:he,label:Q,specIndex:ue,xIndex:O[ue],xScale:i,x:void 0,calcdata:void 0,columnWidth:I[ue]}})};return W.columns.forEach(function(Q){Q.calcdata=W,Q.x=i(Q)}),W};function t(f){if(e(f)){for(var g=0,v=0;v=g||y===f.length-1)&&(v[l]=w,w.key=E++,w.firstRowIndex=S,w.lastRowIndex=y,w=c(),l+=_,S=y+1,_=0);return v}function c(){return{firstRowIndex:null,lastRowIndex:null,rows:[]}}}}),CG=Ze({"src/traces/table/data_split_helpers.js"(Z){"use strict";var q=rs().extendFlat;Z.splitToPanels=function(x){var A=[0,0],M=q({},x,{key:"header",type:"header",page:0,prevPages:A,currentRepaint:[null,null],dragHandle:!0,values:x.calcdata.headerCells.values[x.specIndex],rowBlocks:x.calcdata.headerRowBlocks,calcdata:q({},x.calcdata,{cells:x.calcdata.headerCells})}),e=q({},x,{key:"cells1",type:"cells",page:0,prevPages:A,currentRepaint:[null,null],dragHandle:!1,values:x.calcdata.cells.values[x.specIndex],rowBlocks:x.calcdata.rowBlocks}),t=q({},x,{key:"cells2",type:"cells",page:1,prevPages:A,currentRepaint:[null,null],dragHandle:!1,values:x.calcdata.cells.values[x.specIndex],rowBlocks:x.calcdata.rowBlocks});return[e,t,M]},Z.splitToCells=function(x){var A=d(x);return(x.values||[]).slice(A[0],A[1]).map(function(M,e){var t=typeof M=="string"&&M.match(/[<$&> ]/)?"_keybuster_"+Math.random():"";return{keyWithinBlock:e+t,key:A[0]+e,column:x,calcdata:x.calcdata,page:x.page,rowBlocks:x.rowBlocks,value:M}})};function d(x){var A=x.rowBlocks[x.page],M=A?A.rows[0].rowIndex:0,e=A?M+A.rows.length:0;return[M,e]}}}),W6=Ze({"src/traces/table/plot.js"(Z,q){"use strict";var d=H6(),x=On(),A=ca(),M=A.numberFormat,e=Cv(),t=as(),r=fu(),o=ca().raiseToTop,a=ca().strTranslate,i=ca().cancelTransition,n=EG(),s=CG(),c=Yn();q.exports=function(re,ce){var be=!re._context.staticPlot,Ae=re._fullLayout._paper.selectAll("."+d.cn.table).data(ce.map(function(Qe){var Lt=e.unwrap(Qe),kt=Lt.trace;return n(re,kt)}),e.keyFun);Ae.exit().remove(),Ae.enter().append("g").classed(d.cn.table,!0).attr("overflow","visible").style("box-sizing","content-box").style("position","absolute").style("left",0).style("overflow","visible").style("shape-rendering","crispEdges").style("pointer-events","all"),Ae.attr("width",function(Qe){return Qe.width+Qe.size.l+Qe.size.r}).attr("height",function(Qe){return Qe.height+Qe.size.t+Qe.size.b}).attr("transform",function(Qe){return a(Qe.translateX,Qe.translateY)});var ze=Ae.selectAll("."+d.cn.tableControlView).data(e.repeat,e.keyFun),Re=ze.enter().append("g").classed(d.cn.tableControlView,!0).style("box-sizing","content-box");if(be){var Xe="onwheel"in document?"wheel":"mousewheel";Re.on("mousemove",function(Qe){ze.filter(function(Lt){return Qe===Lt}).call(l,re)}).on(Xe,function(Qe){if(!Qe.scrollbarState.wheeling){Qe.scrollbarState.wheeling=!0;var Lt=Qe.scrollY+x.event.deltaY,kt=Q(re,ze,null,Lt)(Qe);kt||(x.event.stopPropagation(),x.event.preventDefault()),Qe.scrollbarState.wheeling=!1}}).call(l,re,!0)}ze.attr("transform",function(Qe){return a(Qe.size.l,Qe.size.t)});var it=ze.selectAll("."+d.cn.scrollBackground).data(e.repeat,e.keyFun);it.enter().append("rect").classed(d.cn.scrollBackground,!0).attr("fill","none"),it.attr("width",function(Qe){return Qe.width}).attr("height",function(Qe){return Qe.height}),ze.each(function(Qe){t.setClipUrl(x.select(this),g(re,Qe),re)});var ot=ze.selectAll("."+d.cn.yColumn).data(function(Qe){return Qe.columns},e.keyFun);ot.enter().append("g").classed(d.cn.yColumn,!0),ot.exit().remove(),ot.attr("transform",function(Qe){return a(Qe.x,0)}),be&&ot.call(x.behavior.drag().origin(function(Qe){var Lt=x.select(this);return B(Lt,Qe,-d.uplift),o(this),Qe.calcdata.columnDragInProgress=!0,l(ze.filter(function(kt){return Qe.calcdata.key===kt.key}),re),Qe}).on("drag",function(Qe){var Lt=x.select(this),kt=function(Sr){return(Qe===Sr?x.event.x:Sr.x)+Sr.columnWidth/2};Qe.x=Math.max(-d.overdrag,Math.min(Qe.calcdata.width+d.overdrag-Qe.columnWidth,x.event.x));var Vt=T(ot).filter(function(Sr){return Sr.calcdata.key===Qe.calcdata.key}),Zt=Vt.sort(function(Sr,xr){return kt(Sr)-kt(xr)});Zt.forEach(function(Sr,xr){Sr.xIndex=xr,Sr.x=Qe===Sr?Sr.x:Sr.xScale(Sr)}),ot.filter(function(Sr){return Qe!==Sr}).transition().ease(d.transitionEase).duration(d.transitionDuration).attr("transform",function(Sr){return a(Sr.x,0)}),Lt.call(i).attr("transform",a(Qe.x,-d.uplift))}).on("dragend",function(Qe){var Lt=x.select(this),kt=Qe.calcdata;Qe.x=Qe.xScale(Qe),Qe.calcdata.columnDragInProgress=!1,B(Lt,Qe,0),z(re,kt,kt.columns.map(function(Vt){return Vt.xIndex}))})),ot.each(function(Qe){t.setClipUrl(x.select(this),v(re,Qe),re)});var tt=ot.selectAll("."+d.cn.columnBlock).data(s.splitToPanels,e.keyFun);tt.enter().append("g").classed(d.cn.columnBlock,!0).attr("id",function(Qe){return Qe.key}),tt.style("cursor",function(Qe){return Qe.dragHandle?"ew-resize":Qe.calcdata.scrollbarState.barWiggleRoom?"ns-resize":"default"});var lt=tt.filter(I),Ee=tt.filter(O);be&&Ee.call(x.behavior.drag().origin(function(Qe){return x.event.stopPropagation(),Qe}).on("drag",Q(re,ze,-1)).on("dragend",function(){})),_(re,ze,lt,tt),_(re,ze,Ee,tt);var _e=ze.selectAll("."+d.cn.scrollAreaClip).data(e.repeat,e.keyFun);_e.enter().append("clipPath").classed(d.cn.scrollAreaClip,!0).attr("id",function(Qe){return g(re,Qe)});var fe=_e.selectAll("."+d.cn.scrollAreaClipRect).data(e.repeat,e.keyFun);fe.enter().append("rect").classed(d.cn.scrollAreaClipRect,!0).attr("x",-d.overdrag).attr("y",-d.uplift).attr("fill","none"),fe.attr("width",function(Qe){return Qe.width+2*d.overdrag}).attr("height",function(Qe){return Qe.height+d.uplift});var Fe=ot.selectAll("."+d.cn.columnBoundary).data(e.repeat,e.keyFun);Fe.enter().append("g").classed(d.cn.columnBoundary,!0);var rt=ot.selectAll("."+d.cn.columnBoundaryClippath).data(e.repeat,e.keyFun);rt.enter().append("clipPath").classed(d.cn.columnBoundaryClippath,!0),rt.attr("id",function(Qe){return v(re,Qe)});var st=rt.selectAll("."+d.cn.columnBoundaryRect).data(e.repeat,e.keyFun);st.enter().append("rect").classed(d.cn.columnBoundaryRect,!0).attr("fill","none"),st.attr("width",function(Qe){return Qe.columnWidth+2*f(Qe)}).attr("height",function(Qe){return Qe.calcdata.height+2*f(Qe)+d.uplift}).attr("x",function(Qe){return-f(Qe)}).attr("y",function(Qe){return-f(Qe)}),W(null,Ee,ze)};function f(ee){return Math.ceil(ee.calcdata.maxLineWidth/2)}function g(ee,re){return"clip"+ee._fullLayout._uid+"_scrollAreaBottomClip_"+re.key}function v(ee,re){return"clip"+ee._fullLayout._uid+"_columnBoundaryClippath_"+re.calcdata.key+"_"+re.specIndex}function T(ee){return[].concat.apply([],ee.map(function(re){return re})).map(function(re){return re.__data__})}function l(ee,re,ce){function be(ot){var tt=ot.rowBlocks;return J(tt,tt.length-1)+(tt.length?X(tt[tt.length-1],1/0):1)}var Ae=ee.selectAll("."+d.cn.scrollbarKit).data(e.repeat,e.keyFun);Ae.enter().append("g").classed(d.cn.scrollbarKit,!0).style("shape-rendering","geometricPrecision"),Ae.each(function(ot){var tt=ot.scrollbarState;tt.totalHeight=be(ot),tt.scrollableAreaHeight=ot.groupHeight-N(ot),tt.currentlyVisibleHeight=Math.min(tt.totalHeight,tt.scrollableAreaHeight),tt.ratio=tt.currentlyVisibleHeight/tt.totalHeight,tt.barLength=Math.max(tt.ratio*tt.currentlyVisibleHeight,d.goldenRatio*d.scrollbarWidth),tt.barWiggleRoom=tt.currentlyVisibleHeight-tt.barLength,tt.wiggleRoom=Math.max(0,tt.totalHeight-tt.scrollableAreaHeight),tt.topY=tt.barWiggleRoom===0?0:ot.scrollY/tt.wiggleRoom*tt.barWiggleRoom,tt.bottomY=tt.topY+tt.barLength,tt.dragMultiplier=tt.wiggleRoom/tt.barWiggleRoom}).attr("transform",function(ot){var tt=ot.width+d.scrollbarWidth/2+d.scrollbarOffset;return a(tt,N(ot))});var ze=Ae.selectAll("."+d.cn.scrollbar).data(e.repeat,e.keyFun);ze.enter().append("g").classed(d.cn.scrollbar,!0);var Re=ze.selectAll("."+d.cn.scrollbarSlider).data(e.repeat,e.keyFun);Re.enter().append("g").classed(d.cn.scrollbarSlider,!0),Re.attr("transform",function(ot){return a(0,ot.scrollbarState.topY||0)});var Xe=Re.selectAll("."+d.cn.scrollbarGlyph).data(e.repeat,e.keyFun);Xe.enter().append("line").classed(d.cn.scrollbarGlyph,!0).attr("stroke","black").attr("stroke-width",d.scrollbarWidth).attr("stroke-linecap","round").attr("y1",d.scrollbarWidth/2),Xe.attr("y2",function(ot){return ot.scrollbarState.barLength-d.scrollbarWidth/2}).attr("stroke-opacity",function(ot){return ot.columnDragInProgress||!ot.scrollbarState.barWiggleRoom||ce?0:.4}),Xe.transition().delay(0).duration(0),Xe.transition().delay(d.scrollbarHideDelay).duration(d.scrollbarHideDuration).attr("stroke-opacity",0);var it=ze.selectAll("."+d.cn.scrollbarCaptureZone).data(e.repeat,e.keyFun);it.enter().append("line").classed(d.cn.scrollbarCaptureZone,!0).attr("stroke","white").attr("stroke-opacity",.01).attr("stroke-width",d.scrollbarCaptureWidth).attr("stroke-linecap","butt").attr("y1",0).on("mousedown",function(ot){var tt=x.event.y,lt=this.getBoundingClientRect(),Ee=ot.scrollbarState,_e=tt-lt.top,fe=x.scale.linear().domain([0,Ee.scrollableAreaHeight]).range([0,Ee.totalHeight]).clamp(!0);Ee.topY<=_e&&_e<=Ee.bottomY||Q(re,ee,null,fe(_e-Ee.barLength/2))(ot)}).call(x.behavior.drag().origin(function(ot){return x.event.stopPropagation(),ot.scrollbarState.scrollbarScrollInProgress=!0,ot}).on("drag",Q(re,ee)).on("dragend",function(){})),it.attr("y2",function(ot){return ot.scrollbarState.scrollableAreaHeight}),re._context.staticPlot&&(Xe.remove(),it.remove())}function _(ee,re,ce,be){var Ae=w(ce),ze=S(Ae);p(ze);var Re=E(ze);m(Re);var Xe=b(ze),it=y(Xe);u(it),h(it,re,be,ee),$(ze)}function w(ee){var re=ee.selectAll("."+d.cn.columnCells).data(e.repeat,e.keyFun);return re.enter().append("g").classed(d.cn.columnCells,!0),re.exit().remove(),re}function S(ee){var re=ee.selectAll("."+d.cn.columnCell).data(s.splitToCells,function(ce){return ce.keyWithinBlock});return re.enter().append("g").classed(d.cn.columnCell,!0),re.exit().remove(),re}function E(ee){var re=ee.selectAll("."+d.cn.cellRect).data(e.repeat,function(ce){return ce.keyWithinBlock});return re.enter().append("rect").classed(d.cn.cellRect,!0),re}function y(ee){var re=ee.selectAll("."+d.cn.cellText).data(e.repeat,function(ce){return ce.keyWithinBlock});return re.enter().append("text").classed(d.cn.cellText,!0).style("cursor",function(){return"auto"}).on("mousedown",function(){x.event.stopPropagation()}),re}function b(ee){var re=ee.selectAll("."+d.cn.cellTextHolder).data(e.repeat,function(ce){return ce.keyWithinBlock});return re.enter().append("g").classed(d.cn.cellTextHolder,!0).style("shape-rendering","geometricPrecision"),re}function p(ee){ee.each(function(re,ce){var be=re.calcdata.cells.font,Ae=re.column.specIndex,ze={size:F(be.size,Ae,ce),color:F(be.color,Ae,ce),family:F(be.family,Ae,ce),weight:F(be.weight,Ae,ce),style:F(be.style,Ae,ce),variant:F(be.variant,Ae,ce),textcase:F(be.textcase,Ae,ce),lineposition:F(be.lineposition,Ae,ce),shadow:F(be.shadow,Ae,ce)};re.rowNumber=re.key,re.align=F(re.calcdata.cells.align,Ae,ce),re.cellBorderWidth=F(re.calcdata.cells.line.width,Ae,ce),re.font=ze})}function u(ee){ee.each(function(re){t.font(x.select(this),re.font)})}function m(ee){ee.attr("width",function(re){return re.column.columnWidth}).attr("stroke-width",function(re){return re.cellBorderWidth}).each(function(re){var ce=x.select(this);c.stroke(ce,F(re.calcdata.cells.line.color,re.column.specIndex,re.rowNumber)),c.fill(ce,F(re.calcdata.cells.fill.color,re.column.specIndex,re.rowNumber))})}function h(ee,re,ce,be){ee.text(function(Ae){var ze=Ae.column.specIndex,Re=Ae.rowNumber,Xe=Ae.value,it=typeof Xe=="string",ot=it&&Xe.match(/
/i),tt=!it||ot;Ae.mayHaveMarkup=it&&Xe.match(/[<&>]/);var lt=P(Xe);Ae.latex=lt;var Ee=lt?"":F(Ae.calcdata.cells.prefix,ze,Re)||"",_e=lt?"":F(Ae.calcdata.cells.suffix,ze,Re)||"",fe=lt?null:F(Ae.calcdata.cells.format,ze,Re)||null,Fe=Ee+(fe?M(fe)(Ae.value):Ae.value)+_e,rt;Ae.wrappingNeeded=!Ae.wrapped&&!tt&&!lt&&(rt=L(Fe)),Ae.cellHeightMayIncrease=ot||lt||Ae.mayHaveMarkup||(rt===void 0?L(Fe):rt),Ae.needsConvertToTspans=Ae.mayHaveMarkup||Ae.wrappingNeeded||Ae.latex;var st;if(Ae.wrappingNeeded){var Qe=d.wrapSplitCharacter===" "?Fe.replace(/Ae&&be.push(ze),Ae+=it}return be}function W(ee,re,ce){var be=T(re)[0];if(be!==void 0){var Ae=be.rowBlocks,ze=be.calcdata,Re=J(Ae,Ae.length),Xe=be.calcdata.groupHeight-N(be),it=ze.scrollY=Math.max(0,Math.min(Re-Xe,ze.scrollY)),ot=U(Ae,it,Xe);ot.length===1&&(ot[0]===Ae.length-1?ot.unshift(ot[0]-1):ot.push(ot[0]+1)),ot[0]%2&&ot.reverse(),re.each(function(tt,lt){tt.page=ot[lt],tt.scrollY=it}),re.attr("transform",function(tt){var lt=J(tt.rowBlocks,tt.page)-tt.scrollY;return a(0,lt)}),ee&&(ue(ee,ce,re,ot,be.prevPages,be,0),ue(ee,ce,re,ot,be.prevPages,be,1),l(ce,ee))}}function Q(ee,re,ce,be){return function(ze){var Re=ze.calcdata?ze.calcdata:ze,Xe=re.filter(function(lt){return Re.key===lt.key}),it=ce||Re.scrollbarState.dragMultiplier,ot=Re.scrollY;Re.scrollY=be===void 0?Re.scrollY+it*x.event.dy:be;var tt=Xe.selectAll("."+d.cn.yColumn).selectAll("."+d.cn.columnBlock).filter(O);return W(ee,tt,Xe),Re.scrollY===ot}}function ue(ee,re,ce,be,Ae,ze,Re){var Xe=be[Re]!==Ae[Re];Xe&&(clearTimeout(ze.currentRepaint[Re]),ze.currentRepaint[Re]=setTimeout(function(){var it=ce.filter(function(ot,tt){return tt===Re&&be[tt]!==Ae[tt]});_(ee,re,it,ce),Ae[Re]=be[Re]}))}function le(ee,re,ce,be){return function(){var ze=x.select(re.parentNode);ze.each(function(Re){var Xe=Re.fragments;ze.selectAll("tspan.line").each(function(Fe,rt){Xe[rt].width=this.getComputedTextLength()});var it=Xe[Xe.length-1].width,ot=Xe.slice(0,-1),tt=[],lt,Ee,_e=0,fe=Re.column.columnWidth-2*d.cellPad;for(Re.value="";ot.length;)lt=ot.shift(),Ee=lt.width+it,_e+Ee>fe&&(Re.value+=tt.join(d.wrapSpacer)+d.lineBreaker,tt=[],_e=0),tt.push(lt.text),_e+=Ee;_e&&(Re.value+=tt.join(d.wrapSpacer)),Re.wrapped=!0}),ze.selectAll("tspan.line").remove(),h(ze.select("."+d.cn.cellText),ce,ee,be),x.select(re.parentNode.parentNode).call($)}}function he(ee,re,ce,be,Ae){return function(){if(!Ae.settledY){var Re=x.select(re.parentNode),Xe=ie(Ae),it=Ae.key-Xe.firstRowIndex,ot=Xe.rows[it].rowHeight,tt=Ae.cellHeightMayIncrease?re.parentNode.getBoundingClientRect().height+2*d.cellPad:ot,lt=Math.max(tt,ot),Ee=lt-Xe.rows[it].rowHeight;Ee&&(Xe.rows[it].rowHeight=lt,ee.selectAll("."+d.cn.columnCell).call($),W(null,ee.filter(O),0),l(ce,be,!0)),Re.attr("transform",function(){var _e=this,fe=_e.parentNode,Fe=fe.getBoundingClientRect(),rt=x.select(_e.parentNode).select("."+d.cn.cellRect).node().getBoundingClientRect(),st=_e.transform.baseVal.consolidate(),Qe=rt.top-Fe.top+(st?st.matrix.f:d.cellPad);return a(G(Ae,x.select(_e.parentNode).select("."+d.cn.cellTextHolder).node().getBoundingClientRect().width),Qe)}),Ae.settledY=!0}}}function G(ee,re){switch(ee.align){case"left":return d.cellPad;case"right":return ee.column.columnWidth-(re||0)-d.cellPad;case"center":return(ee.column.columnWidth-(re||0))/2;default:return d.cellPad}}function $(ee){ee.attr("transform",function(re){var ce=re.rowBlocks[0].auxiliaryBlocks.reduce(function(Re,Xe){return Re+X(Xe,1/0)},0),be=ie(re),Ae=X(be,re.key),ze=Ae+ce;return a(0,ze)}).selectAll("."+d.cn.cellRect).attr("height",function(re){return j(ie(re),re.key).rowHeight})}function J(ee,re){for(var ce=0,be=re-1;be>=0;be--)ce+=oe(ee[be]);return ce}function X(ee,re){for(var ce=0,be=0;beM.length&&(A=A.slice(0,M.length)):A=[],t=0;t90&&(g-=180,i=-i),{angle:g,flip:i,p:x.c2p(e,A,M),offsetMultplier:n}}}}),BG=Ze({"src/traces/carpet/plot.js"(Z,q){"use strict";var d=On(),x=as(),A=X6(),M=Z6(),e=OG(),t=fu(),r=ca(),o=r.strRotate,a=r.strTranslate,i=mh();q.exports=function(_,w,S,E){var y=_._context.staticPlot,b=w.xaxis,p=w.yaxis,u=_._fullLayout,m=u._clips;r.makeTraceGroups(E,S,"trace").each(function(h){var P=d.select(this),L=h[0],z=L.trace,F=z.aaxis,B=z.baxis,O=r.ensureSingle(P,"g","minorlayer"),I=r.ensureSingle(P,"g","majorlayer"),N=r.ensureSingle(P,"g","boundarylayer"),U=r.ensureSingle(P,"g","labellayer");P.style("opacity",z.opacity),s(b,p,I,F,"a",F._gridlines,!0,y),s(b,p,I,B,"b",B._gridlines,!0,y),s(b,p,O,F,"a",F._minorgridlines,!0,y),s(b,p,O,B,"b",B._minorgridlines,!0,y),s(b,p,N,F,"a-boundary",F._boundarylines,y),s(b,p,N,B,"b-boundary",B._boundarylines,y);var W=c(_,b,p,z,L,U,F._labels,"a-label"),Q=c(_,b,p,z,L,U,B._labels,"b-label");f(_,U,z,L,b,p,W,Q),n(z,L,m,b,p)})};function n(l,_,w,S,E){var y,b,p,u,m=w.select("#"+l._clipPathId);m.size()||(m=w.append("clipPath").classed("carpetclip",!0));var h=r.ensureSingle(m,"path","carpetboundary"),P=_.clipsegments,L=[];for(u=0;u0?"start":"end","data-notex":1}).call(x.font,P.font).text(P.text).call(t.convertToTspans,l),I=x.bBox(this);O.attr("transform",a(z.p[0],z.p[1])+o(z.angle)+a(P.axis.labelpadding*B,I.height*.3)),m=Math.max(m,I.width+P.axis.labelpadding)}),u.exit().remove(),h.maxExtent=m,h}function f(l,_,w,S,E,y,b,p){var u,m,h,P,L=r.aggNums(Math.min,null,w.a),z=r.aggNums(Math.max,null,w.a),F=r.aggNums(Math.min,null,w.b),B=r.aggNums(Math.max,null,w.b);u=.5*(L+z),m=F,h=w.ab2xy(u,m,!0),P=w.dxyda_rough(u,m),b.angle===void 0&&r.extendFlat(b,e(w,E,y,h,w.dxydb_rough(u,m))),T(l,_,w,S,h,P,w.aaxis,E,y,b,"a-title"),u=L,m=.5*(F+B),h=w.ab2xy(u,m,!0),P=w.dxydb_rough(u,m),p.angle===void 0&&r.extendFlat(p,e(w,E,y,h,w.dxyda_rough(u,m))),T(l,_,w,S,h,P,w.baxis,E,y,p,"b-title")}var g=i.LINE_SPACING,v=(1-i.MID_SHIFT)/g+1;function T(l,_,w,S,E,y,b,p,u,m,h){var P=[];b.title.text&&P.push(b.title.text);var L=_.selectAll("text."+h).data(P),z=m.maxExtent;L.enter().append("text").classed(h,!0),L.each(function(){var F=e(w,p,u,E,y);["start","both"].indexOf(b.showticklabels)===-1&&(z=0);var B=b.title.font.size;z+=B+b.title.offset;var O=m.angle+(m.flip<0?180:0),I=(O-F.angle+450)%360,N=I>90&&I<270,U=d.select(this);U.text(b.title.text).call(t.convertToTspans,l),N&&(z=(-t.lineCount(U)+v)*g*B-z),U.attr("transform",a(F.p[0],F.p[1])+o(F.angle)+a(0,z)).attr("text-anchor","middle").call(x.font,b.title.font)}),L.exit().remove()}}}),NG=Ze({"src/traces/carpet/cheater_basis.js"(Z,q){"use strict";var d=ca().isArrayOrTypedArray;q.exports=function(x,A,M){var e,t,r,o,a,i,n=[],s=d(x)?x.length:x,c=d(A)?A.length:A,f=d(x)?x:null,g=d(A)?A:null;f&&(r=(f.length-1)/(f[f.length-1]-f[0])/(s-1)),g&&(o=(g.length-1)/(g[g.length-1]-g[0])/(c-1));var v,T=1/0,l=-1/0;for(t=0;t=10)return null;for(var e=1/0,t=-1/0,r=A.length,o=0;o0&&(X=M.dxydi([],W-1,ue,0,le),ee.push(he[0]+X[0]/3),re.push(he[1]+X[1]/3),oe=M.dxydi([],W-1,ue,1,le),ee.push(J[0]-oe[0]/3),re.push(J[1]-oe[1]/3)),ee.push(J[0]),re.push(J[1]),he=J;else for(W=M.a2i(U),G=Math.floor(Math.max(0,Math.min(F-2,W))),$=W-G,ce.length=F,ce.crossLength=B,ce.xy=function(be){return M.evalxy([],W,be)},ce.dxy=function(be,Ae){return M.dxydj([],G,be,$,Ae)},Q=0;Q0&&(ie=M.dxydj([],G,Q-1,$,0),ee.push(he[0]+ie[0]/3),re.push(he[1]+ie[1]/3),j=M.dxydj([],G,Q-1,$,1),ee.push(J[0]-j[0]/3),re.push(J[1]-j[1]/3)),ee.push(J[0]),re.push(J[1]),he=J;return ce.axisLetter=e,ce.axis=E,ce.crossAxis=m,ce.value=U,ce.constvar=t,ce.index=f,ce.x=ee,ce.y=re,ce.smoothing=m.smoothing,ce}function N(U){var W,Q,ue,le,he,G=[],$=[],J={};if(J.length=S.length,J.crossLength=u.length,e==="b")for(ue=Math.max(0,Math.min(B-2,U)),he=Math.min(1,Math.max(0,U-ue)),J.xy=function(X){return M.evalxy([],X,U)},J.dxy=function(X,oe){return M.dxydi([],X,ue,oe,he)},W=0;WS.length-1)&&y.push(x(N(o),{color:E.gridcolor,width:E.gridwidth,dash:E.griddash}));for(f=s;fS.length-1)&&!(T<0||T>S.length-1))for(l=S[a],_=S[T],r=0;rS[S.length-1])&&b.push(x(I(v),{color:E.minorgridcolor,width:E.minorgridwidth,dash:E.minorgriddash})));E.startline&&p.push(x(N(0),{color:E.startlinecolor,width:E.startlinewidth})),E.endline&&p.push(x(N(S.length-1),{color:E.endlinecolor,width:E.endlinewidth}))}else{for(i=5e-15,n=[Math.floor((S[S.length-1]-E.tick0)/E.dtick*(1+i)),Math.ceil((S[0]-E.tick0)/E.dtick/(1+i))].sort(function(U,W){return U-W}),s=n[0],c=n[1],f=s;f<=c;f++)g=E.tick0+E.dtick*f,y.push(x(I(g),{color:E.gridcolor,width:E.gridwidth,dash:E.griddash}));for(f=s-1;fS[S.length-1])&&b.push(x(I(v),{color:E.minorgridcolor,width:E.minorgridwidth,dash:E.minorgriddash}));E.startline&&p.push(x(I(S[0]),{color:E.startlinecolor,width:E.startlinewidth})),E.endline&&p.push(x(I(S[S.length-1]),{color:E.endlinecolor,width:E.endlinewidth}))}}}}),qG=Ze({"src/traces/carpet/calc_labels.js"(Z,q){"use strict";var d=Wo(),x=rs().extendFlat;q.exports=function(M,e){var t,r,o,a,i,n=e._labels=[],s=e._gridlines;for(t=0;t=0;t--)r[s-t]=x[c][t],o[s-t]=A[c][t];for(a.push({x:r,y:o,bicubic:i}),t=c,r=[],o=[];t>=0;t--)r[c-t]=x[t][0],o[c-t]=A[t][0];return a.push({x:r,y:o,bicubic:n}),a}}}),GG=Ze({"src/traces/carpet/smooth_fill_2d_array.js"(Z,q){"use strict";var d=ca();q.exports=function(A,M,e){var t,r,o,a=[],i=[],n=A[0].length,s=A.length;function c(Q,ue){var le=0,he,G=0;return Q>0&&(he=A[ue][Q-1])!==void 0&&(G++,le+=he),Q0&&(he=A[ue-1][Q])!==void 0&&(G++,le+=he),ue0&&r0&&tu);return d.log("Smoother converged to",m,"after",P,"iterations"),A}}}),HG=Ze({"src/traces/carpet/constants.js"(Z,q){"use strict";q.exports={RELATIVE_CULL_TOLERANCE:1e-6}}}),WG=Ze({"src/traces/carpet/catmull_rom.js"(Z,q){"use strict";var d=.5;q.exports=function(A,M,e,t){var r=A[0]-M[0],o=A[1]-M[1],a=e[0]-M[0],i=e[1]-M[1],n=Math.pow(r*r+o*o,d/2),s=Math.pow(a*a+i*i,d/2),c=(s*s*r-n*n*a)*t,f=(s*s*o-n*n*i)*t,g=s*(n+s)*3,v=n*(n+s)*3;return[[M[0]+(g&&c/g),M[1]+(g&&f/g)],[M[0]-(v&&c/v),M[1]-(v&&f/v)]]}}}),XG=Ze({"src/traces/carpet/compute_control_points.js"(Z,q){"use strict";var d=WG(),x=ca().ensureArray;function A(M,e,t){var r=-.5*t[0]+1.5*e[0],o=-.5*t[1]+1.5*e[1];return[(2*r+M[0])/3,(2*o+M[1])/3]}q.exports=function(e,t,r,o,a,i){var n,s,c,f,g,v,T,l,_,w,S=r[0].length,E=r.length,y=a?3*S-2:S,b=i?3*E-2:E;for(e=x(e,b),t=x(t,b),c=0;cg&&yT&&bv||bl},o.setScale=function(){var y=o._x,b=o._y,p=A(o._xctrl,o._yctrl,y,b,c.smoothing,f.smoothing);o._xctrl=p[0],o._yctrl=p[1],o.evalxy=M([o._xctrl,o._yctrl],n,s,c.smoothing,f.smoothing),o.dxydi=e([o._xctrl,o._yctrl],c.smoothing,f.smoothing),o.dxydj=t([o._xctrl,o._yctrl],c.smoothing,f.smoothing)},o.i2a=function(y){var b=Math.max(0,Math.floor(y[0]),n-2),p=y[0]-b;return(1-p)*a[b]+p*a[b+1]},o.j2b=function(y){var b=Math.max(0,Math.floor(y[1]),n-2),p=y[1]-b;return(1-p)*i[b]+p*i[b+1]},o.ij2ab=function(y){return[o.i2a(y[0]),o.j2b(y[1])]},o.a2i=function(y){var b=Math.max(0,Math.min(x(y,a),n-2)),p=a[b],u=a[b+1];return Math.max(0,Math.min(n-1,b+(y-p)/(u-p)))},o.b2j=function(y){var b=Math.max(0,Math.min(x(y,i),s-2)),p=i[b],u=i[b+1];return Math.max(0,Math.min(s-1,b+(y-p)/(u-p)))},o.ab2ij=function(y){return[o.a2i(y[0]),o.b2j(y[1])]},o.i2c=function(y,b){return o.evalxy([],y,b)},o.ab2xy=function(y,b,p){if(!p&&(ya[n-1]|bi[s-1]))return[!1,!1];var u=o.a2i(y),m=o.b2j(b),h=o.evalxy([],u,m);if(p){var P=0,L=0,z=[],F,B,O,I;ya[n-1]?(F=n-2,B=1,P=(y-a[n-1])/(a[n-1]-a[n-2])):(F=Math.max(0,Math.min(n-2,Math.floor(u))),B=u-F),bi[s-1]?(O=s-2,I=1,L=(b-i[s-1])/(i[s-1]-i[s-2])):(O=Math.max(0,Math.min(s-2,Math.floor(m))),I=m-O),P&&(o.dxydi(z,F,O,B,I),h[0]+=z[0]*P,h[1]+=z[1]*P),L&&(o.dxydj(z,F,O,B,I),h[0]+=z[0]*L,h[1]+=z[1]*L)}return h},o.c2p=function(y,b,p){return[b.c2p(y[0]),p.c2p(y[1])]},o.p2x=function(y,b,p){return[b.p2c(y[0]),p.p2c(y[1])]},o.dadi=function(y){var b=Math.max(0,Math.min(a.length-2,y));return a[b+1]-a[b]},o.dbdj=function(y){var b=Math.max(0,Math.min(i.length-2,y));return i[b+1]-i[b]},o.dxyda=function(y,b,p,u){var m=o.dxydi(null,y,b,p,u),h=o.dadi(y,p);return[m[0]/h,m[1]/h]},o.dxydb=function(y,b,p,u){var m=o.dxydj(null,y,b,p,u),h=o.dbdj(b,u);return[m[0]/h,m[1]/h]},o.dxyda_rough=function(y,b,p){var u=_*(p||.1),m=o.ab2xy(y+u,b,!0),h=o.ab2xy(y-u,b,!0);return[(m[0]-h[0])*.5/u,(m[1]-h[1])*.5/u]},o.dxydb_rough=function(y,b,p){var u=w*(p||.1),m=o.ab2xy(y,b+u,!0),h=o.ab2xy(y,b-u,!0);return[(m[0]-h[0])*.5/u,(m[1]-h[1])*.5/u]},o.dpdx=function(y){return y._m},o.dpdy=function(y){return y._m}}}}),$G=Ze({"src/traces/carpet/calc.js"(Z,q){"use strict";var d=Wo(),x=ca().isArray1D,A=NG(),M=UG(),e=jG(),t=qG(),r=VG(),o=Y2(),a=GG(),i=Z2(),n=JG();q.exports=function(c,f){var g=d.getFromId(c,f.xaxis),v=d.getFromId(c,f.yaxis),T=f.aaxis,l=f.baxis,_=f.x,w=f.y,S=[];_&&x(_)&&S.push("x"),w&&x(w)&&S.push("y"),S.length&&i(f,T,l,"a","b",S);var E=f._a=f._a||f.a,y=f._b=f._b||f.b;_=f._x||f.x,w=f._y||f.y;var b={};if(f._cheater){var p=T.cheatertype==="index"?E.length:E,u=l.cheatertype==="index"?y.length:y;_=A(p,u,f.cheaterslope)}f._x=_=o(_),f._y=w=o(w),a(_,E,y),a(w,E,y),n(f),f.setScale();var m=M(_),h=M(w),P=.5*(m[1]-m[0]),L=.5*(m[1]+m[0]),z=.5*(h[1]-h[0]),F=.5*(h[1]+h[0]),B=1.3;return m=[L-P*B,L+P*B],h=[F-z*B,F+z*B],f._extremes[g._id]=d.findExtremes(g,m,{padded:!0}),f._extremes[v._id]=d.findExtremes(v,h,{padded:!0}),e(f,"a","b"),e(f,"b","a"),t(f,T),t(f,l),b.clipsegments=r(f._xctrl,f._yctrl,T,l),b.x=_,b.y=w,b.a=E,b.b=y,[b]}}}),QG=Ze({"src/traces/carpet/index.js"(Z,q){"use strict";q.exports={attributes:PT(),supplyDefaults:FG(),plot:BG(),calc:$G(),animatable:!0,isContainer:!0,moduleType:"trace",name:"carpet",basePlotModule:Zf(),categories:["cartesian","svg","carpet","carpetAxis","notLegendIsolatable","noMultiCategory","noHover","noSortingByValue"],meta:{}}}}),eH=Ze({"lib/carpet.js"(Z,q){"use strict";q.exports=QG()}}),Y6=Ze({"src/traces/scattercarpet/attributes.js"(Z,q){"use strict";var d=$d(),x=tf(),A=eu(),M=Cs().hovertemplateAttrs,e=Cs().texttemplateAttrs,t=Mu(),r=rs().extendFlat,o=x.marker,a=x.line,i=o.line;q.exports={carpet:{valType:"string",editType:"calc"},a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},mode:r({},x.mode,{dflt:"markers"}),text:r({},x.text,{}),texttemplate:e({editType:"plot"},{keys:["a","b","text"]}),hovertext:r({},x.hovertext,{}),line:{color:a.color,width:a.width,dash:a.dash,backoff:a.backoff,shape:r({},a.shape,{values:["linear","spline"]}),smoothing:a.smoothing,editType:"calc"},connectgaps:x.connectgaps,fill:r({},x.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:d(),marker:r({symbol:o.symbol,opacity:o.opacity,maxdisplayed:o.maxdisplayed,angle:o.angle,angleref:o.angleref,standoff:o.standoff,size:o.size,sizeref:o.sizeref,sizemin:o.sizemin,sizemode:o.sizemode,line:r({width:i.width,editType:"calc"},t("marker.line")),gradient:o.gradient,editType:"calc"},t("marker")),textfont:x.textfont,textposition:x.textposition,selected:x.selected,unselected:x.unselected,hoverinfo:r({},A.hoverinfo,{flags:["a","b","text","name"]}),hoveron:x.hoveron,hovertemplate:M(),zorder:x.zorder}}}),tH=Ze({"src/traces/scattercarpet/defaults.js"(Z,q){"use strict";var d=ca(),x=Tv(),A=Fu(),M=md(),e=Dd(),t=o1(),r=zd(),o=ev(),a=Y6();q.exports=function(n,s,c,f){function g(E,y){return d.coerce(n,s,a,E,y)}g("carpet"),s.xaxis="x",s.yaxis="y";var v=g("a"),T=g("b"),l=Math.min(v.length,T.length);if(!l){s.visible=!1;return}s._length=l,g("text"),g("texttemplate"),g("hovertext");var _=l0?b=E.labelprefix.replace(/ = $/,""):b=E._hovertitle,l.push(b+": "+y.toFixed(3)+E.labelsuffix)}if(!g.hovertemplate){var w=f.hi||g.hoverinfo,S=w.split("+");S.indexOf("all")!==-1&&(S=["a","b","text"]),S.indexOf("a")!==-1&&_(v.aaxis,f.a),S.indexOf("b")!==-1&&_(v.baxis,f.b),l.push("y: "+a.yLabel),S.indexOf("text")!==-1&&x(f,g,l),a.extraText=l.join("
")}return o}}}),oH=Ze({"src/traces/scattercarpet/event_data.js"(Z,q){"use strict";q.exports=function(x,A,M,e,t){var r=e[t];return x.a=r.a,x.b=r.b,x.y=r.y,x}}}),sH=Ze({"src/traces/scattercarpet/index.js"(Z,q){"use strict";q.exports={attributes:Y6(),supplyDefaults:tH(),colorbar:hp(),formatLabels:rH(),calc:aH(),plot:iH(),style:ed().style,styleOnSelect:ed().styleOnSelect,hoverPoints:nH(),selectPoints:c1(),eventData:oH(),moduleType:"trace",name:"scattercarpet",basePlotModule:Zf(),categories:["svg","carpet","symbols","showLegend","carpetDependent","zoomScale"],meta:{}}}}),lH=Ze({"lib/scattercarpet.js"(Z,q){"use strict";q.exports=sH()}}),K6=Ze({"src/traces/contourcarpet/attributes.js"(Z,q){"use strict";var d=p1(),x=q_(),A=Mu(),M=rs().extendFlat,e=x.contours;q.exports=M({carpet:{valType:"string",editType:"calc"},z:d.z,a:d.x,a0:d.x0,da:d.dx,b:d.y,b0:d.y0,db:d.dy,text:d.text,hovertext:d.hovertext,transpose:d.transpose,atype:d.xtype,btype:d.ytype,fillcolor:x.fillcolor,autocontour:x.autocontour,ncontours:x.ncontours,contours:{type:e.type,start:e.start,end:e.end,size:e.size,coloring:{valType:"enumerated",values:["fill","lines","none"],dflt:"fill",editType:"calc"},showlines:e.showlines,showlabels:e.showlabels,labelfont:e.labelfont,labelformat:e.labelformat,operation:e.operation,value:e.value,editType:"calc",impliedEdits:{autocontour:!1}},line:{color:x.line.color,width:x.line.width,dash:x.line.dash,smoothing:x.line.smoothing,editType:"plot"},zorder:x.zorder},A("",{cLetter:"z",autoColorDflt:!1}))}}),J6=Ze({"src/traces/contourcarpet/defaults.js"(Z,q){"use strict";var d=ca(),x=X2(),A=K6(),M=wS(),e=s3(),t=l3();q.exports=function(o,a,i,n){function s(v,T){return d.coerce(o,a,A,v,T)}function c(v){return d.coerce2(o,a,A,v)}if(s("carpet"),o.a&&o.b){var f=x(o,a,s,n,"a","b");if(!f){a.visible=!1;return}s("text");var g=s("contours.type")==="constraint";g?M(o,a,s,n,i,{hasHover:!1}):(e(o,a,s,c),t(o,a,s,n,{hasHover:!1}))}else a._defaultColor=i,a._length=null;s("zorder")}}}),uH=Ze({"src/traces/contourcarpet/calc.js"(Z,q){"use strict";var d=wp(),x=ca(),A=Z2(),M=Y2(),e=K2(),t=J2(),r=oS(),o=J6(),a=IT(),i=pS();q.exports=function(c,f){var g=f._carpetTrace=a(c,f);if(!(!g||!g.visible||g.visible==="legendonly")){if(!f.a||!f.b){var v=c.data[g.index],T=c.data[f.index];T.a||(T.a=v.a),T.b||(T.b=v.b),o(T,f,f._defaultColor,c._fullLayout)}var l=n(c,f);return i(f,f._z),l}};function n(s,c){var f=c._carpetTrace,g=f.aaxis,v=f.baxis,T,l,_,w,S,E,y;g._minDtick=0,v._minDtick=0,x.isArray1D(c.z)&&A(c,g,v,"a","b",["z"]),T=c._a=c._a||c.a,w=c._b=c._b||c.b,T=T?g.makeCalcdata(c,"_a"):[],w=w?v.makeCalcdata(c,"_b"):[],l=c.a0||0,_=c.da||1,S=c.b0||0,E=c.db||1,y=c._z=M(c._z||c.z,c.transpose),c._emptypoints=t(y),e(y,c._emptypoints);var b=x.maxRowLength(y),p=c.xtype==="scaled"?"":T,u=r(c,p,l,_,b,g),m=c.ytype==="scaled"?"":w,h=r(c,m,S,E,y.length,v),P={a:u,b:h,z:y};return c.contours.type==="levels"&&c.contours.coloring!=="none"&&d(s,c,{vals:y,containerStr:"",cLetter:"z"}),[P]}}}),cH=Ze({"src/traces/carpet/axis_aligned_line.js"(Z,q){"use strict";var d=ca().isArrayOrTypedArray;q.exports=function(x,A,M,e){var t,r,o,a,i,n,s,c,f,g,v,T,l,_=d(M)?"a":"b",w=_==="a"?x.aaxis:x.baxis,S=w.smoothing,E=_==="a"?x.a2i:x.b2j,y=_==="a"?M:e,b=_==="a"?e:M,p=_==="a"?A.a.length:A.b.length,u=_==="a"?A.b.length:A.a.length,m=Math.floor(_==="a"?x.b2j(b):x.a2i(b)),h=_==="a"?function(ue){return x.evalxy([],ue,m)}:function(ue){return x.evalxy([],m,ue)};S&&(o=Math.max(0,Math.min(u-2,m)),a=m-o,r=_==="a"?function(ue,le){return x.dxydi([],ue,o,le,a)}:function(ue,le){return x.dxydj([],o,ue,a,le)});var P=E(y[0]),L=E(y[1]),z=P0?Math.floor:Math.ceil,O=z>0?Math.ceil:Math.floor,I=z>0?Math.min:Math.max,N=z>0?Math.max:Math.min,U=B(P+F),W=O(L-F);s=h(P);var Q=[[s]];for(t=U;t*z=0;ce--)j=N.clipsegments[ce],ee=x([],j.x,P.c2p),re=x([],j.y,L.c2p),ee.reverse(),re.reverse(),be.push(A(ee,re,j.bicubic));var Ae="M"+be.join("L")+"Z";S(F,N.clipsegments,P,L,le,G),E(O,F,P,L,ie,J,$,I,N,G,Ae),v(F,ue,p,B,Q,u,I),M.setClipUrl(F,I._clipPathId,p)})};function g(b,p){var u,m,h,P,L,z,F,B,O;for(u=0;uue&&(m.max=ue),m.len=m.max-m.min}function l(b,p,u){var m=b.getPointAtLength(p),h=b.getPointAtLength(u),P=h.x-m.x,L=h.y-m.y,z=Math.sqrt(P*P+L*L);return[P/z,L/z]}function _(b){var p=Math.sqrt(b[0]*b[0]+b[1]*b[1]);return[b[0]/p,b[1]/p]}function w(b,p){var u=Math.abs(b[0]*p[0]+b[1]*p[1]),m=Math.sqrt(1-u*u);return m/u}function S(b,p,u,m,h,P){var L,z,F,B,O=e.ensureSingle(b,"g","contourbg"),I=O.selectAll("path").data(P==="fill"&&!h?[0]:[]);I.enter().append("path"),I.exit().remove();var N=[];for(B=0;B=0&&(U=ee,Q=ue):Math.abs(N[1]-U[1])=0&&(U=ee,Q=ue):e.log("endpt to newendpt is not vert. or horz.",N,U,ee)}if(Q>=0)break;B+=ie(N,U),N=U}if(Q===p.edgepaths.length){e.log("unclosed perimeter path");break}F=Q,I=O.indexOf(F)===-1,I&&(F=O[0],B+=ie(N,U)+"Z",N=null)}for(F=0;Fy):E=z>h,y=z;var F=g(h,P,L,z);F.pos=m,F.yc=(h+z)/2,F.i=u,F.dir=E?"increasing":"decreasing",F.x=F.pos,F.y=[L,P],b&&(F.orig_p=s[u]),w&&(F.tx=n.text[u]),S&&(F.htx=n.hovertext[u]),p.push(F)}else p.push({pos:m,empty:!0})}return n._extremes[f._id]=A.findExtremes(f,d.concat(l,T),{padded:!0}),p.length&&(p[0].t={labels:{open:x(i,"open:")+" ",high:x(i,"high:")+" ",low:x(i,"low:")+" ",close:x(i,"close:")+" "}}),p}function a(i,n,s){var c=s._minDiff;if(!c){var f=i._fullData,g=[];c=1/0;var v;for(v=0;v"+_.labels[z]+d.hoverLabelText(T,F,l.yhoverformat)):(O=x.extendFlat({},S),O.y0=O.y1=B,O.yLabelVal=F,O.yLabel=_.labels[z]+d.hoverLabelText(T,F,l.yhoverformat),O.name="",w.push(O),P[F]=O)}return w}function n(s,c,f,g){var v=s.cd,T=s.ya,l=v[0].trace,_=v[0].t,w=a(s,c,f,g);if(!w)return[];var S=w.index,E=v[S],y=w.index=E.i,b=E.dir;function p(F){return _.labels[F]+d.hoverLabelText(T,l[F][y],l.yhoverformat)}var u=E.hi||l.hoverinfo,m=u.split("+"),h=u==="all",P=h||m.indexOf("y")!==-1,L=h||m.indexOf("text")!==-1,z=P?[p("open"),p("high"),p("low"),p("close")+" "+r[b]]:[];return L&&e(E,l,z),w.extraText=z.join("
"),w.y0=w.y1=T.c2p(E.yc,!0),[w]}q.exports={hoverPoints:o,hoverSplit:i,hoverOnPoints:n}}}),tC=Ze({"src/traces/ohlc/select.js"(Z,q){"use strict";q.exports=function(x,A){var M=x.cd,e=x.xaxis,t=x.yaxis,r=[],o,a=M[0].t.bPos||0;if(A===!1)for(o=0;oc?function(l){return l<=0}:function(l){return l>=0};a.c2g=function(l){var _=a.c2l(l)-s;return(T(_)?_:0)+v},a.g2c=function(l){return a.l2c(l+s-v)},a.g2p=function(l){return l*g},a.c2p=function(l){return a.g2p(a.c2g(l))}}}function t(a,i){return i==="degrees"?A(a):a}function r(a,i){return i==="degrees"?M(a):a}function o(a,i){var n=a.type;if(n==="linear"){var s=a.d2c,c=a.c2d;a.d2c=function(f,g){return t(s(f),g)},a.c2d=function(f,g){return c(r(f,g))}}a.makeCalcdata=function(f,g){var v=f[g],T=f._length,l,_,w=function(p){return a.d2c(p,f.thetaunit)};if(v)for(l=new Array(T),_=0;_0?p:1/0},E=A(w,S),y=d.mod(E+1,w.length);return[w[E],w[y]]}function g(_){return Math.abs(_)>1e-10?_:0}function v(_,w,S){w=w||0,S=S||0;for(var E=_.length,y=new Array(E),b=0;b0?1:0}function x(r){var o=r[0],a=r[1];if(!isFinite(o)||!isFinite(a))return[1,0];var i=(o+1)*(o+1)+a*a;return[(o*o+a*a-1)/i,2*a/i]}function A(r,o){var a=o[0],i=o[1];return[a*r.radius+r.cx,-i*r.radius+r.cy]}function M(r,o){return o*r.radius}function e(r,o,a,i){var n=A(r,x([a,o])),s=n[0],c=n[1],f=A(r,x([i,o])),g=f[0],v=f[1];if(o===0)return["M"+s+","+c,"L"+g+","+v].join(" ");var T=M(r,1/Math.abs(o));return["M"+s+","+c,"A"+T+","+T+" 0 0,"+(o<0?1:0)+" "+g+","+v].join(" ")}function t(r,o,a,i){var n=M(r,1/(o+1)),s=A(r,x([o,a])),c=s[0],f=s[1],g=A(r,x([o,i])),v=g[0],T=g[1];if(d(a)!==d(i)){var l=A(r,x([o,0])),_=l[0],w=l[1];return["M"+c+","+f,"A"+n+","+n+" 0 0,"+(0it?(ot=re,tt=re*it,_e=(ce-tt)/X.h/2,lt=[j[0],j[1]],Ee=[ee[0]+_e,ee[1]-_e]):(ot=ce/it,tt=ce,_e=(re-ot)/X.w/2,lt=[j[0]+_e,j[1]-_e],Ee=[ee[0],ee[1]]),$.xLength2=ot,$.yLength2=tt,$.xDomain2=lt,$.yDomain2=Ee;var fe=$.xOffset2=X.l+X.w*lt[0],Fe=$.yOffset2=X.t+X.h*(1-Ee[1]),rt=$.radius=ot/ze,st=$.innerRadius=$.getHole(G)*rt,Qe=$.cx=fe-rt*Ae[0],Lt=$.cy=Fe+rt*Ae[3],kt=$.cxx=Qe-fe,Vt=$.cyy=Lt-Fe,Zt=oe.side,Sr;Zt==="counterclockwise"?(Sr=Zt,Zt="top"):Zt==="clockwise"&&(Sr=Zt,Zt="bottom"),$.radialAxis=$.mockAxis(he,G,oe,{_id:"x",side:Zt,_trueSide:Sr,domain:[st/X.w,rt/X.w]}),$.angularAxis=$.mockAxis(he,G,ie,{side:"right",domain:[0,Math.PI],autorange:!1}),$.doAutoRange(he,G),$.updateAngularAxis(he,G),$.updateRadialAxis(he,G),$.updateRadialAxisTitle(he,G),$.xaxis=$.mockCartesianAxis(he,G,{_id:"x",domain:lt}),$.yaxis=$.mockCartesianAxis(he,G,{_id:"y",domain:Ee});var xr=$.pathSubplot();$.clipPaths.forTraces.select("path").attr("d",xr).attr("transform",t(kt,Vt)),J.frontplot.attr("transform",t(fe,Fe)).call(o.setClipUrl,$._hasClipOnAxisFalse?null:$.clipIds.forTraces,$.gd),J.bg.attr("d",xr).attr("transform",t(Qe,Lt)).call(r.fill,G.bgcolor)},U.mockAxis=function(he,G,$,J){var X=M.extendFlat({},$,J);return s(X,G,he),X},U.mockCartesianAxis=function(he,G,$){var J=this,X=J.isSmith,oe=$._id,ie=M.extendFlat({type:"linear"},$);n(ie,he);var j={x:[0,2],y:[1,3]};return ie.setRange=function(){var ee=J.sectorBBox,re=j[oe],ce=J.radialAxis._rl,be=(ce[1]-ce[0])/(1-J.getHole(G));ie.range=[ee[re[0]]*be,ee[re[1]]*be]},ie.isPtWithinRange=oe==="x"&&!X?function(ee){return J.isPtInside(ee)}:function(){return!0},ie.setRange(),ie.setScale(),ie},U.doAutoRange=function(he,G){var $=this,J=$.gd,X=$.radialAxis,oe=$.getRadial(G);c(J,X);var ie=X.range;if(oe.range=ie.slice(),oe._input.range=ie.slice(),X._rl=[X.r2l(ie[0],null,"gregorian"),X.r2l(ie[1],null,"gregorian")],X.minallowed!==void 0){var j=X.r2l(X.minallowed);X._rl[0]>X._rl[1]?X._rl[1]=Math.max(X._rl[1],j):X._rl[0]=Math.max(X._rl[0],j)}if(X.maxallowed!==void 0){var ee=X.r2l(X.maxallowed);X._rl[0]90&&ce<=270&&(be.tickangle=180);var Re=ze?function(rt){var st=z($,h([rt.x,0]));return t(st[0]-j,st[1]-ee)}:function(rt){return t(be.l2p(rt.x)+ie,0)},Xe=ze?function(rt){return L($,rt.x,-1/0,1/0)}:function(rt){return $.pathArc(be.r2p(rt.x)+ie)},it=W(re);if($.radialTickLayout!==it&&(X["radial-axis"].selectAll(".xtick").remove(),$.radialTickLayout=it),Ae){be.setScale();var ot=0,tt=ze?(be.tickvals||[]).filter(function(rt){return rt>=0}).map(function(rt){return i.tickText(be,rt,!0,!1)}):i.calcTicks(be),lt=ze?tt:i.clipEnds(be,tt),Ee=i.getTickSigns(be)[2];ze&&((be.ticks==="top"&&be.side==="bottom"||be.ticks==="bottom"&&be.side==="top")&&(Ee=-Ee),be.ticks==="top"&&be.side==="top"&&(ot=-be.ticklen),be.ticks==="bottom"&&be.side==="bottom"&&(ot=be.ticklen)),i.drawTicks(J,be,{vals:tt,layer:X["radial-axis"],path:i.makeTickPath(be,0,Ee),transFn:Re,crisp:!1}),i.drawGrid(J,be,{vals:lt,layer:X["radial-grid"],path:Xe,transFn:M.noop,crisp:!1}),i.drawLabels(J,be,{vals:tt,layer:X["radial-axis"],transFn:Re,labelFns:i.makeLabelFns(be,ot)})}var _e=$.radialAxisAngle=$.vangles?I(ue(O(re.angle),$.vangles)):re.angle,fe=t(j,ee),Fe=fe+e(-_e);le(X["radial-axis"],Ae&&(re.showticklabels||re.ticks),{transform:Fe}),le(X["radial-grid"],Ae&&re.showgrid,{transform:ze?"":fe}),le(X["radial-line"].select("line"),Ae&&re.showline,{x1:ze?-oe:ie,y1:0,x2:oe,y2:0,transform:Fe}).attr("stroke-width",re.linewidth).call(r.stroke,re.linecolor)},U.updateRadialAxisTitle=function(he,G,$){if(!this.isSmith){var J=this,X=J.gd,oe=J.radius,ie=J.cx,j=J.cy,ee=J.getRadial(G),re=J.id+"title",ce=0;if(ee.title){var be=o.bBox(J.layers["radial-axis"].node()).height,Ae=ee.title.font.size,ze=ee.side;ce=ze==="top"?Ae:ze==="counterclockwise"?-(be+Ae*.4):be+Ae*.8}var Re=$!==void 0?$:J.radialAxisAngle,Xe=O(Re),it=Math.cos(Xe),ot=Math.sin(Xe),tt=ie+oe/2*it+ce*ot,lt=j-oe/2*ot+ce*it;J.layers["radial-axis-title"]=T.draw(X,re,{propContainer:ee,propName:J.id+".radialaxis.title",placeholder:F(X,"Click to enter radial axis title"),attributes:{x:tt,y:lt,"text-anchor":"middle"},transform:{rotate:-Re}})}},U.updateAngularAxis=function(he,G){var $=this,J=$.gd,X=$.layers,oe=$.radius,ie=$.innerRadius,j=$.cx,ee=$.cy,re=$.getAngular(G),ce=$.angularAxis,be=$.isSmith;be||($.fillViewInitialKey("angularaxis.rotation",re.rotation),ce.setGeometry(),ce.setScale());var Ae=be?function(st){var Qe=z($,h([0,st.x]));return Math.atan2(Qe[0]-j,Qe[1]-ee)-Math.PI/2}:function(st){return ce.t2g(st.x)};ce.type==="linear"&&ce.thetaunit==="radians"&&(ce.tick0=I(ce.tick0),ce.dtick=I(ce.dtick));var ze=function(st){return t(j+oe*Math.cos(st),ee-oe*Math.sin(st))},Re=be?function(st){var Qe=z($,h([0,st.x]));return t(Qe[0],Qe[1])}:function(st){return ze(Ae(st))},Xe=be?function(st){var Qe=z($,h([0,st.x])),Lt=Math.atan2(Qe[0]-j,Qe[1]-ee)-Math.PI/2;return t(Qe[0],Qe[1])+e(-I(Lt))}:function(st){var Qe=Ae(st);return ze(Qe)+e(-I(Qe))},it=be?function(st){return P($,st.x,0,1/0)}:function(st){var Qe=Ae(st),Lt=Math.cos(Qe),kt=Math.sin(Qe);return"M"+[j+ie*Lt,ee-ie*kt]+"L"+[j+oe*Lt,ee-oe*kt]},ot=i.makeLabelFns(ce,0),tt=ot.labelStandoff,lt={};lt.xFn=function(st){var Qe=Ae(st);return Math.cos(Qe)*tt},lt.yFn=function(st){var Qe=Ae(st),Lt=Math.sin(Qe)>0?.2:1;return-Math.sin(Qe)*(tt+st.fontSize*Lt)+Math.abs(Math.cos(Qe))*(st.fontSize*b)},lt.anchorFn=function(st){var Qe=Ae(st),Lt=Math.cos(Qe);return Math.abs(Lt)<.1?"middle":Lt>0?"start":"end"},lt.heightFn=function(st,Qe,Lt){var kt=Ae(st);return-.5*(1+Math.sin(kt))*Lt};var Ee=W(re);$.angularTickLayout!==Ee&&(X["angular-axis"].selectAll("."+ce._id+"tick").remove(),$.angularTickLayout=Ee);var _e=be?[1/0].concat(ce.tickvals||[]).map(function(st){return i.tickText(ce,st,!0,!1)}):i.calcTicks(ce);be&&(_e[0].text="\u221E",_e[0].fontSize*=1.75);var fe;if(G.gridshape==="linear"?(fe=_e.map(Ae),M.angleDelta(fe[0],fe[1])<0&&(fe=fe.slice().reverse())):fe=null,$.vangles=fe,ce.type==="category"&&(_e=_e.filter(function(st){return M.isAngleInsideSector(Ae(st),$.sectorInRad)})),ce.visible){var Fe=ce.ticks==="inside"?-1:1,rt=(ce.linewidth||1)/2;i.drawTicks(J,ce,{vals:_e,layer:X["angular-axis"],path:"M"+Fe*rt+",0h"+Fe*ce.ticklen,transFn:Xe,crisp:!1}),i.drawGrid(J,ce,{vals:_e,layer:X["angular-grid"],path:it,transFn:M.noop,crisp:!1}),i.drawLabels(J,ce,{vals:_e,layer:X["angular-axis"],repositionOnUpdate:!0,transFn:Re,labelFns:lt})}le(X["angular-line"].select("path"),re.showline,{d:$.pathSubplot(),transform:t(j,ee)}).attr("stroke-width",re.linewidth).call(r.stroke,re.linecolor)},U.updateFx=function(he,G){if(!this.gd._context.staticPlot){var $=!this.isSmith;$&&(this.updateAngularDrag(he),this.updateRadialDrag(he,G,0),this.updateRadialDrag(he,G,1)),this.updateHoverAndMainDrag(he)}},U.updateHoverAndMainDrag=function(he){var G=this,$=G.isSmith,J=G.gd,X=G.layers,oe=he._zoomlayer,ie=p.MINZOOM,j=p.OFFEDGE,ee=G.radius,re=G.innerRadius,ce=G.cx,be=G.cy,Ae=G.cxx,ze=G.cyy,Re=G.sectorInRad,Xe=G.vangles,it=G.radialAxis,ot=u.clampTiny,tt=u.findXYatLength,lt=u.findEnclosingVertexAngles,Ee=p.cornerHalfWidth,_e=p.cornerLen/2,fe,Fe,rt=f.makeDragger(X,"path","maindrag",he.dragmode===!1?"none":"crosshair");d.select(rt).attr("d",G.pathSubplot()).attr("transform",t(ce,be)),rt.onmousemove=function(rr){v.hover(J,rr,G.id),J._fullLayout._lasthover=rt,J._fullLayout._hoversubplot=G.id},rt.onmouseout=function(rr){J._dragging||g.unhover(J,rr)};var st={element:rt,gd:J,subplot:G.id,plotinfo:{id:G.id,xaxis:G.xaxis,yaxis:G.yaxis},xaxes:[G.xaxis],yaxes:[G.yaxis]},Qe,Lt,kt,Vt,Zt,Sr,xr,jr,wr;function Ir(rr,Qt){return Math.sqrt(rr*rr+Qt*Qt)}function bt(rr,Qt){return Ir(rr-Ae,Qt-ze)}function Be(rr,Qt){return Math.atan2(ze-Qt,rr-Ae)}function Ke(rr,Qt){return[rr*Math.cos(Qt),rr*Math.sin(-Qt)]}function Ue(rr,Qt){if(rr===0)return G.pathSector(2*Ee);var Tr=_e/rr,la=Qt-Tr,Ua=Qt+Tr,Ba=Math.max(0,Math.min(rr,ee)),Ra=Ba-Ee,ei=Ba+Ee;return"M"+Ke(Ra,la)+"A"+[Ra,Ra]+" 0,0,0 "+Ke(Ra,Ua)+"L"+Ke(ei,Ua)+"A"+[ei,ei]+" 0,0,1 "+Ke(ei,la)+"Z"}function Me(rr,Qt,Tr){if(rr===0)return G.pathSector(2*Ee);var la=Ke(rr,Qt),Ua=Ke(rr,Tr),Ba=ot((la[0]+Ua[0])/2),Ra=ot((la[1]+Ua[1])/2),ei,za;if(Ba&&Ra){var ti=Ra/Ba,Ci=-1/ti,Jt=tt(Ee,ti,Ba,Ra);ei=tt(_e,Ci,Jt[0][0],Jt[0][1]),za=tt(_e,Ci,Jt[1][0],Jt[1][1])}else{var Nt,Kt;Ra?(Nt=_e,Kt=Ee):(Nt=Ee,Kt=_e),ei=[[Ba-Nt,Ra-Kt],[Ba+Nt,Ra-Kt]],za=[[Ba-Nt,Ra+Kt],[Ba+Nt,Ra+Kt]]}return"M"+ei.join("L")+"L"+za.reverse().join("L")+"Z"}function qe(){kt=null,Vt=null,Zt=G.pathSubplot(),Sr=!1;var rr=J._fullLayout[G.id];xr=x(rr.bgcolor).getLuminance(),jr=f.makeZoombox(oe,xr,ce,be,Zt),jr.attr("fill-rule","evenodd"),wr=f.makeCorners(oe,ce,be),w(J)}function Ce(rr,Qt){return Qt=Math.max(Math.min(Qt,ee),re),rrie?(rr-1&&rr===1&&_(Qt,J,[G.xaxis],[G.yaxis],G.id,st),Tr.indexOf("event")>-1&&v.click(J,Qt,G.id)}st.prepFn=function(rr,Qt,Tr){var la=J._fullLayout.dragmode,Ua=rt.getBoundingClientRect();J._fullLayout._calcInverseTransform(J);var Ba=J._fullLayout._invTransform;fe=J._fullLayout._invScaleX,Fe=J._fullLayout._invScaleY;var Ra=M.apply3DTransform(Ba)(Qt-Ua.left,Tr-Ua.top);if(Qe=Ra[0],Lt=Ra[1],Xe){var ei=u.findPolygonOffset(ee,Re[0],Re[1],Xe);Qe+=Ae+ei[0],Lt+=ze+ei[1]}switch(la){case"zoom":st.clickFn=Gt,$||(Xe?st.moveFn=yt:st.moveFn=Pe,st.doneFn=Tt,qe(rr,Qt,Tr));break;case"select":case"lasso":l(rr,Qt,Tr,st,la);break}},g.init(st)},U.updateRadialDrag=function(he,G,$){var J=this,X=J.gd,oe=J.layers,ie=J.radius,j=J.innerRadius,ee=J.cx,re=J.cy,ce=J.radialAxis,be=p.radialDragBoxSize,Ae=be/2;if(!ce.visible)return;var ze=O(J.radialAxisAngle),Re=ce._rl,Xe=Re[0],it=Re[1],ot=Re[$],tt=.75*(Re[1]-Re[0])/(1-J.getHole(G))/ie,lt,Ee,_e;$?(lt=ee+(ie+Ae)*Math.cos(ze),Ee=re-(ie+Ae)*Math.sin(ze),_e="radialdrag"):(lt=ee+(j-Ae)*Math.cos(ze),Ee=re-(j-Ae)*Math.sin(ze),_e="radialdrag-inner");var fe=f.makeRectDragger(oe,_e,"crosshair",-Ae,-Ae,be,be),Fe={element:fe,gd:X};he.dragmode===!1&&(Fe.dragmode=!1),le(d.select(fe),ce.visible&&j0!=($?Qe>Xe:Qe=90||X>90&&oe>=450?ze=1:j<=0&&re<=0?ze=0:ze=Math.max(j,re),X<=180&&oe>=180||X>180&&oe>=540?ce=-1:ie>=0&&ee>=0?ce=0:ce=Math.min(ie,ee),X<=270&&oe>=270||X>270&&oe>=630?be=-1:j>=0&&re>=0?be=0:be=Math.min(j,re),oe>=360?Ae=1:ie<=0&&ee<=0?Ae=0:Ae=Math.max(ie,ee),[ce,be,Ae,ze]}function ue(he,G){var $=function(X){return M.angleDist(he,X)},J=M.findIndexOfMin(G,$);return G[J]}function le(he,G,$){return G?(he.attr("display",null),he.attr($)):he&&he.attr("display","none"),he}}}),oC=Ze({"src/plots/polar/layout_attributes.js"(Z,q){"use strict";var d=oh(),x=Wh(),A=bc().attributes,M=ca().extendFlat,e=pc().overrideAll,t=e({color:x.color,showline:M({},x.showline,{dflt:!0}),linecolor:x.linecolor,linewidth:x.linewidth,showgrid:M({},x.showgrid,{dflt:!0}),gridcolor:x.gridcolor,gridwidth:x.gridwidth,griddash:x.griddash},"plot","from-root"),r=e({tickmode:x.minor.tickmode,nticks:x.nticks,tick0:x.tick0,dtick:x.dtick,tickvals:x.tickvals,ticktext:x.ticktext,ticks:x.ticks,ticklen:x.ticklen,tickwidth:x.tickwidth,tickcolor:x.tickcolor,ticklabelstep:x.ticklabelstep,showticklabels:x.showticklabels,labelalias:x.labelalias,minorloglabels:x.minorloglabels,showtickprefix:x.showtickprefix,tickprefix:x.tickprefix,showticksuffix:x.showticksuffix,ticksuffix:x.ticksuffix,showexponent:x.showexponent,exponentformat:x.exponentformat,minexponent:x.minexponent,separatethousands:x.separatethousands,tickfont:x.tickfont,tickangle:x.tickangle,tickformat:x.tickformat,tickformatstops:x.tickformatstops,layer:x.layer},"plot","from-root"),o={visible:M({},x.visible,{dflt:!0}),type:M({},x.type,{values:["-","linear","log","date","category"]}),autotypenumbers:x.autotypenumbers,autorangeoptions:{minallowed:x.autorangeoptions.minallowed,maxallowed:x.autorangeoptions.maxallowed,clipmin:x.autorangeoptions.clipmin,clipmax:x.autorangeoptions.clipmax,include:x.autorangeoptions.include,editType:"plot"},autorange:M({},x.autorange,{editType:"plot"}),rangemode:{valType:"enumerated",values:["tozero","nonnegative","normal"],dflt:"tozero",editType:"calc"},minallowed:M({},x.minallowed,{editType:"plot"}),maxallowed:M({},x.maxallowed,{editType:"plot"}),range:M({},x.range,{items:[{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}}],editType:"plot"}),categoryorder:x.categoryorder,categoryarray:x.categoryarray,angle:{valType:"angle",editType:"plot"},autotickangles:x.autotickangles,side:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"clockwise",editType:"plot"},title:{text:M({},x.title.text,{editType:"plot",dflt:""}),font:M({},x.title.font,{editType:"plot"}),editType:"plot"},hoverformat:x.hoverformat,uirevision:{valType:"any",editType:"none"},editType:"calc"};M(o,t,r);var a={visible:M({},x.visible,{dflt:!0}),type:{valType:"enumerated",values:["-","linear","category"],dflt:"-",editType:"calc",_noTemplating:!0},autotypenumbers:x.autotypenumbers,categoryorder:x.categoryorder,categoryarray:x.categoryarray,thetaunit:{valType:"enumerated",values:["radians","degrees"],dflt:"degrees",editType:"calc"},period:{valType:"number",editType:"calc",min:0},direction:{valType:"enumerated",values:["counterclockwise","clockwise"],dflt:"counterclockwise",editType:"calc"},rotation:{valType:"angle",editType:"calc"},hoverformat:x.hoverformat,uirevision:{valType:"any",editType:"none"},editType:"calc"};M(a,t,r),q.exports={domain:A({name:"polar",editType:"plot"}),sector:{valType:"info_array",items:[{valType:"number",editType:"plot"},{valType:"number",editType:"plot"}],dflt:[0,360],editType:"plot"},hole:{valType:"number",min:0,max:1,dflt:0,editType:"plot"},bgcolor:{valType:"color",editType:"plot",dflt:d.background},radialaxis:o,angularaxis:a,gridshape:{valType:"enumerated",values:["circular","linear"],dflt:"circular",editType:"plot"},uirevision:{valType:"any",editType:"none"},editType:"calc"}}}),TH=Ze({"src/plots/polar/layout_defaults.js"(Z,q){"use strict";var d=ca(),x=Yn(),A=Dl(),M=i0(),e=Hh().getSubplotData,t=X0(),r=t1(),o=$m(),a=Qm(),i=I2(),n=D_(),s=f5(),c=a1(),f=oC(),g=aC(),v=DT(),T=v.axisNames;function l(w,S,E,y){var b=E("bgcolor");y.bgColor=x.combine(b,y.paper_bgcolor);var p=E("sector");E("hole");var u=e(y.fullData,v.name,y.id),m=y.layoutOut,h;function P(be,Ae){return E(h+"."+be,Ae)}for(var L=0;L")}}q.exports={hoverPoints:x,makeHoverPointText:A}}}),MH=Ze({"src/traces/scatterpolar/index.js"(Z,q){"use strict";q.exports={moduleType:"trace",name:"scatterpolar",basePlotModule:FT(),categories:["polar","symbols","showLegend","scatter-like"],attributes:Cx(),supplyDefaults:OT().supplyDefaults,colorbar:hp(),formatLabels:BT(),calc:AH(),plot:SH(),style:ed().style,styleOnSelect:ed().styleOnSelect,hoverPoints:NT().hoverPoints,selectPoints:c1(),meta:{}}}}),EH=Ze({"lib/scatterpolar.js"(Z,q){"use strict";q.exports=MH()}}),sC=Ze({"src/traces/scatterpolargl/attributes.js"(Z,q){"use strict";var d=Cx(),x=_x(),A=Cs().texttemplateAttrs;q.exports={mode:d.mode,r:d.r,theta:d.theta,r0:d.r0,dr:d.dr,theta0:d.theta0,dtheta:d.dtheta,thetaunit:d.thetaunit,text:d.text,texttemplate:A({editType:"plot"},{keys:["r","theta","text"]}),hovertext:d.hovertext,hovertemplate:d.hovertemplate,line:{color:x.line.color,width:x.line.width,dash:x.line.dash,editType:"calc"},connectgaps:x.connectgaps,marker:x.marker,fill:x.fill,fillcolor:x.fillcolor,textposition:x.textposition,textfont:x.textfont,hoverinfo:d.hoverinfo,selected:d.selected,unselected:d.unselected}}}),CH=Ze({"src/traces/scatterpolargl/defaults.js"(Z,q){"use strict";var d=ca(),x=Fu(),A=OT().handleRThetaDefaults,M=md(),e=Dd(),t=zd(),r=ev(),o=Tv().PTS_LINESONLY,a=sC();q.exports=function(n,s,c,f){function g(T,l){return d.coerce(n,s,a,T,l)}var v=A(n,s,f,g);if(!v){s.visible=!1;return}g("thetaunit"),g("mode",v=r&&(y.marker.cluster=_.tree),y.marker&&(y.markerSel.positions=y.markerUnsel.positions=y.marker.positions=m),y.line&&m.length>1&&t.extendFlat(y.line,e.linePositions(i,l,m)),y.text&&(t.extendFlat(y.text,{positions:m},e.textPosition(i,l,y.text,y.marker)),t.extendFlat(y.textSel,{positions:m},e.textPosition(i,l,y.text,y.markerSel)),t.extendFlat(y.textUnsel,{positions:m},e.textPosition(i,l,y.text,y.markerUnsel))),y.fill&&!g.fill2d&&(g.fill2d=!0),y.marker&&!g.scatter2d&&(g.scatter2d=!0),y.line&&!g.line2d&&(g.line2d=!0),y.text&&!g.glText&&(g.glText=!0),g.lineOptions.push(y.line),g.fillOptions.push(y.fill),g.markerOptions.push(y.marker),g.markerSelectedOptions.push(y.markerSel),g.markerUnselectedOptions.push(y.markerUnsel),g.textOptions.push(y.text),g.textSelectedOptions.push(y.textSel),g.textUnselectedOptions.push(y.textUnsel),g.selectBatch.push([]),g.unselectBatch.push([]),_.x=h,_.y=P,_.rawx=h,_.rawy=P,_.r=S,_.theta=E,_.positions=m,_._scene=g,_.index=g.count,g.count++}}),A(i,n,s)}},q.exports.reglPrecompiled=o}}),DH=Ze({"src/traces/scatterpolargl/index.js"(Z,q){"use strict";var d=IH();d.plot=RH(),q.exports=d}}),zH=Ze({"lib/scatterpolargl.js"(Z,q){"use strict";q.exports=DH()}}),lC=Ze({"src/traces/barpolar/attributes.js"(Z,q){"use strict";var d=Cs().hovertemplateAttrs,x=rs().extendFlat,A=Cx(),M=Sv();q.exports={r:A.r,theta:A.theta,r0:A.r0,dr:A.dr,theta0:A.theta0,dtheta:A.dtheta,thetaunit:A.thetaunit,base:x({},M.base,{}),offset:x({},M.offset,{}),width:x({},M.width,{}),text:x({},M.text,{}),hovertext:x({},M.hovertext,{}),marker:e(),hoverinfo:A.hoverinfo,hovertemplate:d(),selected:M.selected,unselected:M.unselected};function e(){var t=x({},M.marker);return delete t.cornerradius,t}}}),uC=Ze({"src/traces/barpolar/layout_attributes.js"(Z,q){"use strict";q.exports={barmode:{valType:"enumerated",values:["stack","overlay"],dflt:"stack",editType:"calc"},bargap:{valType:"number",dflt:.1,min:0,max:1,editType:"calc"}}}}),FH=Ze({"src/traces/barpolar/defaults.js"(Z,q){"use strict";var d=ca(),x=OT().handleRThetaDefaults,A=j2(),M=lC();q.exports=function(t,r,o,a){function i(s,c){return d.coerce(t,r,M,s,c)}var n=x(t,r,a,i);if(!n){r.visible=!1;return}i("thetaunit"),i("base"),i("offset"),i("width"),i("text"),i("hovertext"),i("hovertemplate"),A(t,r,i,o,a),d.coerceSelectionMarkerOpacity(r,i)}}}),OH=Ze({"src/traces/barpolar/layout_defaults.js"(Z,q){"use strict";var d=ca(),x=uC();q.exports=function(A,M,e){var t={},r;function o(n,s){return d.coerce(A[r]||{},M[r],x,n,s)}for(var a=0;a0?(f=s,g=c):(f=c,g=s);var v=e.findEnclosingVertexAngles(f,r.vangles)[0],T=e.findEnclosingVertexAngles(g,r.vangles)[1],l=[v,(f+g)/2,T];return e.pathPolygonAnnulus(i,n,f,g,l,o,a)}:function(i,n,s,c){return A.pathAnnulus(i,n,s,c,o,a)}}}}),NH=Ze({"src/traces/barpolar/hover.js"(Z,q){"use strict";var d=ef(),x=ca(),A=f1().getTraceColor,M=x.fillText,e=NT().makeHoverPointText,t=zT().isPtInsidePolygon;q.exports=function(o,a,i){var n=o.cd,s=n[0].trace,c=o.subplot,f=c.radialAxis,g=c.angularAxis,v=c.vangles,T=v?t:x.isPtInsideSector,l=o.maxHoverDistance,_=g._period||2*Math.PI,w=Math.abs(f.g2p(Math.sqrt(a*a+i*i))),S=Math.atan2(i,a);f.range[0]>f.range[1]&&(S+=Math.PI);var E=function(u){return T(w,S,[u.rp0,u.rp1],[u.thetag0,u.thetag1],v)?l+Math.min(1,Math.abs(u.thetag1-u.thetag0)/_)-1+(u.rp1-w)/(u.rp1-u.rp0)-1:1/0};if(d.getClosest(n,E,o),o.index!==!1){var y=o.index,b=n[y];o.x0=o.x1=b.ct[0],o.y0=o.y1=b.ct[1];var p=x.extendFlat({},b,{r:b.s,theta:b.p});return M(b,s,o),e(p,s,c,o),o.hovertemplate=s.hovertemplate,o.color=A(s,b),o.xLabelVal=o.yLabelVal=void 0,b.s<0&&(o.idealAlign="left"),[o]}}}}),UH=Ze({"src/traces/barpolar/index.js"(Z,q){"use strict";q.exports={moduleType:"trace",name:"barpolar",basePlotModule:FT(),categories:["polar","bar","showLegend"],attributes:lC(),layoutAttributes:uC(),supplyDefaults:FH(),supplyLayoutDefaults:OH(),calc:cC().calc,crossTraceCalc:cC().crossTraceCalc,plot:BH(),colorbar:hp(),formatLabels:BT(),style:Nd().style,styleOnSelect:Nd().styleOnSelect,hoverPoints:NH(),selectPoints:h1(),meta:{}}}}),jH=Ze({"lib/barpolar.js"(Z,q){"use strict";q.exports=UH()}}),fC=Ze({"src/plots/smith/constants.js"(Z,q){"use strict";q.exports={attr:"subplot",name:"smith",axisNames:["realaxis","imaginaryaxis"],axisName2dataArray:{imaginaryaxis:"imag",realaxis:"real"}}}}),hC=Ze({"src/plots/smith/layout_attributes.js"(Z,q){"use strict";var d=oh(),x=Wh(),A=bc().attributes,M=ca().extendFlat,e=pc().overrideAll,t=e({color:x.color,showline:M({},x.showline,{dflt:!0}),linecolor:x.linecolor,linewidth:x.linewidth,showgrid:M({},x.showgrid,{dflt:!0}),gridcolor:x.gridcolor,gridwidth:x.gridwidth,griddash:x.griddash},"plot","from-root"),r=e({ticklen:x.ticklen,tickwidth:M({},x.tickwidth,{dflt:2}),tickcolor:x.tickcolor,showticklabels:x.showticklabels,labelalias:x.labelalias,showtickprefix:x.showtickprefix,tickprefix:x.tickprefix,showticksuffix:x.showticksuffix,ticksuffix:x.ticksuffix,tickfont:x.tickfont,tickformat:x.tickformat,hoverformat:x.hoverformat,layer:x.layer},"plot","from-root"),o=M({visible:M({},x.visible,{dflt:!0}),tickvals:{dflt:[.2,.5,1,2,5],valType:"data_array",editType:"plot"},tickangle:M({},x.tickangle,{dflt:90}),ticks:{valType:"enumerated",values:["top","bottom",""],editType:"ticks"},side:{valType:"enumerated",values:["top","bottom"],dflt:"top",editType:"plot"},editType:"calc"},t,r),a=M({visible:M({},x.visible,{dflt:!0}),tickvals:{valType:"data_array",editType:"plot"},ticks:x.ticks,editType:"calc"},t,r);q.exports={domain:A({name:"smith",editType:"plot"}),bgcolor:{valType:"color",editType:"plot",dflt:d.background},realaxis:o,imaginaryaxis:a,editType:"calc"}}}),qH=Ze({"src/plots/smith/layout_defaults.js"(Z,q){"use strict";var d=ca(),x=Yn(),A=Dl(),M=i0(),e=Hh().getSubplotData,t=Qm(),r=$m(),o=D_(),a=wv(),i=hC(),n=fC(),s=n.axisNames,c=g(function(v){return d.isTypedArray(v)&&(v=Array.from(v)),v.slice().reverse().map(function(T){return-T}).concat([0]).concat(v)},String);function f(v,T,l,_){var w=l("bgcolor");_.bgColor=x.combine(w,_.paper_bgcolor);var S=e(_.fullData,n.name,_.id),E=_.layoutOut,y;function b(U,W){return l(y+"."+U,W)}for(var p=0;p")}}q.exports={hoverPoints:x,makeHoverPointText:A}}}),YH=Ze({"src/traces/scattersmith/index.js"(Z,q){"use strict";q.exports={moduleType:"trace",name:"scattersmith",basePlotModule:VH(),categories:["smith","symbols","showLegend","scatter-like"],attributes:pC(),supplyDefaults:GH(),colorbar:hp(),formatLabels:HH(),calc:WH(),plot:XH(),style:ed().style,styleOnSelect:ed().styleOnSelect,hoverPoints:ZH().hoverPoints,selectPoints:c1(),meta:{}}}}),KH=Ze({"lib/scattersmith.js"(Z,q){"use strict";q.exports=YH()}}),Sp=Ze({"node_modules/world-calendars/dist/main.js"(Z,q){var d=sh();function x(){this.regionalOptions=[],this.regionalOptions[""]={invalidCalendar:"Calendar {0} not found",invalidDate:"Invalid {0} date",invalidMonth:"Invalid {0} month",invalidYear:"Invalid {0} year",differentCalendars:"Cannot mix {0} and {1} dates"},this.local=this.regionalOptions[""],this.calendars={},this._localCals={}}d(x.prototype,{instance:function(o,a){o=(o||"gregorian").toLowerCase(),a=a||"";var i=this._localCals[o+"-"+a];if(!i&&this.calendars[o]&&(i=new this.calendars[o](a),this._localCals[o+"-"+a]=i),!i)throw(this.local.invalidCalendar||this.regionalOptions[""].invalidCalendar).replace(/\{0\}/,o);return i},newDate:function(o,a,i,n,s){return n=(o!=null&&o.year?o.calendar():typeof n=="string"?this.instance(n,s):n)||this.instance(),n.newDate(o,a,i)},substituteDigits:function(o){return function(a){return(a+"").replace(/[0-9]/g,function(i){return o[i]})}},substituteChineseDigits:function(o,a){return function(i){for(var n="",s=0;i>0;){var c=i%10;n=(c===0?"":o[c]+a[s])+n,s++,i=Math.floor(i/10)}return n.indexOf(o[1]+a[1])===0&&(n=n.substr(1)),n||o[0]}}});function A(o,a,i,n){if(this._calendar=o,this._year=a,this._month=i,this._day=n,this._calendar._validateLevel===0&&!this._calendar.isValid(this._year,this._month,this._day))throw(r.local.invalidDate||r.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name)}function M(o,a){return o=""+o,"000000".substring(0,a-o.length)+o}d(A.prototype,{newDate:function(o,a,i){return this._calendar.newDate(o??this,a,i)},year:function(o){return arguments.length===0?this._year:this.set(o,"y")},month:function(o){return arguments.length===0?this._month:this.set(o,"m")},day:function(o){return arguments.length===0?this._day:this.set(o,"d")},date:function(o,a,i){if(!this._calendar.isValid(o,a,i))throw(r.local.invalidDate||r.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name);return this._year=o,this._month=a,this._day=i,this},leapYear:function(){return this._calendar.leapYear(this)},epoch:function(){return this._calendar.epoch(this)},formatYear:function(){return this._calendar.formatYear(this)},monthOfYear:function(){return this._calendar.monthOfYear(this)},weekOfYear:function(){return this._calendar.weekOfYear(this)},daysInYear:function(){return this._calendar.daysInYear(this)},dayOfYear:function(){return this._calendar.dayOfYear(this)},daysInMonth:function(){return this._calendar.daysInMonth(this)},dayOfWeek:function(){return this._calendar.dayOfWeek(this)},weekDay:function(){return this._calendar.weekDay(this)},extraInfo:function(){return this._calendar.extraInfo(this)},add:function(o,a){return this._calendar.add(this,o,a)},set:function(o,a){return this._calendar.set(this,o,a)},compareTo:function(o){if(this._calendar.name!==o._calendar.name)throw(r.local.differentCalendars||r.regionalOptions[""].differentCalendars).replace(/\{0\}/,this._calendar.local.name).replace(/\{1\}/,o._calendar.local.name);var a=this._year!==o._year?this._year-o._year:this._month!==o._month?this.monthOfYear()-o.monthOfYear():this._day-o._day;return a===0?0:a<0?-1:1},calendar:function(){return this._calendar},toJD:function(){return this._calendar.toJD(this)},fromJD:function(o){return this._calendar.fromJD(o)},toJSDate:function(){return this._calendar.toJSDate(this)},fromJSDate:function(o){return this._calendar.fromJSDate(o)},toString:function(){return(this.year()<0?"-":"")+M(Math.abs(this.year()),4)+"-"+M(this.month(),2)+"-"+M(this.day(),2)}});function e(){this.shortYearCutoff="+10"}d(e.prototype,{_validateLevel:0,newDate:function(o,a,i){return o==null?this.today():(o.year&&(this._validate(o,a,i,r.local.invalidDate||r.regionalOptions[""].invalidDate),i=o.day(),a=o.month(),o=o.year()),new A(this,o,a,i))},today:function(){return this.fromJSDate(new Date)},epoch:function(o){var a=this._validate(o,this.minMonth,this.minDay,r.local.invalidYear||r.regionalOptions[""].invalidYear);return a.year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(o){var a=this._validate(o,this.minMonth,this.minDay,r.local.invalidYear||r.regionalOptions[""].invalidYear);return(a.year()<0?"-":"")+M(Math.abs(a.year()),4)},monthsInYear:function(o){return this._validate(o,this.minMonth,this.minDay,r.local.invalidYear||r.regionalOptions[""].invalidYear),12},monthOfYear:function(o,a){var i=this._validate(o,a,this.minDay,r.local.invalidMonth||r.regionalOptions[""].invalidMonth);return(i.month()+this.monthsInYear(i)-this.firstMonth)%this.monthsInYear(i)+this.minMonth},fromMonthOfYear:function(o,a){var i=(a+this.firstMonth-2*this.minMonth)%this.monthsInYear(o)+this.minMonth;return this._validate(o,i,this.minDay,r.local.invalidMonth||r.regionalOptions[""].invalidMonth),i},daysInYear:function(o){var a=this._validate(o,this.minMonth,this.minDay,r.local.invalidYear||r.regionalOptions[""].invalidYear);return this.leapYear(a)?366:365},dayOfYear:function(o,a,i){var n=this._validate(o,a,i,r.local.invalidDate||r.regionalOptions[""].invalidDate);return n.toJD()-this.newDate(n.year(),this.fromMonthOfYear(n.year(),this.minMonth),this.minDay).toJD()+1},daysInWeek:function(){return 7},dayOfWeek:function(o,a,i){var n=this._validate(o,a,i,r.local.invalidDate||r.regionalOptions[""].invalidDate);return(Math.floor(this.toJD(n))+2)%this.daysInWeek()},extraInfo:function(o,a,i){return this._validate(o,a,i,r.local.invalidDate||r.regionalOptions[""].invalidDate),{}},add:function(o,a,i){return this._validate(o,this.minMonth,this.minDay,r.local.invalidDate||r.regionalOptions[""].invalidDate),this._correctAdd(o,this._add(o,a,i),a,i)},_add:function(o,a,i){if(this._validateLevel++,i==="d"||i==="w"){var n=o.toJD()+a*(i==="w"?this.daysInWeek():1),s=o.calendar().fromJD(n);return this._validateLevel--,[s.year(),s.month(),s.day()]}try{var c=o.year()+(i==="y"?a:0),f=o.monthOfYear()+(i==="m"?a:0),s=o.day(),g=function(l){for(;f_-1+l.minMonth;)c++,f-=_,_=l.monthsInYear(c)};i==="y"?(o.month()!==this.fromMonthOfYear(c,f)&&(f=this.newDate(c,o.month(),this.minDay).monthOfYear()),f=Math.min(f,this.monthsInYear(c)),s=Math.min(s,this.daysInMonth(c,this.fromMonthOfYear(c,f)))):i==="m"&&(g(this),s=Math.min(s,this.daysInMonth(c,this.fromMonthOfYear(c,f))));var v=[c,this.fromMonthOfYear(c,f),s];return this._validateLevel--,v}catch(T){throw this._validateLevel--,T}},_correctAdd:function(o,a,i,n){if(!this.hasYearZero&&(n==="y"||n==="m")&&(a[0]===0||o.year()>0!=a[0]>0)){var s={y:[1,1,"y"],m:[1,this.monthsInYear(-1),"m"],w:[this.daysInWeek(),this.daysInYear(-1),"d"],d:[1,this.daysInYear(-1),"d"]}[n],c=i<0?-1:1;a=this._add(o,i*s[0]+c*s[1],s[2])}return o.date(a[0],a[1],a[2])},set:function(o,a,i){this._validate(o,this.minMonth,this.minDay,r.local.invalidDate||r.regionalOptions[""].invalidDate);var n=i==="y"?a:o.year(),s=i==="m"?a:o.month(),c=i==="d"?a:o.day();return(i==="y"||i==="m")&&(c=Math.min(c,this.daysInMonth(n,s))),o.date(n,s,c)},isValid:function(o,a,i){this._validateLevel++;var n=this.hasYearZero||o!==0;if(n){var s=this.newDate(o,a,this.minDay);n=a>=this.minMonth&&a-this.minMonth=this.minDay&&i-this.minDay13.5?13:1),T=s-(v>2.5?4716:4715);return T<=0&&T--,this.newDate(T,v,g)},toJSDate:function(o,a,i){var n=this._validate(o,a,i,r.local.invalidDate||r.regionalOptions[""].invalidDate),s=new Date(n.year(),n.month()-1,n.day());return s.setHours(0),s.setMinutes(0),s.setSeconds(0),s.setMilliseconds(0),s.setHours(s.getHours()>12?s.getHours()+2:0),s},fromJSDate:function(o){return this.newDate(o.getFullYear(),o.getMonth()+1,o.getDate())}});var r=q.exports=new x;r.cdate=A,r.baseCalendar=e,r.calendars.gregorian=t}}),JH=Ze({"node_modules/world-calendars/dist/plus.js"(){var Z=sh(),q=Sp();Z(q.regionalOptions[""],{invalidArguments:"Invalid arguments",invalidFormat:"Cannot format a date from another calendar",missingNumberAt:"Missing number at position {0}",unknownNameAt:"Unknown name at position {0}",unexpectedLiteralAt:"Unexpected literal at position {0}",unexpectedText:"Additional text found at end"}),q.local=q.regionalOptions[""],Z(q.cdate.prototype,{formatDate:function(d,x){return typeof d!="string"&&(x=d,d=""),this._calendar.formatDate(d||"",this,x)}}),Z(q.baseCalendar.prototype,{UNIX_EPOCH:q.instance().newDate(1970,1,1).toJD(),SECS_PER_DAY:24*60*60,TICKS_EPOCH:q.instance().jdEpoch,TICKS_PER_DAY:24*60*60*1e7,ATOM:"yyyy-mm-dd",COOKIE:"D, dd M yyyy",FULL:"DD, MM d, yyyy",ISO_8601:"yyyy-mm-dd",JULIAN:"J",RFC_822:"D, d M yy",RFC_850:"DD, dd-M-yy",RFC_1036:"D, d M yy",RFC_1123:"D, d M yyyy",RFC_2822:"D, d M yyyy",RSS:"D, d M yy",TICKS:"!",TIMESTAMP:"@",W3C:"yyyy-mm-dd",formatDate:function(d,x,A){if(typeof d!="string"&&(A=x,x=d,d=""),!x)return"";if(x.calendar()!==this)throw q.local.invalidFormat||q.regionalOptions[""].invalidFormat;d=d||this.local.dateFormat,A=A||{};for(var M=A.dayNamesShort||this.local.dayNamesShort,e=A.dayNames||this.local.dayNames,t=A.monthNumbers||this.local.monthNumbers,r=A.monthNamesShort||this.local.monthNamesShort,o=A.monthNames||this.local.monthNames,a=A.calculateWeek||this.local.calculateWeek,i=function(S,E){for(var y=1;w+y1},n=function(S,E,y,b){var p=""+E;if(i(S,b))for(;p.length1},_=function(P,L){var z=l(P,L),F=[2,3,z?4:2,z?4:2,10,11,20]["oyYJ@!".indexOf(P)+1],B=new RegExp("^-?\\d{1,"+F+"}"),O=x.substring(p).match(B);if(!O)throw(q.local.missingNumberAt||q.regionalOptions[""].missingNumberAt).replace(/\{0\}/,p);return p+=O[0].length,parseInt(O[0],10)},w=this,S=function(){if(typeof o=="function"){l("m");var P=o.call(w,x.substring(p));return p+=P.length,P}return _("m")},E=function(P,L,z,F){for(var B=l(P,F)?z:L,O=0;O-1){c=1,f=g;for(var h=this.daysInMonth(s,c);f>h;h=this.daysInMonth(s,c))c++,f-=h}return n>-1?this.fromJD(n):this.newDate(s,c,f)},determineDate:function(d,x,A,M,e){A&&typeof A!="object"&&(e=M,M=A,A=null),typeof M!="string"&&(e=M,M="");var t=this,r=function(o){try{return t.parseDate(M,o,e)}catch{}o=o.toLowerCase();for(var a=(o.match(/^c/)&&A?A.newDate():null)||t.today(),i=/([+-]?[0-9]+)\s*(d|w|m|y)?/g,n=i.exec(o);n;)a.add(parseInt(n[1],10),n[2]||"d"),n=i.exec(o);return a};return x=x?x.newDate():null,d=d==null?x:typeof d=="string"?r(d):typeof d=="number"?isNaN(d)||d===1/0||d===-1/0?x:t.today().add(d,"d"):t.newDate(d),d}})}}),$H=Ze({"node_modules/world-calendars/dist/calendars/chinese.js"(){var Z=Sp(),q=sh(),d=Z.instance();function x(n){this.local=this.regionalOptions[n||""]||this.regionalOptions[""]}x.prototype=new Z.baseCalendar,q(x.prototype,{name:"Chinese",jdEpoch:17214255e-1,hasYearZero:!1,minMonth:0,firstMonth:0,minDay:1,regionalOptions:{"":{name:"Chinese",epochs:["BEC","EC"],monthNumbers:function(n,s){if(typeof n=="string"){var c=n.match(M);return c?c[0]:""}var f=this._validateYear(n),g=n.month(),v=""+this.toChineseMonth(f,g);return s&&v.length<2&&(v="0"+v),this.isIntercalaryMonth(f,g)&&(v+="i"),v},monthNames:function(n){if(typeof n=="string"){var s=n.match(e);return s?s[0]:""}var c=this._validateYear(n),f=n.month(),g=this.toChineseMonth(c,f),v=["\u4E00\u6708","\u4E8C\u6708","\u4E09\u6708","\u56DB\u6708","\u4E94\u6708","\u516D\u6708","\u4E03\u6708","\u516B\u6708","\u4E5D\u6708","\u5341\u6708","\u5341\u4E00\u6708","\u5341\u4E8C\u6708"][g-1];return this.isIntercalaryMonth(c,f)&&(v="\u95F0"+v),v},monthNamesShort:function(n){if(typeof n=="string"){var s=n.match(t);return s?s[0]:""}var c=this._validateYear(n),f=n.month(),g=this.toChineseMonth(c,f),v=["\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D","\u4E03","\u516B","\u4E5D","\u5341","\u5341\u4E00","\u5341\u4E8C"][g-1];return this.isIntercalaryMonth(c,f)&&(v="\u95F0"+v),v},parseMonth:function(n,s){n=this._validateYear(n);var c=parseInt(s),f;if(isNaN(c))s[0]==="\u95F0"&&(f=!0,s=s.substring(1)),s[s.length-1]==="\u6708"&&(s=s.substring(0,s.length-1)),c=1+["\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D","\u4E03","\u516B","\u4E5D","\u5341","\u5341\u4E00","\u5341\u4E8C"].indexOf(s);else{var g=s[s.length-1];f=g==="i"||g==="I"}var v=this.toMonthIndex(n,c,f);return v},dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},_validateYear:function(n,s){if(n.year&&(n=n.year()),typeof n!="number"||n<1888||n>2111)throw s.replace(/\{0\}/,this.local.name);return n},toMonthIndex:function(n,s,c){var f=this.intercalaryMonth(n),g=c&&s!==f;if(g||s<1||s>12)throw Z.local.invalidMonth.replace(/\{0\}/,this.local.name);var v;return f?!c&&s<=f?v=s-1:v=s:v=s-1,v},toChineseMonth:function(n,s){n.year&&(n=n.year(),s=n.month());var c=this.intercalaryMonth(n),f=c?12:11;if(s<0||s>f)throw Z.local.invalidMonth.replace(/\{0\}/,this.local.name);var g;return c?s>13;return c},isIntercalaryMonth:function(n,s){n.year&&(n=n.year(),s=n.month());var c=this.intercalaryMonth(n);return!!c&&c===s},leapYear:function(n){return this.intercalaryMonth(n)!==0},weekOfYear:function(n,s,c){var f=this._validateYear(n,Z.local.invalidyear),g=o[f-o[0]],v=g>>9&4095,T=g>>5&15,l=g&31,_;_=d.newDate(v,T,l),_.add(4-(_.dayOfWeek()||7),"d");var w=this.toJD(n,s,c)-_.toJD();return 1+Math.floor(w/7)},monthsInYear:function(n){return this.leapYear(n)?13:12},daysInMonth:function(n,s){n.year&&(s=n.month(),n=n.year()),n=this._validateYear(n);var c=r[n-r[0]],f=c>>13,g=f?12:11;if(s>g)throw Z.local.invalidMonth.replace(/\{0\}/,this.local.name);var v=c&1<<12-s?30:29;return v},weekDay:function(n,s,c){return(this.dayOfWeek(n,s,c)||7)<6},toJD:function(n,s,c){var f=this._validate(n,v,c,Z.local.invalidDate);n=this._validateYear(f.year()),s=f.month(),c=f.day();var g=this.isIntercalaryMonth(n,s),v=this.toChineseMonth(n,s),T=i(n,v,c,g);return d.toJD(T.year,T.month,T.day)},fromJD:function(n){var s=d.fromJD(n),c=a(s.year(),s.month(),s.day()),f=this.toMonthIndex(c.year,c.month,c.isIntercalary);return this.newDate(c.year,f,c.day)},fromString:function(n){var s=n.match(A),c=this._validateYear(+s[1]),f=+s[2],g=!!s[3],v=this.toMonthIndex(c,f,g),T=+s[4];return this.newDate(c,v,T)},add:function(n,s,c){var f=n.year(),g=n.month(),v=this.isIntercalaryMonth(f,g),T=this.toChineseMonth(f,g),l=Object.getPrototypeOf(x.prototype).add.call(this,n,s,c);if(c==="y"){var _=l.year(),w=l.month(),S=this.isIntercalaryMonth(_,T),E=v&&S?this.toMonthIndex(_,T,!0):this.toMonthIndex(_,T,!1);E!==w&&l.month(E)}return l}});var A=/^\s*(-?\d\d\d\d|\d\d)[-/](\d?\d)([iI]?)[-/](\d?\d)/m,M=/^\d?\d[iI]?/m,e=/^闰?十?[一二三四五六七八九]?月/m,t=/^闰?十?[一二三四五六七八九]?/m;Z.calendars.chinese=x;var r=[1887,5780,5802,19157,2742,50359,1198,2646,46378,7466,3412,30122,5482,67949,2396,5294,43597,6732,6954,36181,2772,4954,18781,2396,54427,5274,6730,47781,5800,6868,21210,4790,59703,2350,5270,46667,3402,3496,38325,1388,4782,18735,2350,52374,6804,7498,44457,2906,1388,29294,4700,63789,6442,6804,56138,5802,2772,38235,1210,4698,22827,5418,63125,3476,5802,43701,2484,5302,27223,2646,70954,7466,3412,54698,5482,2412,38062,5294,2636,32038,6954,60245,2772,4826,43357,2394,5274,39501,6730,72357,5800,5844,53978,4790,2358,38039,5270,87627,3402,3496,54708,5484,4782,43311,2350,3222,27978,7498,68965,2904,5484,45677,4700,6444,39573,6804,6986,19285,2772,62811,1210,4698,47403,5418,5780,38570,5546,76469,2420,5302,51799,2646,5414,36501,3412,5546,18869,2412,54446,5276,6732,48422,6822,2900,28010,4826,92509,2394,5274,55883,6730,6820,47956,5812,2778,18779,2358,62615,5270,5450,46757,3492,5556,27318,4718,67887,2350,3222,52554,7498,3428,38252,5468,4700,31022,6444,64149,6804,6986,43861,2772,5338,35421,2650,70955,5418,5780,54954,5546,2740,38074,5302,2646,29991,3366,61011,3412,5546,43445,2412,5294,35406,6732,72998,6820,6996,52586,2778,2396,38045,5274,6698,23333,6820,64338,5812,2746,43355,2358,5270,39499,5450,79525,3492,5548],o=[1887,966732,967231,967733,968265,968766,969297,969798,970298,970829,971330,971830,972362,972863,973395,973896,974397,974928,975428,975929,976461,976962,977462,977994,978494,979026,979526,980026,980558,981059,981559,982091,982593,983124,983624,984124,984656,985157,985656,986189,986690,987191,987722,988222,988753,989254,989754,990286,990788,991288,991819,992319,992851,993352,993851,994383,994885,995385,995917,996418,996918,997450,997949,998481,998982,999483,1000014,1000515,1001016,1001548,1002047,1002578,1003080,1003580,1004111,1004613,1005113,1005645,1006146,1006645,1007177,1007678,1008209,1008710,1009211,1009743,1010243,1010743,1011275,1011775,1012306,1012807,1013308,1013840,1014341,1014841,1015373,1015874,1016404,1016905,1017405,1017937,1018438,1018939,1019471,1019972,1020471,1021002,1021503,1022035,1022535,1023036,1023568,1024069,1024568,1025100,1025601,1026102,1026633,1027133,1027666,1028167,1028666,1029198,1029699,1030199,1030730,1031231,1031763,1032264,1032764,1033296,1033797,1034297,1034828,1035329,1035830,1036362,1036861,1037393,1037894,1038394,1038925,1039427,1039927,1040459,1040959,1041491,1041992,1042492,1043023,1043524,1044024,1044556,1045057,1045558,1046090,1046590,1047121,1047622,1048122,1048654,1049154,1049655,1050187,1050689,1051219,1051720,1052220,1052751,1053252,1053752,1054284,1054786,1055285,1055817,1056317,1056849,1057349,1057850,1058382,1058883,1059383,1059915,1060415,1060947,1061447,1061947,1062479,1062981,1063480,1064012,1064514,1065014,1065545,1066045,1066577,1067078,1067578,1068110,1068611,1069112,1069642,1070142,1070674,1071175,1071675,1072207,1072709,1073209,1073740,1074241,1074741,1075273,1075773,1076305,1076807,1077308,1077839,1078340,1078840,1079372,1079871,1080403,1080904];function a(n,s,c,f){var g,v;if(typeof n=="object")g=n,v=s||{};else{var T=typeof n=="number"&&n>=1888&&n<=2111;if(!T)throw new Error("Solar year outside range 1888-2111");var l=typeof s=="number"&&s>=1&&s<=12;if(!l)throw new Error("Solar month outside range 1 - 12");var _=typeof c=="number"&&c>=1&&c<=31;if(!_)throw new Error("Solar day outside range 1 - 31");g={year:n,month:s,day:c},v=f||{}}var w=o[g.year-o[0]],S=g.year<<9|g.month<<5|g.day;v.year=S>=w?g.year:g.year-1,w=o[v.year-o[0]];var E=w>>9&4095,y=w>>5&15,b=w&31,p,u=new Date(E,y-1,b),m=new Date(g.year,g.month-1,g.day);p=Math.round((m-u)/(24*3600*1e3));var h=r[v.year-r[0]],P;for(P=0;P<13;P++){var L=h&1<<12-P?30:29;if(p>13;return!z||P=1888&&n<=2111;if(!l)throw new Error("Lunar year outside range 1888-2111");var _=typeof s=="number"&&s>=1&&s<=12;if(!_)throw new Error("Lunar month outside range 1 - 12");var w=typeof c=="number"&&c>=1&&c<=30;if(!w)throw new Error("Lunar day outside range 1 - 30");var S;typeof f=="object"?(S=!1,v=f):(S=!!f,v=g||{}),T={year:n,month:s,day:c,isIntercalary:S}}var E;E=T.day-1;var y=r[T.year-r[0]],b=y>>13,p;b&&(T.month>b||T.isIntercalary)?p=T.month:p=T.month-1;for(var u=0;u>9&4095,L=h>>5&15,z=h&31,F=new Date(P,L-1,z+E);return v.year=F.getFullYear(),v.month=1+F.getMonth(),v.day=F.getDate(),v}}}),QH=Ze({"node_modules/world-calendars/dist/calendars/coptic.js"(){var Z=Sp(),q=sh();function d(x){this.local=this.regionalOptions[x||""]||this.regionalOptions[""]}d.prototype=new Z.baseCalendar,q(d.prototype,{name:"Coptic",jdEpoch:18250295e-1,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Coptic",epochs:["BAM","AM"],monthNames:["Thout","Paopi","Hathor","Koiak","Tobi","Meshir","Paremhat","Paremoude","Pashons","Paoni","Epip","Mesori","Pi Kogi Enavot"],monthNamesShort:["Tho","Pao","Hath","Koi","Tob","Mesh","Pat","Pad","Pash","Pao","Epi","Meso","PiK"],dayNames:["Tkyriaka","Pesnau","Pshoment","Peftoou","Ptiou","Psoou","Psabbaton"],dayNamesShort:["Tky","Pes","Psh","Pef","Pti","Pso","Psa"],dayNamesMin:["Tk","Pes","Psh","Pef","Pt","Pso","Psa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(M){var A=this._validate(M,this.minMonth,this.minDay,Z.local.invalidYear),M=A.year()+(A.year()<0?1:0);return M%4===3||M%4===-1},monthsInYear:function(x){return this._validate(x,this.minMonth,this.minDay,Z.local.invalidYear||Z.regionalOptions[""].invalidYear),13},weekOfYear:function(x,A,M){var e=this.newDate(x,A,M);return e.add(-e.dayOfWeek(),"d"),Math.floor((e.dayOfYear()-1)/7)+1},daysInMonth:function(x,A){var M=this._validate(x,A,this.minDay,Z.local.invalidMonth);return this.daysPerMonth[M.month()-1]+(M.month()===13&&this.leapYear(M.year())?1:0)},weekDay:function(x,A,M){return(this.dayOfWeek(x,A,M)||7)<6},toJD:function(x,A,M){var e=this._validate(x,A,M,Z.local.invalidDate);return x=e.year(),x<0&&x++,e.day()+(e.month()-1)*30+(x-1)*365+Math.floor(x/4)+this.jdEpoch-1},fromJD:function(x){var A=Math.floor(x)+.5-this.jdEpoch,M=Math.floor((A-Math.floor((A+366)/1461))/365)+1;M<=0&&M--,A=Math.floor(x)+.5-this.newDate(M,1,1).toJD();var e=Math.floor(A/30)+1,t=A-(e-1)*30+1;return this.newDate(M,e,t)}}),Z.calendars.coptic=d}}),eW=Ze({"node_modules/world-calendars/dist/calendars/discworld.js"(){var Z=Sp(),q=sh();function d(A){this.local=this.regionalOptions[A||""]||this.regionalOptions[""]}d.prototype=new Z.baseCalendar,q(d.prototype,{name:"Discworld",jdEpoch:17214255e-1,daysPerMonth:[16,32,32,32,32,32,32,32,32,32,32,32,32],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Discworld",epochs:["BUC","UC"],monthNames:["Ick","Offle","February","March","April","May","June","Grune","August","Spune","Sektober","Ember","December"],monthNamesShort:["Ick","Off","Feb","Mar","Apr","May","Jun","Gru","Aug","Spu","Sek","Emb","Dec"],dayNames:["Sunday","Octeday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Oct","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Oc","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:2,isRTL:!1}},leapYear:function(A){return this._validate(A,this.minMonth,this.minDay,Z.local.invalidYear),!1},monthsInYear:function(A){return this._validate(A,this.minMonth,this.minDay,Z.local.invalidYear),13},daysInYear:function(A){return this._validate(A,this.minMonth,this.minDay,Z.local.invalidYear),400},weekOfYear:function(A,M,e){var t=this.newDate(A,M,e);return t.add(-t.dayOfWeek(),"d"),Math.floor((t.dayOfYear()-1)/8)+1},daysInMonth:function(A,M){var e=this._validate(A,M,this.minDay,Z.local.invalidMonth);return this.daysPerMonth[e.month()-1]},daysInWeek:function(){return 8},dayOfWeek:function(A,M,e){var t=this._validate(A,M,e,Z.local.invalidDate);return(t.day()+1)%8},weekDay:function(A,M,e){var t=this.dayOfWeek(A,M,e);return t>=2&&t<=6},extraInfo:function(A,M,e){var t=this._validate(A,M,e,Z.local.invalidDate);return{century:x[Math.floor((t.year()-1)/100)+1]||""}},toJD:function(A,M,e){var t=this._validate(A,M,e,Z.local.invalidDate);return A=t.year()+(t.year()<0?1:0),M=t.month(),e=t.day(),e+(M>1?16:0)+(M>2?(M-2)*32:0)+(A-1)*400+this.jdEpoch-1},fromJD:function(A){A=Math.floor(A+.5)-Math.floor(this.jdEpoch)-1;var M=Math.floor(A/400)+1;A-=(M-1)*400,A+=A>15?16:0;var e=Math.floor(A/32)+1,t=A-(e-1)*32+1;return this.newDate(M<=0?M-1:M,e,t)}});var x={20:"Fruitbat",21:"Anchovy"};Z.calendars.discworld=d}}),tW=Ze({"node_modules/world-calendars/dist/calendars/ethiopian.js"(){var Z=Sp(),q=sh();function d(x){this.local=this.regionalOptions[x||""]||this.regionalOptions[""]}d.prototype=new Z.baseCalendar,q(d.prototype,{name:"Ethiopian",jdEpoch:17242205e-1,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Ethiopian",epochs:["BEE","EE"],monthNames:["Meskerem","Tikemet","Hidar","Tahesas","Tir","Yekatit","Megabit","Miazia","Genbot","Sene","Hamle","Nehase","Pagume"],monthNamesShort:["Mes","Tik","Hid","Tah","Tir","Yek","Meg","Mia","Gen","Sen","Ham","Neh","Pag"],dayNames:["Ehud","Segno","Maksegno","Irob","Hamus","Arb","Kidame"],dayNamesShort:["Ehu","Seg","Mak","Iro","Ham","Arb","Kid"],dayNamesMin:["Eh","Se","Ma","Ir","Ha","Ar","Ki"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(M){var A=this._validate(M,this.minMonth,this.minDay,Z.local.invalidYear),M=A.year()+(A.year()<0?1:0);return M%4===3||M%4===-1},monthsInYear:function(x){return this._validate(x,this.minMonth,this.minDay,Z.local.invalidYear||Z.regionalOptions[""].invalidYear),13},weekOfYear:function(x,A,M){var e=this.newDate(x,A,M);return e.add(-e.dayOfWeek(),"d"),Math.floor((e.dayOfYear()-1)/7)+1},daysInMonth:function(x,A){var M=this._validate(x,A,this.minDay,Z.local.invalidMonth);return this.daysPerMonth[M.month()-1]+(M.month()===13&&this.leapYear(M.year())?1:0)},weekDay:function(x,A,M){return(this.dayOfWeek(x,A,M)||7)<6},toJD:function(x,A,M){var e=this._validate(x,A,M,Z.local.invalidDate);return x=e.year(),x<0&&x++,e.day()+(e.month()-1)*30+(x-1)*365+Math.floor(x/4)+this.jdEpoch-1},fromJD:function(x){var A=Math.floor(x)+.5-this.jdEpoch,M=Math.floor((A-Math.floor((A+366)/1461))/365)+1;M<=0&&M--,A=Math.floor(x)+.5-this.newDate(M,1,1).toJD();var e=Math.floor(A/30)+1,t=A-(e-1)*30+1;return this.newDate(M,e,t)}}),Z.calendars.ethiopian=d}}),rW=Ze({"node_modules/world-calendars/dist/calendars/hebrew.js"(){var Z=Sp(),q=sh();function d(A){this.local=this.regionalOptions[A||""]||this.regionalOptions[""]}d.prototype=new Z.baseCalendar,q(d.prototype,{name:"Hebrew",jdEpoch:347995.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29,29],hasYearZero:!1,minMonth:1,firstMonth:7,minDay:1,regionalOptions:{"":{name:"Hebrew",epochs:["BAM","AM"],monthNames:["Nisan","Iyar","Sivan","Tammuz","Av","Elul","Tishrei","Cheshvan","Kislev","Tevet","Shevat","Adar","Adar II"],monthNamesShort:["Nis","Iya","Siv","Tam","Av","Elu","Tis","Che","Kis","Tev","She","Ada","Ad2"],dayNames:["Yom Rishon","Yom Sheni","Yom Shlishi","Yom Revi'i","Yom Chamishi","Yom Shishi","Yom Shabbat"],dayNamesShort:["Ris","She","Shl","Rev","Cha","Shi","Sha"],dayNamesMin:["Ri","She","Shl","Re","Ch","Shi","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(A){var M=this._validate(A,this.minMonth,this.minDay,Z.local.invalidYear);return this._leapYear(M.year())},_leapYear:function(A){return A=A<0?A+1:A,x(A*7+1,19)<7},monthsInYear:function(A){return this._validate(A,this.minMonth,this.minDay,Z.local.invalidYear),this._leapYear(A.year?A.year():A)?13:12},weekOfYear:function(A,M,e){var t=this.newDate(A,M,e);return t.add(-t.dayOfWeek(),"d"),Math.floor((t.dayOfYear()-1)/7)+1},daysInYear:function(A){var M=this._validate(A,this.minMonth,this.minDay,Z.local.invalidYear);return A=M.year(),this.toJD(A===-1?1:A+1,7,1)-this.toJD(A,7,1)},daysInMonth:function(A,M){return A.year&&(M=A.month(),A=A.year()),this._validate(A,M,this.minDay,Z.local.invalidMonth),M===12&&this.leapYear(A)||M===8&&x(this.daysInYear(A),10)===5?30:M===9&&x(this.daysInYear(A),10)===3?29:this.daysPerMonth[M-1]},weekDay:function(A,M,e){return this.dayOfWeek(A,M,e)!==6},extraInfo:function(A,M,e){var t=this._validate(A,M,e,Z.local.invalidDate);return{yearType:(this.leapYear(t)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(t)%10-3]}},toJD:function(A,M,e){var t=this._validate(A,M,e,Z.local.invalidDate);A=t.year(),M=t.month(),e=t.day();var r=A<=0?A+1:A,o=this.jdEpoch+this._delay1(r)+this._delay2(r)+e+1;if(M<7){for(var a=7;a<=this.monthsInYear(A);a++)o+=this.daysInMonth(A,a);for(var a=1;a=this.toJD(M===-1?1:M+1,7,1);)M++;for(var e=Athis.toJD(M,e,this.daysInMonth(M,e));)e++;var t=A-this.toJD(M,e,1)+1;return this.newDate(M,e,t)}});function x(A,M){return A-M*Math.floor(A/M)}Z.calendars.hebrew=d}}),aW=Ze({"node_modules/world-calendars/dist/calendars/islamic.js"(){var Z=Sp(),q=sh();function d(x){this.local=this.regionalOptions[x||""]||this.regionalOptions[""]}d.prototype=new Z.baseCalendar,q(d.prototype,{name:"Islamic",jdEpoch:19484395e-1,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Islamic",epochs:["BH","AH"],monthNames:["Muharram","Safar","Rabi' al-awwal","Rabi' al-thani","Jumada al-awwal","Jumada al-thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-ahad","Yawm al-ithnayn","Yawm ath-thulaathaa'","Yawm al-arbi'aa'","Yawm al-kham\u012Bs","Yawm al-jum'a","Yawm as-sabt"],dayNamesShort:["Aha","Ith","Thu","Arb","Kha","Jum","Sab"],dayNamesMin:["Ah","It","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(x){var A=this._validate(x,this.minMonth,this.minDay,Z.local.invalidYear);return(A.year()*11+14)%30<11},weekOfYear:function(x,A,M){var e=this.newDate(x,A,M);return e.add(-e.dayOfWeek(),"d"),Math.floor((e.dayOfYear()-1)/7)+1},daysInYear:function(x){return this.leapYear(x)?355:354},daysInMonth:function(x,A){var M=this._validate(x,A,this.minDay,Z.local.invalidMonth);return this.daysPerMonth[M.month()-1]+(M.month()===12&&this.leapYear(M.year())?1:0)},weekDay:function(x,A,M){return this.dayOfWeek(x,A,M)!==5},toJD:function(x,A,M){var e=this._validate(x,A,M,Z.local.invalidDate);return x=e.year(),A=e.month(),M=e.day(),x=x<=0?x+1:x,M+Math.ceil(29.5*(A-1))+(x-1)*354+Math.floor((3+11*x)/30)+this.jdEpoch-1},fromJD:function(x){x=Math.floor(x)+.5;var A=Math.floor((30*(x-this.jdEpoch)+10646)/10631);A=A<=0?A-1:A;var M=Math.min(12,Math.ceil((x-29-this.toJD(A,1,1))/29.5)+1),e=x-this.toJD(A,M,1)+1;return this.newDate(A,M,e)}}),Z.calendars.islamic=d}}),iW=Ze({"node_modules/world-calendars/dist/calendars/julian.js"(){var Z=Sp(),q=sh();function d(x){this.local=this.regionalOptions[x||""]||this.regionalOptions[""]}d.prototype=new Z.baseCalendar,q(d.prototype,{name:"Julian",jdEpoch:17214235e-1,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Julian",epochs:["BC","AD"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"mm/dd/yyyy",firstDay:0,isRTL:!1}},leapYear:function(M){var A=this._validate(M,this.minMonth,this.minDay,Z.local.invalidYear),M=A.year()<0?A.year()+1:A.year();return M%4===0},weekOfYear:function(x,A,M){var e=this.newDate(x,A,M);return e.add(4-(e.dayOfWeek()||7),"d"),Math.floor((e.dayOfYear()-1)/7)+1},daysInMonth:function(x,A){var M=this._validate(x,A,this.minDay,Z.local.invalidMonth);return this.daysPerMonth[M.month()-1]+(M.month()===2&&this.leapYear(M.year())?1:0)},weekDay:function(x,A,M){return(this.dayOfWeek(x,A,M)||7)<6},toJD:function(x,A,M){var e=this._validate(x,A,M,Z.local.invalidDate);return x=e.year(),A=e.month(),M=e.day(),x<0&&x++,A<=2&&(x--,A+=12),Math.floor(365.25*(x+4716))+Math.floor(30.6001*(A+1))+M-1524.5},fromJD:function(x){var A=Math.floor(x+.5),M=A+1524,e=Math.floor((M-122.1)/365.25),t=Math.floor(365.25*e),r=Math.floor((M-t)/30.6001),o=r-Math.floor(r<14?1:13),a=e-Math.floor(o>2?4716:4715),i=M-t-Math.floor(30.6001*r);return a<=0&&a--,this.newDate(a,o,i)}}),Z.calendars.julian=d}}),nW=Ze({"node_modules/world-calendars/dist/calendars/mayan.js"(){var Z=Sp(),q=sh();function d(M){this.local=this.regionalOptions[M||""]||this.regionalOptions[""]}d.prototype=new Z.baseCalendar,q(d.prototype,{name:"Mayan",jdEpoch:584282.5,hasYearZero:!0,minMonth:0,firstMonth:0,minDay:0,regionalOptions:{"":{name:"Mayan",epochs:["",""],monthNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],monthNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],dayNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesMin:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],digits:null,dateFormat:"YYYY.m.d",firstDay:0,isRTL:!1,haabMonths:["Pop","Uo","Zip","Zotz","Tzec","Xul","Yaxkin","Mol","Chen","Yax","Zac","Ceh","Mac","Kankin","Muan","Pax","Kayab","Cumku","Uayeb"],tzolkinMonths:["Imix","Ik","Akbal","Kan","Chicchan","Cimi","Manik","Lamat","Muluc","Oc","Chuen","Eb","Ben","Ix","Men","Cib","Caban","Etznab","Cauac","Ahau"]}},leapYear:function(M){return this._validate(M,this.minMonth,this.minDay,Z.local.invalidYear),!1},formatYear:function(M){var e=this._validate(M,this.minMonth,this.minDay,Z.local.invalidYear);M=e.year();var t=Math.floor(M/400);M=M%400,M+=M<0?400:0;var r=Math.floor(M/20);return t+"."+r+"."+M%20},forYear:function(M){if(M=M.split("."),M.length<3)throw"Invalid Mayan year";for(var e=0,t=0;t19||t>0&&r<0)throw"Invalid Mayan year";e=e*20+r}return e},monthsInYear:function(M){return this._validate(M,this.minMonth,this.minDay,Z.local.invalidYear),18},weekOfYear:function(M,e,t){return this._validate(M,e,t,Z.local.invalidDate),0},daysInYear:function(M){return this._validate(M,this.minMonth,this.minDay,Z.local.invalidYear),360},daysInMonth:function(M,e){return this._validate(M,e,this.minDay,Z.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(M,e,t){var r=this._validate(M,e,t,Z.local.invalidDate);return r.day()},weekDay:function(M,e,t){return this._validate(M,e,t,Z.local.invalidDate),!0},extraInfo:function(M,e,t){var r=this._validate(M,e,t,Z.local.invalidDate),o=r.toJD(),a=this._toHaab(o),i=this._toTzolkin(o);return{haabMonthName:this.local.haabMonths[a[0]-1],haabMonth:a[0],haabDay:a[1],tzolkinDayName:this.local.tzolkinMonths[i[0]-1],tzolkinDay:i[0],tzolkinTrecena:i[1]}},_toHaab:function(M){M-=this.jdEpoch;var e=x(M+8+17*20,365);return[Math.floor(e/20)+1,x(e,20)]},_toTzolkin:function(M){return M-=this.jdEpoch,[A(M+20,20),A(M+4,13)]},toJD:function(M,e,t){var r=this._validate(M,e,t,Z.local.invalidDate);return r.day()+r.month()*20+r.year()*360+this.jdEpoch},fromJD:function(M){M=Math.floor(M)+.5-this.jdEpoch;var e=Math.floor(M/360);M=M%360,M+=M<0?360:0;var t=Math.floor(M/20),r=M%20;return this.newDate(e,t,r)}});function x(M,e){return M-e*Math.floor(M/e)}function A(M,e){return x(M-1,e)+1}Z.calendars.mayan=d}}),oW=Ze({"node_modules/world-calendars/dist/calendars/nanakshahi.js"(){var Z=Sp(),q=sh();function d(A){this.local=this.regionalOptions[A||""]||this.regionalOptions[""]}d.prototype=new Z.baseCalendar;var x=Z.instance("gregorian");q(d.prototype,{name:"Nanakshahi",jdEpoch:22576735e-1,daysPerMonth:[31,31,31,31,31,30,30,30,30,30,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Nanakshahi",epochs:["BN","AN"],monthNames:["Chet","Vaisakh","Jeth","Harh","Sawan","Bhadon","Assu","Katak","Maghar","Poh","Magh","Phagun"],monthNamesShort:["Che","Vai","Jet","Har","Saw","Bha","Ass","Kat","Mgr","Poh","Mgh","Pha"],dayNames:["Somvaar","Mangalvar","Budhvaar","Veervaar","Shukarvaar","Sanicharvaar","Etvaar"],dayNamesShort:["Som","Mangal","Budh","Veer","Shukar","Sanichar","Et"],dayNamesMin:["So","Ma","Bu","Ve","Sh","Sa","Et"],digits:null,dateFormat:"dd-mm-yyyy",firstDay:0,isRTL:!1}},leapYear:function(A){var M=this._validate(A,this.minMonth,this.minDay,Z.local.invalidYear||Z.regionalOptions[""].invalidYear);return x.leapYear(M.year()+(M.year()<1?1:0)+1469)},weekOfYear:function(A,M,e){var t=this.newDate(A,M,e);return t.add(1-(t.dayOfWeek()||7),"d"),Math.floor((t.dayOfYear()-1)/7)+1},daysInMonth:function(A,M){var e=this._validate(A,M,this.minDay,Z.local.invalidMonth);return this.daysPerMonth[e.month()-1]+(e.month()===12&&this.leapYear(e.year())?1:0)},weekDay:function(A,M,e){return(this.dayOfWeek(A,M,e)||7)<6},toJD:function(r,M,e){var t=this._validate(r,M,e,Z.local.invalidMonth),r=t.year();r<0&&r++;for(var o=t.day(),a=1;a=this.toJD(M+1,1,1);)M++;for(var e=A-Math.floor(this.toJD(M,1,1)+.5)+1,t=1;e>this.daysInMonth(M,t);)e-=this.daysInMonth(M,t),t++;return this.newDate(M,t,e)}}),Z.calendars.nanakshahi=d}}),sW=Ze({"node_modules/world-calendars/dist/calendars/nepali.js"(){var Z=Sp(),q=sh();function d(x){this.local=this.regionalOptions[x||""]||this.regionalOptions[""]}d.prototype=new Z.baseCalendar,q(d.prototype,{name:"Nepali",jdEpoch:17007095e-1,daysPerMonth:[31,31,32,32,31,30,30,29,30,29,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,daysPerYear:365,regionalOptions:{"":{name:"Nepali",epochs:["BBS","ABS"],monthNames:["Baisakh","Jestha","Ashadh","Shrawan","Bhadra","Ashwin","Kartik","Mangsir","Paush","Mangh","Falgun","Chaitra"],monthNamesShort:["Bai","Je","As","Shra","Bha","Ash","Kar","Mang","Pau","Ma","Fal","Chai"],dayNames:["Aaitabaar","Sombaar","Manglbaar","Budhabaar","Bihibaar","Shukrabaar","Shanibaar"],dayNamesShort:["Aaita","Som","Mangl","Budha","Bihi","Shukra","Shani"],dayNamesMin:["Aai","So","Man","Bu","Bi","Shu","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:1,isRTL:!1}},leapYear:function(x){return this.daysInYear(x)!==this.daysPerYear},weekOfYear:function(x,A,M){var e=this.newDate(x,A,M);return e.add(-e.dayOfWeek(),"d"),Math.floor((e.dayOfYear()-1)/7)+1},daysInYear:function(x){var A=this._validate(x,this.minMonth,this.minDay,Z.local.invalidYear);if(x=A.year(),typeof this.NEPALI_CALENDAR_DATA[x]>"u")return this.daysPerYear;for(var M=0,e=this.minMonth;e<=12;e++)M+=this.NEPALI_CALENDAR_DATA[x][e];return M},daysInMonth:function(x,A){return x.year&&(A=x.month(),x=x.year()),this._validate(x,A,this.minDay,Z.local.invalidMonth),typeof this.NEPALI_CALENDAR_DATA[x]>"u"?this.daysPerMonth[A-1]:this.NEPALI_CALENDAR_DATA[x][A]},weekDay:function(x,A,M){return this.dayOfWeek(x,A,M)!==6},toJD:function(x,A,M){var e=this._validate(x,A,M,Z.local.invalidDate);x=e.year(),A=e.month(),M=e.day();var t=Z.instance(),r=0,o=A,a=x;this._createMissingCalendarData(x);var i=x-(o>9||o===9&&M>=this.NEPALI_CALENDAR_DATA[a][0]?56:57);for(A!==9&&(r=M,o--);o!==9;)o<=0&&(o=12,a--),r+=this.NEPALI_CALENDAR_DATA[a][o],o--;return A===9?(r+=M-this.NEPALI_CALENDAR_DATA[a][0],r<0&&(r+=t.daysInYear(i))):r+=this.NEPALI_CALENDAR_DATA[a][9]-this.NEPALI_CALENDAR_DATA[a][0],t.newDate(i,1,1).add(r,"d").toJD()},fromJD:function(x){var A=Z.instance(),M=A.fromJD(x),e=M.year(),t=M.dayOfYear(),r=e+56;this._createMissingCalendarData(r);for(var o=9,a=this.NEPALI_CALENDAR_DATA[r][0],i=this.NEPALI_CALENDAR_DATA[r][o]-a+1;t>i;)o++,o>12&&(o=1,r++),i+=this.NEPALI_CALENDAR_DATA[r][o];var n=this.NEPALI_CALENDAR_DATA[r][o]-(i-t);return this.newDate(r,o,n)},_createMissingCalendarData:function(x){var A=this.daysPerMonth.slice(0);A.unshift(17);for(var M=x-1;M"u"&&(this.NEPALI_CALENDAR_DATA[M]=A)},NEPALI_CALENDAR_DATA:{1970:[18,31,31,32,31,31,31,30,29,30,29,30,30],1971:[18,31,31,32,31,32,30,30,29,30,29,30,30],1972:[17,31,32,31,32,31,30,30,30,29,29,30,30],1973:[19,30,32,31,32,31,30,30,30,29,30,29,31],1974:[19,31,31,32,30,31,31,30,29,30,29,30,30],1975:[18,31,31,32,32,30,31,30,29,30,29,30,30],1976:[17,31,32,31,32,31,30,30,30,29,29,30,31],1977:[18,31,32,31,32,31,31,29,30,29,30,29,31],1978:[18,31,31,32,31,31,31,30,29,30,29,30,30],1979:[18,31,31,32,32,31,30,30,29,30,29,30,30],1980:[17,31,32,31,32,31,30,30,30,29,29,30,31],1981:[18,31,31,31,32,31,31,29,30,30,29,30,30],1982:[18,31,31,32,31,31,31,30,29,30,29,30,30],1983:[18,31,31,32,32,31,30,30,29,30,29,30,30],1984:[17,31,32,31,32,31,30,30,30,29,29,30,31],1985:[18,31,31,31,32,31,31,29,30,30,29,30,30],1986:[18,31,31,32,31,31,31,30,29,30,29,30,30],1987:[18,31,32,31,32,31,30,30,29,30,29,30,30],1988:[17,31,32,31,32,31,30,30,30,29,29,30,31],1989:[18,31,31,31,32,31,31,30,29,30,29,30,30],1990:[18,31,31,32,31,31,31,30,29,30,29,30,30],1991:[18,31,32,31,32,31,30,30,29,30,29,30,30],1992:[17,31,32,31,32,31,30,30,30,29,30,29,31],1993:[18,31,31,31,32,31,31,30,29,30,29,30,30],1994:[18,31,31,32,31,31,31,30,29,30,29,30,30],1995:[17,31,32,31,32,31,30,30,30,29,29,30,30],1996:[17,31,32,31,32,31,30,30,30,29,30,29,31],1997:[18,31,31,32,31,31,31,30,29,30,29,30,30],1998:[18,31,31,32,31,31,31,30,29,30,29,30,30],1999:[17,31,32,31,32,31,30,30,30,29,29,30,31],2e3:[17,30,32,31,32,31,30,30,30,29,30,29,31],2001:[18,31,31,32,31,31,31,30,29,30,29,30,30],2002:[18,31,31,32,32,31,30,30,29,30,29,30,30],2003:[17,31,32,31,32,31,30,30,30,29,29,30,31],2004:[17,30,32,31,32,31,30,30,30,29,30,29,31],2005:[18,31,31,32,31,31,31,30,29,30,29,30,30],2006:[18,31,31,32,32,31,30,30,29,30,29,30,30],2007:[17,31,32,31,32,31,30,30,30,29,29,30,31],2008:[17,31,31,31,32,31,31,29,30,30,29,29,31],2009:[18,31,31,32,31,31,31,30,29,30,29,30,30],2010:[18,31,31,32,32,31,30,30,29,30,29,30,30],2011:[17,31,32,31,32,31,30,30,30,29,29,30,31],2012:[17,31,31,31,32,31,31,29,30,30,29,30,30],2013:[18,31,31,32,31,31,31,30,29,30,29,30,30],2014:[18,31,31,32,32,31,30,30,29,30,29,30,30],2015:[17,31,32,31,32,31,30,30,30,29,29,30,31],2016:[17,31,31,31,32,31,31,29,30,30,29,30,30],2017:[18,31,31,32,31,31,31,30,29,30,29,30,30],2018:[18,31,32,31,32,31,30,30,29,30,29,30,30],2019:[17,31,32,31,32,31,30,30,30,29,30,29,31],2020:[17,31,31,31,32,31,31,30,29,30,29,30,30],2021:[18,31,31,32,31,31,31,30,29,30,29,30,30],2022:[17,31,32,31,32,31,30,30,30,29,29,30,30],2023:[17,31,32,31,32,31,30,30,30,29,30,29,31],2024:[17,31,31,31,32,31,31,30,29,30,29,30,30],2025:[18,31,31,32,31,31,31,30,29,30,29,30,30],2026:[17,31,32,31,32,31,30,30,30,29,29,30,31],2027:[17,30,32,31,32,31,30,30,30,29,30,29,31],2028:[17,31,31,32,31,31,31,30,29,30,29,30,30],2029:[18,31,31,32,31,32,30,30,29,30,29,30,30],2030:[17,31,32,31,32,31,30,30,30,30,30,30,31],2031:[17,31,32,31,32,31,31,31,31,31,31,31,31],2032:[17,32,32,32,32,32,32,32,32,32,32,32,32],2033:[18,31,31,32,32,31,30,30,29,30,29,30,30],2034:[17,31,32,31,32,31,30,30,30,29,29,30,31],2035:[17,30,32,31,32,31,31,29,30,30,29,29,31],2036:[17,31,31,32,31,31,31,30,29,30,29,30,30],2037:[18,31,31,32,32,31,30,30,29,30,29,30,30],2038:[17,31,32,31,32,31,30,30,30,29,29,30,31],2039:[17,31,31,31,32,31,31,29,30,30,29,30,30],2040:[17,31,31,32,31,31,31,30,29,30,29,30,30],2041:[18,31,31,32,32,31,30,30,29,30,29,30,30],2042:[17,31,32,31,32,31,30,30,30,29,29,30,31],2043:[17,31,31,31,32,31,31,29,30,30,29,30,30],2044:[17,31,31,32,31,31,31,30,29,30,29,30,30],2045:[18,31,32,31,32,31,30,30,29,30,29,30,30],2046:[17,31,32,31,32,31,30,30,30,29,29,30,31],2047:[17,31,31,31,32,31,31,30,29,30,29,30,30],2048:[17,31,31,32,31,31,31,30,29,30,29,30,30],2049:[17,31,32,31,32,31,30,30,30,29,29,30,30],2050:[17,31,32,31,32,31,30,30,30,29,30,29,31],2051:[17,31,31,31,32,31,31,30,29,30,29,30,30],2052:[17,31,31,32,31,31,31,30,29,30,29,30,30],2053:[17,31,32,31,32,31,30,30,30,29,29,30,30],2054:[17,31,32,31,32,31,30,30,30,29,30,29,31],2055:[17,31,31,32,31,31,31,30,29,30,30,29,30],2056:[17,31,31,32,31,32,30,30,29,30,29,30,30],2057:[17,31,32,31,32,31,30,30,30,29,29,30,31],2058:[17,30,32,31,32,31,30,30,30,29,30,29,31],2059:[17,31,31,32,31,31,31,30,29,30,29,30,30],2060:[17,31,31,32,32,31,30,30,29,30,29,30,30],2061:[17,31,32,31,32,31,30,30,30,29,29,30,31],2062:[17,30,32,31,32,31,31,29,30,29,30,29,31],2063:[17,31,31,32,31,31,31,30,29,30,29,30,30],2064:[17,31,31,32,32,31,30,30,29,30,29,30,30],2065:[17,31,32,31,32,31,30,30,30,29,29,30,31],2066:[17,31,31,31,32,31,31,29,30,30,29,29,31],2067:[17,31,31,32,31,31,31,30,29,30,29,30,30],2068:[17,31,31,32,32,31,30,30,29,30,29,30,30],2069:[17,31,32,31,32,31,30,30,30,29,29,30,31],2070:[17,31,31,31,32,31,31,29,30,30,29,30,30],2071:[17,31,31,32,31,31,31,30,29,30,29,30,30],2072:[17,31,32,31,32,31,30,30,29,30,29,30,30],2073:[17,31,32,31,32,31,30,30,30,29,29,30,31],2074:[17,31,31,31,32,31,31,30,29,30,29,30,30],2075:[17,31,31,32,31,31,31,30,29,30,29,30,30],2076:[16,31,32,31,32,31,30,30,30,29,29,30,30],2077:[17,31,32,31,32,31,30,30,30,29,30,29,31],2078:[17,31,31,31,32,31,31,30,29,30,29,30,30],2079:[17,31,31,32,31,31,31,30,29,30,29,30,30],2080:[16,31,32,31,32,31,30,30,30,29,29,30,30],2081:[17,31,31,32,32,31,30,30,30,29,30,30,30],2082:[17,31,32,31,32,31,30,30,30,29,30,30,30],2083:[17,31,31,32,31,31,30,30,30,29,30,30,30],2084:[17,31,31,32,31,31,30,30,30,29,30,30,30],2085:[17,31,32,31,32,31,31,30,30,29,30,30,30],2086:[17,31,32,31,32,31,30,30,30,29,30,30,30],2087:[16,31,31,32,31,31,31,30,30,29,30,30,30],2088:[16,30,31,32,32,30,31,30,30,29,30,30,30],2089:[17,31,32,31,32,31,30,30,30,29,30,30,30],2090:[17,31,32,31,32,31,30,30,30,29,30,30,30],2091:[16,31,31,32,31,31,31,30,30,29,30,30,30],2092:[16,31,31,32,32,31,30,30,30,29,30,30,30],2093:[17,31,32,31,32,31,30,30,30,29,30,30,30],2094:[17,31,31,32,31,31,30,30,30,29,30,30,30],2095:[17,31,31,32,31,31,31,30,29,30,30,30,30],2096:[17,30,31,32,32,31,30,30,29,30,29,30,30],2097:[17,31,32,31,32,31,30,30,30,29,30,30,30],2098:[17,31,31,32,31,31,31,29,30,29,30,30,31],2099:[17,31,31,32,31,31,31,30,29,29,30,30,30],2100:[17,31,32,31,32,30,31,30,29,30,29,30,30]}}),Z.calendars.nepali=d}}),lW=Ze({"node_modules/world-calendars/dist/calendars/persian.js"(){var Z=Sp(),q=sh();function d(A){this.local=this.regionalOptions[A||""]||this.regionalOptions[""]}function x(A){var M=A-475;A<0&&M++;var e=.242197,t=e*M,r=e*(M+1),o=t-Math.floor(t),a=r-Math.floor(r);return o>a}d.prototype=new Z.baseCalendar,q(d.prototype,{name:"Persian",jdEpoch:19483205e-1,daysPerMonth:[31,31,31,31,31,31,30,30,30,30,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Persian",epochs:["BP","AP"],monthNames:["Farvardin","Ordibehesht","Khordad","Tir","Mordad","Shahrivar","Mehr","Aban","Azar","Dey","Bahman","Esfand"],monthNamesShort:["Far","Ord","Kho","Tir","Mor","Sha","Meh","Aba","Aza","Dey","Bah","Esf"],dayNames:["Yekshanbeh","Doshanbeh","Seshanbeh","Chah\u0101rshanbeh","Panjshanbeh","Jom'eh","Shanbeh"],dayNamesShort:["Yek","Do","Se","Cha","Panj","Jom","Sha"],dayNamesMin:["Ye","Do","Se","Ch","Pa","Jo","Sh"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(A){var M=this._validate(A,this.minMonth,this.minDay,Z.local.invalidYear);return x(M.year())},weekOfYear:function(A,M,e){var t=this.newDate(A,M,e);return t.add(-((t.dayOfWeek()+1)%7),"d"),Math.floor((t.dayOfYear()-1)/7)+1},daysInMonth:function(A,M){var e=this._validate(A,M,this.minDay,Z.local.invalidMonth);return this.daysPerMonth[e.month()-1]+(e.month()===12&&this.leapYear(e.year())?1:0)},weekDay:function(A,M,e){return this.dayOfWeek(A,M,e)!==5},toJD:function(A,M,e){var t=this._validate(A,M,e,Z.local.invalidDate);A=t.year(),M=t.month(),e=t.day();var r=0;if(A>0)for(var o=1;o0?A-1:A)*365+r+this.jdEpoch-1},fromJD:function(A){A=Math.floor(A)+.5;var M=475+(A-this.toJD(475,1,1))/365.242197,e=Math.floor(M);e<=0&&e--,A>this.toJD(e,12,x(e)?30:29)&&(e++,e===0&&e++);var t=A-this.toJD(e,1,1)+1,r=t<=186?Math.ceil(t/31):Math.ceil((t-6)/30),o=A-this.toJD(e,r,1)+1;return this.newDate(e,r,o)}}),Z.calendars.persian=d,Z.calendars.jalali=d}}),uW=Ze({"node_modules/world-calendars/dist/calendars/taiwan.js"(){var Z=Sp(),q=sh(),d=Z.instance();function x(A){this.local=this.regionalOptions[A||""]||this.regionalOptions[""]}x.prototype=new Z.baseCalendar,q(x.prototype,{name:"Taiwan",jdEpoch:24194025e-1,yearsOffset:1911,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Taiwan",epochs:["BROC","ROC"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},leapYear:function(e){var M=this._validate(e,this.minMonth,this.minDay,Z.local.invalidYear),e=this._t2gYear(M.year());return d.leapYear(e)},weekOfYear:function(r,M,e){var t=this._validate(r,this.minMonth,this.minDay,Z.local.invalidYear),r=this._t2gYear(t.year());return d.weekOfYear(r,t.month(),t.day())},daysInMonth:function(A,M){var e=this._validate(A,M,this.minDay,Z.local.invalidMonth);return this.daysPerMonth[e.month()-1]+(e.month()===2&&this.leapYear(e.year())?1:0)},weekDay:function(A,M,e){return(this.dayOfWeek(A,M,e)||7)<6},toJD:function(r,M,e){var t=this._validate(r,M,e,Z.local.invalidDate),r=this._t2gYear(t.year());return d.toJD(r,t.month(),t.day())},fromJD:function(A){var M=d.fromJD(A),e=this._g2tYear(M.year());return this.newDate(e,M.month(),M.day())},_t2gYear:function(A){return A+this.yearsOffset+(A>=-this.yearsOffset&&A<=-1?1:0)},_g2tYear:function(A){return A-this.yearsOffset-(A>=1&&A<=this.yearsOffset?1:0)}}),Z.calendars.taiwan=x}}),cW=Ze({"node_modules/world-calendars/dist/calendars/thai.js"(){var Z=Sp(),q=sh(),d=Z.instance();function x(A){this.local=this.regionalOptions[A||""]||this.regionalOptions[""]}x.prototype=new Z.baseCalendar,q(x.prototype,{name:"Thai",jdEpoch:15230985e-1,yearsOffset:543,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Thai",epochs:["BBE","BE"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var M=this._validate(e,this.minMonth,this.minDay,Z.local.invalidYear),e=this._t2gYear(M.year());return d.leapYear(e)},weekOfYear:function(r,M,e){var t=this._validate(r,this.minMonth,this.minDay,Z.local.invalidYear),r=this._t2gYear(t.year());return d.weekOfYear(r,t.month(),t.day())},daysInMonth:function(A,M){var e=this._validate(A,M,this.minDay,Z.local.invalidMonth);return this.daysPerMonth[e.month()-1]+(e.month()===2&&this.leapYear(e.year())?1:0)},weekDay:function(A,M,e){return(this.dayOfWeek(A,M,e)||7)<6},toJD:function(r,M,e){var t=this._validate(r,M,e,Z.local.invalidDate),r=this._t2gYear(t.year());return d.toJD(r,t.month(),t.day())},fromJD:function(A){var M=d.fromJD(A),e=this._g2tYear(M.year());return this.newDate(e,M.month(),M.day())},_t2gYear:function(A){return A-this.yearsOffset-(A>=1&&A<=this.yearsOffset?1:0)},_g2tYear:function(A){return A+this.yearsOffset+(A>=-this.yearsOffset&&A<=-1?1:0)}}),Z.calendars.thai=x}}),fW=Ze({"node_modules/world-calendars/dist/calendars/ummalqura.js"(){var Z=Sp(),q=sh();function d(A){this.local=this.regionalOptions[A||""]||this.regionalOptions[""]}d.prototype=new Z.baseCalendar,q(d.prototype,{name:"UmmAlQura",hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Umm al-Qura",epochs:["BH","AH"],monthNames:["Al-Muharram","Safar","Rabi' al-awwal","Rabi' Al-Thani","Jumada Al-Awwal","Jumada Al-Thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-Ahad","Yawm al-Ithnain","Yawm al-Thal\u0101th\u0101\u2019","Yawm al-Arba\u2018\u0101\u2019","Yawm al-Kham\u012Bs","Yawm al-Jum\u2018a","Yawm al-Sabt"],dayNamesMin:["Ah","Ith","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!0}},leapYear:function(A){var M=this._validate(A,this.minMonth,this.minDay,Z.local.invalidYear);return this.daysInYear(M.year())===355},weekOfYear:function(A,M,e){var t=this.newDate(A,M,e);return t.add(-t.dayOfWeek(),"d"),Math.floor((t.dayOfYear()-1)/7)+1},daysInYear:function(A){for(var M=0,e=1;e<=12;e++)M+=this.daysInMonth(A,e);return M},daysInMonth:function(A,M){for(var e=this._validate(A,M,this.minDay,Z.local.invalidMonth),t=e.toJD()-24e5+.5,r=0,o=0;ot)return x[r]-x[r-1];r++}return 30},weekDay:function(A,M,e){return this.dayOfWeek(A,M,e)!==5},toJD:function(A,M,e){var t=this._validate(A,M,e,Z.local.invalidDate),r=12*(t.year()-1)+t.month()-15292,o=t.day()+x[r-1]-1;return o+24e5-.5},fromJD:function(A){for(var M=A-24e5+.5,e=0,t=0;tM);t++)e++;var r=e+15292,o=Math.floor((r-1)/12),a=o+1,i=r-12*o,n=M-x[e-1]+1;return this.newDate(a,i,n)},isValid:function(A,M,e){var t=Z.baseCalendar.prototype.isValid.apply(this,arguments);return t&&(A=A.year!=null?A.year:A,t=A>=1276&&A<=1500),t},_validate:function(A,M,e,t){var r=Z.baseCalendar.prototype._validate.apply(this,arguments);if(r.year<1276||r.year>1500)throw t.replace(/\{0\}/,this.local.name);return r}}),Z.calendars.ummalqura=d;var x=[20,50,79,109,138,168,197,227,256,286,315,345,374,404,433,463,492,522,551,581,611,641,670,700,729,759,788,818,847,877,906,936,965,995,1024,1054,1083,1113,1142,1172,1201,1231,1260,1290,1320,1350,1379,1409,1438,1468,1497,1527,1556,1586,1615,1645,1674,1704,1733,1763,1792,1822,1851,1881,1910,1940,1969,1999,2028,2058,2087,2117,2146,2176,2205,2235,2264,2294,2323,2353,2383,2413,2442,2472,2501,2531,2560,2590,2619,2649,2678,2708,2737,2767,2796,2826,2855,2885,2914,2944,2973,3003,3032,3062,3091,3121,3150,3180,3209,3239,3268,3298,3327,3357,3386,3416,3446,3476,3505,3535,3564,3594,3623,3653,3682,3712,3741,3771,3800,3830,3859,3889,3918,3948,3977,4007,4036,4066,4095,4125,4155,4185,4214,4244,4273,4303,4332,4362,4391,4421,4450,4480,4509,4539,4568,4598,4627,4657,4686,4716,4745,4775,4804,4834,4863,4893,4922,4952,4981,5011,5040,5070,5099,5129,5158,5188,5218,5248,5277,5307,5336,5366,5395,5425,5454,5484,5513,5543,5572,5602,5631,5661,5690,5720,5749,5779,5808,5838,5867,5897,5926,5956,5985,6015,6044,6074,6103,6133,6162,6192,6221,6251,6281,6311,6340,6370,6399,6429,6458,6488,6517,6547,6576,6606,6635,6665,6694,6724,6753,6783,6812,6842,6871,6901,6930,6960,6989,7019,7048,7078,7107,7137,7166,7196,7225,7255,7284,7314,7344,7374,7403,7433,7462,7492,7521,7551,7580,7610,7639,7669,7698,7728,7757,7787,7816,7846,7875,7905,7934,7964,7993,8023,8053,8083,8112,8142,8171,8201,8230,8260,8289,8319,8348,8378,8407,8437,8466,8496,8525,8555,8584,8614,8643,8673,8702,8732,8761,8791,8821,8850,8880,8909,8938,8968,8997,9027,9056,9086,9115,9145,9175,9205,9234,9264,9293,9322,9352,9381,9410,9440,9470,9499,9529,9559,9589,9618,9648,9677,9706,9736,9765,9794,9824,9853,9883,9913,9943,9972,10002,10032,10061,10090,10120,10149,10178,10208,10237,10267,10297,10326,10356,10386,10415,10445,10474,10504,10533,10562,10592,10621,10651,10680,10710,10740,10770,10799,10829,10858,10888,10917,10947,10976,11005,11035,11064,11094,11124,11153,11183,11213,11242,11272,11301,11331,11360,11389,11419,11448,11478,11507,11537,11567,11596,11626,11655,11685,11715,11744,11774,11803,11832,11862,11891,11921,11950,11980,12010,12039,12069,12099,12128,12158,12187,12216,12246,12275,12304,12334,12364,12393,12423,12453,12483,12512,12542,12571,12600,12630,12659,12688,12718,12747,12777,12807,12837,12866,12896,12926,12955,12984,13014,13043,13072,13102,13131,13161,13191,13220,13250,13280,13310,13339,13368,13398,13427,13456,13486,13515,13545,13574,13604,13634,13664,13693,13723,13752,13782,13811,13840,13870,13899,13929,13958,13988,14018,14047,14077,14107,14136,14166,14195,14224,14254,14283,14313,14342,14372,14401,14431,14461,14490,14520,14550,14579,14609,14638,14667,14697,14726,14756,14785,14815,14844,14874,14904,14933,14963,14993,15021,15051,15081,15110,15140,15169,15199,15228,15258,15287,15317,15347,15377,15406,15436,15465,15494,15524,15553,15582,15612,15641,15671,15701,15731,15760,15790,15820,15849,15878,15908,15937,15966,15996,16025,16055,16085,16114,16144,16174,16204,16233,16262,16292,16321,16350,16380,16409,16439,16468,16498,16528,16558,16587,16617,16646,16676,16705,16734,16764,16793,16823,16852,16882,16912,16941,16971,17001,17030,17060,17089,17118,17148,17177,17207,17236,17266,17295,17325,17355,17384,17414,17444,17473,17502,17532,17561,17591,17620,17650,17679,17709,17738,17768,17798,17827,17857,17886,17916,17945,17975,18004,18034,18063,18093,18122,18152,18181,18211,18241,18270,18300,18330,18359,18388,18418,18447,18476,18506,18535,18565,18595,18625,18654,18684,18714,18743,18772,18802,18831,18860,18890,18919,18949,18979,19008,19038,19068,19098,19127,19156,19186,19215,19244,19274,19303,19333,19362,19392,19422,19452,19481,19511,19540,19570,19599,19628,19658,19687,19717,19746,19776,19806,19836,19865,19895,19924,19954,19983,20012,20042,20071,20101,20130,20160,20190,20219,20249,20279,20308,20338,20367,20396,20426,20455,20485,20514,20544,20573,20603,20633,20662,20692,20721,20751,20780,20810,20839,20869,20898,20928,20957,20987,21016,21046,21076,21105,21135,21164,21194,21223,21253,21282,21312,21341,21371,21400,21430,21459,21489,21519,21548,21578,21607,21637,21666,21696,21725,21754,21784,21813,21843,21873,21902,21932,21962,21991,22021,22050,22080,22109,22138,22168,22197,22227,22256,22286,22316,22346,22375,22405,22434,22464,22493,22522,22552,22581,22611,22640,22670,22700,22730,22759,22789,22818,22848,22877,22906,22936,22965,22994,23024,23054,23083,23113,23143,23173,23202,23232,23261,23290,23320,23349,23379,23408,23438,23467,23497,23527,23556,23586,23616,23645,23674,23704,23733,23763,23792,23822,23851,23881,23910,23940,23970,23999,24029,24058,24088,24117,24147,24176,24206,24235,24265,24294,24324,24353,24383,24413,24442,24472,24501,24531,24560,24590,24619,24648,24678,24707,24737,24767,24796,24826,24856,24885,24915,24944,24974,25003,25032,25062,25091,25121,25150,25180,25210,25240,25269,25299,25328,25358,25387,25416,25446,25475,25505,25534,25564,25594,25624,25653,25683,25712,25742,25771,25800,25830,25859,25888,25918,25948,25977,26007,26037,26067,26096,26126,26155,26184,26214,26243,26272,26302,26332,26361,26391,26421,26451,26480,26510,26539,26568,26598,26627,26656,26686,26715,26745,26775,26805,26834,26864,26893,26923,26952,26982,27011,27041,27070,27099,27129,27159,27188,27218,27248,27277,27307,27336,27366,27395,27425,27454,27484,27513,27542,27572,27602,27631,27661,27691,27720,27750,27779,27809,27838,27868,27897,27926,27956,27985,28015,28045,28074,28104,28134,28163,28193,28222,28252,28281,28310,28340,28369,28399,28428,28458,28488,28517,28547,28577,28607,28636,28665,28695,28724,28754,28783,28813,28843,28872,28901,28931,28960,28990,29019,29049,29078,29108,29137,29167,29196,29226,29255,29285,29315,29345,29375,29404,29434,29463,29492,29522,29551,29580,29610,29640,29669,29699,29729,29759,29788,29818,29847,29876,29906,29935,29964,29994,30023,30053,30082,30112,30141,30171,30200,30230,30259,30289,30318,30348,30378,30408,30437,30467,30496,30526,30555,30585,30614,30644,30673,30703,30732,30762,30791,30821,30850,30880,30909,30939,30968,30998,31027,31057,31086,31116,31145,31175,31204,31234,31263,31293,31322,31352,31381,31411,31441,31471,31500,31530,31559,31589,31618,31648,31676,31706,31736,31766,31795,31825,31854,31884,31913,31943,31972,32002,32031,32061,32090,32120,32150,32180,32209,32239,32268,32298,32327,32357,32386,32416,32445,32475,32504,32534,32563,32593,32622,32652,32681,32711,32740,32770,32799,32829,32858,32888,32917,32947,32976,33006,33035,33065,33094,33124,33153,33183,33213,33243,33272,33302,33331,33361,33390,33420,33450,33479,33509,33539,33568,33598,33627,33657,33686,33716,33745,33775,33804,33834,33863,33893,33922,33952,33981,34011,34040,34069,34099,34128,34158,34187,34217,34247,34277,34306,34336,34365,34395,34424,34454,34483,34512,34542,34571,34601,34631,34660,34690,34719,34749,34778,34808,34837,34867,34896,34926,34955,34985,35015,35044,35074,35103,35133,35162,35192,35222,35251,35280,35310,35340,35370,35399,35429,35458,35488,35517,35547,35576,35605,35635,35665,35694,35723,35753,35782,35811,35841,35871,35901,35930,35960,35989,36019,36048,36078,36107,36136,36166,36195,36225,36254,36284,36314,36343,36373,36403,36433,36462,36492,36521,36551,36580,36610,36639,36669,36698,36728,36757,36786,36816,36845,36875,36904,36934,36963,36993,37022,37052,37081,37111,37141,37170,37200,37229,37259,37288,37318,37347,37377,37406,37436,37465,37495,37524,37554,37584,37613,37643,37672,37701,37731,37760,37790,37819,37849,37878,37908,37938,37967,37997,38027,38056,38085,38115,38144,38174,38203,38233,38262,38292,38322,38351,38381,38410,38440,38469,38499,38528,38558,38587,38617,38646,38676,38705,38735,38764,38794,38823,38853,38882,38912,38941,38971,39001,39030,39059,39089,39118,39148,39178,39208,39237,39267,39297,39326,39355,39385,39414,39444,39473,39503,39532,39562,39592,39621,39650,39680,39709,39739,39768,39798,39827,39857,39886,39916,39946,39975,40005,40035,40064,40094,40123,40153,40182,40212,40241,40271,40300,40330,40359,40389,40418,40448,40477,40507,40536,40566,40595,40625,40655,40685,40714,40744,40773,40803,40832,40862,40892,40921,40951,40980,41009,41039,41068,41098,41127,41157,41186,41216,41245,41275,41304,41334,41364,41393,41422,41452,41481,41511,41540,41570,41599,41629,41658,41688,41718,41748,41777,41807,41836,41865,41894,41924,41953,41983,42012,42042,42072,42102,42131,42161,42190,42220,42249,42279,42308,42337,42367,42397,42426,42456,42485,42515,42545,42574,42604,42633,42662,42692,42721,42751,42780,42810,42839,42869,42899,42929,42958,42988,43017,43046,43076,43105,43135,43164,43194,43223,43253,43283,43312,43342,43371,43401,43430,43460,43489,43519,43548,43578,43607,43637,43666,43696,43726,43755,43785,43814,43844,43873,43903,43932,43962,43991,44021,44050,44080,44109,44139,44169,44198,44228,44258,44287,44317,44346,44375,44405,44434,44464,44493,44523,44553,44582,44612,44641,44671,44700,44730,44759,44788,44818,44847,44877,44906,44936,44966,44996,45025,45055,45084,45114,45143,45172,45202,45231,45261,45290,45320,45350,45380,45409,45439,45468,45498,45527,45556,45586,45615,45644,45674,45704,45733,45763,45793,45823,45852,45882,45911,45940,45970,45999,46028,46058,46088,46117,46147,46177,46206,46236,46265,46295,46324,46354,46383,46413,46442,46472,46501,46531,46560,46590,46620,46649,46679,46708,46738,46767,46797,46826,46856,46885,46915,46944,46974,47003,47033,47063,47092,47122,47151,47181,47210,47240,47269,47298,47328,47357,47387,47417,47446,47476,47506,47535,47565,47594,47624,47653,47682,47712,47741,47771,47800,47830,47860,47890,47919,47949,47978,48008,48037,48066,48096,48125,48155,48184,48214,48244,48273,48303,48333,48362,48392,48421,48450,48480,48509,48538,48568,48598,48627,48657,48687,48717,48746,48776,48805,48834,48864,48893,48922,48952,48982,49011,49041,49071,49100,49130,49160,49189,49218,49248,49277,49306,49336,49365,49395,49425,49455,49484,49514,49543,49573,49602,49632,49661,49690,49720,49749,49779,49809,49838,49868,49898,49927,49957,49986,50016,50045,50075,50104,50133,50163,50192,50222,50252,50281,50311,50340,50370,50400,50429,50459,50488,50518,50547,50576,50606,50635,50665,50694,50724,50754,50784,50813,50843,50872,50902,50931,50960,50990,51019,51049,51078,51108,51138,51167,51197,51227,51256,51286,51315,51345,51374,51403,51433,51462,51492,51522,51552,51582,51611,51641,51670,51699,51729,51758,51787,51816,51846,51876,51906,51936,51965,51995,52025,52054,52083,52113,52142,52171,52200,52230,52260,52290,52319,52349,52379,52408,52438,52467,52497,52526,52555,52585,52614,52644,52673,52703,52733,52762,52792,52822,52851,52881,52910,52939,52969,52998,53028,53057,53087,53116,53146,53176,53205,53235,53264,53294,53324,53353,53383,53412,53441,53471,53500,53530,53559,53589,53619,53648,53678,53708,53737,53767,53796,53825,53855,53884,53913,53943,53973,54003,54032,54062,54092,54121,54151,54180,54209,54239,54268,54297,54327,54357,54387,54416,54446,54476,54505,54535,54564,54593,54623,54652,54681,54711,54741,54770,54800,54830,54859,54889,54919,54948,54977,55007,55036,55066,55095,55125,55154,55184,55213,55243,55273,55302,55332,55361,55391,55420,55450,55479,55508,55538,55567,55597,55627,55657,55686,55716,55745,55775,55804,55834,55863,55892,55922,55951,55981,56011,56040,56070,56100,56129,56159,56188,56218,56247,56276,56306,56335,56365,56394,56424,56454,56483,56513,56543,56572,56601,56631,56660,56690,56719,56749,56778,56808,56837,56867,56897,56926,56956,56985,57015,57044,57074,57103,57133,57162,57192,57221,57251,57280,57310,57340,57369,57399,57429,57458,57487,57517,57546,57576,57605,57634,57664,57694,57723,57753,57783,57813,57842,57871,57901,57930,57959,57989,58018,58048,58077,58107,58137,58167,58196,58226,58255,58285,58314,58343,58373,58402,58432,58461,58491,58521,58551,58580,58610,58639,58669,58698,58727,58757,58786,58816,58845,58875,58905,58934,58964,58994,59023,59053,59082,59111,59141,59170,59200,59229,59259,59288,59318,59348,59377,59407,59436,59466,59495,59525,59554,59584,59613,59643,59672,59702,59731,59761,59791,59820,59850,59879,59909,59939,59968,59997,60027,60056,60086,60115,60145,60174,60204,60234,60264,60293,60323,60352,60381,60411,60440,60469,60499,60528,60558,60588,60618,60648,60677,60707,60736,60765,60795,60824,60853,60883,60912,60942,60972,61002,61031,61061,61090,61120,61149,61179,61208,61237,61267,61296,61326,61356,61385,61415,61445,61474,61504,61533,61563,61592,61621,61651,61680,61710,61739,61769,61799,61828,61858,61888,61917,61947,61976,62006,62035,62064,62094,62123,62153,62182,62212,62242,62271,62301,62331,62360,62390,62419,62448,62478,62507,62537,62566,62596,62625,62655,62685,62715,62744,62774,62803,62832,62862,62891,62921,62950,62980,63009,63039,63069,63099,63128,63157,63187,63216,63246,63275,63305,63334,63363,63393,63423,63453,63482,63512,63541,63571,63600,63630,63659,63689,63718,63747,63777,63807,63836,63866,63895,63925,63955,63984,64014,64043,64073,64102,64131,64161,64190,64220,64249,64279,64309,64339,64368,64398,64427,64457,64486,64515,64545,64574,64603,64633,64663,64692,64722,64752,64782,64811,64841,64870,64899,64929,64958,64987,65017,65047,65076,65106,65136,65166,65195,65225,65254,65283,65313,65342,65371,65401,65431,65460,65490,65520,65549,65579,65608,65638,65667,65697,65726,65755,65785,65815,65844,65874,65903,65933,65963,65992,66022,66051,66081,66110,66140,66169,66199,66228,66258,66287,66317,66346,66376,66405,66435,66465,66494,66524,66553,66583,66612,66641,66671,66700,66730,66760,66789,66819,66849,66878,66908,66937,66967,66996,67025,67055,67084,67114,67143,67173,67203,67233,67262,67292,67321,67351,67380,67409,67439,67468,67497,67527,67557,67587,67617,67646,67676,67705,67735,67764,67793,67823,67852,67882,67911,67941,67971,68e3,68030,68060,68089,68119,68148,68177,68207,68236,68266,68295,68325,68354,68384,68414,68443,68473,68502,68532,68561,68591,68620,68650,68679,68708,68738,68768,68797,68827,68857,68886,68916,68946,68975,69004,69034,69063,69092,69122,69152,69181,69211,69240,69270,69300,69330,69359,69388,69418,69447,69476,69506,69535,69565,69595,69624,69654,69684,69713,69743,69772,69802,69831,69861,69890,69919,69949,69978,70008,70038,70067,70097,70126,70156,70186,70215,70245,70274,70303,70333,70362,70392,70421,70451,70481,70510,70540,70570,70599,70629,70658,70687,70717,70746,70776,70805,70835,70864,70894,70924,70954,70983,71013,71042,71071,71101,71130,71159,71189,71218,71248,71278,71308,71337,71367,71397,71426,71455,71485,71514,71543,71573,71602,71632,71662,71691,71721,71751,71781,71810,71839,71869,71898,71927,71957,71986,72016,72046,72075,72105,72135,72164,72194,72223,72253,72282,72311,72341,72370,72400,72429,72459,72489,72518,72548,72577,72607,72637,72666,72695,72725,72754,72784,72813,72843,72872,72902,72931,72961,72991,73020,73050,73080,73109,73139,73168,73197,73227,73256,73286,73315,73345,73375,73404,73434,73464,73493,73523,73552,73581,73611,73640,73669,73699,73729,73758,73788,73818,73848,73877,73907,73936,73965,73995,74024,74053,74083,74113,74142,74172,74202,74231,74261,74291,74320,74349,74379,74408,74437,74467,74497,74526,74556,74586,74615,74645,74675,74704,74733,74763,74792,74822,74851,74881,74910,74940,74969,74999,75029,75058,75088,75117,75147,75176,75206,75235,75264,75294,75323,75353,75383,75412,75442,75472,75501,75531,75560,75590,75619,75648,75678,75707,75737,75766,75796,75826,75856,75885,75915,75944,75974,76003,76032,76062,76091,76121,76150,76180,76210,76239,76269,76299,76328,76358,76387,76416,76446,76475,76505,76534,76564,76593,76623,76653,76682,76712,76741,76771,76801,76830,76859,76889,76918,76948,76977,77007,77036,77066,77096,77125,77155,77185,77214,77243,77273,77302,77332,77361,77390,77420,77450,77479,77509,77539,77569,77598,77627,77657,77686,77715,77745,77774,77804,77833,77863,77893,77923,77952,77982,78011,78041,78070,78099,78129,78158,78188,78217,78247,78277,78307,78336,78366,78395,78425,78454,78483,78513,78542,78572,78601,78631,78661,78690,78720,78750,78779,78808,78838,78867,78897,78926,78956,78985,79015,79044,79074,79104,79133,79163,79192,79222,79251,79281,79310,79340,79369,79399,79428,79458,79487,79517,79546,79576,79606,79635,79665,79695,79724,79753,79783,79812,79841,79871,79900,79930,79960,79990]}}),hW=Ze({"src/components/calendars/calendars.js"(Z,q){"use strict";q.exports=Sp(),JH(),$H(),QH(),eW(),tW(),rW(),aW(),iW(),nW(),oW(),sW(),lW(),uW(),cW(),fW()}}),pW=Ze({"src/components/calendars/index.js"(Z,q){"use strict";var d=hW(),x=ca(),A=qs(),M=A.EPOCHJD,e=A.ONEDAY,t={valType:"enumerated",values:x.sortObjectKeys(d.calendars),editType:"calc",dflt:"gregorian"},r=function(y,b,p,u){var m={};return m[p]=t,x.coerce(y,b,m,p,u)},o=function(y,b,p,u){for(var m=0;m0){if(++ge>=UZ)return arguments[0]}else ge=0;return se.apply(void 0,arguments)}}var Lb=VZ;var GZ=Lb(Tb),Pb=GZ;var HZ=/\{\n\/\* \[wrapped with (.+)\] \*/,WZ=/,? & /;function XZ(se){var ge=se.match(HZ);return ge?ge[1].split(WZ):[]}var uk=XZ;var ZZ=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;function YZ(se,ge){var Ye=ge.length;if(!Ye)return se;var Pt=Ye-1;return ge[Pt]=(Ye>1?"& ":"")+ge[Pt],ge=ge.join(Ye>2?", ":" "),se.replace(ZZ,`{ /* [wrapped with `+ge+`] */ `)}var ck=YZ;function KZ(se){return function(){return se}}var $g=KZ;var JZ=function(){try{var se=ld(Object,"defineProperty");return se({},"",{}),se}catch{}}(),Qg=JZ;var $Z=Qg?function(se,ge){return Qg(se,"toString",{configurable:!0,enumerable:!1,value:$g(ge),writable:!0})}:Fc,fk=$Z;var QZ=Lb(fk),ey=QZ;function eY(se,ge){for(var Ye=-1,Pt=se==null?0:se.length;++Ye-1}var Sm=nY;var oY=1,sY=2,lY=8,uY=16,cY=32,fY=64,hY=128,pY=256,dY=512,vY=[["ary",hY],["bind",oY],["bindKey",sY],["curry",lY],["curryRight",uY],["flip",dY],["partial",cY],["partialRight",fY],["rearg",pY]];function mY(se,ge){return Nh(vY,function(Ye){var Pt="_."+Ye[0];ge&Ye[1]&&!Sm(se,Pt)&&se.push(Pt)}),se.sort()}var pk=mY;function gY(se,ge,Ye){var Pt=ge+"";return ey(se,ck(Pt,pk(uk(Pt),Ye)))}var Rb=gY;var yY=1,_Y=2,xY=4,bY=8,dk=32,vk=64;function wY(se,ge,Ye,Pt,vr,Zr,ka,oi,ci,Ln){var bn=ge&bY,Fn=bn?ka:void 0,Uo=bn?void 0:ka,ws=bn?Zr:void 0,wo=bn?void 0:Zr;ge|=bn?dk:vk,ge&=~(bn?vk:dk),ge&xY||(ge&=~(yY|_Y));var Ze=[se,ge,vr,ws,Fn,wo,Uo,oi,ci,Ln],Ws=Ye.apply(void 0,Ze);return i_(se)&&Pb(Ws,Ze),Ws.placeholder=Pt,Rb(Ws,se,ge)}var Db=wY;function TY(se){var ge=se;return ge.placeholder}var Sd=TY;var AY=9007199254740991,SY=/^(?:0|[1-9]\d*)$/;function MY(se,ge){var Ye=typeof se;return ge=ge??AY,!!ge&&(Ye=="number"||Ye!="symbol"&&SY.test(se))&&se>-1&&se%1==0&&se1&&cu.reverse(),bn&&ci-1&&se%1==0&&se<=rK}var Mm=aK;function iK(se){return se!=null&&Mm(se.length)&&!ap(se)}var jc=iK;function nK(se,ge,Ye){if(!kl(Ye))return!1;var Pt=typeof ge;return(Pt=="number"?jc(Ye)&&ip(ge,Ye.length):Pt=="string"&&ge in Ye)?ih(Ye[ge],se):!1}var Oc=nK;function oK(se){return Ho(function(ge,Ye){var Pt=-1,vr=Ye.length,Zr=vr>1?Ye[vr-1]:void 0,ka=vr>2?Ye[2]:void 0;for(Zr=se.length>3&&typeof Zr=="function"?(vr--,Zr):void 0,ka&&Oc(Ye[0],Ye[1],ka)&&(Zr=vr<3?void 0:Zr,vr=1),ge=Object(ge);++Pt-1}var Yk=zJ;function FJ(se,ge){var Ye=this.__data__,Pt=Cm(Ye,se);return Pt<0?(++this.size,Ye.push([se,ge])):Ye[Pt][1]=ge,this}var Kk=FJ;function sy(se){var ge=-1,Ye=se==null?0:se.length;for(this.clear();++ge0&&Ye(oi)?ge>1?oL(oi,ge-1,Ye,Pt,vr):Fp(vr,oi):Pt||(vr[vr.length]=oi)}return vr}var Qu=oL;function o$(se){var ge=se==null?0:se.length;return ge?Qu(se,1):[]}var jb=o$;function s$(se){return ey(Fb(se,void 0,jb),se+"")}var lp=s$;var l$=lp(cy),sL=l$;var u$=Bb(Object.getPrototypeOf,Object),Im=u$;var c$="[object Object]",f$=Function.prototype,h$=Object.prototype,lL=f$.toString,p$=h$.hasOwnProperty,d$=lL.call(Object);function v$(se){if(!Rl(se)||zc(se)!=c$)return!1;var ge=Im(se);if(ge===null)return!0;var Ye=p$.call(ge,"constructor")&&ge.constructor;return typeof Ye=="function"&&Ye instanceof Ye&&lL.call(Ye)==d$}var gv=v$;var m$="[object DOMException]",g$="[object Error]";function y$(se){if(!Rl(se))return!1;var ge=zc(se);return ge==g$||ge==m$||typeof se.message=="string"&&typeof se.name=="string"&&!gv(se)}var fy=y$;var _$=Ho(function(se,ge){try{return _f(se,void 0,ge)}catch(Ye){return fy(Ye)?Ye:new Error(Ye)}}),qb=_$;var x$="Expected a function";function b$(se,ge){var Ye;if(typeof ge!="function")throw new TypeError(x$);return se=Go(se),function(){return--se>0&&(Ye=ge.apply(this,arguments)),se<=1&&(ge=void 0),Ye}}var Vb=b$;var w$=1,T$=32,PA=Ho(function(se,ge,Ye){var Pt=w$;if(Ye.length){var vr=Yp(Ye,Sd(PA));Pt|=T$}return np(se,Pt,ge,Ye,vr)});PA.placeholder={};var Gb=PA;var A$=lp(function(se,ge){return Nh(ge,function(Ye){Ye=Sh(Ye),op(se,Ye,Gb(se[Ye],se))}),se}),uL=A$;var S$=1,M$=2,E$=32,IA=Ho(function(se,ge,Ye){var Pt=S$|M$;if(Ye.length){var vr=Yp(Ye,Sd(IA));Pt|=E$}return np(ge,Pt,se,Ye,vr)});IA.placeholder={};var cL=IA;function C$(se,ge,Ye){var Pt=-1,vr=se.length;ge<0&&(ge=-ge>vr?0:vr+ge),Ye=Ye>vr?vr:Ye,Ye<0&&(Ye+=vr),vr=ge>Ye?0:Ye-ge>>>0,ge>>>=0;for(var Zr=Array(vr);++Pt=Pt?se:Xf(se,ge,Ye)}var Op=k$;var L$="\\ud800-\\udfff",P$="\\u0300-\\u036f",I$="\\ufe20-\\ufe2f",R$="\\u20d0-\\u20ff",D$=P$+I$+R$,z$="\\ufe0e\\ufe0f",F$="\\u200d",O$=RegExp("["+F$+L$+D$+z$+"]");function B$(se){return O$.test(se)}var Cd=B$;function N$(se){return se.split("")}var fL=N$;var hL="\\ud800-\\udfff",U$="\\u0300-\\u036f",j$="\\ufe20-\\ufe2f",q$="\\u20d0-\\u20ff",V$=U$+j$+q$,G$="\\ufe0e\\ufe0f",H$="["+hL+"]",RA="["+V$+"]",DA="\\ud83c[\\udffb-\\udfff]",W$="(?:"+RA+"|"+DA+")",pL="[^"+hL+"]",dL="(?:\\ud83c[\\udde6-\\uddff]){2}",vL="[\\ud800-\\udbff][\\udc00-\\udfff]",X$="\\u200d",mL=W$+"?",gL="["+G$+"]?",Z$="(?:"+X$+"(?:"+[pL,dL,vL].join("|")+")"+gL+mL+")*",Y$=gL+mL+Z$,K$="(?:"+[pL+RA+"?",RA,dL,vL,H$].join("|")+")",J$=RegExp(DA+"(?="+DA+")|"+K$+Y$,"g");function $$(se){return se.match(J$)||[]}var yL=$$;function Q$(se){return Cd(se)?yL(se):fL(se)}var Uh=Q$;function eQ(se){return function(ge){ge=Ds(ge);var Ye=Cd(ge)?Uh(ge):void 0,Pt=Ye?Ye[0]:ge.charAt(0),vr=Ye?Op(Ye,1).join(""):ge.slice(1);return Pt[se]()+vr}}var Hb=eQ;var tQ=Hb("toUpperCase"),hy=tQ;function rQ(se){return hy(Ds(se).toLowerCase())}var Wb=rQ;function aQ(se,ge,Ye,Pt){var vr=-1,Zr=se==null?0:se.length;for(Pt&&Zr&&(Ye=se[++vr]);++vr=ge?se:ge)),se}var cd=ree;function aee(se,ge,Ye){return Ye===void 0&&(Ye=ge,ge=void 0),Ye!==void 0&&(Ye=Th(Ye),Ye=Ye===Ye?Ye:0),ge!==void 0&&(ge=Th(ge),ge=ge===ge?ge:0),cd(Th(se),ge,Ye)}var GL=aee;function iee(){this.__data__=new km,this.size=0}var HL=iee;function nee(se){var ge=this.__data__,Ye=ge.delete(se);return this.size=ge.size,Ye}var WL=nee;function oee(se){return this.__data__.get(se)}var XL=oee;function see(se){return this.__data__.has(se)}var ZL=see;var lee=200;function uee(se,ge){var Ye=this.__data__;if(Ye instanceof km){var Pt=Ye.__data__;if(!Lm||Pt.lengthoi))return!1;var Ln=Zr.get(se),bn=Zr.get(ge);if(Ln&&bn)return Ln==ge&&bn==se;var Fn=-1,Uo=!0,ws=Ye&ure?new Dm:void 0;for(Zr.set(se,ge),Zr.set(ge,se);++Fn=ge||$p<0||Fn&&jp>=Zr}function Yl(){var On=Ly();if(Ws(On))return cu(On);oi=setTimeout(Yl,Ze(On))}function cu(On){return oi=void 0,Uo&&Pt?ws(On):(Pt=vr=void 0,ka)}function nh(){oi!==void 0&&clearTimeout(oi),Ln=0,Pt=ci=vr=oi=void 0}function Eh(){return oi===void 0?ka:cu(Ly())}function Up(){var On=Ly(),$p=Ws(On);if(Pt=arguments,vr=this,ci=On,$p){if(oi===void 0)return wo(ci);if(Fn)return clearTimeout(oi),oi=setTimeout(Yl,ge),ws(ci)}return oi===void 0&&(oi=setTimeout(Yl,ge)),ka}return Up.cancel=nh,Up.flush=Eh,Up}var _w=wae;function Tae(se,ge){return se==null||se!==se?ge:se}var $P=Tae;var QP=Object.prototype,Aae=QP.hasOwnProperty,Sae=Ho(function(se,ge){se=Object(se);var Ye=-1,Pt=ge.length,vr=Pt>2?ge[2]:void 0;for(vr&&Oc(ge[0],ge[1],vr)&&(Pt=1);++Ye=Bae&&(Zr=Gv,ka=!1,ge=new Dm(ge));e:for(;++vr=0&&se.slice(Ye,vr)==ge}var gI=aie;function iie(se,ge){return Sl(ge,function(Ye){return[Ye,se[Ye]]})}var yI=iie;function nie(se){var ge=-1,Ye=Array(se.size);return se.forEach(function(Pt){Ye[++ge]=[Pt,Pt]}),Ye}var _I=nie;var oie="[object Map]",sie="[object Set]";function lie(se){return function(ge){var Ye=jh(ge);return Ye==oie?Ay(ge):Ye==sie?_I(ge):yI(ge,se(ge))}}var Sw=lie;var uie=Sw(du),p_=uie;var cie=Sw(qc),d_=cie;var fie={"&":"&","<":"<",">":">",'"':""","'":"'"},hie=dy(fie),xI=hie;var bI=/[&<>"']/g,pie=RegExp(bI.source);function die(se){return se=Ds(se),se&&pie.test(se)?se.replace(bI,xI):se}var Mw=die;var wI=/[\\^$.*+?()[\]{}|]/g,vie=RegExp(wI.source);function mie(se){return se=Ds(se),se&&vie.test(se)?se.replace(wI,"\\$&"):se}var TI=mie;function gie(se,ge){for(var Ye=-1,Pt=se==null?0:se.length;++Yevr?0:vr+Ye),Pt=Pt===void 0||Pt>vr?vr:Go(Pt),Pt<0&&(Pt+=vr),Pt=Ye>Pt?0:Cw(Pt);Ye-1?vr[Zr?ge[ka]:ka]:void 0}}var Lw=Mie;var Eie=Math.max;function Cie(se,ge,Ye){var Pt=se==null?0:se.length;if(!Pt)return-1;var vr=Ye==null?0:Go(Ye);return vr<0&&(vr=Eie(Pt+vr,0)),Am(se,bo(ge,3),vr)}var Pw=Cie;var kie=Lw(Pw),kI=kie;function Lie(se,ge,Ye){var Pt;return Ye(se,function(vr,Zr,ka){if(ge(vr,Zr,ka))return Pt=Zr,!1}),Pt}var Iw=Lie;function Pie(se,ge){return Iw(se,bo(ge,3),cp)}var LI=Pie;var Iie=Math.max,Rie=Math.min;function Die(se,ge,Ye){var Pt=se==null?0:se.length;if(!Pt)return-1;var vr=Pt-1;return Ye!==void 0&&(vr=Go(Ye),vr=Ye<0?Iie(Pt+vr,0):Rie(vr,Pt-1)),Am(se,bo(ge,3),vr,!0)}var Rw=Die;var zie=Lw(Rw),PI=zie;function Fie(se,ge){return Iw(se,bo(ge,3),Ry)}var II=Fie;function Oie(se){return se&&se.length?se[0]:void 0}var v_=Oie;function Bie(se,ge){var Ye=-1,Pt=jc(se)?Array(se.length):[];return Np(se,function(vr,Zr,ka){Pt[++Ye]=ge(vr,Zr,ka)}),Pt}var Dw=Bie;function Nie(se,ge){var Ye=Do(se)?Sl:Dw;return Ye(se,bo(ge,3))}var Nm=Nie;function Uie(se,ge){return Qu(Nm(se,ge),1)}var RI=Uie;var jie=1/0;function qie(se,ge){return Qu(Nm(se,ge),jie)}var DI=qie;function Vie(se,ge,Ye){return Ye=Ye===void 0?1:Go(Ye),Qu(Nm(se,ge),Ye)}var zI=Vie;var Gie=1/0;function Hie(se){var ge=se==null?0:se.length;return ge?Qu(se,Gie):[]}var FI=Hie;function Wie(se,ge){var Ye=se==null?0:se.length;return Ye?(ge=ge===void 0?1:Go(ge),Qu(se,ge)):[]}var OI=Wie;var Xie=512;function Zie(se){return np(se,Xie)}var BI=Zie;var Yie=my("floor"),NI=Yie;var Kie="Expected a function",Jie=8,$ie=32,Qie=128,ene=256;function tne(se){return lp(function(ge){var Ye=ge.length,Pt=Ye,vr=Dp.prototype.thru;for(se&&ge.reverse();Pt--;){var Zr=ge[Pt];if(typeof Zr!="function")throw new TypeError(Kie);if(vr&&!ka&&Jg(Zr)=="wrapper")var ka=new Dp([],!0)}for(Pt=ka?Pt:Ye;++Ptge}var Dy=vne;function mne(se){return function(ge,Ye){return typeof ge=="string"&&typeof Ye=="string"||(ge=Th(ge),Ye=Th(Ye)),se(ge,Ye)}}var jm=mne;var gne=jm(Dy),KI=gne;var yne=jm(function(se,ge){return se>=ge}),JI=yne;var _ne=Object.prototype,xne=_ne.hasOwnProperty;function bne(se,ge){return se!=null&&xne.call(se,ge)}var $I=bne;function wne(se,ge){return se!=null&&pw(se,ge,$I)}var QI=wne;var Tne=Math.max,Ane=Math.min;function Sne(se,ge,Ye){return se>=Ane(ge,Ye)&&se-1:!!vr&&Ad(se,ge,Ye)>-1}var r8=Ine;var Rne=Math.max;function Dne(se,ge,Ye){var Pt=se==null?0:se.length;if(!Pt)return-1;var vr=Ye==null?0:Go(Ye);return vr<0&&(vr=Rne(Pt+vr,0)),Ad(se,ge,vr)}var a8=Dne;function zne(se){var ge=se==null?0:se.length;return ge?Xf(se,0,-1):[]}var i8=zne;var Fne=Math.min;function One(se,ge,Ye){for(var Pt=Ye?Iy:Sm,vr=se[0].length,Zr=se.length,ka=Zr,oi=Array(Zr),ci=1/0,Ln=[];ka--;){var bn=se[ka];ka&&ge&&(bn=Sl(bn,bf(ge))),ci=Fne(bn.length,ci),oi[ka]=!Ye&&(ge||vr>=120&&bn.length>=120)?new Dm(ka&&bn):void 0}bn=se[0];var Fn=-1,Uo=oi[0];e:for(;++Fn=-z8&&se<=z8}var F8=Ioe;function Roe(se){return se===void 0}var O8=Roe;var Doe="[object WeakMap]";function zoe(se){return Rl(se)&&jh(se)==Doe}var B8=zoe;var Foe="[object WeakSet]";function Ooe(se){return Rl(se)&&zc(se)==Foe}var N8=Ooe;var Boe=1;function Noe(se){return bo(typeof se=="function"?se:up(se,Boe))}var U8=Noe;var Uoe=Array.prototype,joe=Uoe.join;function qoe(se,ge){return se==null?"":joe.call(se,ge)}var j8=qoe;var Voe=kd(function(se,ge,Ye){return se+(Ye?"-":"")+ge.toLowerCase()}),q8=Voe;var Goe=Om(function(se,ge,Ye){op(se,Ye,ge)}),V8=Goe;function Hoe(se,ge,Ye){for(var Pt=Ye+1;Pt--;)if(se[Pt]===ge)return Pt;return Pt}var G8=Hoe;var Woe=Math.max,Xoe=Math.min;function Zoe(se,ge,Ye){var Pt=se==null?0:se.length;if(!Pt)return-1;var vr=Pt;return Ye!==void 0&&(vr=Go(Ye),vr=vr<0?Woe(Pt+vr,0):Xoe(vr,Pt-1)),ge===ge?G8(se,ge,vr):Am(se,Ib,vr,!0)}var H8=Zoe;var Yoe=kd(function(se,ge,Ye){return se+(Ye?" ":"")+ge.toLowerCase()}),W8=Yoe;var Koe=Hb("toLowerCase"),X8=Koe;function Joe(se,ge){return se=this.__values__.length,ge=se?void 0:this.__values__[this.__index__++];return{done:se,value:ge}}var fR=Ese;function Cse(se,ge){var Ye=se.length;if(Ye)return ge+=ge<0?Ye:0,ip(ge,Ye)?se[ge]:void 0}var Vw=Cse;function kse(se,ge){return se&&se.length?Vw(se,Go(ge)):void 0}var hR=kse;function Lse(se){return se=Go(se),Ho(function(ge){return Vw(ge,se)})}var pR=Lse;function Pse(se,ge){return ge=zp(ge,se),se=Ow(se,ge),se==null||delete se[Sh(wf(ge))]}var jy=Pse;function Ise(se){return gv(se)?void 0:se}var dR=Ise;var Rse=1,Dse=2,zse=4,Fse=lp(function(se,ge){var Ye={};if(se==null)return Ye;var Pt=!1;ge=Sl(ge,function(Zr){return Zr=zp(Zr,se),Pt||(Pt=Zr.length>1),Zr}),Ah(se,xy(se),Ye),Pt&&(Ye=up(Ye,Rse|Dse|zse,dR));for(var vr=ge.length;vr--;)jy(Ye,ge[vr]);return Ye}),vR=Fse;function Ose(se,ge,Ye,Pt){if(!kl(se))return se;ge=zp(ge,se);for(var vr=-1,Zr=ge.length,ka=Zr-1,oi=se;oi!=null&&++vrge||Zr&&ka&&ci&&!oi&&!Ln||Pt&&ka&&ci||!Ye&&ci||!vr)return 1;if(!Pt&&!Zr&&!Ln&&se=oi)return ci;var Ln=Ye[Pt];return ci*(Ln=="desc"?-1:1)}}return se.index-ge.index}var _R=Gse;function Hse(se,ge,Ye){ge.length?ge=Sl(ge,function(Zr){return Do(Zr)?function(ka){return ud(ka,Zr.length===1?Zr[0]:Zr)}:Zr}):ge=[Fc];var Pt=-1;ge=Sl(ge,bf(bo));var vr=Dw(se,function(Zr,ka,oi){var ci=Sl(ge,function(Ln){return Ln(Zr)});return{criteria:ci,index:++Pt,value:Zr}});return yR(vr,function(Zr,ka){return _R(Zr,ka,Ye)})}var Xw=Hse;function Wse(se,ge,Ye,Pt){return se==null?[]:(Do(ge)||(ge=ge==null?[]:[ge]),Ye=Pt?void 0:Ye,Do(Ye)||(Ye=Ye==null?[]:[Ye]),Xw(se,ge,Ye))}var xR=Wse;function Xse(se){return lp(function(ge){return ge=Sl(ge,bf(bo)),Ho(function(Ye){var Pt=this;return se(ge,function(vr){return _f(vr,Pt,Ye)})})})}var qy=Xse;var Zse=qy(Sl),bR=Zse;var Yse=Ho,wR=Yse;var Kse=Math.min,Jse=wR(function(se,ge){ge=ge.length==1&&Do(ge[0])?Sl(ge[0],bf(bo)):Sl(Qu(ge,1),bf(bo));var Ye=ge.length;return Ho(function(Pt){for(var vr=-1,Zr=Kse(Pt.length,Ye);++vrele)return Ye;do ge%2&&(Ye+=se),ge=tle(ge/2),ge&&(se+=se);while(ge);return Ye}var m_=rle;var ale=Cy("length"),MR=ale;var CR="\\ud800-\\udfff",ile="\\u0300-\\u036f",nle="\\ufe20-\\ufe2f",ole="\\u20d0-\\u20ff",sle=ile+nle+ole,lle="\\ufe0e\\ufe0f",ule="["+CR+"]",NA="["+sle+"]",UA="\\ud83c[\\udffb-\\udfff]",cle="(?:"+NA+"|"+UA+")",kR="[^"+CR+"]",LR="(?:\\ud83c[\\udde6-\\uddff]){2}",PR="[\\ud800-\\udbff][\\udc00-\\udfff]",fle="\\u200d",IR=cle+"?",RR="["+lle+"]?",hle="(?:"+fle+"(?:"+[kR,LR,PR].join("|")+")"+RR+IR+")*",ple=RR+IR+hle,dle="(?:"+[kR+NA+"?",NA,LR,PR,ule].join("|")+")",ER=RegExp(UA+"(?="+UA+")|"+dle+ple,"g");function vle(se){for(var ge=ER.lastIndex=0;ER.test(se);)++ge;return ge}var DR=vle;function mle(se){return Cd(se)?DR(se):MR(se)}var Pd=mle;var gle=Math.ceil;function yle(se,ge){ge=ge===void 0?" ":ah(ge);var Ye=ge.length;if(Ye<2)return Ye?m_(ge,se):ge;var Pt=m_(ge,gle(se/Pd(ge)));return Cd(ge)?Op(Uh(Pt),0,se).join(""):Pt.slice(0,se)}var V0=yle;var _le=Math.ceil,xle=Math.floor;function ble(se,ge,Ye){se=Ds(se),ge=Go(ge);var Pt=ge?Pd(se):0;if(!ge||Pt>=ge)return se;var vr=(ge-Pt)/2;return V0(xle(vr),Ye)+se+V0(_le(vr),Ye)}var zR=ble;function wle(se,ge,Ye){se=Ds(se),ge=Go(ge);var Pt=ge?Pd(se):0;return ge&&Pt-1;)oi!==se&&WR.call(oi,ci,1),WR.call(se,ci,1);return se}var Vy=Fle;function Ole(se,ge){return se&&se.length&&ge&&ge.length?Vy(se,ge):se}var Yw=Ole;var Ble=Ho(Yw),XR=Ble;function Nle(se,ge,Ye){return se&&se.length&&ge&&ge.length?Vy(se,ge,bo(Ye,2)):se}var ZR=Nle;function Ule(se,ge,Ye){return se&&se.length&&ge&&ge.length?Vy(se,ge,void 0,Ye):se}var YR=Ule;var jle=Array.prototype,qle=jle.splice;function Vle(se,ge){for(var Ye=se?ge.length:0,Pt=Ye-1;Ye--;){var vr=ge[Ye];if(Ye==Pt||vr!==Zr){var Zr=vr;ip(vr)?qle.call(se,vr,1):jy(se,vr)}}return se}var Kw=Vle;var Gle=lp(function(se,ge){var Ye=se==null?0:se.length,Pt=cy(se,ge);return Kw(se,Sl(ge,function(vr){return ip(vr,Ye)?+vr:vr}).sort(Ww)),Pt}),KR=Gle;var Hle=Math.floor,Wle=Math.random;function Xle(se,ge){return se+Hle(Wle()*(ge-se+1))}var Gy=Xle;var Zle=parseFloat,Yle=Math.min,Kle=Math.random;function Jle(se,ge,Ye){if(Ye&&typeof Ye!="boolean"&&Oc(se,ge,Ye)&&(ge=Ye=void 0),Ye===void 0&&(typeof ge=="boolean"?(Ye=ge,ge=void 0):typeof se=="boolean"&&(Ye=se,se=void 0)),se===void 0&&ge===void 0?(se=0,ge=1):(se=sd(se),ge===void 0?(ge=se,se=0):ge=sd(ge)),se>ge){var Pt=se;se=ge,ge=Pt}if(Ye||se%1||ge%1){var vr=Kle();return Yle(se+vr*(ge-se+Zle("1e-"+((vr+"").length-1))),ge)}return Gy(se,ge)}var JR=Jle;var $le=Math.ceil,Qle=Math.max;function eue(se,ge,Ye,Pt){for(var vr=-1,Zr=Qle($le((ge-se)/(Ye||1)),0),ka=Array(Zr);Zr--;)ka[Pt?Zr:++vr]=se,se+=Ye;return ka}var $R=eue;function tue(se){return function(ge,Ye,Pt){return Pt&&typeof Pt!="number"&&Oc(ge,Ye,Pt)&&(Ye=Pt=void 0),ge=sd(ge),Ye===void 0?(Ye=ge,ge=0):Ye=sd(Ye),Pt=Pt===void 0?ge1&&Oc(se,ge[0],ge[1])?ge=[]:Ye>2&&Oc(ge[0],ge[1],ge[2])&&(ge=[ge[0]]),Xw(se,Qu(ge,1),[])}),E4=Uue;var jue=4294967295,que=jue-1,Vue=Math.floor,Gue=Math.min;function Hue(se,ge,Ye,Pt){var vr=0,Zr=se==null?0:se.length;if(Zr===0)return 0;ge=Ye(ge);for(var ka=ge!==ge,oi=ge===null,ci=Rf(ge),Ln=ge===void 0;vr>>1;function Zue(se,ge,Ye){var Pt=0,vr=se==null?Pt:se.length;if(typeof ge=="number"&&ge===ge&&vr<=Xue){for(;Pt>>1,ka=se[Zr];ka!==null&&!Rf(ka)&&(Ye?ka<=ge:ka>>0,Ye?(se=Ds(se),se&&(typeof ge=="string"||ge!=null&&!By(ge))&&(ge=ah(ge),!ge&&Cd(se))?Op(Uh(se),0,Ye):se.split(ge,Ye)):[]}var F4=nce;var oce="Expected a function",sce=Math.max;function lce(se,ge){if(typeof se!="function")throw new TypeError(oce);return ge=ge==null?0:sce(Go(ge),0),Ho(function(Ye){var Pt=Ye[ge],vr=Op(Ye,0,ge);return Pt&&Fp(vr,Pt),_f(se,this,vr)})}var O4=lce;var uce=kd(function(se,ge,Ye){return se+(Ye?" ":"")+hy(ge)}),B4=uce;function cce(se,ge,Ye){return se=Ds(se),Ye=Ye==null?0:cd(Go(Ye),0,se.length),ge=ah(ge),se.slice(Ye,Ye+ge.length)==ge}var N4=cce;function fce(){return{}}var U4=fce;function hce(){return""}var j4=hce;function pce(){return!0}var q4=pce;var dce=bm(function(se,ge){return se-ge},0),V4=dce;function vce(se){return se&&se.length?Uy(se,Fc):0}var G4=vce;function mce(se,ge){return se&&se.length?Uy(se,bo(ge,2)):0}var H4=mce;function gce(se){var ge=se==null?0:se.length;return ge?Xf(se,1,ge):[]}var W4=gce;function yce(se,ge,Ye){return se&&se.length?(ge=Ye||ge===void 0?1:Go(ge),Xf(se,0,ge<0?0:ge)):[]}var X4=yce;function _ce(se,ge,Ye){var Pt=se==null?0:se.length;return Pt?(ge=Ye||ge===void 0?1:Go(ge),ge=Pt-ge,Xf(se,ge<0?0:ge,Pt)):[]}var Z4=_ce;function xce(se,ge){return se&&se.length?Bm(se,bo(ge,3),!1,!0):[]}var Y4=xce;function bce(se,ge){return se&&se.length?Bm(se,bo(ge,3)):[]}var K4=bce;function wce(se,ge){return ge(se),se}var J4=wce;var $4=Object.prototype,Tce=$4.hasOwnProperty;function Ace(se,ge,Ye,Pt){return se===void 0||ih(se,$4[Ye])&&!Tce.call(Pt,Ye)?ge:se}var VA=Ace;var Sce={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"};function Mce(se){return"\\"+Sce[se]}var Q4=Mce;var Ece=/<%=([\s\S]+?)%>/g,t2=Ece;var Cce=/<%-([\s\S]+?)%>/g,eD=Cce;var kce=/<%([\s\S]+?)%>/g,tD=kce;var Lce={escape:eD,evaluate:tD,interpolate:t2,variable:"",imports:{_:{escape:Mw}}},y_=Lce;var Pce="Invalid `variable` option passed into `_.template`",Ice=/\b__p \+= '';/g,Rce=/\b(__p \+=) '' \+/g,Dce=/(__e\(.*?\)|\b__t\)) \+\n'';/g,zce=/[()=,{}\[\]\/\s]/,Fce=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,r2=/($^)/,Oce=/['\n\r\u2028\u2029\\]/g,Bce=Object.prototype,rD=Bce.hasOwnProperty;function Nce(se,ge,Ye){var Pt=y_.imports._.templateSettings||y_;Ye&&Oc(se,ge,Ye)&&(ge=void 0),se=Ds(se),ge=Em({},ge,Pt,VA);var vr=Em({},ge.imports,Pt.imports,VA),Zr=du(vr),ka=zy(vr,Zr),oi,ci,Ln=0,bn=ge.interpolate||r2,Fn="__p += '",Uo=RegExp((ge.escape||r2).source+"|"+bn.source+"|"+(bn===t2?Fce:r2).source+"|"+(ge.evaluate||r2).source+"|$","g"),ws=rD.call(ge,"sourceURL")?"//# sourceURL="+(ge.sourceURL+"").replace(/\s/g," ")+` `:"";se.replace(Uo,function(Ws,Yl,cu,nh,Eh,Up){return cu||(cu=nh),Fn+=se.slice(Ln,Up).replace(Oce,Q4),Yl&&(oi=!0,Fn+=`' + __e(`+Yl+`) + '`),Eh&&(ci=!0,Fn+=`'; `+Eh+`; __p += '`),cu&&(Fn+=`' + ((__t = (`+cu+`)) == null ? '' : __t) + '`),Ln=Up+Ws.length,Ws}),Fn+=`'; `;var wo=rD.call(ge,"variable")&&ge.variable;if(!wo)Fn=`with (obj) { `+Fn+` } `;else if(zce.test(wo))throw new Error(Pce);Fn=(ci?Fn.replace(Ice,""):Fn).replace(Rce,"$1").replace(Dce,"$1;"),Fn="function("+(wo||"obj")+`) { `+(wo?"":`obj || (obj = {}); `)+"var __t, __p = ''"+(oi?", __e = _.escape":"")+(ci?`, __j = Array.prototype.join; function print() { __p += __j.call(arguments, '') } `:`; `)+Fn+`return __p }`;var Ze=qb(function(){return Function(Zr,ws+"return "+Fn).apply(void 0,ka)});if(Ze.source=Fn,fy(Ze))throw Ze;return Ze}var aD=Nce;var Uce="Expected a function";function jce(se,ge,Ye){var Pt=!0,vr=!0;if(typeof se!="function")throw new TypeError(Uce);return kl(Ye)&&(Pt="leading"in Ye?!!Ye.leading:Pt,vr="trailing"in Ye?!!Ye.trailing:vr),_w(se,ge,{leading:Pt,maxWait:ge,trailing:vr})}var iD=jce;function qce(se,ge){return ge(se)}var Wv=qce;var Vce=9007199254740991,GA=4294967295,Gce=Math.min;function Hce(se,ge){if(se=Go(se),se<1||se>Vce)return[];var Ye=GA,Pt=Gce(se,GA);ge=Mh(ge),se-=GA;for(var vr=ry(Pt,ge);++Ye-1;);return Ye}var i2=efe;function tfe(se,ge){for(var Ye=-1,Pt=se.length;++Ye-1;);return Ye}var n2=tfe;function rfe(se,ge,Ye){if(se=Ds(se),se&&(Ye||ge===void 0))return bb(se);if(!se||!(ge=ah(ge)))return se;var Pt=Uh(se),vr=Uh(ge),Zr=n2(Pt,vr),ka=i2(Pt,vr)+1;return Op(Pt,Zr,ka).join("")}var pD=rfe;function afe(se,ge,Ye){if(se=Ds(se),se&&(Ye||ge===void 0))return se.slice(0,xb(se)+1);if(!se||!(ge=ah(ge)))return se;var Pt=Uh(se),vr=i2(Pt,Uh(ge))+1;return Op(Pt,0,vr).join("")}var dD=afe;var ife=/^\s+/;function nfe(se,ge,Ye){if(se=Ds(se),se&&(Ye||ge===void 0))return se.replace(ife,"");if(!se||!(ge=ah(ge)))return se;var Pt=Uh(se),vr=n2(Pt,Uh(ge));return Op(Pt,vr).join("")}var vD=nfe;var ofe=30,sfe="...",lfe=/\w*$/;function ufe(se,ge){var Ye=ofe,Pt=sfe;if(kl(ge)){var vr="separator"in ge?ge.separator:vr;Ye="length"in ge?Go(ge.length):Ye,Pt="omission"in ge?ah(ge.omission):Pt}se=Ds(se);var Zr=se.length;if(Cd(se)){var ka=Uh(se);Zr=ka.length}if(Ye>=Zr)return se;var oi=Ye-Pd(Pt);if(oi<1)return Pt;var ci=ka?Op(ka,0,oi).join(""):se.slice(0,oi);if(vr===void 0)return ci+Pt;if(ka&&(oi+=ci.length-oi),By(vr)){if(se.slice(oi).search(vr)){var Ln,bn=ci;for(vr.global||(vr=RegExp(vr.source,Ds(lfe.exec(vr))+"g")),vr.lastIndex=0;Ln=vr.exec(bn);)var Fn=Ln.index;ci=ci.slice(0,Fn===void 0?oi:Fn)}}else if(se.indexOf(ah(vr),oi)!=oi){var Uo=ci.lastIndexOf(vr);Uo>-1&&(ci=ci.slice(0,Uo))}return ci+Pt}var mD=ufe;function cfe(se){return zb(se,1)}var gD=cfe;var ffe={"&":"&","<":"<",">":">",""":'"',"'":"'"},hfe=dy(ffe),yD=hfe;var _D=/&(?:amp|lt|gt|quot|#39);/g,pfe=RegExp(_D.source);function dfe(se){return se=Ds(se),se&&pfe.test(se)?se.replace(_D,yD):se}var xD=dfe;var vfe=1/0,mfe=Rm&&1/zm(new Rm([,-0]))[1]==vfe?function(se){return new Rm(se)}:Yg,bD=mfe;var gfe=200;function yfe(se,ge,Ye){var Pt=-1,vr=Sm,Zr=se.length,ka=!0,oi=[],ci=oi;if(Ye)ka=!1,vr=Iy;else if(Zr>=gfe){var Ln=ge?null:bD(se);if(Ln)return zm(Ln);ka=!1,vr=Gv,ci=new Dm}else ci=ge?[]:oi;e:for(;++Pt1||this.__actions__.length||!(Pt instanceof Bl)||!ip(Ye)?this.thru(vr):(Pt=Pt.slice(Ye,+Ye+(ge?1:0)),Pt.__actions__.push({func:Wv,args:[vr],thisArg:void 0}),new Dp(Pt,this.__chain__).thru(function(Zr){return ge&&!Zr.length&&Zr.push(void 0),Zr}))}),FD=Bfe;function Nfe(){return Yb(this)}var OD=Nfe;function Ufe(){var se=this.__wrapped__;if(se instanceof Bl){var ge=se;return this.__actions__.length&&(ge=new Bl(this)),ge=ge.reverse(),ge.__actions__.push({func:Wv,args:[g_],thisArg:void 0}),new Dp(ge,this.__chain__)}return this.thru(g_)}var BD=Ufe;function jfe(se,ge,Ye){var Pt=se.length;if(Pt<2)return Pt?Jp(se[0]):[];for(var vr=-1,Zr=Array(Pt);++vr1?se[ge-1]:void 0;return Ye=typeof Ye=="function"?(se.pop(),Ye):void 0,o2(se,Ye)}),HD=Yfe;var ds={chunk:VL,compact:CP,concat:kP,difference:lI,differenceBy:uI,differenceWith:cI,drop:hI,dropRight:pI,dropRightWhile:dI,dropWhile:vI,fill:EI,findIndex:Pw,findLastIndex:Rw,first:v_,flatten:jb,flattenDeep:FI,flattenDepth:OI,fromPairs:WI,head:v_,indexOf:a8,initial:i8,intersection:n8,intersectionBy:o8,intersectionWith:s8,join:j8,last:wf,lastIndexOf:H8,nth:hR,pull:XR,pullAll:Yw,pullAllBy:ZR,pullAllWith:YR,pullAt:KR,remove:o4,reverse:g_,slice:T4,sortedIndex:C4,sortedIndexBy:k4,sortedIndexOf:L4,sortedLastIndex:P4,sortedLastIndexBy:I4,sortedLastIndexOf:R4,sortedUniq:D4,sortedUniqBy:z4,tail:W4,take:X4,takeRight:Z4,takeRightWhile:Y4,takeWhile:K4,union:wD,unionBy:TD,unionWith:AD,uniq:SD,uniqBy:MD,uniqWith:ED,unzip:Wy,unzipWith:o2,without:DD,xor:ND,xorBy:UD,xorWith:jD,zip:qD,zipObject:VD,zipObjectDeep:GD,zipWith:HD};var _c={countBy:ZP,each:f_,eachRight:h_,every:SI,filter:CI,find:kI,findLast:PI,flatMap:RI,flatMapDeep:DI,flatMapDepth:zI,forEach:f_,forEachRight:h_,groupBy:YI,includes:r8,invokeMap:p8,keyBy:V8,map:Nm,orderBy:xR,partition:UR,reduce:r4,reduceRight:i4,reject:n4,sample:p4,sampleSize:m4,shuffle:b4,size:w4,some:M4,sortBy:E4};var HA={now:Ly};var Df={after:rk,ary:zb,before:Vb,bind:Gb,bindKey:cL,curry:KP,curryRight:JP,debounce:_w,defer:oI,delay:sI,flip:BI,memoize:Nb,negate:Hv,once:gR,overArgs:TR,partial:Zw,partialRight:NR,rearg:t4,rest:u4,spread:O4,throttle:iD,unary:gD,wrap:zD};var js={castArray:jL,clone:TP,cloneDeep:AP,cloneDeepWith:SP,cloneWith:MP,conformsTo:HP,eq:ih,gt:KI,gte:JI,isArguments:dd,isArray:Do,isArrayBuffer:m8,isArrayLike:jc,isArrayLikeObject:Su,isBoolean:g8,isBuffer:Kp,isDate:x8,isElement:b8,isEmpty:w8,isEqual:T8,isEqualWith:A8,isError:fy,isFinite:S8,isFunction:ap,isInteger:Bw,isLength:Mm,isMap:iw,isMatch:M8,isMatchWith:E8,isNaN:C8,isNative:L8,isNil:P8,isNull:I8,isNumber:Nw,isObject:kl,isObjectLike:Rl,isPlainObject:gv,isRegExp:By,isSafeInteger:F8,isSet:nw,isString:qm,isSymbol:Rf,isTypedArray:Ed,isUndefined:O8,isWeakMap:B8,isWeakSet:N8,lt:Z8,lte:Y8,toArray:qw,toFinite:sd,toInteger:Go,toLength:Cw,toNumber:Th,toPlainObject:xw,toSafeInteger:cD,toString:Ds};var _p={add:QC,ceil:qL,divide:fI,floor:NI,max:eR,maxBy:tR,mean:rR,meanBy:aR,min:sR,minBy:lR,multiply:uR,round:f4,subtract:V4,sum:G4,sumBy:H4};var __={clamp:GL,inRange:t8,random:JR};var dl={assign:Ok,assignIn:s_,assignInWith:Em,assignWith:Uk,at:sL,create:YP,defaults:eI,defaultsDeep:nI,entries:p_,entriesIn:d_,extend:s_,extendWith:Em,findKey:LI,findLastKey:II,forIn:qI,forInRight:VI,forOwn:GI,forOwnRight:HI,functions:XI,functionsIn:ZI,get:uy,has:QI,hasIn:Ey,invert:u8,invertBy:f8,invoke:h8,keys:du,keysIn:qc,mapKeys:K8,mapValues:J8,merge:iR,mergeWith:bw,omit:vR,omitBy:mR,pick:qR,pickBy:Hw,result:c4,set:g4,setWith:y4,toPairs:p_,toPairsIn:d_,transform:hD,unset:kD,update:LD,updateWith:PD,values:Ld,valuesIn:RD};var Id={at:FD,chain:Yb,commit:EP,lodash:_a,next:fR,plant:VR,reverse:BD,tap:J4,thru:Wv,toIterator:oD,toJSON:Wm,value:Wm,valueOf:Wm,wrapperChain:OD};var ju={camelCase:UL,capitalize:Wb,deburr:Xb,endsWith:gI,escape:Mw,escapeRegExp:TI,kebabCase:q8,lowerCase:W8,lowerFirst:X8,pad:zR,padEnd:FR,padStart:OR,parseInt:BR,repeat:s4,replace:l4,snakeCase:A4,split:F4,startCase:B4,startsWith:N4,template:aD,templateSettings:y_,toLower:sD,toUpper:fD,trim:pD,trimEnd:dD,trimStart:vD,truncate:mD,unescape:xD,upperCase:ID,upperFirst:hy,words:Zb};var ec={attempt:qb,bindAll:uL,cond:qP,conforms:GP,constant:$g,defaultTo:$P,flow:UI,flowRight:jI,identity:Fc,iteratee:U8,matches:$8,matchesProperty:Q8,method:nR,methodOf:oR,mixin:jw,noop:Yg,nthArg:pR,over:bR,overEvery:AR,overSome:SR,property:vw,propertyOf:GR,range:QR,rangeRight:e4,stubArray:yy,stubFalse:ay,stubObject:U4,stubString:j4,stubTrue:q4,times:nD,toPath:lD,uniqueId:CD};function Kfe(){var se=new Bl(this.__wrapped__);return se.__actions__=ff(this.__actions__),se.__dir__=this.__dir__,se.__filtered__=this.__filtered__,se.__iteratees__=ff(this.__iteratees__),se.__takeCount__=this.__takeCount__,se.__views__=ff(this.__views__),se}var WD=Kfe;function Jfe(){if(this.__filtered__){var se=new Bl(this);se.__dir__=-1,se.__filtered__=!0}else se=this.clone(),se.__dir__*=-1;return se}var XD=Jfe;var $fe=Math.max,Qfe=Math.min;function ehe(se,ge,Ye){for(var Pt=-1,vr=Ye.length;++Pt0||ge<0)?new Bl(Ye):(se<0?Ye=Ye.takeRight(-se):se&&(Ye=Ye.drop(se)),ge!==void 0&&(ge=Go(ge),Ye=ge<0?Ye.dropRight(-ge):Ye.take(ge-se)),Ye)};Bl.prototype.takeRightWhile=function(se){return this.reverse().takeWhile(se).reverse()};Bl.prototype.toArray=function(){return this.take($D)};cp(Bl.prototype,function(se,ge){var Ye=/^(?:filter|find|map|reject)|While$/.test(ge),Pt=/^(?:head|last)$/.test(ge),vr=_a[Pt?"take"+(ge=="last"?"Right":""):ge],Zr=Pt||/^find/.test(ge);vr&&(_a.prototype[ge]=function(){var ka=this.__wrapped__,oi=Pt?[1]:arguments,ci=ka instanceof Bl,Ln=oi[0],bn=ci||Do(ka),Fn=function(Yl){var cu=vr.apply(_a,Fp([Yl],oi));return Pt&&Uo?cu[0]:cu};bn&&Ye&&typeof Ln=="function"&&Ln.length!=1&&(ci=bn=!1);var Uo=this.__chain__,ws=!!this.__actions__.length,wo=Zr&&!Uo,Ze=ci&&!ws;if(!Zr&&bn){ka=Ze?ka:new Bl(this);var Ws=se.apply(ka,oi);return Ws.__actions__.push({func:Wv,args:[Fn],thisArg:void 0}),new Dp(Ws,Uo)}return wo&&Ze?se.apply(this,oi):(Ws=this.thru(Fn),wo?Pt?Ws.value()[0]:Ws.value():Ws)})});Nh(["pop","push","shift","sort","splice","unshift"],function(se){var ge=uhe[se],Ye=/^(?:push|sort|unshift)$/.test(se)?"tap":"thru",Pt=/^(?:pop|shift)$/.test(se);_a.prototype[se]=function(){var vr=arguments;if(Pt&&!this.__chain__){var Zr=this.value();return ge.apply(Do(Zr)?Zr:[],vr)}return this[Ye](function(ka){return ge.apply(Do(ka)?ka:[],vr)})}});cp(Bl.prototype,function(se,ge){var Ye=_a[ge];if(Ye){var Pt=Ye.name+"";QD.call(Tm,Pt)||(Tm[Pt]=[]),Tm[Pt].push({name:ge,func:Ye})}});Tm[ty(void 0,ohe).name]=[{name:"wrapper",func:void 0}];Bl.prototype.clone=WD;Bl.prototype.reverse=XD;Bl.prototype.value=YD;_a.prototype.at=Id.at;_a.prototype.chain=Id.wrapperChain;_a.prototype.commit=Id.commit;_a.prototype.next=Id.next;_a.prototype.plant=Id.plant;_a.prototype.reverse=Id.reverse;_a.prototype.toJSON=_a.prototype.valueOf=_a.prototype.value=Id.value;_a.prototype.first=_a.prototype.head;KD&&(_a.prototype[KD]=Id.toIterator);var Jc=_a;var Rd=lX(r7());window.PlotlyConfig={MathJaxConfig:"local"};var XA=class{constructor(ge,Ye){this.model=ge,this.serializers=Ye}get(ge){let Ye=this.serializers[ge],Pt=this.model.get(ge);return Ye?.deserialize?Ye.deserialize(Pt):Pt}set(ge,Ye){let Pt=this.serializers[ge];Pt?.serialize&&(Ye=Pt.serialize(Ye)),this.model.set(ge,Ye)}on(ge,Ye){this.model.on(ge,Ye)}save_changes(){this.model.save_changes()}defaults(){return{_widget_data:[],_widget_layout:{},_config:{},_py2js_addTraces:null,_py2js_deleteTraces:null,_py2js_moveTraces:null,_py2js_restyle:null,_py2js_relayout:null,_py2js_update:null,_py2js_animate:null,_py2js_removeLayoutProps:null,_py2js_removeTraceProps:null,_js2py_restyle:null,_js2py_relayout:null,_js2py_update:null,_js2py_layoutDelta:null,_js2py_traceDeltas:null,_js2py_pointsCallback:null,_last_layout_edit_id:0,_last_trace_edit_id:0}}initialize(){this.model.on("change:_widget_data",()=>this.do_data()),this.model.on("change:_widget_layout",()=>this.do_layout()),this.model.on("change:_py2js_addTraces",()=>this.do_addTraces()),this.model.on("change:_py2js_deleteTraces",()=>this.do_deleteTraces()),this.model.on("change:_py2js_moveTraces",()=>this.do_moveTraces()),this.model.on("change:_py2js_restyle",()=>this.do_restyle()),this.model.on("change:_py2js_relayout",()=>this.do_relayout()),this.model.on("change:_py2js_update",()=>this.do_update()),this.model.on("change:_py2js_animate",()=>this.do_animate()),this.model.on("change:_py2js_removeLayoutProps",()=>this.do_removeLayoutProps()),this.model.on("change:_py2js_removeTraceProps",()=>this.do_removeTraceProps())}_normalize_trace_indexes(ge){if(ge==null){var Ye=this.model.get("_widget_data").length;ge=Jc.range(Ye)}return Array.isArray(ge)||(ge=[ge]),ge}do_data(){}do_layout(){}do_addTraces(){var ge=this.model.get("_py2js_addTraces");if(ge!==null){var Ye=this.model.get("_widget_data"),Pt=ge.trace_data;Jc.forEach(Pt,function(vr){Ye.push(vr)})}}do_deleteTraces(){var ge=this.model.get("_py2js_deleteTraces");if(ge!==null){var Ye=ge.delete_inds,Pt=this.model.get("_widget_data");Ye.slice().reverse().forEach(function(vr){Pt.splice(vr,1)})}}do_moveTraces(){var ge=this.model.get("_py2js_moveTraces");if(ge!==null){var Ye=this.model.get("_widget_data"),Pt=ge.current_trace_inds,vr=ge.new_trace_inds;mhe(Ye,Pt,vr)}}do_restyle(){var ge=this.model.get("_py2js_restyle");if(ge!==null){var Ye=ge.restyle_data,Pt=this._normalize_trace_indexes(ge.restyle_traces);i7(this.model.get("_widget_data"),Ye,Pt)}}do_relayout(){var ge=this.model.get("_py2js_relayout");ge!==null&&c2(this.model.get("_widget_layout"),ge.relayout_data)}do_update(){var ge=this.model.get("_py2js_update");if(ge!==null){var Ye=ge.style_data,Pt=ge.layout_data,vr=this._normalize_trace_indexes(ge.style_traces);i7(this.model.get("_widget_data"),Ye,vr),c2(this.model.get("_widget_layout"),Pt)}}do_animate(){var ge=this.model.get("_py2js_animate");if(ge!==null){for(var Ye=ge.style_data,Pt=ge.layout_data,vr=this._normalize_trace_indexes(ge.style_traces),Zr=0;Zrthis.do_addTraces()),this.model.on("change:_py2js_deleteTraces",()=>this.do_deleteTraces()),this.model.on("change:_py2js_moveTraces",()=>this.do_moveTraces()),this.model.on("change:_py2js_restyle",()=>this.do_restyle()),this.model.on("change:_py2js_relayout",()=>this.do_relayout()),this.model.on("change:_py2js_update",()=>this.do_update()),this.model.on("change:_py2js_animate",()=>this.do_animate()),window?.MathJax?.Hub?.Config?.({SVG:{font:"STIX-Web"}});var Ye=this.model.get("_last_layout_edit_id"),Pt=this.model.get("_last_trace_edit_id");this.viewID=o7();var vr=Jc.cloneDeep(this.model.get("_widget_data")),Zr=Jc.cloneDeep(this.model.get("_widget_layout"));Zr.height||(Zr.height=360);var ka=this.model.get("_config");ka.editSelection=!1,Rd.default.newPlot(ge.el,vr,Zr,ka).then(function(){ge._sendTraceDeltas(Pt),ge._sendLayoutDelta(Ye),ge.el.on("plotly_restyle",function(ci){ge.handle_plotly_restyle(ci)}),ge.el.on("plotly_relayout",function(ci){ge.handle_plotly_relayout(ci)}),ge.el.on("plotly_update",function(ci){ge.handle_plotly_update(ci)}),ge.el.on("plotly_click",function(ci){ge.handle_plotly_click(ci)}),ge.el.on("plotly_hover",function(ci){ge.handle_plotly_hover(ci)}),ge.el.on("plotly_unhover",function(ci){ge.handle_plotly_unhover(ci)}),ge.el.on("plotly_selected",function(ci){ge.handle_plotly_selected(ci)}),ge.el.on("plotly_deselect",function(ci){ge.handle_plotly_deselect(ci)}),ge.el.on("plotly_doubleclick",function(ci){ge.handle_plotly_doubleclick(ci)});var oi=new CustomEvent("plotlywidget-after-render",{detail:{element:ge.el,viewID:ge.viewID}});document.dispatchEvent(oi)})}_processLuminoMessage(ge,Ye){Ye.apply(this,arguments);var Pt=this;switch(ge.type){case"before-attach":var vr={showgrid:!1,showline:!1,tickvals:[]};Rd.default.newPlot(Pt.el,[],{xaxis:vr,yaxis:vr}),this.resizeEventListener=()=>{this.autosizeFigure()},window.addEventListener("resize",this.resizeEventListener);break;case"after-attach":this.perform_render();break;case"after-show":case"resize":this.autosizeFigure();break}}autosizeFigure(){var ge=this,Ye=ge.model.get("_widget_layout");(Jc.isNil(Ye)||Jc.isNil(Ye.width))&&Rd.default.Plots.resize(ge.el).then(function(){var Pt=ge.model.get("_last_layout_edit_id");ge._sendLayoutDelta(Pt)})}remove(){Rd.default.purge(this.el),window.removeEventListener("resize",this.resizeEventListener)}getFullData(){return Jc.mergeWith({},this.el._fullData,this.el.data,a7)}getFullLayout(){return Jc.mergeWith({},this.el._fullLayout,this.el.layout,a7)}buildPointsObject(ge){var Ye;if(ge.hasOwnProperty("points")){var Pt=ge.points,vr=Pt.length,Zr=!0;for(let bn=0;bn=0;vr--)Pt.splice(0,0,se[ge[vr]]),se.splice(ge[vr],1);var Zr=Jc(Ye).zip(Pt).sortBy(0).unzip().value();Ye=Zr[0],Pt=Zr[1];for(var ka=0;ka0&&typeof Zr[0]=="object"){Ye[Pt]=new Array(Zr.length);for(var ka=0;ka0&&(Ye[Pt]=oi)}else typeof Zr=="object"&&!Array.isArray(Zr)?Ye[Pt]=x_(Zr,{}):Zr!==void 0&&typeof Zr!="function"&&(Ye[Pt]=Zr)}}return Ye}function o7(se,ge,Ye,Pt){if(Ye||(Ye=16),ge===void 0&&(ge=24),ge<=0)return"0";var vr=Math.log(Math.pow(2,ge))/Math.log(Ye),Zr="",ka,oi,ci;for(ka=2;vr===1/0;ka*=2)vr=Math.log(Math.pow(2,ge/ka))/Math.log(Ye)*ka;var Ln=vr-Math.floor(vr);for(ka=0;ka=Math.pow(2,ge)?Pt>10?(console.warn("randstr failed uniqueness"),Zr):o7(se,ge,Ye,(Pt||0)+1):Zr}var SHe=()=>{let se;return{initialize(ge){se=new XA(ge.model,hhe),se.initialize()},render({el:ge}){let Ye=new ZA(se,ge);return Ye.perform_render(),()=>Ye.remove()}}};export{XA as FigureModel,ZA as FigureView,SHe as default}; /*! Bundled license information: plotly.js/dist/plotly.js: (*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT *) (*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh *) (*! * Determine if an object is a Buffer * * @author Feross Aboukhadijeh * @license MIT *) (*! * pad-left * * Copyright (c) 2014-2015, Jon Schlinkert. * Licensed under the MIT license. *) (*! * repeat-string * * Copyright (c) 2014-2015, Jon Schlinkert. * Licensed under the MIT License. *) (*! Bundled license information: native-promise-only/lib/npo.src.js: (*! Native Promise Only v0.8.1 (c) Kyle Simpson MIT License: http://getify.mit-license.org *) polybooljs/index.js: (* * @copyright 2016 Sean Connelly (@voidqk), http://syntheti.cc * @license MIT * @preserve Project Home: https://github.com/voidqk/polybooljs *) ieee754/index.js: (*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh *) buffer/index.js: (*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT *) safe-buffer/index.js: (*! safe-buffer. MIT License. Feross Aboukhadijeh *) assert/build/internal/util/comparisons.js: (*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT *) object-assign/index.js: (* object-assign (c) Sindre Sorhus @license MIT *) maplibre-gl/dist/maplibre-gl.js: (** * MapLibre GL JS * @license 3-Clause BSD. Full text of license: https://github.com/maplibre/maplibre-gl-js/blob/v4.7.1/LICENSE.txt *) *) lodash-es/lodash.default.js: (** * @license * Lodash (Custom Build) * Build: `lodash modularize exports="es" -o ./` * Copyright OpenJS Foundation and other contributors * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors *) lodash-es/lodash.js: (** * @license * Lodash (Custom Build) * Build: `lodash modularize exports="es" -o ./` * Copyright OpenJS Foundation and other contributors * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors *) */