var rX=Object.create;var Hk=Object.defineProperty;var aX=Object.getOwnPropertyDescriptor;var nX=Object.getOwnPropertyNames;var iX=Object.getPrototypeOf,oX=Object.prototype.hasOwnProperty;var sX=(le,ge)=>()=>(ge||le((ge={exports:{}}).exports,ge),ge.exports);var lX=(le,ge,Ye,Pt)=>{if(ge&&typeof ge=="object"||typeof ge=="function")for(let vr of nX(ge))!oX.call(le,vr)&&vr!==Ye&&Hk(le,vr,{get:()=>ge[vr],enumerable:!(Pt=aX(ge,vr))||Pt.enumerable});return le};var uX=(le,ge,Ye)=>(Ye=le!=null?rX(iX(le)):{},lX(ge||!le||!le.__esModule?Hk(Ye,"default",{value:le,enumerable:!0}):Ye,le));var rF=sX((tF,u2)=>{(function(le,ge){typeof u2=="object"&&u2.exports?u2.exports=ge():le.moduleName=ge()})(typeof self<"u"?self:tF,()=>{"use strict";var le=(()=>{var ge=Object.create,Ye=Object.defineProperty,Pt=Object.defineProperties,vr=Object.getOwnPropertyDescriptor,Zr=Object.getOwnPropertyDescriptors,ka=Object.getOwnPropertyNames,sn=Object.getOwnPropertySymbols,fn=Object.getPrototypeOf,Li=Object.prototype.hasOwnProperty,bi=Object.prototype.propertyIsEnumerable,Fi=(Z,q,v)=>q in Z?Ye(Z,q,{enumerable:!0,configurable:!0,writable:!0,value:v}):Z[q]=v,Uo=(Z,q)=>{for(var v in q||(q={}))Li.call(q,v)&&Fi(Z,v,q[v]);if(sn)for(var v of sn(q))bi.call(q,v)&&Fi(Z,v,q[v]);return Z},ws=(Z,q)=>Pt(Z,Zr(q)),mo=(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 v in q)Ye(Z,v,{get:q[v],enumerable:!0})},Yl=(Z,q,v,x)=>{if(q&&typeof q=="object"||typeof q=="function")for(let A of ka(q))!Li.call(Z,A)&&A!==v&&Ye(Z,A,{get:()=>q[A],enumerable:!(x=vr(q,A))||x.enumerable});return Z},cu=(Z,q,v)=>(v=Z!=null?ge(fn(Z)):{},Yl(q||!Z||!Z.__esModule?Ye(v,"default",{value:Z,enumerable:!0}):v,Z)),ih=Z=>Yl(Ye({},"__esModule",{value:!0}),Z),Eh=Ze({"src/version.js"(Z){"use strict";Z.version="3.1.0"}}),Bp=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(g,b){this.fn=g,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 i(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 h(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 h(l){this.def=l,this.triggered=!1}function m(l){this.promise=l,this.state=0,this.triggered=!1,this.chain=[],this.msg=void 0}function d(l){if(typeof l!="function")throw TypeError("Not a function");if(this.__NPO__!==0)throw TypeError("Not a promise");this.__NPO__=1;var _=new m(this);this.then=function(S,E){var g={success:typeof S=="function"?S:!0,failure:typeof E=="function"?E:!1};return g.promise=new this.constructor(function(p,u){if(typeof p!="function"||typeof u!="function")throw TypeError("Not a function");g.resolve=p,g.reject=u}),_.chain.push(g),_.state!==0&&r(a,_),g.promise},this.catch=function(S){return this.then(void 0,S)};try{l.call(void 0,function(S){o.call(_,S)},function(S){s.call(_,S)})}catch(w){s.call(_,w)}}var T=x({},"constructor",d,!1);return d.prototype=T,x(T,"__NPO__",0,!1),x(d,"resolve",function(_){var w=this;return _&&typeof _=="object"&&_.__NPO__===1?_:new w(function(E,g){if(typeof E!="function"||typeof g!="function")throw TypeError("Not a function");E(_)})}),x(d,"reject",function(_){return new this(function(S,E){if(typeof S!="function"||typeof E!="function")throw TypeError("Not a function");E(_)})}),x(d,"all",function(_){var w=this;return e.call(_)!="[object Array]"?w.reject(TypeError("Not an array")):_.length===0?w.resolve([]):new w(function(E,g){if(typeof E!="function"||typeof g!="function")throw TypeError("Not a function");var b=_.length,p=Array(b),u=0;c(w,_,function(f,P){p[f]=P,++u===b&&E(p)},g)})}),x(d,"race",function(_){var w=this;return e.call(_)!="[object Array]"?w.reject(TypeError("Not an array")):new w(function(E,g){if(typeof E!="function"||typeof g!="function")throw TypeError("Not a function");c(w,_,function(p,u){E(u)},g)})}),d})}}),Oi=Ze({"node_modules/@plotly/d3/d3.js"(Z,q){(function(){var v={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,i=r.setAttribute,a=r.setAttributeNS,n=this.CSSStyleDeclaration.prototype,o=n.setProperty;r.setAttribute=function(De,et){i.call(this,De,et+"")},r.setAttributeNS=function(De,et,vt){a.call(this,De,et,vt+"")},n.setProperty=function(De,et,vt){o.call(this,De,et+"",vt)}}v.ascending=s;function s(de,De){return deDe?1:de>=De?0:NaN}v.descending=function(de,De){return Dede?1:De>=de?0:NaN},v.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},v.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},v.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)},v.deviation=function(){var de=v.variance.apply(this,arguments);return de&&Math.sqrt(de)};function m(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 d=m(s);v.bisectLeft=d.left,v.bisect=v.bisectRight=d.right,v.bisector=function(de){return m(de.length===1?function(De,et){return s(de(De),et)}:de)},v.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},v.permute=function(de,De){for(var et=De.length,vt=new Array(et);et--;)vt[et]=de[De[et]];return vt},v.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;v.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[qr++],tn,on,Ma,Na=new S,Ka;++Wr=De.length)return zt;var qr=[],Wr=et[gr++];return zt.forEach(function(Ta,ya){qr.push({key:Ta,values:ar(ya,gr)})}),Wr?qr.sort(function(Ta,ya){return Wr(Ta.key,ya.key)}):qr}return de.map=function(zt,gr){return St(gr,zt,0)},de.entries=function(zt){return ar(St(v.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},v.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}},ne.attr=function(de,De){if(arguments.length<2){if(typeof de=="string"){var et=this.node();return de=v.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=v.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," ")}ne.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},ne.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=qt.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 qr(){var Wr=new RegExp("^__on([^.]+)"+v.requote(de)+"$"),Ta;for(var ya in this)if(Ta=ya.match(Wr)){var tn=this[ya];this.removeEventListener(Ta[1],tn,tn.$),delete this[ya]}}return _t?De?gr:zt:De?N:qr}var qt=v.map({mouseenter:"mouseover",mouseleave:"mouseout"});M&&qt.forEach(function(de){"on"+de in M&&qt.remove(de)});function Zt(de,De){return function(et){var vt=v.event;v.event=et,De[0]=this.__data__;try{de.apply(this,De)}finally{v.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=v.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)}}}v.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=v.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]}v.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)}},v.behavior.drag=function(){var de=se(_t,"drag","dragstart","dragend"),De=null,et=St(N,v.mouse,t,"mousemove","mouseup"),vt=St(Be,v.touch,F,"touchmove","touchend");function _t(){this.on("mousedown.drag",et).on("touchstart.drag",vt)}function St(ar,zt,gr,qr,Wr){return function(){var Ta=this,ya=v.event.target.correspondingElement||v.event.target,tn=Ta.parentNode,on=de.of(Ta,arguments),Ma=0,Na=ar(),Ka=".drag"+(Na==null?"":"-"+Na),mn,cn=v.select(gr(ya)).on(qr+Ka,ni).on(Wr+Ka,vi),Pa=wr(ya),si=zt(tn,Na);De?(mn=De.apply(Ta,arguments),mn=[mn.x-si[0],mn.y-si[1]]):mn=[0,0],on({type:"dragstart"});function ni(){var Pi=zt(tn,Na),Zi,eo;Pi&&(Zi=Pi[0]-si[0],eo=Pi[1]-si[1],Ma|=Zi|eo,si=Pi,on({type:"drag",x:Pi[0]+mn[0],y:Pi[1]+mn[1],dx:Zi,dy:eo}))}function vi(){zt(tn,Na)&&(cn.on(qr+Ka,null).on(Wr+Ka,null),Pa(Ma),on({type:"dragend"}))}}}return _t.origin=function(ar){return arguments.length?(De=ar,_t):De},v.rebind(_t,de,"on")};function Be(){return v.event.changedTouches[0].identifier}v.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,Ee=Math.PI,Ve=2*Ee,Ce=Ve-Ke,Te=Ee/2,Pe=Ee/180,at=180/Ee;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?Ee: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;v.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,qr=ar-vt,Wr=gr*gr+qr*qr,Ta,ya;if(Wr0&&(gi=gi.transition().duration(ar)),gi.call(cn.event)}function Zi(){Na&&Na.domain(Ma.range().map(function(gi){return(gi-de.x)/de.k}).map(Ma.invert)),mn&&mn.domain(Ka.range().map(function(gi){return(gi-de.y)/de.k}).map(Ka.invert))}function eo(gi){zt++||gi({type:"zoomstart"})}function $o(gi){Zi(),gi({type:"zoom",scale:de.k,translate:[de.x,de.y]})}function no(gi){--zt||(gi({type:"zoomend"}),et=null)}function Zo(){var gi=this,vo=on.of(gi,arguments),cs=0,ps=v.select(t(gi)).on(qr,Tu).on(Wr,Il),Tl=Pa(v.mouse(gi)),Gl=wr(gi);Bi.call(gi),eo(vo);function Tu(){cs=1,vi(v.mouse(gi),Tl),$o(vo)}function Il(){ps.on(qr,null).on(Wr,null),Gl(cs),no(vo)}}function ul(){var gi=this,vo=on.of(gi,arguments),cs={},ps=0,Tl,Gl=".zoom-"+v.event.changedTouches[0].identifier,Tu="touchmove"+Gl,Il="touchend"+Gl,yc=[],nt=v.select(gi),Yt=wr(gi);ua(),eo(vo),nt.on(gr,null).on(ya,ua);function cr(){var wa=v.touches(gi);return Tl=de.k,wa.forEach(function(Ja){Ja.identifier in cs&&(cs[Ja.identifier]=Pa(Ja))}),wa}function ua(){var wa=v.event.target;v.select(wa).on(Tu,Aa).on(Il,xa),yc.push(wa);for(var Ja=v.event.changedTouches,Sn=0,wn=Ja.length;Sn1){var Bn=hn[0],Ln=hn[1],Va=Bn[0]-Ln[0],ea=Bn[1]-Ln[1];ps=Va*Va+ea*ea}}function Aa(){var wa=v.touches(gi),Ja,Sn,wn,hn;Bi.call(gi);for(var yi=0,Bn=wa.length;yi1?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))}v.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=v.rgb(de)).r,de.g,de.b)).l,de.a,de.b):new Wt(de,De,et)}var Pr=Wt.prototype=new kn;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)}v.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,rn=1.08883,nn=ma.prototype=new kn;nn.brighter=function(de){return new ma(Math.min(100,this.l+ra*(arguments.length?de:1)),this.a,this.b)},nn.darker=function(de){return new ma(Math.max(0,this.l-ra*(arguments.length?de:1)),this.a,this.b)},nn.rgb=function(){return yn(this.l,this.a,this.b)};function yn(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)*rn,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))}v.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 kn;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)/rn);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=v.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 na(de){return typeof de=="function"?de:function(){return de}}v.functor=na,v.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=v.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=qr:zt.onreadystatechange=function(){zt.readyState>3&&qr()};function qr(){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=v.event;v.event=Wr;try{St.progress.call(_t,zt)}finally{v.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 tn in ar)zt.setRequestHeader(tn,ar[tn]);return De!=null&&zt.overrideMimeType&&zt.overrideMimeType(De),gr!=null&&(zt.responseType=gr),ya!=null&&_t.on("error",ya).on("load",function(on){ya(null,on)}),St.beforesend.call(_t,zt),zt.send(Ta??null),_t},_t.abort=function(){return zt.abort(),_t},v.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}v.dsv=function(de,De){var et=new RegExp('["'+de+` ]`),vt=de.charCodeAt(0);function _t(qr,Wr,Ta){arguments.length<3&&(Ta=Wr,Wr=null);var ya=Fa(qr,De,Wr==null?St:ar(Wr),Ta);return ya.row=function(tn){return arguments.length?ya.response((Wr=tn)==null?St:ar(tn)):Wr},ya}function St(qr){return _t.parse(qr.responseText)}function ar(qr){return function(Wr){return _t.parse(Wr.responseText,qr)}}_t.parse=function(qr,Wr){var Ta;return _t.parseRows(qr,function(ya,tn){if(Ta)return Ta(ya,tn-1);var on=function(Ma){for(var Na={},Ka=ya.length,mn=0;mn=on)return ya;if(mn)return mn=!1,Ta;var si=Ma;if(qr.charCodeAt(si)===34){for(var ni=si;ni++24?(isFinite(De)&&(clearTimeout(fi),fi=setTimeout(zi,De)),Pn=0):(Pn=1,Ai(zi))}v.timer.flush=function(){Xi(),to()};function Xi(){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[qr[Ta[zt]][2]]);for(zt=+tn;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]}v.geom.polygon=function(de){return H(de,Ts),de};var Ts=v.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),Si(vt),Si(_t);return}if(!_t){gr.edge=zs(vt.site,gr.site);return}po(vt),po(_t);var qr=vt.site,Wr=qr.x,Ta=qr.y,ya=de.x-Wr,tn=de.y-Ta,on=_t.site,Ma=on.x-Wr,Na=on.y-Ta,Ka=2*(ya*Na-tn*Ma),mn=ya*ya+tn*tn,cn=Ma*Ma+Na*Na,Pa={x:(Na*mn-tn*cn)/Ka+Wr,y:(ya*cn-Ma*mn)/Ka+Ta};fl(_t.edge,qr,on,Pa),gr.edge=zs(qr,de,null,Pa),_t.edge=zs(de,on,null,Pa),Si(vt),Si(_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,qr=gr-De;if(!qr)return zt;var Wr=zt-vt,Ta=1/St-1/qr,ya=Wr/qr;return Ta?(-ya+Math.sqrt(ya*ya-2*Ta*(Wr*Wr/(-2*qr)-gr+qr/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,qr=Vo,Wr=qr.length,Ta,ya,tn,on,Ma,Na;Wr--;)if(Ta=qr[Wr],!(!Ta||!Ta.prepare()))for(tn=Ta.edges,on=tn.length,ya=0;yaKe||l(gr-ar)>Ke)&&(tn.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+qr*qr,tn=Wr*Wr+Na*Na,on=(Na*ya-qr*tn)/Ta,Ma=(gr*tn-Wr*ya)/Ta,Na=Ma+zt,Ka=Ys.pop()||new rl;Ka.arc=de,Ka.site=_t,Ka.x=on+ar,Ka.y=Na+Math.sqrt(on*on+Ma*Ma),Ka.cy=Na,de.circle=Ka;for(var mn=null,cn=os._;cn;)if(Ka.y0)){if(Ma/=tn,tn<0){if(Ma0){if(Ma>ya)return;Ma>Ta&&(Ta=Ma)}if(Ma=et-zt,!(!tn&&Ma<0)){if(Ma/=tn,tn<0){if(Ma>ya)return;Ma>Ta&&(Ta=Ma)}else if(tn>0){if(Ma0)){if(Ma/=on,on<0){if(Ma0){if(Ma>ya)return;Ma>Ta&&(Ta=Ma)}if(Ma=vt-gr,!(!on&&Ma<0)){if(Ma/=on,on<0){if(Ma>ya)return;Ma>Ta&&(Ta=Ma)}else if(on>0){if(Ma0&&(_t.a={x:zt+Ta*tn,y:gr+Ta*on}),ya<1&&(_t.b={x:zt+ya*tn,y:gr+ya*on}),_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:on,y:ar};else if(vt.y>=zt)return;et={x:on,y:zt}}else{if(!vt)vt={x:on,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 $i(de,De){this.l=de,this.r=De,this.a=this.b=null}function zs(de,De,et,vt){var _t=new $i(de,De);return To.push(_t),et&&fl(_t,de,De,et),vt&&fl(_t,De,de,vt),Vo[de.i].edges.push(new xu(_t,de,De)),Vo[De.i].edges.push(new xu(_t,De,de)),_t}function au(de,De,et){var vt=new $i(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&&(nu(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,nu(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,nu(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,nu(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,nu(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 nu(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=[],Vo=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<=tn?[[Wr,tn],[ya,tn],[ya,Ta],[Wr,Ta]]:[];mn.point=gr[Ma]}),qr}function zt(gr){return gr.map(function(qr,Wr){return{x:Math.round(vt(qr,Wr)/Ke)*Ke,y:Math.round(_t(qr,Wr)/Ke)*Ke,i:Wr}})}return ar.links=function(gr){return Cu(zt(gr)).edges.filter(function(qr){return qr.l&&qr.r}).map(function(qr){return{source:gr[qr.l.i],target:gr[qr.r.i]}})},ar.triangles=function(gr){var qr=[];return Cu(zt(gr)).cells.forEach(function(Wr,Ta){for(var ya=Wr.site,tn=Wr.edges.sort(Is),on=-1,Ma=tn.length,Na,Ka,mn=tn[Ma-1].edge,cn=mn.l===ya?mn.r:mn.l;++oncn&&(cn=Wr.x),Wr.y>Pa&&(Pa=Wr.y),tn.push(Wr.x),on.push(Wr.y);else for(Ma=0;Macn&&(cn=si),ni>Pa&&(Pa=ni),tn.push(si),on.push(ni)}var vi=cn-Ka,Pi=Pa-mn;vi>Pi?Pa=mn+vi:cn=Ka+Pi;function Zi(no,Zo,ul,el,_l,gi,vo,cs){if(!(isNaN(ul)||isNaN(el)))if(no.leaf){var ps=no.x,Tl=no.y;if(ps!=null)if(l(ps-ul)+l(Tl-el)<.01)eo(no,Zo,ul,el,_l,gi,vo,cs);else{var Gl=no.point;no.x=no.y=no.point=null,eo(no,Gl,ps,Tl,_l,gi,vo,cs),eo(no,Zo,ul,el,_l,gi,vo,cs)}else no.x=ul,no.y=el,no.point=Zo}else eo(no,Zo,ul,el,_l,gi,vo,cs)}function eo(no,Zo,ul,el,_l,gi,vo,cs){var ps=(_l+vo)*.5,Tl=(gi+cs)*.5,Gl=ul>=ps,Tu=el>=Tl,Il=Tu<<1|Gl;no.leaf=!1,no=no.nodes[Il]||(no.nodes[Il]=iu()),Gl?_l=ps:vo=ps,Tu?gi=Tl:cs=Tl,Zi(no,Zo,ul,el,_l,gi,vo,cs)}var $o=iu();if($o.add=function(no){Zi($o,no,+Ta(no,++Ma),+ya(no,Ma),Ka,mn,cn,Pa)},$o.visit=function(no){Ll(no,$o,Ka,mn,cn,Pa)},$o.find=function(no){return nc($o,no[0],no[1],Ka,mn,cn,Pa)},Ma=-1,De==null){for(;++MaSt||ya>ar||tn=si,Pi=et>=ni,Zi=Pi<<1|vi,eo=Zi+4;Ziet&&(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=ic.lastIndex;return et=0&&!(vt=v.interpolators[et](de,De)););return vt}v.interpolators=[function(de,De){var et=typeof De;return(et==="string"?kr.has(De.toLowerCase())||/^(#|rgb\(|hsl\()/i.test(De)?Ou:gs:De instanceof kn?Ou:Array.isArray(De)?Vu:et==="object"&&isNaN(De)?nl:vl)(de,De)}],v.interpolateArray=Vu;function Vu(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 Qi(de){return function(De){return .5*(De<.5?de(2*De):2-de(2-2*De))}}function Gc(de){return de*de}function qu(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/Ve*Math.asin(1/de):(de=1,et=De/4),function(vt){return 1+de*Math.pow(2,-10*vt)*Math.sin((vt-et)*Ve/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}v.interpolateHcl=Nc;function Nc(de,De){de=v.hcl(de),De=v.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)+""}}v.interpolateHsl=Ff;function Ff(de,De){de=v.hsl(de),De=v.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)+""}}v.interpolateLab=Of;function Of(de,De){de=v.lab(de),De=v.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 yn(et+St*gr,vt+ar*gr,_t+zt*gr)+""}}v.interpolateRound=Gu;function Gu(de,De){return De-=de,function(et){return Math.round(de+De*et)}}v.transform=function(de){var De=M.createElementNS(v.ns.prefix.svg,"g");return(v.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=v.transform(de),De=v.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=ki(de.tick)),de):St},de.start=function(){var Pa,si=tn.length,ni=on.length,vi=vt[0],Pi=vt[1],Zi,eo;for(Pa=0;Pa=0;)St.push(Wr=qr[gr]),Wr.parent=zt,Wr.depth=zt.depth+1;et&&(zt.value=0),zt.children=qr}else et&&(zt.value=+et.call(vt,zt,zt.depth)||0),delete zt.children;return vc(_t,function(Ta){var ya,tn;de&&(ya=Ta.children)&&ya.sort(de),et&&(tn=Ta.parent)&&(tn.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 v.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]}v.layout.histogram=function(){var de=!0,De=Number,et=mf,vt=Mc;function _t(St,ya){for(var zt=[],gr=St.map(De,this),qr=et.call(this,gr,ya),Wr=vt.call(this,qr,gr,ya),Ta,ya=-1,tn=gr.length,on=Wr.length-1,Ma=de?1:1/tn,Na;++ya0)for(ya=-1;++ya=qr[0]&&Na<=qr[1]&&(Ta=zt[v.bisect(Wr,Na,1,on)-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=na(St),_t):et},_t.bins=function(St){return arguments.length?(vt=typeof St=="number"?function(ar){return Hu(ar,St)}:na(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[v.min(de),v.max(de)]}v.layout.pack=function(){var de=v.layout.hierarchy().sort(Wu),De=0,et=[1,1],vt;function _t(St,ar){var zt=de.call(this,St,ar),gr=zt[0],qr=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(tn){tn.r=+Ta(tn.value)}),vc(gr,jf),De){var ya=De*(vt?1:Math.max(2*gr.r/qr,2*gr.r/Wr))/2;vc(gr,function(tn){tn.r+=ya}),vc(gr,jf),vc(gr,function(tn){tn.r-=ya})}return mc(gr,qr/2,Wr/2,vt?1:1/Math.max(2*gr.r/qr,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,qr,Wr,Ta,ya;function tn(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,tn(ar),ya>1&&(zt=De[1],zt.x=zt.r,zt.y=0,tn(zt),ya>2))for(gr=De[2],jl(ar,zt,gr),tn(gr),Zc(ar,gr),ar._pack_prev=gr,Zc(gr,zt),zt=ar._pack_next,qr=3;qrNa.x&&(Na=si),si.depth>Ka.depth&&(Ka=si)});var mn=De(Ma,Na)/2-Ma.x,cn=et[0]/(Na.x+De(Na,Ma)/2+mn),Pa=et[1]/(Ka.depth||1);Sc(tn,function(si){si.x=(si.x+mn)*cn,si.y=si.depth*Pa})}return ya}function St(Wr){for(var Ta={A:null,children:[Wr]},ya=[Ta],tn;(tn=ya.pop())!=null;)for(var on=tn.children,Ma,Na=0,Ka=on.length;Na0&&(sc(er(Ma,Wr,ya),Wr,si),Ka+=si,mn+=si),cn+=Ma.m,Ka+=tn.m,Pa+=Na.m,mn+=on.m;Ma&&!Yc(on)&&(on.t=Ma,on.m+=cn-mn),tn&&!Cc(Na)&&(Na.t=tn,Na.m+=Ka-Pa,ya=Wr)}return ya}function qr(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?qr:null,_t):vt?null:et},_t.nodeSize=function(Wr){return arguments.length?(vt=(et=Wr)==null?null:qr,_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}v.layout.cluster=function(){var de=v.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],qr,Wr=0;vc(gr,function(Ma){var Na=Ma.children;Na&&Na.length?(Ma.x=ia(Na),Ma.y=yr(Na)):(Ma.x=qr?Wr+=De(Ma,qr):0,Ma.y=0,qr=Ma)});var Ta=$r(gr),ya=La(gr),tn=Ta.x-De(Ta,ya)/2,on=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-tn)/(on-tn)*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+v.max(de,function(De){return De.y})}function ia(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}v.layout.treemap=function(){var de=v.layout.hierarchy(),De=Math.round,et=[1,1],vt=null,_t=pn,St=!1,ar,zt="squarify",gr=.5*(1+Math.sqrt(5));function qr(Ma,Na){for(var Ka=-1,mn=Ma.length,cn,Pa;++Ka0;)mn.push(Pa=cn[Pi-1]),mn.area+=Pa.area,zt!=="squarify"||(ni=ya(mn,vi))<=si?(cn.pop(),si=ni):(mn.area-=mn.pop().area,tn(mn,vi,Ka,!1),vi=Math.min(Ka.dx,Ka.dy),mn.length=mn.area=0,si=1/0);mn.length&&(tn(mn,vi,Ka,!0),mn.length=mn.area=0),Na.forEach(Wr)}}function Ta(Ma){var Na=Ma.children;if(Na&&Na.length){var Ka=_t(Ma),mn=Na.slice(),cn,Pa=[];for(qr(mn,Ka.dx*Ka.dy/Ma.value),Pa.area=0;cn=mn.pop();)Pa.push(cn),Pa.area+=cn.area,cn.z!=null&&(tn(Pa,cn.z?Ka.dx:Ka.dy,Ka,!mn.length),Pa.length=Pa.area=0);Na.forEach(Ta)}}function ya(Ma,Na){for(var Ka=Ma.area,mn,cn=0,Pa=1/0,si=-1,ni=Ma.length;++sicn&&(cn=mn));return Ka*=Ka,Na*=Na,Ka?Math.max(Na*cn*gr/Ka,Ka/(Na*Pa*gr)):1/0}function tn(Ma,Na,Ka,mn){var cn=-1,Pa=Ma.length,si=Ka.x,ni=Ka.y,vi=Na?De(Ma.area/Na):0,Pi;if(Na==Ka.dx){for((mn||vi>Ka.dy)&&(vi=Ka.dy);++cnKa.dx)&&(vi=Ka.dx);++cn1);return de+De*vt*Math.sqrt(-2*Math.log(St)/St)}},logNormal:function(){var de=v.random.normal.apply(v,arguments);return function(){return Math.exp(de())}},bates:function(de){var De=v.random.irwinHall(de);return function(){return De()/de}},irwinHall:function(de){return function(){for(var De=0,et=0;et2?xn:di,qr=vt?ku:Kf;return _t=gr(de,De,qr,et),St=gr(De,de,qr,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,qr){return d3_scale_linearTickFormat(de,gr,qr)},zt.nice=function(gr){return ao(de,gr),ar()},zt.copy=function(){return Mi(de,De,et,vt)},ar()}function Ki(de,De){return v.rebind(de,De,"range","rangeRound","interpolate","clamp")}function ao(de,De){return Dn(de,On(Ji(de,De)[2])),Dn(de,On(Ji(de,De)[2])),de}function Ji(de,De){De==null&&(De=10);var et=Yn(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 v.range.apply(v,Ji(de,De))}var wi={s:1,g:1,p:1,r:1,e:1};function ui(de){return-Math.floor(Math.log(de)/Math.LN10+.01)}function xo(de,De){var et=ui(De[2]);return de in wi?Math.abs(et-ui(Math.max(l(De[0]),l(De[1]))))+ +(de!=="e"):et-(de==="%")*2}v.scale.log=function(){return Qo(v.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=Dn(vt.map(_t),et?Math:xs);return de.domain(zt),vt=zt.map(St),ar},ar.ticks=function(){var zt=Yn(vt),gr=[],qr=zt[0],Wr=zt[1],Ta=Math.floor(_t(qr)),ya=Math.ceil(_t(Wr)),tn=De%1?2:De;if(isFinite(ya-Ta)){if(et){for(;Ta0;on--)gr.push(St(Ta)*on);for(Ta=0;gr[Ta]Wr;ya--);gr=gr.slice(Ta,ya)}return gr},ar.copy=function(){return Qo(de.copy(),De,et,vt)},Ki(ar,de)}var xs={floor:function(de){return-Math.ceil(-de)},ceil:function(de){return-Math.floor(-de)}};v.scale.pow=function(){return Qs(v.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)},Ki(St,de)}function Rs(de){return function(De){return De<0?-Math.pow(-De,de):Math.pow(De,de)}}v.scale.sqrt=function(){return v.scale.pow().exponent(.5)},v.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 v.range(de.length).map(function(qr){return zt+gr*qr})}return St.domain=function(zt){if(!arguments.length)return de;de=[],et=new S;for(var gr=-1,qr=zt.length,Wr;++gr0?et[St-1]:de[0],Stya?0:1;if(Wr=Ce)return gr(Wr,on)+(qr?gr(qr,1-on):"")+"Z";var Ma,Na,Ka,mn,cn=0,Pa=0,si,ni,vi,Pi,Zi,eo,$o,no,Zo=[];if((mn=(+ar.apply(this,arguments)||0)/2)&&(Ka=vt===Iu?Math.sqrt(qr*qr+Wr*Wr):+vt.apply(this,arguments),on||(Pa*=-1),Wr&&(Pa=Gt(Ka/Wr*Math.sin(mn))),qr&&(cn=Gt(Ka/qr*Math.sin(mn)))),Wr){si=Wr*Math.cos(Ta+Pa),ni=Wr*Math.sin(Ta+Pa),vi=Wr*Math.cos(ya-Pa),Pi=Wr*Math.sin(ya-Pa);var ul=Math.abs(ya-Ta-2*Pa)<=Ee?0:1;if(Pa&&gc(si,ni,vi,Pi)===on^ul){var el=(Ta+ya)/2;si=Wr*Math.cos(el),ni=Wr*Math.sin(el),vi=Pi=null}}else si=ni=0;if(qr){Zi=qr*Math.cos(ya-cn),eo=qr*Math.sin(ya-cn),$o=qr*Math.cos(Ta+cn),no=qr*Math.sin(Ta+cn);var _l=Math.abs(Ta-ya+2*cn)<=Ee?0:1;if(cn&&gc(Zi,eo,$o,no)===1-on^_l){var gi=(Ta+ya)/2;Zi=qr*Math.cos(gi),eo=qr*Math.sin(gi),$o=no=null}}else Zi=eo=0;if(tn>Ke&&(Ma=Math.min(Math.abs(Wr-qr)/2,+et.apply(this,arguments)))>.001){Na=qr0?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,qr=-zt*St,Wr=de[0]+gr,Ta=de[1]+qr,ya=De[0]+gr,tn=De[1]+qr,on=(Wr+ya)/2,Ma=(Ta+tn)/2,Na=ya-Wr,Ka=tn-Ta,mn=Na*Na+Ka*Ka,cn=et-vt,Pa=Wr*tn-ya*Ta,si=(Ka<0?-1:1)*Math.sqrt(Math.max(0,cn*cn*mn-Pa*Pa)),ni=(Pa*Ka-Na*si)/mn,vi=(-Pa*Na-Ka*si)/mn,Pi=(Pa*Ka+Na*si)/mn,Zi=(-Pa*Na+Ka*si)/mn,eo=ni-on,$o=vi-Ma,no=Pi-on,Zo=Zi-Ma;return eo*eo+$o*$o>no*no+Zo*Zo&&(ni=Pi,vi=Zi),[[ni-gr,vi-qr],[ni*et/cn,vi*et/cn]]}function zo(){return!0}function Ic(de){var De=go,et=pi,vt=zo,_t=Yu,St=_t.key,ar=.7;function zt(gr){var qr=[],Wr=[],Ta=-1,ya=gr.length,tn,on=na(De),Ma=na(et);function Na(){qr.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 qr=2;qr9&&(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))}v.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;++etEe)+",1 "+Ta}function qr(Wr,Ta,ya,tn){return"Q 0,0 "+tn}return St.radius=function(Wr){return arguments.length?(et=na(Wr),St):et},St.source=function(Wr){return arguments.length?(de=na(Wr),St):de},St.target=function(Wr){return arguments.length?(De=na(Wr),St):De},St.startAngle=function(Wr){return arguments.length?(vt=na(Wr),St):vt},St.endAngle=function(Wr){return arguments.length?(_t=na(Wr),St):_t},St};function ga(de){return de.radius}v.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,qr=[ar,{x:ar.x,y:gr},{x:zt.x,y:gr},zt];return qr=qr.map(et),"M"+qr[0]+"C"+qr[1]+" "+qr[2]+" "+qr[3]}return vt.source=function(_t){return arguments.length?(de=na(_t),vt):de},vt.target=function(_t){return arguments.length?(De=na(_t),vt):De},vt.projection=function(_t){return arguments.length?(et=_t,vt):et},vt};function Sa(de){return[de.x,de.y]}v.svg.diagonal.radial=function(){var de=v.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)]}}v.svg.symbol=function(){var de=Xn,De=vn;function et(vt,_t){return(oi.get(de.call(this,vt,_t))||Hn)(De.call(this,vt,_t))}return et.type=function(vt){return arguments.length?(de=na(vt),et):de},et.size=function(vt){return arguments.length?(De=na(vt),et):De},et};function vn(){return 64}function Xn(){return"circle"}function Hn(de){var De=Math.sqrt(de/Ee);return"M0,"+De+"A"+De+","+De+" 0 1,1 0,"+-De+"A"+De+","+De+" 0 1,1 0,"+De+"Z"}var oi=v.map({circle:Hn,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*Wi)),et=De*Wi;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/Ti),et=De*Ti/2;return"M0,"+et+"L"+De+","+-et+" "+-De+","+-et+"Z"},"triangle-up":function(de){var De=Math.sqrt(de/Ti),et=De*Ti/2;return"M0,"+-et+"L"+De+","+et+" "+-De+","+et+"Z"}});v.svg.symbolTypes=oi.keys();var Ti=Math.sqrt(3),Wi=Math.tan(30*Pe);ne.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[--mn].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=ki(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)}v.svg.axis=function(){var de=v.scale.linear(),De=$l,et=6,vt=6,_t=3,St=[10],ar=null,zt;function gr(qr){qr.each(function(){var Wr=v.select(this),Ta=this.__chart__||de,ya=this.__chart__=de.copy(),tn=ar??(ya.ticks?ya.ticks.apply(ya,St):ya.domain()),on=zt??(ya.tickFormat?ya.tickFormat.apply(ya,St):F),Ma=Wr.selectAll(".tick").data(tn,ya),Na=Ma.enter().insert("g",".domain").attr("class","tick").style("opacity",Ke),Ka=v.transition(Ma.exit()).style("opacity",Ke).remove(),mn=v.transition(Ma.order()).style("opacity",1),cn=Math.max(et,0)+_t,Pa,si=ri(ya),ni=Wr.selectAll(".domain").data([0]),vi=(ni.enter().append("path").attr("class","domain"),v.transition(ni));Na.append("line"),Na.append("text");var Pi=Na.select("line"),Zi=mn.select("line"),eo=Ma.select("text").text(on),$o=Na.select("text"),no=mn.select("text"),Zo=De==="top"||De==="left"?-1:1,ul,el,_l,gi;if(De==="bottom"||De==="top"?(Pa=hu,ul="x",_l="y",el="x2",gi="y2",eo.attr("dy",Zo<0?"0em":".71em").style("text-anchor","middle"),vi.attr("d","M"+si[0]+","+Zo*vt+"V0H"+si[1]+"V"+Zo*vt)):(Pa=wl,ul="y",_l="x",el="y2",gi="x2",eo.attr("dy",".32em").style("text-anchor",Zo<0?"end":"start"),vi.attr("d","M"+Zo*vt+","+si[0]+"H0V"+si[1]+"H"+Zo*vt)),Pi.attr(gi,Zo*et),$o.attr(_l,Zo*cn),Zi.attr(el,0).attr(gi,Zo*et),no.attr(ul,0).attr(_l,Zo*cn),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),mn.call(Pa,ya,ya)})}return gr.scale=function(qr){return arguments.length?(de=qr,gr):de},gr.orient=function(qr){return arguments.length?(De=qr in Ru?qr+"":$l,gr):De},gr.ticks=function(){return arguments.length?(St=A(arguments),gr):St},gr.tickValues=function(qr){return arguments.length?(ar=qr,gr):ar},gr.tickFormat=function(qr){return arguments.length?(zt=qr,gr):zt},gr.tickSize=function(qr){var Wr=arguments.length;return Wr?(et=+qr,vt=+arguments[Wr-1],gr):et},gr.innerTickSize=function(qr){return arguments.length?(et=+qr,gr):et},gr.outerTickSize=function(qr){return arguments.length?(vt=+qr,gr):vt},gr.tickPadding=function(qr){return arguments.length?(_t=+qr,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))+")"})}v.svg.brush=function(){var de=se(Wr,"brushstart","brush","brushend"),De=null,et=null,vt=[0,0],_t=[0,0],St,ar,zt=!0,gr=!0,qr=uc[0];function Wr(Ma){Ma.each(function(){var Na=v.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",on).on("touchstart.brush",on),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 mn=Na.selectAll(".resize").data(qr,F);mn.exit().remove(),mn.enter().append("g").attr("class",function(ni){return"resize "+ni}).style("cursor",function(ni){return su[ni]}).append("rect").attr("x",function(ni){return/[ew]$/.test(ni)?-3:null}).attr("y",function(ni){return/^[ns]/.test(ni)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),mn.style("display",Wr.empty()?"none":null);var cn=v.transition(Na),Pa=v.transition(Ka),si;De&&(si=ri(De),Pa.attr("x",si[0]).attr("width",si[1]-si[0]),ya(cn)),et&&(si=ri(et),Pa.attr("y",si[0]).attr("height",si[1]-si[0]),tn(cn)),Ta(cn)})}Wr.event=function(Ma){Ma.each(function(){var Na=de.of(this,arguments),Ka={x:vt,y:_t,i:St,j:ar},mn=this.__chart__||Ka;this.__chart__=Ka,hs?v.select(this).transition().each("start.brush",function(){St=mn.i,ar=mn.j,vt=mn.x,_t=mn.y,Na({type:"brushstart"})}).tween("brush:brush",function(){var cn=Vu(vt,Ka.x),Pa=Vu(_t,Ka.y);return St=ar=null,function(si){vt=Ka.x=cn(si),_t=Ka.y=Pa(si),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 tn(Ma){Ma.select(".extent").attr("y",_t[0]),Ma.selectAll(".extent,.e>rect,.w>rect").attr("height",_t[1]-_t[0])}function on(){var Ma=this,Na=v.select(v.event.target),Ka=de.of(Ma,arguments),mn=v.select(Ma),cn=Na.datum(),Pa=!/^(n|s)$/.test(cn)&&De,si=!/^(e|w)$/.test(cn)&&et,ni=Na.classed("extent"),vi=wr(Ma),Pi,Zi=v.mouse(Ma),eo,$o=v.select(t(Ma)).on("keydown.brush",ul).on("keyup.brush",el);if(v.event.changedTouches?$o.on("touchmove.brush",_l).on("touchend.brush",vo):$o.on("mousemove.brush",_l).on("mouseup.brush",vo),mn.interrupt().selectAll("*").interrupt(),ni)Zi[0]=vt[0]-Zi[0],Zi[1]=_t[0]-Zi[1];else if(cn){var no=+/w$/.test(cn),Zo=+/^n/.test(cn);eo=[vt[1-no]-Zi[0],_t[1-Zo]-Zi[1]],Zi[0]=vt[no],Zi[1]=_t[Zo]}else v.event.altKey&&(Pi=Zi.slice());mn.style("pointer-events","none").selectAll(".resize").style("display",null),v.select("body").style("cursor",Na.style("cursor")),Ka({type:"brushstart"}),_l();function ul(){v.event.keyCode==32&&(ni||(Pi=null,Zi[0]-=vt[1],Zi[1]-=_t[1],ni=2),Q())}function el(){v.event.keyCode==32&&ni==2&&(Zi[0]+=vt[1],Zi[1]+=_t[1],ni=0,Q())}function _l(){var cs=v.mouse(Ma),ps=!1;eo&&(cs[0]+=eo[0],cs[1]+=eo[1]),ni||(v.event.altKey?(Pi||(Pi=[(vt[0]+vt[1])/2,(_t[0]+_t[1])/2]),Zi[0]=vt[+(cs[0]0))return Zt;do Zt.push(Sr=new Date(+Lt)),Fe(Lt,qt),fe(Lt);while(Sr=kt)for(;fe(kt),!Lt(kt);)kt.setTime(kt-1)},function(kt,qt){if(kt>=kt)if(qt<0)for(;++qt<=0;)for(;Fe(kt,-1),!Lt(kt););else for(;--qt>=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,i=6e4,a=36e5,n=864e5,o=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,h=M(function(fe){fe.setTime(fe-fe.getMilliseconds()-fe.getSeconds()*r)},function(fe,Fe){fe.setTime(+fe+Fe*i)},function(fe,Fe){return(Fe-fe)/i},function(fe){return fe.getMinutes()}),m=h.range,d=M(function(fe){fe.setTime(fe-fe.getMilliseconds()-fe.getSeconds()*r-fe.getMinutes()*i)},function(fe,Fe){fe.setTime(+fe+Fe*a)},function(fe,Fe){return(Fe-fe)/a},function(fe){return fe.getHours()}),T=d.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())*i)/n},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())*i)/o})}var S=w(0),E=w(1),g=w(2),b=w(3),p=w(4),u=w(5),y=w(6),f=S.range,P=E.range,L=g.range,z=b.range,F=p.range,B=u.range,O=y.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*i)},function(fe,Fe){return(Fe-fe)/i},function(fe){return fe.getUTCMinutes()}),ue=Q.range,se=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=se.range,H=M(function(fe){fe.setUTCHours(0,0,0,0)},function(fe,Fe){fe.setUTCDate(fe.getUTCDate()+Fe)},function(fe,Fe){return(Fe-fe)/n},function(fe){return fe.getUTCDate()-1}),$=H.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)/o})}var X=J(0),oe=J(1),ne=J(2),j=J(3),ee=J(4),re=J(5),ce=J(6),be=X.range,Ae=oe.range,ze=ne.range,Re=j.range,We=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()}),ut=tt.range,Me=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()});Me.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=Me.range;v.timeDay=l,v.timeDays=_,v.timeFriday=u,v.timeFridays=B,v.timeHour=d,v.timeHours=T,v.timeInterval=M,v.timeMillisecond=e,v.timeMilliseconds=t,v.timeMinute=h,v.timeMinutes=m,v.timeMonday=E,v.timeMondays=P,v.timeMonth=I,v.timeMonths=N,v.timeSaturday=y,v.timeSaturdays=O,v.timeSecond=s,v.timeSeconds=c,v.timeSunday=S,v.timeSundays=f,v.timeThursday=p,v.timeThursdays=F,v.timeTuesday=g,v.timeTuesdays=L,v.timeWednesday=b,v.timeWednesdays=z,v.timeWeek=S,v.timeWeeks=f,v.timeYear=U,v.timeYears=W,v.utcDay=H,v.utcDays=$,v.utcFriday=re,v.utcFridays=it,v.utcHour=se,v.utcHours=he,v.utcMillisecond=e,v.utcMilliseconds=t,v.utcMinute=Q,v.utcMinutes=ue,v.utcMonday=oe,v.utcMondays=Ae,v.utcMonth=tt,v.utcMonths=ut,v.utcSaturday=ce,v.utcSaturdays=ot,v.utcSecond=s,v.utcSeconds=c,v.utcSunday=X,v.utcSundays=be,v.utcThursday=ee,v.utcThursdays=We,v.utcTuesday=ne,v.utcTuesdays=ze,v.utcWednesday=j,v.utcWednesdays=Re,v.utcWeek=X,v.utcWeeks=be,v.utcYear=Me,v.utcYears=_e,Object.defineProperty(v,"__esModule",{value:!0})})}}),Np=Ze({"node_modules/d3-time-format/dist/d3-time-format.js"(Z,q){(function(v,x){typeof Z=="object"&&typeof q<"u"?x(Z,$p()):(v=v||self,x(v.d3=v.d3||{},v.d3))})(Z,function(v,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,Ee=Be.time,Ve=Be.periods,Ce=Be.days,Te=Be.shortDays,Pe=Be.months,at=Be.shortMonths,yt=c(Ve),Tt=h(Ve),Ot=c(Ce),Gt=h(Ce),rr=c(Te),Qt=h(Te),Tr=c(Pe),la=h(Pe),Ua=c(at),Ba=h(at),Ra={a:Ha,A:rn,b:nn,B:yn,c:null,d:I,e:I,f:ue,H:N,I:U,j:W,L:Q,m:se,M:he,p:xt,q:ct,Q:kt,s:qt,S:H,u:$,U:J,V:X,w:oe,W:ne,x:null,X:null,y:j,Y:ee,Z:re,"%":Lt},Qa={a:Nr,A:Or,b:Rr,B:Lr,c:null,d:ce,e:ce,f:We,H:be,I:Ae,j:ze,L:Re,m:it,M:ot,p:Gr,q:Kr,Q:kt,s:qt,S:tt,u:ut,U:Me,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:y,I:y,j:u,L,m:b,M:f,p:Nt,q:g,Q:B,s:O,S:P,u:d,U:T,V:l,w:m,W:_,x:ra,X:Ia,y:S,Y:w,Z:E,"%":F};Ra.x=en(Ue,Ra),Ra.X=en(Ee,Ra),Ra.c=en(Ke,Ra),Qa.x=en(Ue,Qa),Qa.X=en(Ee,Qa),Qa.c=en(Ke,Qa);function en(Ur,aa){return function(da){var fa=[],It=-1,dr=0,kr=Ur.length,na,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,na,Ca;It=kr)return-1;if(na=aa.charCodeAt(It++),na===37){if(na=aa.charAt(It++),Ca=za[na in r?aa.charAt(It++):na],!Ca||(fa=Ca(Ur,da,fa))<0)return-1}else if(na!=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,Ee,aa,da)}function Ha(Ur){return Te[Ur.getDay()]}function rn(Ur){return Ce[Ur.getDay()]}function nn(Ur){return at[Ur.getMonth()]}function yn(Ur){return Pe[Ur.getMonth()]}function xt(Ur){return Ve[+(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 Ve[+(Ur.getUTCHours()>=12)]}function Kr(Ur){return 1+~~(Ur.getUTCMonth()/3)}return{format:function(Ur){var aa=en(Ur+="",Ra);return aa.toString=function(){return Ur},aa},parse:function(Ur){var aa=kn(Ur+="",!1);return aa.toString=function(){return Ur},aa},utcFormat:function(Ur){var aa=en(Ur+="",Qa);return aa.toString=function(){return Ur},aa},utcParse:function(Ur){var aa=kn(Ur+="",!0);return aa.toString=function(){return Ur},aa}}}var r={"-":"",_:" ",0:"0"},i=/^\s*\d+/,a=/^%/,n=/[\\^$*+?|[\]().{}]/g;function o(Be,Ke,Ue){var Ee=Be<0?"-":"",Ve=(Ee?-Be:Be)+"",Ce=Ve.length;return Ee+(Ce68?1900:2e3),Ue+Ee[0].length):-1}function E(Be,Ke,Ue){var Ee=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(Ke.slice(Ue,Ue+6));return Ee?(Be.Z=Ee[1]?0:-(Ee[2]+(Ee[3]||"00")),Ue+Ee[0].length):-1}function g(Be,Ke,Ue){var Ee=i.exec(Ke.slice(Ue,Ue+1));return Ee?(Be.q=Ee[0]*3-3,Ue+Ee[0].length):-1}function b(Be,Ke,Ue){var Ee=i.exec(Ke.slice(Ue,Ue+2));return Ee?(Be.m=Ee[0]-1,Ue+Ee[0].length):-1}function p(Be,Ke,Ue){var Ee=i.exec(Ke.slice(Ue,Ue+2));return Ee?(Be.d=+Ee[0],Ue+Ee[0].length):-1}function u(Be,Ke,Ue){var Ee=i.exec(Ke.slice(Ue,Ue+3));return Ee?(Be.m=0,Be.d=+Ee[0],Ue+Ee[0].length):-1}function y(Be,Ke,Ue){var Ee=i.exec(Ke.slice(Ue,Ue+2));return Ee?(Be.H=+Ee[0],Ue+Ee[0].length):-1}function f(Be,Ke,Ue){var Ee=i.exec(Ke.slice(Ue,Ue+2));return Ee?(Be.M=+Ee[0],Ue+Ee[0].length):-1}function P(Be,Ke,Ue){var Ee=i.exec(Ke.slice(Ue,Ue+2));return Ee?(Be.S=+Ee[0],Ue+Ee[0].length):-1}function L(Be,Ke,Ue){var Ee=i.exec(Ke.slice(Ue,Ue+3));return Ee?(Be.L=+Ee[0],Ue+Ee[0].length):-1}function z(Be,Ke,Ue){var Ee=i.exec(Ke.slice(Ue,Ue+6));return Ee?(Be.L=Math.floor(Ee[0]/1e3),Ue+Ee[0].length):-1}function F(Be,Ke,Ue){var Ee=a.exec(Ke.slice(Ue,Ue+1));return Ee?Ue+Ee[0].length:-1}function B(Be,Ke,Ue){var Ee=i.exec(Ke.slice(Ue));return Ee?(Be.Q=+Ee[0],Ue+Ee[0].length):-1}function O(Be,Ke,Ue){var Ee=i.exec(Ke.slice(Ue));return Ee?(Be.s=+Ee[0],Ue+Ee[0].length):-1}function I(Be,Ke){return o(Be.getDate(),Ke,2)}function N(Be,Ke){return o(Be.getHours(),Ke,2)}function U(Be,Ke){return o(Be.getHours()%12||12,Ke,2)}function W(Be,Ke){return o(1+x.timeDay.count(x.timeYear(Be),Be),Ke,3)}function Q(Be,Ke){return o(Be.getMilliseconds(),Ke,3)}function ue(Be,Ke){return Q(Be,Ke)+"000"}function se(Be,Ke){return o(Be.getMonth()+1,Ke,2)}function he(Be,Ke){return o(Be.getMinutes(),Ke,2)}function H(Be,Ke){return o(Be.getSeconds(),Ke,2)}function $(Be){var Ke=Be.getDay();return Ke===0?7:Ke}function J(Be,Ke){return o(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),o(x.timeThursday.count(x.timeYear(Be),Be)+(x.timeYear(Be).getDay()===4),Ke,2)}function oe(Be){return Be.getDay()}function ne(Be,Ke){return o(x.timeMonday.count(x.timeYear(Be)-1,Be),Ke,2)}function j(Be,Ke){return o(Be.getFullYear()%100,Ke,2)}function ee(Be,Ke){return o(Be.getFullYear()%1e4,Ke,4)}function re(Be){var Ke=Be.getTimezoneOffset();return(Ke>0?"-":(Ke*=-1,"+"))+o(Ke/60|0,"0",2)+o(Ke%60,"0",2)}function ce(Be,Ke){return o(Be.getUTCDate(),Ke,2)}function be(Be,Ke){return o(Be.getUTCHours(),Ke,2)}function Ae(Be,Ke){return o(Be.getUTCHours()%12||12,Ke,2)}function ze(Be,Ke){return o(1+x.utcDay.count(x.utcYear(Be),Be),Ke,3)}function Re(Be,Ke){return o(Be.getUTCMilliseconds(),Ke,3)}function We(Be,Ke){return Re(Be,Ke)+"000"}function it(Be,Ke){return o(Be.getUTCMonth()+1,Ke,2)}function ot(Be,Ke){return o(Be.getUTCMinutes(),Ke,2)}function tt(Be,Ke){return o(Be.getUTCSeconds(),Ke,2)}function ut(Be){var Ke=Be.getUTCDay();return Ke===0?7:Ke}function Me(Be,Ke){return o(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),o(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 o(x.utcMonday.count(x.utcYear(Be)-1,Be),Ke,2)}function rt(Be,Ke){return o(Be.getUTCFullYear()%100,Ke,2)}function st(Be,Ke){return o(Be.getUTCFullYear()%1e4,Ke,4)}function Qe(){return"+0000"}function Lt(){return"%"}function kt(Be){return+Be}function qt(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),v.timeFormat=Zt.format,v.timeParse=Zt.parse,v.utcFormat=Zt.utcFormat,v.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:v.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:v.utcParse(xr);v.isoFormat=wr,v.isoParse=bt,v.timeFormatDefaultLocale=Sr,v.timeFormatLocale=t,Object.defineProperty(v,"__esModule",{value:!0})})}}),Zy=Ze({"node_modules/d3-format/dist/d3-format.js"(Z,q){(function(v,x){typeof Z=="object"&&typeof q<"u"?x(Z):(v=typeof globalThis<"u"?globalThis:v||self,x(v.d3=v.d3||{}))})(Z,function(v){"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,y=b.slice(0,u);return[y.length>1?y[0]+y.slice(2):y,+b.slice(u+1)]}function M(b){return b=A(Math.abs(b)),b?b[1]:NaN}function e(b,p){return function(u,y){for(var f=u.length,P=[],L=0,z=b[0],F=0;f>0&&z>0&&(F+z+1>y&&(z=Math.max(1,y-F)),P.push(u.substring(f-=z,f+z)),!((F+=z+1)>y));)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 i(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]})}i.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 n(b){e:for(var p=b.length,u=1,y=-1,f;u0&&(y=0);break}return y>0?b.slice(0,y)+b.slice(f+1):b}var o;function s(b,p){var u=A(b,p);if(!u)return b+"";var y=u[0],f=u[1],P=f-(o=Math.max(-8,Math.min(8,Math.floor(f/3)))*3)+1,L=y.length;return P===L?y:P>L?y+new Array(P-L+1).join("0"):P>0?y.slice(0,P)+"."+y.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 y=u[0],f=u[1];return f<0?"0."+new Array(-f).join("0")+y:y.length>f+1?y.slice(0,f+1)+"."+y.slice(f+1):y+new Array(f-y.length+2).join("0")}var h={"%":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 m(b){return b}var d=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?m:e(d.call(b.grouping,Number),b.thousands+""),u=b.currency===void 0?"":b.currency[0]+"",y=b.currency===void 0?"":b.currency[1]+"",f=b.decimal===void 0?".":b.decimal+"",P=b.numerals===void 0?m:t(d.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=i(I);var N=I.fill,U=I.align,W=I.sign,Q=I.symbol,ue=I.zero,se=I.width,he=I.comma,H=I.precision,$=I.trim,J=I.type;J==="n"?(he=!0,J="g"):h[J]||(H===void 0&&(H=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==="$"?y:/[%p]/.test(J)?L:"",ne=h[J],j=/[defgprs%]/.test(J);H=H===void 0?6:/[gprs]/.test(J)?Math.max(1,Math.min(21,H)):Math.max(0,Math.min(20,H));function ee(re){var ce=X,be=oe,Ae,ze,Re;if(J==="c")be=ne(re)+be,re="";else{re=+re;var We=re<0||1/re<0;if(re=isNaN(re)?F:ne(Math.abs(re),H),$&&(re=n(re)),We&&+re==0&&W!=="+"&&(We=!1),ce=(We?W==="("?W:z:W==="-"||W==="("?"":W)+ce,be=(J==="s"?T[8+o/3]:"")+be+(We&&W==="("?")":""),j){for(Ae=-1,ze=re.length;++AeRe||Re>57){be=(Re===46?f+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=i(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(se){return U(Q*se)+ue}}return{format:B,formatPrefix:O}}var _;w({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"});function w(b){return _=l(b),v.format=_.format,v.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 g(b,p){return b=Math.abs(b),p=Math.abs(p)-b,Math.max(0,M(p)-M(b))+1}v.FormatSpecifier=a,v.formatDefaultLocale=w,v.formatLocale=l,v.formatSpecifier=i,v.precisionFixed=S,v.precisionPrefix=E,v.precisionRound=g,Object.defineProperty(v,"__esModule",{value:!0})})}}),sF=Ze({"node_modules/is-string-blank/index.js"(Z,q){"use strict";q.exports=function(v){for(var x=v.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}}}),is=Ze({"node_modules/fast-isnumeric/index.js"(Z,q){"use strict";var v=sF();q.exports=function(x){var A=typeof x;if(A==="string"){var M=x;if(x=+x,x===0&&v(M))return!1}else if(A!=="number")return!1;return x-x<1}}}),Vs=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(v,x){typeof Z=="object"&&typeof q<"u"?x(Z):(v=typeof globalThis<"u"?globalThis:v||self,x(v["base64-arraybuffer"]={}))})(Z,function(v){"use strict";for(var x="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",A=typeof Uint8Array>"u"?[]:new Uint8Array(256),M=0;M>2],o+=x[(i[a]&3)<<4|i[a+1]>>4],o+=x[(i[a+1]&15)<<2|i[a+2]>>6],o+=x[i[a+2]&63];return n%3===2?o=o.substring(0,o.length-1)+"=":n%3===1&&(o=o.substring(0,o.length-2)+"=="),o},t=function(r){var i=r.length*.75,a=r.length,n,o=0,s,c,h,m;r[r.length-1]==="="&&(i--,r[r.length-2]==="="&&i--);var d=new ArrayBuffer(i),T=new Uint8Array(d);for(n=0;n>4,T[o++]=(c&15)<<4|h>>2,T[o++]=(h&3)<<6|m&63;return d};v.decode=t,v.encode=e,Object.defineProperty(v,"__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,v=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 i={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};i.uint8c=i.u1c,i.uint8=i.u1,i.int8=i.i1,i.uint16=i.u2,i.int16=i.i2,i.uint32=i.u4,i.int32=i.i4,i.float32=i.f4,i.float64=i.f8;function a(s){return s.constructor===ArrayBuffer}Z.isArrayBuffer=a,Z.decodeTypedArraySpec=function(s){var c=[],h=n(s),m=h.dtype,d=i[m];if(!d)throw new Error('Error in dtype: "'+m+'"');var T=d.BYTES_PER_ELEMENT,l=h.bdata;a(l)||(l=q(l));var _=h.shape===void 0?[l.byteLength/T]:(""+h.shape).split(",");_.reverse();var w=_.length,S,E,g=+_[0],b=T*g,p=0;if(w===1)c=new d(l);else if(w===2)for(S=+_[1],E=0;E2)return d[S]=d[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 v(e)||(e=Math.log(Math.max(M[0],M[1]))/Math.LN10-6),e}}}),cF=Ze({"src/lib/relink_private.js"(Z,q){"use strict";var v=xp().isArrayOrTypedArray,x=Xv();q.exports=function A(M,e){for(var t in e){var r=e[t],i=M[t];if(i!==r)if(t.charAt(0)==="_"||typeof r=="function"){if(t in M)continue;M[t]=r}else if(v(r)&&v(i)&&x(r[0])){if(t==="customdata"||t==="ids")continue;for(var a=Math.min(r.length,i.length),n=0;nM/2?A-Math.round(A/M)*M:A}q.exports={mod:v,modHalf:x}}}),Ch=Ze({"node_modules/tinycolor2/tinycolor.js"(Z,q){(function(v){var x=/^\s+/,A=/\s+$/,M=0,e=v.round,t=v.min,r=v.max,i=v.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=n(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=v.pow((ee+.055)/1.055,2.4),re<=.03928?Ae=re/12.92:Ae=v.pow((re+.055)/1.055,2.4),ce<=.03928?ze=ce/12.92:ze=v.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=h(this._r,this._g,this._b);return{h:j.h*360,s:j.s,v:j.v,a:this._a}},toHsvString:function(){var j=h(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 d(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[d(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(g,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(y,arguments)},tetrad:function(){return this._applyCombination(f,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 n(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=o(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=m(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 o(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 We=ce-be;switch(ze=Re>.5?We/(2-ce-be):We/(ce+be),ce){case j:Ae=(ee-re)/We+(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,We=2*re-Re;ce=ze(We,Re,j+1/3),be=ze(We,Re,j),Ae=ze(We,Re,j-1/3)}return{r:ce*255,g:be*255,b:Ae*255}}function h(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,We=ce-be;if(ze=ce===0?0:We/ce,ce==be)Ae=0;else{switch(ce){case j:Ae=(ee-re)/We+(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(v.max(re.getLuminance(),ce.getLuminance())+.05)/(v.min(re.getLuminance(),ce.getLuminance())+.05)},a.isReadable=function(j,ee,re){var ce=a.readability(j,ee),be,Ae;switch(Ae=!1,be=ne(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,We;re=re||{},ze=re.includeFallbackColors,Re=re.level,We=re.size;for(var it=0;itbe&&(be=Ae,ce=a(ee[it]));return a.isReadable(j,ce,{level:Re,size:We})||!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),v.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 se(j){return j.length==1?"0"+j:""+j}function he(j){return j<=1&&(j=j*100+"%"),j}function H(j){return v.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 ne(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(),v=Array.isArray;function x(M,e){var t,r;for(t=0;t=0)))return a;if(h===3)s[h]>1&&(s[h]=1);else if(s[h]>=1)return a}var m=Math.round(s[0]*255)+", "+Math.round(s[1]*255)+", "+Math.round(s[2]*255);return c?"rgba("+m+", "+s[3]+")":"rgb("+m+")"}}}),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,v,x,A){var M=(v||"")+(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)}}}),fF=Ze({"src/lib/coerce.js"(Z){"use strict";var q=is(),v=Ch(),x=rs().extendFlat,A=eu(),M=Gg(),e=Yi(),t=Zm().DESELECTDIM,r=b_(),i=Jy().counter,a=Yy().modHalf,n=xp().isArrayOrTypedArray,o=xp().isTypedArraySpec,s=xp().decodeTypedArraySpec;Z.valObjectMeta={data_array:{coerceFunction:function(h,m,d){m.set(n(h)?h:o(h)?s(h):d)}},enumerated:{coerceFunction:function(h,m,d,T){T.coerceNumber&&(h=+h),T.values.indexOf(h)===-1?m.set(d):m.set(h)},validateFunction:function(h,m){m.coerceNumber&&(h=+h);for(var d=m.values,T=0;TT.max?m.set(d):m.set(+h)}},integer:{coerceFunction:function(h,m,d,T){if((T.extras||[]).indexOf(h)!==-1){m.set(h);return}o(h)&&(h=s(h)),h%1||!q(h)||T.min!==void 0&&hT.max?m.set(d):m.set(+h)}},string:{coerceFunction:function(h,m,d,T){if(typeof h!="string"){var l=typeof h=="number";T.strict===!0||!l?m.set(d):m.set(String(h))}else T.noBlank&&!h?m.set(d):m.set(h)}},color:{coerceFunction:function(h,m,d){o(h)&&(h=s(h)),v(h).isValid()?m.set(h):m.set(d)}},colorlist:{coerceFunction:function(h,m,d){function T(l){return v(l).isValid()}!Array.isArray(h)||!h.length?m.set(d):h.every(T)?m.set(h):m.set(d)}},colorscale:{coerceFunction:function(h,m,d){m.set(M.get(h,d))}},angle:{coerceFunction:function(h,m,d){o(h)&&(h=s(h)),h==="auto"?m.set("auto"):q(h)?m.set(a(+h,360)):m.set(d)}},subplotid:{coerceFunction:function(h,m,d,T){var l=T.regex||i(d);if(typeof h=="string"&&l.test(h)){m.set(h);return}m.set(d)},validateFunction:function(h,m){var d=m.dflt;return h===d?!0:typeof h!="string"?!1:!!i(d).test(h)}},flaglist:{coerceFunction:function(h,m,d,T){if((T.extras||[]).indexOf(h)!==-1){m.set(h);return}if(typeof h!="string"){m.set(d);return}for(var l=h.split("+"),_=0;_/g),h=0;h1){var e=["LOG:"];for(M=0;M1){var t=[];for(M=0;M"),"long")}},A.warn=function(){var M;if(v.logging>0){var e=["WARN:"];for(M=0;M0){var t=[];for(M=0;M"),"stick")}},A.error=function(){var M;if(v.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 i=[],a=0;a=l&&F<=_?F:e}if(typeof F!="string"&&typeof F!="number")return e;F=String(F);var U=d(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?h:c);if(!ue)return e;var se=ue[1],he=ue[3]||"1",H=Number(ue[5]||1),$=Number(ue[7]||0),J=Number(ue[9]||0),X=Number(ue[11]||0);if(U){if(se.length===2)return e;se=Number(se);var oe;try{var ne=o.getComponentMethod("calendars","getCal")(B);if(Q){var j=he.charAt(he.length-1)==="i";he=parseInt(he,10),oe=ne.newDate(se,ne.toMonthIndex(se,he,j),H)}else oe=ne.newDate(se,Number(he),H)}catch{return e}return oe?(oe.toJD()-n)*t+$*r+J*i+X*a:e}se.length===2?se=(Number(se)+2e3-m)%100+m:se=Number(se),he-=1;var ee=new Date(Date.UTC(2e3,he,H,$,J));return ee.setUTCFullYear(se),ee.getUTCMonth()!==he||ee.getUTCDate()!==H?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,g=5*i;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,se,he;if(d(O)){var H=Math.floor(N/t)+n,$=Math.floor(A(F,t));try{U=o.getComponentMethod("calendars","getCal")(O).fromJD(H).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(d(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,y={1:"1",2:"1",3:"2",4:"2"};function f(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 y[O("%q")(N)]}),d(I))try{F=o.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/i),60),2);if(B!=="M"){v(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=d(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)+` `+f(U.dayMonthYear,F,I,N);return f(B,F,I,N)};var z=3*t;Z.incrementMonth=function(F,B,O){O=d(O)&&O;var I=A(F,t);if(F=Math.round(F-I),O)try{var N=Math.round(F/t)+n,U=o.getComponentMethod("calendars","getCal")(O),W=U.fromJD(N);return B%12?U.add(W,B,"m"):U.add(W,B/12,"y"),(W.toJD()-n)*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=d(B)&&o.getComponentMethod("calendars","getCal")(B),se=0;se1?(n[c-1]-n[0])/(c-1):1,d,T;for(m>=0?T=o?e:t:T=o?i:r,a+=m*M*(o?-1:1)*(m>=0?1:-1);s90&&v.log("Long binary search..."),s-1};function e(a,n){return an}function i(a,n){return a>=n}Z.sorterAsc=function(a,n){return a-n},Z.sorterDes=function(a,n){return n-a},Z.distinctVals=function(a){var n=a.slice();n.sort(Z.sorterAsc);var o;for(o=n.length-1;o>-1&&n[o]===A;o--);for(var s=n[o]-n[0]||1,c=s/(o||1)/1e4,h=[],m,d=0;d<=o;d++){var T=n[d],l=T-m;m===void 0?(h.push(T),m=T):l>c&&(s=Math.min(s,l),h.push(T),m=T)}return{vals:h,minDiff:s}},Z.roundUp=function(a,n,o){for(var s=0,c=n.length-1,h,m=0,d=o?0:1,T=o?1:0,l=o?Math.ceil:Math.floor;s0&&(s=1),o&&s)return a.sort(n)}return s?a:a.reverse()},Z.findIndexOfMin=function(a,n){n=n||x;for(var o=1/0,s,c=0;cM.length)&&(e=M.length),q(A)||(A=!1),v(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)]}}}),HF=Ze({"src/lib/angles.js"(Z,q){"use strict";var v=Yy(),x=v.mod,A=v.modHalf,M=Math.PI,e=2*M;function t(T){return T/180*M}function r(T){return T/M*180}function i(T){return Math.abs(T[1]-T[0])>e-1e-14}function a(T,l){return A(l-T,e)}function n(T,l){return Math.abs(a(T,l))}function o(T,l){if(i(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(!o(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,g){S=S||0,E=E||0;var b=i([_,w]),p,u,y,f,P;b?(p=0,u=M,y=e):_1/3&&v.x<2/3},Z.isRightAnchor=function(v){return v.xanchor==="right"||v.xanchor==="auto"&&v.x>=2/3},Z.isTopAnchor=function(v){return v.yanchor==="top"||v.yanchor==="auto"&&v.y>=2/3},Z.isMiddleAnchor=function(v){return v.yanchor==="middle"||v.yanchor==="auto"&&v.y>1/3&&v.y<2/3},Z.isBottomAnchor=function(v){return v.yanchor==="bottom"||v.yanchor==="auto"&&v.y<=1/3}}}),XF=Ze({"src/lib/geometry2d.js"(Z){"use strict";var q=Yy().mod;Z.segmentsIntersect=v;function v(t,r,i,a,n,o,s,c){var h=i-t,m=n-t,d=s-n,T=a-r,l=o-r,_=c-o,w=h*_-d*T;if(w===0)return null;var S=(m*_-d*l)/w,E=(m*T-h*l)/w;return E<0||E>1||S<0||S>1?null:{x:t+h*S,y:r+T*S}}Z.segmentDistance=function(r,i,a,n,o,s,c,h){if(v(r,i,a,n,o,s,c,h))return 0;var m=a-r,d=n-i,T=c-o,l=h-s,_=m*m+d*d,w=T*T+l*l,S=Math.min(x(m,d,_,o-r,s-i),x(m,d,_,c-r,h-i),x(T,l,w,r-o,i-s),x(T,l,w,a-o,n-s));return Math.sqrt(S)};function x(t,r,i,a,n){var o=a*t+n*r;if(o<0)return a*a+n*n;if(o>i){var s=a-t,c=n-r;return s*s+c*c}else{var h=a*r-n*t;return h*h/i}}var A,M,e;Z.getTextLocation=function(r,i,a,n){if((r!==M||n!==e)&&(A={},M=r,e=n),A[a])return A[a];var o=r.getPointAtLength(q(a-n/2,i)),s=r.getPointAtLength(q(a+n/2,i)),c=Math.atan((s.y-o.y)/(s.x-o.x)),h=r.getPointAtLength(q(a,i)),m=(h.x*4+o.x+s.x)/6,d=(h.y*4+o.y+s.y)/6,T={x:m,y:d,theta:c};return A[a]=T,T},Z.clearLocationCache=function(){M=null},Z.getVisibleSegment=function(r,i,a){var n=i.left,o=i.right,s=i.top,c=i.bottom,h=0,m=r.getTotalLength(),d=m,T,l;function _(S){var E=r.getPointAtLength(S);S===0?T=E:S===m&&(l=E);var g=E.xo?E.x-o:0,b=E.yc?E.y-c:0;return Math.sqrt(g*g+b*b)}for(var w=_(h);w;){if(h+=w+a,h>d)return;w=_(h)}for(w=_(d);w;){if(d-=w+a,h>d)return;w=_(d)}return{min:h,max:d,len:d-h,total:m,isClosed:h===0&&d===m&&Math.abs(T.x-l.x)<.1&&Math.abs(T.y-l.y)<.1}},Z.findPointOnPath=function(r,i,a,n){n=n||{};for(var o=n.pathLength||r.getTotalLength(),s=n.tolerance||.001,c=n.iterationLimit||30,h=r.getPointAtLength(0)[a]>r.getPointAtLength(o)[a]?-1:1,m=0,d=0,T=o,l,_,w;m0?T=l:d=l,m++}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 i in q)q[i].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)v(q[x]),delete q[x];else for(var A in q)Z.clear(A)};function v(x){x&&x.timer!==null&&(clearTimeout(x.timer),x.timer=null)}}}),ZF=Ze({"src/lib/clear_responsive.js"(Z,q){"use strict";q.exports=function(x){x._responsiveChartHandler&&(window.removeEventListener("resize",x._responsiveChartHandler),delete x._responsiveChartHandler)}}}),YF=Ze({"node_modules/is-mobile/index.js"(Z,q){"use strict";q.exports=M,q.exports.isMobile=M,q.exports.default=M;var v=/(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=v.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}}}),KF=Ze({"src/lib/preserve_drawing_buffer.js"(Z,q){"use strict";var v=is(),x=YF();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 i=t.split(" "),a=1;a-1;o--){var s=i[o];if(s.substr(0,8)==="Version/"){var c=s.substr(8).split(".")[0];if(v(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}}}),JF=Ze({"src/lib/make_trace_groups.js"(Z,q){"use strict";var v=Oi();q.exports=function(A,M,e){var t=A.selectAll("g."+e.replace(/\s/g,".")).data(M,function(i){return i[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(i){i[0][r]=v.select(this)}),t}}}),$F=Ze({"src/lib/localize.js"(Z,q){"use strict";var v=oo();q.exports=function(A,M){for(var e=A._context.locale,t=0;t<2;t++){for(var r=A._context.locales,i=0;i<2;i++){var a=(r[e]||{}).dictionary;if(a){var n=a[M];if(n)return n}r=v.localeRegistry}var o=e.split("-")[0];if(o===e)break;e=o}return M}}}),rS=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,i=String(x).length;if(t>=i+r){var a=parseFloat(e).toPrecision(12);a.indexOf("e+")===-1&&(e=+a)}}return e}}}),tO=Ze({"src/lib/clean_number.js"(Z,q){"use strict";var v=is(),x=Vs().BADNUM,A=/^['"%,$#\s']+|[, ]|['"%,$#\s']+$/g;q.exports=function(e){return typeof e=="string"&&(e=e.replace(A,"")),v(e)?Number(e):x}}}),ca=Ze({"src/lib/index.js"(Z,q){"use strict";var v=Oi(),x=Np().utcFormat,A=Zy().format,M=is(),e=Vs(),t=e.FP_SAFE,r=-t,i=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 n={};a.warnBadFormat=function(ne){var j=String(ne);n[j]||(n[j]=1,a.warn('encountered bad format: "'+j+'"'))},a.noFormat=function(ne){return String(ne)},a.numberFormat=function(ne){var j;try{j=A(a.adjustFormat(ne))}catch{return a.warnBadFormat(ne),a.noFormat}return j},a.nestedProperty=b_(),a.keyedContainer=lF(),a.relativeAttr=uF(),a.isPlainObject=Xv(),a.toLogRange=f2(),a.relinkPrivateKeys=cF();var o=xp();a.isArrayBuffer=o.isArrayBuffer,a.isTypedArray=o.isTypedArray,a.isArrayOrTypedArray=o.isArrayOrTypedArray,a.isArray1D=o.isArray1D,a.ensureArray=o.ensureArray,a.concat=o.concat,a.maxRowLength=o.maxRowLength,a.minRowLength=o.minRowLength;var s=Yy();a.mod=s.mod,a.modHalf=s.modHalf;var c=fF();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 h=qF();a.dateTime2ms=h.dateTime2ms,a.isDateTime=h.isDateTime,a.ms2DateTime=h.ms2DateTime,a.ms2DateTimeLocal=h.ms2DateTimeLocal,a.cleanDate=h.cleanDate,a.isJSDate=h.isJSDate,a.formatDate=h.formatDate,a.incrementMonth=h.incrementMonth,a.dateTick0=h.dateTick0,a.dfltRange=h.dfltRange,a.findExactDates=h.findExactDates,a.MIN_MS=h.MIN_MS,a.MAX_MS=h.MAX_MS;var m=m2();a.findBin=m.findBin,a.sorterAsc=m.sorterAsc,a.sorterDes=m.sorterDes,a.distinctVals=m.distinctVals,a.roundUp=m.roundUp,a.sort=m.sort,a.findIndexOfMin=m.findIndexOfMin,a.sortObjectKeys=Km();var d=GF();a.aggNums=d.aggNums,a.len=d.len,a.mean=d.mean,a.geometricMean=d.geometricMean,a.median=d.median,a.midRange=d.midRange,a.variance=d.variance,a.stdev=d.stdev,a.interp=d.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=HF();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 _=WF();a.isLeftAnchor=_.isLeftAnchor,a.isCenterAnchor=_.isCenterAnchor,a.isRightAnchor=_.isRightAnchor,a.isTopAnchor=_.isTopAnchor,a.isMiddleAnchor=_.isMiddleAnchor,a.isBottomAnchor=_.isBottomAnchor;var w=XF();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 g=Jy();a.counterRegex=g.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=ZF(),a.preserveDrawingBuffer=KF(),a.makeTraceGroups=JF(),a._=$F(),a.notifier=KA(),a.filterUnique=rS(),a.filterVisible=QF(),a.pushUnique=JA(),a.increment=eO(),a.cleanNumber=tO(),a.ensureNumber=function(j){return M(j)?(j=Number(j),j>t||j=j?!1:M(ne)&&ne>=0&&ne%1===0},a.noop=h2(),a.identity=S_(),a.repeat=function(ne,j){for(var ee=new Array(j),re=0;reee?Math.max(ee,Math.min(j,ne)):Math.max(j,Math.min(ee,ne))},a.bBoxIntersect=function(ne,j,ee){return ee=ee||0,ne.left<=j.right+ee&&j.left<=ne.right+ee&&ne.top<=j.bottom+ee&&j.top<=ne.bottom+ee},a.simpleMap=function(ne,j,ee,re,ce){for(var be=ne.length,Ae=new Array(be),ze=0;ze=Math.pow(2,ee)?ce>10?(a.warn("randstr failed uniqueness"),Ae):ne(j,ee,re,(ce||0)+1):Ae},a.OptionControl=function(ne,j){ne||(ne={}),j||(j="opt");var ee={};return ee.optionList=[],ee._newoption=function(re){re[j]=ne,ee[re.name]=re,ee.optionList.push(re)},ee["_"+j]=ne,ee},a.smooth=function(ne,j){if(j=Math.round(j)||0,j<2)return ne;var ee=ne.length,re=2*ee,ce=2*j-1,be=new Array(ce),Ae=new Array(ee),ze,Re,We,it;for(ze=0;ze=re&&(We-=re*Math.floor(We/re)),We<0?We=-1-We:We>=ee&&(We=re-1-We),it+=ne[We]*be[Re];Ae[ze]=it}return Ae},a.syncOrAsync=function(ne,j,ee){var re,ce;function be(){return a.syncOrAsync(ne,j,ee)}for(;ne.length;)if(ce=ne.splice(0,1)[0],re=ce(j),re&&re.then)return re.then(be);return ee&&ee(j)},a.stripTrailingSlash=function(ne){return ne.substr(-1)==="/"?ne.substr(0,ne.length-1):ne},a.noneOrAll=function(ne,j,ee){if(ne){var re=!1,ce=!0,be,Ae;for(be=0;be0?ce:0})},a.fillArray=function(ne,j,ee,re){if(re=re||a.identity,a.isArrayOrTypedArray(ne))for(var ce=0;ceL.test(window.navigator.userAgent);var z=/Firefox\/(\d+)\.\d+/;a.getFirefoxVersion=function(){var ne=z.exec(window.navigator.userAgent);if(ne&&ne.length===2){var j=parseInt(ne[1]);if(!isNaN(j))return j}return null},a.isD3Selection=function(ne){return ne instanceof v.selection},a.ensureSingle=function(ne,j,ee,re){var ce=ne.select(j+(ee?"."+ee:""));if(ce.size())return ce;var be=ne.append(j);return ee&&be.classed(ee,!0),re&&be.call(re),be},a.ensureSingleById=function(ne,j,ee,re){var ce=ne.select(j+"#"+ee);if(ce.size())return ce;var be=ne.append(j).attr("id",ee);return re&&be.call(re),be},a.objectFromPath=function(ne,j){for(var ee=ne.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(ne,j){var ee={};return ne.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(ne){var j=ne.match(W);return j?{key:j[1],op:j[2],number:Number(j[3])}:{key:ne,op:null,number:null}}var ue={max:10,count:0,name:"texttemplate",parseMultDiv:!0};a.texttemplateStringForShapes=function(){return he.apply(ue,arguments)};var se=/^[:|\|]/;function he(ne,j,ee){var re=this,ce=arguments;return j||(j={}),ne.replace(a.TEMPLATE_STRING_REGEX,function(be,Ae,ze){var Re=Ae==="xother"||Ae==="yother",We=Ae==="_xother"||Ae==="_yother",it=Ae==="_xother_"||Ae==="_yother_",ot=Ae==="xother_"||Ae==="yother_",tt=Re||We||ot||it,ut=Ae;(We||it)&&(ut=ut.substring(1)),(ot||it)&&(ut=ut.substring(0,ut.length-1));var Me=null,_e=null;if(re.parseMultDiv){var fe=Q(ut);ut=fe.key,Me=fe.op,_e=fe.number}var Fe;if(tt){if(Fe=j[ut],Fe===void 0)return""}else{var rt,st;for(st=3;st=H&&Ae<=$,We=ze>=H&&ze<=$;if(Re&&(re=10*re+Ae-H),We&&(ce=10*ce+ze-H),!Re||!We){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 ne=J;return J=(69069*J+1)%4294967296,Math.abs(J-ne)<429496729?a.pseudoRandom():J/4294967296},a.fillText=function(ne,j,ee){var re=Array.isArray(ee)?function(Ae){ee.push(Ae)}:function(Ae){ee.text=Ae},ce=a.extractOption(ne,j,"htx","hovertext");if(a.isValidTextValue(ce))return re(ce);var be=a.extractOption(ne,j,"tx","text");if(a.isValidTextValue(be))return re(be)},a.isValidTextValue=function(ne){return ne||ne===0},a.formatPercent=function(ne,j){j=j||0;for(var ee=(Math.round(100*ne*Math.pow(10,j))*Math.pow(.1,j)).toFixed(j)+"%",re=0;re1&&(We=1):We=0,a.strTranslate(ce-We*(ee+Ae),be-We*(re+ze))+a.strScale(We)+(Re?"rotate("+Re+(j?"":" "+ee+" "+re)+")":"")},a.setTransormAndDisplay=function(ne,j){ne.attr("transform",a.getTextTransform(j)),ne.style("display",j.scale?null:"none")},a.ensureUniformFontSize=function(ne,j){var ee=a.extendFlat({},j);return ee.size=Math.max(j.size,ne._fullLayout.uniformtext.minsize||0),ee},a.join2=function(ne,j,ee){var re=ne.length;return re>1?ne.slice(0,-1).join(j)+ee+ne[re-1]:ne.join(j)},a.bigFont=function(ne){return Math.round(1.2*ne)};var X=a.getFirefoxVersion(),oe=X!==null&&X<86;a.getPositionFromD3Event=function(){return oe?[v.event.layerX,v.event.layerY]:[v.event.offsetX,v.event.offsetY]}}}),rO=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)v=x.replace(/^,/," ,").replace(/X/g,".js-plotly-plot .plotly").replace(/Y/g,".plotly-notifier"),Z.addStyleRule(v,q[x]);var v,x}}),aS=Ze({"node_modules/is-browser/client.js"(Z,q){q.exports=!0}}),nS=Ze({"node_modules/has-hover/index.js"(Z,q){"use strict";var v=aS(),x;typeof window.matchMedia=="function"?x=!window.matchMedia("(hover: none)").matches:x=v,q.exports=x}}),Wg=Ze({"node_modules/events/events.js"(Z,q){"use strict";var v=typeof Reflect=="object"?Reflect:null,x=v&&typeof v.apply=="function"?v.apply:function(E,g,b){return Function.prototype.apply.call(E,g,b)},A;v&&typeof v.ownKeys=="function"?A=v.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 i(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 g=[],b=1;b0&&(y=g[0]),y instanceof Error)throw y;var f=new Error("Unhandled error."+(y?" ("+y.message+")":""));throw f.context=y,f}var P=u[E];if(P===void 0)return!1;if(typeof P=="function")x(P,this,g);else for(var L=P.length,z=m(P,L),b=0;b0&&y.length>p&&!y.warned){y.warned=!0;var f=new Error("Possible EventEmitter memory leak detected. "+y.length+" "+String(E)+" listeners added. Use emitter.setMaxListeners() to increase limit");f.name="MaxListenersExceededWarning",f.emitter=S,f.type=E,f.count=y.length,M(f)}return S}t.prototype.addListener=function(E,g){return n(this,E,g,!1)},t.prototype.on=t.prototype.addListener,t.prototype.prependListener=function(E,g){return n(this,E,g,!0)};function o(){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,g){var b={fired:!1,wrapFn:void 0,target:S,type:E,listener:g},p=o.bind(b);return p.listener=g,b.wrapFn=p,p}t.prototype.once=function(E,g){return i(g),this.on(E,s(this,E,g)),this},t.prototype.prependOnceListener=function(E,g){return i(g),this.prependListener(E,s(this,E,g)),this},t.prototype.removeListener=function(E,g){var b,p,u,y,f;if(i(g),p=this._events,p===void 0)return this;if(b=p[E],b===void 0)return this;if(b===g||b.listener===g)--this._eventsCount===0?this._events=Object.create(null):(delete p[E],p.removeListener&&this.emit("removeListener",E,b.listener||g));else if(typeof b!="function"){for(u=-1,y=b.length-1;y>=0;y--)if(b[y]===g||b[y].listener===g){f=b[y].listener,u=y;break}if(u<0)return this;u===0?b.shift():d(b,u),b.length===1&&(p[E]=b[0]),p.removeListener!==void 0&&this.emit("removeListener",E,f||g)}return this},t.prototype.off=t.prototype.removeListener,t.prototype.removeAllListeners=function(E){var g,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),y;for(p=0;p=0;p--)this.removeListener(E,g[p]);return this};function c(S,E,g){var b=S._events;if(b===void 0)return[];var p=b[E];return p===void 0?[]:typeof p=="function"?g?[p.listener||p]:[p]:g?T(p):m(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):h.call(S,E)},t.prototype.listenerCount=h;function h(S){var E=this._events;if(E!==void 0){var g=E[S];if(typeof g=="function")return 1;if(g!==void 0)return g.length}return 0}t.prototype.eventNames=function(){return this._eventsCount>0?A(this._events):[]};function m(S,E){for(var g=new Array(E),b=0;b{}),A},triggerHandler:function(A,M,e){var t,r=A._ev;if(!r)return;var i=r._events[M];if(!i)return;function a(o){if(o.listener){if(r.removeListener(M,o.listener),!o.fired)return o.fired=!0,o.listener.apply(r,[e])}else return o.apply(r,[e])}i=Array.isArray(i)?i:[i];var n;for(n=0;nx.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,i;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,i=0;i=t.undoQueue.queue.length)){for(r=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,i=0;i=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=i({},x),I=i({},z.attributes);Z.crawl(I,function(W,Q,ue,se,he){o(O,he).set(void 0),W===void 0&&o(I,he).set(void 0)}),i(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,i(B,I),F.attributes&&i(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={};i(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;i(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&&(i._input||{})._templateitemname;o&&(n=a);var s=r+"["+n+"]",c;function h(){c={},o&&(c[s]={},c[s][x]=o)}h();function m(_,w){c[_]=w}function d(_,w){o?q.nestedProperty(c[s],_).set(w):c[s+"."+_]=w}function T(){var _=c;return h(),_}function l(_,w){_&&d(_,w);var S=T();for(var E in S)q.nestedProperty(t,E).set(S[E])}return{modifyBase:m,modifyItem:d,getUpdateObj:T,applyUpdate:l}}}}),kh=Ze({"src/plots/cartesian/constants.js"(Z,q){"use strict";var v=Jy().counter;q.exports={idRegex:{x:v("x","( domain)?"),y:v("y","( domain)?")},attrRegex:v("[xy]axis"),xAxisMatch:v("xaxis"),yAxisMatch:v("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(),v=kh();Z.id2name=function(M){if(!(typeof M!="string"||!M.match(v.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(v.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(v.AX_ID_PATTERN))&&!(e&&M.charAt(0)!==e)&&!(r&&!t)){var i=M.split(" ")[0].substr(1).replace(/^0+/,"");return i==="1"&&(i=""),M.charAt(0)+i+(r&&t?" domain":"")}},Z.list=function(A,M,e){var t=A._fullLayout;if(!t)return[];var r=Z.listIds(A,M),i=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?".":"")+o;v.isPlainObject(s)?t(s,i,c,n+1):i(c,o,s)}})}}}),xc=Ze({"src/plots/plots.js"(Z,q){"use strict";var v=Oi(),x=Np().timeFormatLocale,A=Zy().formatLocale,M=is(),e=YA(),t=oo(),r=e1(),i=Dl(),a=ca(),n=Yi(),o=Vs().BADNUM,s=$c(),c=Jm().clearOutline,h=y2(),m=A_(),d=iS(),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=nO();w.executeAPICommand=S.executeAPICommand,w.computeAPICommandBindings=S.computeAPICommandBindings,w.manageCommandObserver=S.manageCommandObserver,w.hasSimpleAPICommandBindings=S.hasSimpleAPICommandBindings,w.redrawText=function(H){return H=a.getGraphDiv(H),new Promise(function($){setTimeout(function(){H._fullLayout&&(t.getComponentMethod("annotations","draw")(H),t.getComponentMethod("legend","draw")(H),t.getComponentMethod("colorbar","draw")(H),$(w.previousPromises(H)))},300)})},w.resize=function(H){H=a.getGraphDiv(H);var $,J=new Promise(function(X,oe){(!H||a.isHidden(H))&&oe(new Error("Resize must be passed a displayed plot div element.")),H._redrawTimer&&clearTimeout(H._redrawTimer),H._resolveResize&&($=H._resolveResize),H._resolveResize=X,H._redrawTimer=setTimeout(function(){if(!H.layout||H.layout.width&&H.layout.height||a.isHidden(H)){X(H);return}delete H.layout.width,delete H.layout.height;var ne=H.changed;H.autoplay=!0,t.call("relayout",H,{autosize:!0}).then(function(){H.changed=ne,H._resolveResize===X&&(delete H._resolveResize,X(H))})},100)});return $&&$(J),J},w.previousPromises=function(H){if((H._promises||[]).length)return Promise.all(H._promises).then(function(){H._promises=[]})},w.addLinks=function(H){if(!(!H._context.showLink&&!H._context.showSources)){var $=H._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:n.defaultLine,"pointer-events":"all"}).each(function(){var ce=v.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 ne=J.select(".js-link-to-tool"),j=J.select(".js-link-spacer"),ee=J.select(".js-sourcelinks");H._context.showSources&&H._context.showSources(H),H._context.showLink&&E(H,ne),j.text(ne.text()&&ee.text()?" - ":"")}};function E(H,$){$.text("");var J=$.append("a").attr({"xlink:xlink:href":"#",class:"link--impt link--embedview","font-weight":"bold"}).text(H._context.linkText+" \xBB");if(H._context.sendData)J.on("click",function(){w.sendDataToCloud(H)});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(H){var $=(window.PLOTLYENV||{}).BASE_URL||H._context.plotlyServerURL;if($){H.emit("plotly_beforeexport");var J=v.select(H).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(H,!1,"keepdata"),X.node().submit(),J.remove(),H.emit("plotly_afterexport"),!1}};var g=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],b=["year","month","dayMonth","dayMonthYear"];w.supplyDefaults=function(H,$){var J=$&&$.skipUpdateCalc,X=H._fullLayout||{};if(X._skipDefaults){delete X._skipDefaults;return}var oe=H._fullLayout={},ne=H.layout||{},j=H._fullData||[],ee=H._fullData=[],re=H.data||[],ce=H.calcdata||[],be=H._context||{},Ae;H._transitionData||w.createTransitionData(H),oe._dfltTitle={plot:_(H,"Click to enter Plot title"),subtitle:_(H,"Click to enter Plot subtitle"),x:_(H,"Click to enter X axis title"),y:_(H,"Click to enter Y axis title"),colorbar:_(H,"Click to enter Colorscale title"),annotation:_(H,"new text")},oe._traceWord=_(H,"trace");var ze=y(H,g);if(oe._mapboxAccessToken=be.mapboxAccessToken,X._initialAutoSizeIsDone){var Re=X.width,We=X.height;w.supplyLayoutGlobalDefaults(ne,oe,ze),ne.width||(oe.width=Re),ne.height||(oe.height=We),w.sanitizeMargins(oe)}else{w.supplyLayoutGlobalDefaults(ne,oe,ze);var it=!ne.width||!ne.height,ot=oe.autosize,tt=be.autosizable,ut=it&&(ot||tt);ut?w.plotAutoSize(H,ne,oe):it&&w.sanitizeMargins(oe),!ot&&it&&(ne.width=oe.width,ne.height=oe.height)}oe._d3locale=f(ze,oe.separators),oe._extraFormat=y(H,b),oe._initialAutoSizeIsDone=!0,oe._dataLength=re.length,oe._modules=[],oe._visibleModules=[],oe._basePlotModules=[];var Me=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,ne,oe);var Fe=Object.keys(_e.x),rt=Object.keys(_e.y);if(Fe.length>1&&rt.length>1){for(t.getComponentMethod("grid","sizeDefaults")(ne,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 qt=!!(X._has&&X._has("cartesian")),Zt=!!(oe._has&&oe._has("cartesian")),Sr=qt,xr=Zt;Sr&&!xr?X._bgLayer.remove():xr&&!Sr&&(oe._shouldCreateBgLayer=!0),X._zoomlayer&&!H._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*ne;j=Math.round(be*j),ee=Math.round(be*ee)}}var Ae=w.layoutAttributes.width.min,ze=w.layoutAttributes.height.min;j1,We=!J.height&&Math.abs(X.height-ee)>1;(We||Re)&&(Re&&(X.width=j),We&&(X.height=ee)),$._initialAutoSize||($._initialAutoSize={width:j,height:ee}),w.sanitizeMargins(X)},w.supplyLayoutModuleDefaults=function(H,$,J,X){var oe=t.componentsRegistry,ne=$._basePlotModules,j,ee,re,ce=t.subplotsRegistry.cartesian;for(j in oe)re=oe[j],re.includeBasePlot&&re.includeBasePlot(H,$);ne.length||ne.push(ce),$._has("cartesian")&&(t.getComponentMethod("grid","contentDefaults")(H,$),ce.finalizeSubplots(H,$));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 ut=J.xl!==void 0?J.xl:J.x,Me=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:ut,size:J.l+it},r:{val:Me,size:J.r+it},b:{val:fe,size:J.b+it},t:{val:_e,size:J.t+it}},We[$]=1}if(!X._replotting)return w.doAutoMargin(H)}};function I(H){if("_redrawFromAutoMarginCount"in H._fullLayout)return!1;var $=s.list(H,"",!0);for(var J in $)if($[J].autoshift||$[J].shift)return!0;return!1}w.doAutoMargin=function(H){var $=H._fullLayout,J=$.width,X=$.height;$._size||($._size={}),F($);var oe=$._size,ne=$.margin,j={t:0,b:0,l:0,r:0},ee=a.extendFlat({},oe),re=ne.l,ce=ne.r,be=ne.t,Ae=ne.b,ze=$._pushmargin,Re=$._pushmarginIds,We=$.minreducedwidth,it=$.minreducedheight;if(ne.autoexpand!==!1){for(var ot in ze)Re[ot]||delete ze[ot];var tt=H._fullLayout._reservedMargin;for(var ut in tt)for(var Me in tt[ut]){var _e=tt[ut][Me];j[Me]=Math.max(j[Me],_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,ne[fe]-Fe);j[fe]=Math.max(0,j[fe]-st)}for(var Qe in ze){var Lt=ze[Qe].l||{},kt=ze[Qe].b||{},qt=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>qt){var Ke=(Zt*bt+(Be-jr)*qt)/(bt-qt),Ue=(Be*(1-qt)+(Zt-jr)*(1-bt))/(bt-qt);Ke+Ue>re+ce&&(re=Ke,ce=Ue)}}if(M(xr)&&ze[Ir].t){var Ee=ze[Ir].t.val,Ve=ze[Ir].t.size;if(Ee>Sr){var Ce=(xr*Ee+(Ve-wr)*Sr)/(Ee-Sr),Te=(Ve*(1-Sr)+(xr-wr)*(1-Ee))/(Ee-Sr);Ce+Te>Ae+be&&(Ae=Ce,be=Te)}}}}}var Pe=a.constrain(J-ne.l-ne.r,B,We),at=a.constrain(X-ne.t-ne.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(ne.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(H))){"_redrawFromAutoMarginCount"in $?$._redrawFromAutoMarginCount++:$._redrawFromAutoMarginCount=1;var rr=3*(1+Object.keys(Re).length);if($._redrawFromAutoMarginCount1)return!0}return!1},w.graphJson=function(H,$,J,X,oe,ne){(oe&&$&&!H._fullData||oe&&!$&&!H._fullLayout)&&w.supplyDefaults(H);var j=oe?H._fullData:H.data,ee=oe?H._fullLayout:H.layout,re=(H._transitionData||{})._frames;function ce(ze,Re){if(typeof ze=="function")return Re?"_function_":null;if(a.isPlainObject(ze)){var We={},it;return Object.keys(ze).sort().forEach(function(Me){if(["_","["].indexOf(Me.charAt(0))===-1){if(typeof ze[Me]=="function"){Re&&(We[Me]="_function");return}if(J==="keepdata"){if(Me.substr(Me.length-3)==="src")return}else if(J==="keepstream"){if(it=ze[Me+"src"],typeof it=="string"&&it.indexOf(":")>0&&!a.isPlainObject(ze.stream))return}else if(J!=="keepall"&&(it=ze[Me+"src"],typeof it=="string"&&it.indexOf(":")>0))return;We[Me]=ce(ze[Me],Re)}}),We}var ot=Array.isArray(ze),tt=a.isTypedArray(ze);if((ot||tt)&&ze.dtype&&ze.shape){var ut=ze.bdata;return ce({dtype:ze.dtype,shape:ze.shape,bdata:a.isArrayBuffer(ut)?e.encode(ut):ut},Re)}return ot?ze.map(function(Me){return ce(Me,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)),ne&&(be.config=ce(H._context,!0)),X==="object"?be:JSON.stringify(be)},w.modifyFrames=function(H,$){var J,X,oe,ne=H._transitionData._frames,j=H._transitionData._frameHash;for(J=0;J<$.length;J++)switch(X=$[J],X.type){case"replace":oe=X.value;var ee=(ne[X.index]||{}).name,re=oe.name;ne[X.index]=j[re]=oe,re!==ee&&(delete j[ee],j[re]=oe);break;case"insert":oe=X.value,j[oe.name]=oe,ne.splice(X.index,0,oe);break;case"delete":oe=ne[X.index],delete j[oe.name],ne.splice(X.index,1);break}return Promise.resolve()},w.computeFrame=function(H,$){var J=H._transitionData._frameHash,X,oe,ne,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&&(H._transitioningWithDuration=!0),H._transitionData._interruptCallbacks.push(function(){X=!0}),J.redraw&&H._transitionData._interruptCallbacks.push(function(){return t.call("redraw",H)}),H._transitionData._interruptCallbacks.push(function(){H.emit("plotly_transitioninterrupted",[])});var ze=0,Re=0;function We(){return ze++,function(){Re++,!X&&Re===ze&&ee(Ae)}}J.runFn(We),setTimeout(We())})}function ee(Ae){if(H._transitionData)return ne(H._transitionData._interruptCallbacks),Promise.resolve().then(function(){if(J.redraw)return t.call("redraw",H)}).then(function(){H._transitioning=!1,H._transitioningWithDuration=!1,H.emit("plotly_transitioned",[])}).then(Ae)}function re(){if(H._transitionData)return H._transitioning=!1,oe(H._transitionData._interruptCallbacks)}var ce=[w.previousPromises,re,J.prepareFn,w.rehover,w.reselect,j],be=a.syncOrAsync(ce,H);return(!be||!be.then)&&(be=Promise.resolve()),be.then(function(){return H})}w.doCalcdata=function(H,$){var J=s.list(H),X=H._fullData,oe=H._fullLayout,ne,j,ee,re,ce=new Array(X.length),be=(H.calcdata||[]).slice();for(H.calcdata=ce,oe._numBoxes=0,oe._numViolins=0,oe._violinScaleGroupStats={},H._hmpixcount=0,H._hmlumcount=0,oe._piecolormap={},oe._sunburstcolormap={},oe._treemapcolormap={},oe._iciclecolormap={},oe._funnelareacolormap={},ee=0;ee=0;re--)if(fe[re].enabled){ne._indexToPoints=fe[re]._indexToPoints;break}j&&j.calc&&(_e=j.calc(H,ne))}(!Array.isArray(_e)||!_e[0])&&(_e=[{x:o,y:o}]),_e[0].t||(_e[0].t={}),_e[0].trace=ne,ce[ut]=_e}}for(se(J,X,oe),ee=0;eeee||Re>re)&&(ne.style("overflow","hidden"),Ae=ne.node().getBoundingClientRect(),ze=Ae.width,Re=Ae.height);var We=+O.attr("x"),it=+O.attr("y"),ot=H||O.node().getBoundingClientRect().height,tt=-ot/4;if(ue[0]==="y")j.attr({transform:"rotate("+[-90,We,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)We=0,it=tt;else{var ut=O.attr("text-anchor");We=We-ze*(ut==="middle"?.5:ut==="end"?1:0),it=it+tt-Re/2}ne.attr({x:We,y:it}),N&&N.call(O,j),he(j)})})):se(),O};var t=/(<|<|<)/g,r=/(>|>|>)/g;function i(O){return O.replace(t,"\\lt ").replace(r,"\\gt ")}var a=[["$","$"],["\\(","\\)"]];function n(O,I,N){var U=parseInt((MathJax.version||"").split(".")[0]);if(U!==2&&U!==3){v.warn("No MathJax version:",MathJax.version);return}var W,Q,ue,se,he=function(){return Q=v.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"})},H=function(){Q=v.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-"+v.randstr({},64);se=q.select("body").append("div").attr({id:ce}).style({visibility:"hidden",position:"absolute","font-size":I.fontSize+"px"}).text(i(O));var be=se.node();return U===2?MathJax.Hub.Typeset(be):MathJax.typeset([be])},oe=function(){var ce=se.select(U===2?".MathJax_SVG":".MathJax"),be=!ce.empty()&&se.select("svg").node();if(!be)v.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)}se.remove()},ne=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,ne,ee):U===3&&(H(),J(),MathJax.startup.defaultReady(),MathJax.startup.promise.then(function(){X(),oe(),j(),re()}))}var o={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"},h="\u200B",m=["http:","https:","mailto:","",void 0,":"],d=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,g=/(^|[\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&&f(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),se=[],he="",H=0,$=0;$Q?se.push(J.substr(0,j-Q)+W):se.push(J.substr(0,j));break}he=""}}return se.join("")};var u={mu:"\u03BC",amp:"&",lt:"<",gt:">",nbsp:"\xA0",times:"\xD7",plusmn:"\xB1",deg:"\xB0"},y=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function f(O){return O.replace(y,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=f;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(d," ");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 We=U;if(U=[{node:Re}],We.length>1)for(var it=1;it.",I);return}var We=U.pop();Re!==We.type&&v.log("Start tag <"+We.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=d[_];l[w]=[1-S[0],S[1]]}return l}function c(d,T){T=T||{};for(var l=d.domain,_=d.range,w=_.length,S=new Array(w),E=0;Ed-h?h=d-(m-d):m-d=0?_=i.colorscale.sequential:_=i.colorscale.sequentialminus,s._sync("colorscale",_)}}}}),rc=Ze({"src/components/colorscale/index.js"(Z,q){"use strict";var v=Gg(),x=Up();q.exports={moduleType:"component",name:"colorscale",attributes:Mu(),layoutAttributes:oS(),supplyLayoutDefaults:iO(),handleDefaults:gh(),crossTraceDefaults:oO(),calc:jp(),scales:v.scales,defaultScale:v.defaultScale,getScale:v.get,isValidScale:v.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 v=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 v.isPlainObject(M)&&(v.isArrayOrTypedArray(M.size)||x(M.size))}}}}),r1=Ze({"src/traces/scatter/make_bubble_size_func.js"(Z,q){"use strict";var v=is();q.exports=function(A,M){M||(M=2);var e=A.marker,t=e.sizeref||1,r=e.sizemin||0,i=e.sizemode==="area"?function(a){return Math.sqrt(a/t)}:function(a){return a/t};return function(a){var n=i(a/M);return v(n)&&n>0?Math.max(n,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 i=t.xaxes||[],a=t.yaxes||[],n=0;n=0&&i.index2&&(r.push([a].concat(n.splice(0,2))),o="l",a=a=="m"?"l":"L");;){if(n.length==v[o])return n.unshift(a),r.push(n);if(n.length0&&(_e=100,Me=Me.replace("-open","")),Me.indexOf("-dot")>0&&(_e+=200,Me=Me.replace("-dot","")),Me=l.symbolNames.indexOf(Me),Me>=0&&(Me+=_e)}return Me%100>=p||Me>=400?0:Math.floor(Math.max(Me,0))};function y(Me,_e,fe,Fe){var rt=Me%100;return l.symbolFuncs[rt](_e,fe,Fe)+(Me>=200?u:"")}var f=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(Me,_e,fe,Fe,rt,st){var Qe=P[Fe];return L(Me,_e,fe,Qe.type,rt,st,Qe.start,Qe.stop,!1,Qe.reversed)};function L(Me,_e,fe,Fe,rt,st,Qe,Lt,kt,qt){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:qt}:Fe==="radial"&&(Sr={node:"radialGradient",reversed:qt});for(var xr=new Array(Zt),jr=0;jr=0&&Me.i===void 0&&(Me.i=st.i),_e.style("opacity",Fe.selectedOpacityFn?Fe.selectedOpacityFn(Me):Me.mo===void 0?Qe.opacity:Me.mo),Fe.ms2mrc){var kt;Me.ms==="various"||Qe.size==="various"?kt=3:kt=Fe.ms2mrc(Me.ms),Me.mrc=kt,Fe.selectedSizeFn&&(kt=Me.mrc=Fe.selectedSizeFn(Me));var qt=l.symbolNumber(Me.mx||Qe.symbol)||0;Me.om=qt%200>=100;var Zt=ut(Me,fe),Sr=ee(Me,fe);_e.attr("d",y(qt,kt,Zt,Sr))}var xr=!1,jr,wr,Ir;if(Me.so)Ir=Lt.outlierwidth,wr=Lt.outliercolor,jr=Qe.outliercolor;else{var bt=(Lt||{}).width;Ir=(Me.mlw+1||bt+1||(Me.trace?(Me.trace.marker.line||{}).width:0)+1)-1||0,"mlc"in Me?wr=Me.mlcc=Fe.lineScale(Me.mlc):x.isArrayOrTypedArray(Lt.color)?wr=r.defaultLine:wr=Lt.color,x.isArrayOrTypedArray(Qe.color)&&(jr=r.defaultLine,xr=!0),"mc"in Me?jr=Me.mcc=Fe.markerScale(Me.mc):jr=Qe.color||Qe.colors||"rgba(0,0,0,0)",Fe.selectedColorFn&&(jr=Fe.selectedColorFn(Me))}if(Me.om)_e.call(r.stroke,jr).style({"stroke-width":(Ir||1)+"px",fill:"none"});else{_e.style("stroke-width",(Me.isBlank?0:Ir)+"px");var Be=Qe.gradient,Ke=Me.mgt;Ke?xr=!0:Ke=Be&&Be.type,x.isArrayOrTypedArray(Ke)&&(Ke=Ke[0],P[Ke]||(Ke=0));var Ue=Qe.pattern,Ee=l.getPatternAttr,Ve=Ue&&(Ee(Ue.shape,Me.i,"")||Ee(Ue.path,Me.i,""));if(Ke&&Ke!=="none"){var Ce=Me.mgc;Ce?xr=!0:Ce=Be.color;var Te=fe.uid;xr&&(Te+="-"+Me.i),l.gradient(_e,rt,Te,Ke,[[0,Ce],[1,jr]],"fill")}else if(Ve){var Pe=!1,at=Ue.fgcolor;!at&&st&&st.color&&(at=st.color,Pe=!0);var yt=Ee(at,Me.i,st&&st.color||null),Tt=Ee(Ue.bgcolor,Me.i,null),Ot=Ue.fgopacity,Gt=Ee(Ue.size,Me.i,8),rr=Ee(Ue.solidity,Me.i,.3);Pe=Pe||Me.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+="-"+Me.i),l.pattern(_e,"point",rt,Qt,Ve,Gt,rr,Me.mcc,Ue.fillmode,Tt,yt,Ot)}else x.isArrayOrTypedArray(jr)?r.fill(_e,jr[Me.i]):r.fill(_e,jr);Ir&&r.stroke(_e,wr)}},l.makePointStyleFns=function(Me){var _e={},fe=Me.marker;return _e.markerScale=l.tryColorscale(fe,""),_e.lineScale=l.tryColorscale(fe,"line"),t.traceIs(Me,"symbols")&&(_e.ms2mrc=m.isBubble(Me)?d(Me):function(){return(fe.size||6)/2}),Me.selectedpoints&&x.extendFlat(_e,l.makeSelectedPointStyleFns(Me)),_e},l.makeSelectedPointStyleFns=function(Me){var _e={},fe=Me.selected||{},Fe=Me.unselected||{},rt=Me.marker||{},st=fe.marker||{},Qe=Fe.marker||{},Lt=rt.opacity,kt=st.opacity,qt=Qe.opacity,Zt=kt!==void 0,Sr=qt!==void 0;(x.isArrayOrTypedArray(Lt)||Zt||Sr)&&(_e.selectedOpacityFn=function(Ee){var Ve=Ee.mo===void 0?rt.opacity:Ee.mo;return Ee.selected?Zt?kt:Ve:Sr?qt:h*Ve});var xr=rt.color,jr=st.color,wr=Qe.color;(jr||wr)&&(_e.selectedColorFn=function(Ee){var Ve=Ee.mcc||xr;return Ee.selected?jr||Ve:wr||Ve});var Ir=rt.size,bt=st.size,Be=Qe.size,Ke=bt!==void 0,Ue=Be!==void 0;return t.traceIs(Me,"symbols")&&(Ke||Ue)&&(_e.selectedSizeFn=function(Ee){var Ve=Ee.mrc||Ir/2;return Ee.selected?Ke?bt/2:Ve:Ue?Be/2:Ve}),_e},l.makeSelectedTextStyleFns=function(Me){var _e={},fe=Me.selected||{},Fe=Me.unselected||{},rt=Me.textfont||{},st=fe.textfont||{},Qe=Fe.textfont||{},Lt=rt.color,kt=st.color,qt=Qe.color;return _e.selectedTextColorFn=function(Zt){var Sr=Zt.tc||Lt;return Zt.selected?kt||Sr:qt||(kt?Sr:r.addOpacity(Sr,h))},_e},l.selectedPointStyle=function(Me,_e){if(!(!Me.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",y(l.symbolNumber(Lt),kt,ut(Qe,_e),ee(Qe,_e))),Qe.mrc2=kt}),rt.length&&Me.each(function(st){for(var Qe=v.select(this),Lt=0;Lt0?fe:0}l.textPointStyle=function(Me,_e,fe){if(Me.size()){var Fe;if(_e.selectedpoints){var rt=l.makeSelectedTextStyleFns(_e);Fe=rt.selectedTextColorFn}var st=_e.texttemplate,Qe=fe._fullLayout;Me.each(function(Lt){var kt=v.select(this),qt=st?x.extractOption(Lt,_e,"txt","texttemplate"):x.extractOption(Lt,_e,"tx","text");if(!qt&&qt!==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||{};qt=x.texttemplateString(qt,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(qt).call(n.convertToTspans,fe).call(F,wr,Ir,Lt.mrc)})}},l.selectedTextStyle=function(Me,_e){if(!(!Me.size()||!_e.selectedpoints)){var fe=l.makeSelectedTextStyleFns(_e);Me.each(function(Fe){var rt=v.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(Me,_e){if(Me.length<3)return"M"+Me.join("L");var fe="M"+Me[0],Fe=[],rt;for(rt=1;rt=kt||Ee>=Zt&&Ee<=kt)&&(Ve<=Sr&&Ve>=qt||Ve>=Sr&&Ve<=qt)&&(Me=[Ee,Ve])}return Me}l.applyBackoff=H,l.makeTester=function(){var Me=x.ensureSingleById(v.select("body"),"svg","js-plotly-tester",function(fe){fe.attr(o.svgAttrs).style({position:"absolute",left:"-10000px",top:"-10000px",width:"9000px",height:"9000px","z-index":"1"})}),_e=x.ensureSingle(Me,"path","js-reference-point",function(fe){fe.attr("d","M0,0H1V1H0Z").style({"stroke-width":0,fill:"black"})});l.tester=Me,l.testref=_e},l.savedBBoxes={};var $=0,J=1e4;l.bBox=function(Me,_e,fe){fe||(fe=X(Me));var Fe;if(fe){if(Fe=l.savedBBoxes[fe],Fe)return x.extendFlat({},Fe)}else if(Me.childNodes.length===1){var rt=Me.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 qt,Zt;_e?qt=Me:(Zt=l.tester.node(),qt=Me.cloneNode(!0),Zt.appendChild(qt)),v.select(qt).attr("transform",null).call(n.positionText,0,0);var Sr=qt.getBoundingClientRect(),xr=l.testref.node().getBoundingClientRect();_e||Zt.removeChild(qt);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(Me){var _e=Me.getAttribute("data-unformatted");if(_e!==null)return _e+Me.getAttribute("data-math")+Me.getAttribute("text-anchor")+Me.getAttribute("style")}l.setClipUrl=function(Me,_e,fe){Me.attr("clip-path",oe(_e,fe))};function oe(Me,_e){if(!Me)return null;var fe=_e._context,Fe=fe._exportedPlot?"":fe._baseUrl||"";return Fe?"url('"+Fe+"#"+Me+"')":"url(#"+Me+")"}l.getTranslate=function(Me){var _e=/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,fe=Me.attr?"attr":"getAttribute",Fe=Me[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(Me,_e,fe){var Fe=/(\btranslate\(.*?\);?)/,rt=Me.attr?"attr":"getAttribute",st=Me.attr?"attr":"setAttribute",Qe=Me[rt]("transform")||"";return _e=_e||0,fe=fe||0,Qe=Qe.replace(Fe,"").trim(),Qe+=a(_e,fe),Qe=Qe.trim(),Me[st]("transform",Qe),Qe},l.getScale=function(Me){var _e=/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,fe=Me.attr?"attr":"getAttribute",Fe=Me[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(Me,_e,fe){var Fe=/(\bscale\(.*?\);?)/,rt=Me.attr?"attr":"getAttribute",st=Me.attr?"attr":"setAttribute",Qe=Me[rt]("transform")||"";return _e=_e||1,fe=fe||1,Qe=Qe.replace(Fe,"").trim(),Qe+="scale("+_e+","+fe+")",Qe=Qe.trim(),Me[st]("transform",Qe),Qe};var ne=/\s*sc.*/;l.setPointGroupScale=function(Me,_e,fe){if(_e=_e||1,fe=fe||1,!!Me){var Fe=_e===1&&fe===1?"":"scale("+_e+","+fe+")";Me.each(function(){var rt=(this.getAttribute("transform")||"").replace(ne,"");rt+=Fe,rt=rt.trim(),this.setAttribute("transform",rt)})}};var j=/translate\([^)]*\)\s*$/;l.setTextPointsScale=function(Me,_e,fe){Me&&Me.each(function(){var Fe,rt=v.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(Me,_e){var fe;return Me&&(fe=Me.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(Me,_e){var fe=_e[0],Fe=_e[1];return[fe*ce(Me)-Fe*be(Me),fe*be(Me)+Fe*ce(Me)]}var ze,Re,We,it,ot,tt;function ut(Me,_e){var fe=Me.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(Me.lonlat);Fe=Qe[0],rt=Qe[1]}else{var Lt=_e._xA,kt=_e._yA;if(Lt&&kt)Fe=Lt.c2p(Me.x),rt=kt.c2p(Me.y);else return 90}if(_e._geo){var qt=Me.lonlat[0],Zt=Me.lonlat[1],Sr=_e._geo.project([qt,Zt+1e-5]),xr=_e._geo.project([qt+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=qt/180*Math.PI,Be=Zt/180*Math.PI,Ke=ze/180*Math.PI,Ue=Re/180*Math.PI,Ee=Ke-bt,Ve=ce(Ue)*be(Ee),Ce=be(Ue)*ce(Be)-ce(Ue)*be(Be)*ce(Ee);Ir=-re(Ve,Ce)-Math.PI,ze=qt,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&&Me.i===ot+1)&&(fe=null)}if(st==="previous"&&!_e._geo)if(tt===_e.uid&&Me.i===ot+1&&M(Fe)&&M(rt)){var at=Fe-We,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 We=Fe,it=rt,ot=Me.i,tt=_e.uid,fe}l.getMarkerAngle=ut}}),Zg=Ze({"src/components/titles/index.js"(Z,q){"use strict";var v=Oi(),x=is(),A=xc(),M=oo(),e=ca(),t=e.strTranslate,r=as(),i=Yi(),a=fu(),n=Zm(),o=mh().OPPOSITE_SIDE,s=/ [XY][0-9]* /,c=1.6,h=1.6;function m(d,T,l){var _=d._fullLayout,w=l.propContainer,S=l.propName,E=l.placeholder,g=l.traceIndex,b=l.avoid||{},p=l.attributes,u=l.transform,y=l.containerGroup,f=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,se=F.shadow,he=l.subtitlePropName,H=!!he,$=l.subtitlePlaceholder,J=(w.title||{}).subtitle||{text:"",font:{}},X=J.text.trim(),oe=!1,ne=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,We=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=d._context.edits[ot];function ut(xr,jr){return xr===void 0||jr===void 0?!1:xr.replace(s," % ")===jr.replace(s," % ")}L===""?f=0:ut(L,E)&&(tt||(L=""),f=.2,z=!0),H&&(X===""?ne=0:ut(X,$)&&(tt||(X=""),ne=.2,oe=!0)),l._meta?L=e.templateString(L,l._meta):_._meta&&(L=e.templateString(L,_._meta));var Me=L||X||tt,_e;y||(y=e.ensureSingle(_._infolayer,"g","g-"+T),_e=_._hColorbarMoveTitle);var fe=y.selectAll("text."+T).data(Me?[0]:[]);fe.enter().append("text"),fe.text(L).attr("class",T),fe.exit().remove();var Fe=null,rt=T+"-subtitle",st=X||tt;if(H&&st&&(Fe=y.selectAll("text."+rt).data(st?[0]:[]),Fe.enter().append("text"),Fe.text(X).attr("class",rt),Fe.exit().remove()),!Me)return y;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=v.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",f*i.opacity(I)).call(r.font,{color:i.rgb(I),size:v.round(O,2),family:B,weight:N,style:U,variant:W,textcase:Q,shadow:se,lineposition:ue}).attr(p).call(a.convertToTspans,d,bt),wr){var Be=y.select("."+T+"-math-group"),Ke=jr.node().getBBox(),Ue=Be.node()?Be.node().getBBox():void 0,Ee=Ue?Ue.y+Ue.height+c*re:Ke.y+Ke.height+h*re,Ve=e.extendFlat({},p,{y:Ee});wr.attr("transform",Ir),wr.style("opacity",ne*i.opacity(ce)).call(r.font,{color:i.rgb(ce),size:v.round(re,2),family:ee,weight:be,style:Ae,variant:ze,textcase:Re,shadow:it,lineposition:We}).attr(Ve).call(a.convertToTspans,d)}return A.previousPromises(d)}function kt(xr){var jr=xr.title,wr=v.select(jr.node().parentNode);if(b&&b.selection&&b.side&&L){wr.attr("transform",null);var Ir=o[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},Ee=d._fullLayout._reservedMargin;for(var Ve in Ee)for(var Ce in Ee[Ve]){var Te=Ee[Ve][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 qt(xr,jr){xr.text(jr).on("mouseover.opacity",function(){v.select(this).transition().duration(n.SHOW_PLACEHOLDER).style("opacity",1)}).on("mouseout.opacity",function(){v.select(this).transition().duration(n.HIDE_PLACEHOLDER).style("opacity",0)})}if(tt&&(L?fe.on(".opacity",null):(qt(fe,E),z=!0),fe.call(a.makeEditable,{gd:d}).on("edit",function(xr){g!==void 0?M.call("_guiRestyle",d,S,xr,g):M.call("_guiRelayout",d,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)}),H)){if(H&&!L){var Zt=fe.node().getBBox(),Sr=Zt.y+Zt.height+h*re;Fe.attr("y",Sr)}X?Fe.on(".opacity",null):(qt(Fe,$),oe=!0),Fe.call(a.makeEditable,{gd:d}).on("edit",function(xr){M.call("_guiRelayout",d,"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),y}q.exports={draw:m,SUBTITLE_PADDING_EM:h,SUBTITLE_PADDING_MATHJAX_EM:c}}}),wv=Ze({"src/plots/cartesian/set_convert.js"(Z,q){"use strict";var v=Oi(),x=Np().utcFormat,A=ca(),M=A.numberFormat,e=is(),t=A.cleanNumber,r=A.ms2DateTime,i=A.dateTime2ms,a=A.ensureNumber,n=A.isArrayOrTypedArray,o=Vs(),s=o.FP_SAFE,c=o.BADNUM,h=o.LOG_CLIP,m=o.ONEWEEK,d=o.ONEDAY,T=o.ONEHOUR,l=o.ONEMIN,_=o.ONESEC,w=$c(),S=kh(),E=S.HOUR_PATTERN,g=S.WEEKDAY_PATTERN;function b(u){return Math.pow(10,u)}function p(u){return u!=null}q.exports=function(y,f){f=f||{};var P=y._id||"x",L=P.charAt(0);function z(X,oe){if(X>0)return Math.log(X)/Math.LN10;if(X<=0&&oe&&y.range&&y.range.length===2){var ne=y.range[0],j=y.range[1];return .5*(ne+j-2*h*Math.abs(ne-j))}else return c}function F(X,oe,ne,j){if((j||{}).msUTC&&e(X))return+X;var ee=i(X,ne||y.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=i(new Date(ce))+re/10}else return c;return ee}function B(X,oe,ne){return r(X,oe,ne||y.calendar)}function O(X){return y._categories[Math.round(X)]}function I(X){if(p(X)){if(y._categoriesMap===void 0&&(y._categoriesMap={}),y._categoriesMap[X]!==void 0)return y._categoriesMap[X];y._categories.push(typeof X=="number"?String(X):X);var oe=y._categories.length-1;return y._categoriesMap[X]=oe,oe}return c}function N(X,oe){for(var ne=new Array(oe),j=0;jy.range[1]&&(ne=!ne);for(var j=ne?-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=y._B[re]||0;return isFinite(ze)?ue(X,y._m2,ze):0},H=function(X){var oe=y._rangebreaks.length;if(!oe)return se(X,y._m,y._b);for(var ne=0,j=0;jy._rangebreaks[j].pmax&&(ne=j+1);return se(X,y._m2,y._B[ne])}}y.c2l=y.type==="log"?z:a,y.l2c=y.type==="log"?b:a,y.l2p=he,y.p2l=H,y.c2p=y.type==="log"?function(X,oe){return he(z(X,oe))}:he,y.p2c=y.type==="log"?function(X){return b(H(X))}:H,["linear","-"].indexOf(y.type)!==-1?(y.d2r=y.r2d=y.d2c=y.r2c=y.d2l=y.r2l=t,y.c2d=y.c2r=y.l2d=y.l2r=a,y.d2p=y.r2p=function(X){return y.l2p(t(X))},y.p2d=y.p2r=H,y.cleanPos=a):y.type==="log"?(y.d2r=y.d2l=function(X,oe){return z(t(X),oe)},y.r2d=y.r2c=function(X){return b(t(X))},y.d2c=y.r2l=t,y.c2d=y.l2r=a,y.c2r=z,y.l2d=b,y.d2p=function(X,oe){return y.l2p(y.d2r(X,oe))},y.p2d=function(X){return b(H(X))},y.r2p=function(X){return y.l2p(t(X))},y.p2r=H,y.cleanPos=a):y.type==="date"?(y.d2r=y.r2d=A.identity,y.d2c=y.r2c=y.d2l=y.r2l=F,y.c2d=y.c2r=y.l2d=y.l2r=B,y.d2p=y.r2p=function(X,oe,ne){return y.l2p(F(X,0,ne))},y.p2d=y.p2r=function(X,oe,ne){return B(H(X),oe,ne)},y.cleanPos=function(X){return A.cleanDate(X,c,y.calendar)}):y.type==="category"?(y.d2c=y.d2l=I,y.r2d=y.c2d=y.l2d=O,y.d2r=y.d2l_noadd=W,y.r2c=function(X){var oe=Q(X);return oe!==void 0?oe:y.fraction2r(.5)},y.l2r=y.c2r=a,y.r2l=Q,y.d2p=function(X){return y.l2p(y.r2c(X))},y.p2d=function(X){return O(H(X))},y.r2p=y.d2p,y.p2r=H,y.cleanPos=function(X){return typeof X=="string"&&X!==""?X:a(X)}):y.type==="multicategory"&&(y.r2d=y.c2d=y.l2d=O,y.d2r=y.d2l_noadd=W,y.r2c=function(X){var oe=W(X);return oe!==void 0?oe:y.fraction2r(.5)},y.r2c_just_indices=U,y.l2r=y.c2r=a,y.r2l=W,y.d2p=function(X){return y.l2p(y.r2c(X))},y.p2d=function(X){return O(H(X))},y.r2p=y.d2p,y.p2r=H,y.cleanPos=function(X){return Array.isArray(X)||typeof X=="string"&&X!==""?X:a(X)},y.setupMultiCategory=function(X){var oe=y._traceIndices,ne,j,ee=y._matchGroup;if(ee&&y._categories.length===0){for(var re in ee)if(re!==P){var ce=f[w.id2name(re)];oe=oe.concat(ce._traceIndices)}}var be=[[0,{}],[0,{}]],Ae=[];for(ne=0;nece[1]&&(j[re?0:1]=ne),j[0]===j[1]){var be=y.l2r(oe),Ae=y.l2r(ne);if(oe!==void 0){var ze=be+1;ne!==void 0&&(ze=Math.min(ze,Ae)),j[re?1:0]=ze}if(ne!==void 0){var Re=Ae+1;oe!==void 0&&(Re=Math.max(Re,be)),j[re?0:1]=Re}}}},y.cleanRange=function(X,oe){y._cleanRange(X,oe),y.limitRange(X)},y._cleanRange=function(X,oe){oe||(oe={}),X||(X="range");var ne=A.nestedProperty(y,X).get(),j,ee;if(y.type==="date"?ee=A.dfltRange(y.calendar):L==="y"?ee=S.DFLTRANGEY:y._name==="realaxis"?ee=[0,1]:ee=oe.dfltRange||S.DFLTRANGEX,ee=ee.slice(),(y.rangemode==="tozero"||y.rangemode==="nonnegative")&&(ee[0]=0),!ne||ne.length!==2){A.nestedProperty(y,X).set(ee);return}var re=ne[0]===null,ce=ne[1]===null;for(y.type==="date"&&!y.autorange&&(ne[0]=A.cleanDate(ne[0],c,y.calendar),ne[1]=A.cleanDate(ne[1],c,y.calendar)),j=0;j<2;j++)if(y.type==="date"){if(!A.isDateTime(ne[j],y.calendar)){y[X]=ee;break}if(y.r2l(ne[0])===y.r2l(ne[1])){var be=A.constrain(y.r2l(ne[0]),A.MIN_MS+1e3,A.MAX_MS-1e3);ne[0]=y.l2r(be-1e3),ne[1]=y.l2r(be+1e3);break}}else{if(!e(ne[j]))if(!(re||ce)&&e(ne[1-j]))ne[j]=ne[1-j]*(j?10:.1);else{y[X]=ee;break}if(ne[j]<-s?ne[j]=-s:ne[j]>s&&(ne[j]=s),ne[0]===ne[1]){var Ae=Math.max(1,Math.abs(ne[0]*1e-6));ne[0]-=Ae,ne[1]+=Ae}}},y.setScale=function(X){var oe=f._size;if(y.overlaying){var ne=w.getFromId({_fullLayout:f},y.overlaying);y.domain=ne.domain}var j=X&&y._r?"_r":"range",ee=y.calendar;y.cleanRange(j);var re=y.r2l(y[j][0],ee),ce=y.r2l(y[j][1],ee),be=L==="y";if(be?(y._offset=oe.t+(1-y.domain[1])*oe.h,y._length=oe.h*(y.domain[1]-y.domain[0]),y._m=y._length/(re-ce),y._b=-y._m*ce):(y._offset=oe.l+y.domain[0]*oe.w,y._length=oe.w*(y.domain[1]-y.domain[0]),y._m=y._length/(ce-re),y._b=-y._m*re),y._rangebreaks=[],y._lBreaks=0,y._m2=0,y._B=[],y.rangebreaks){var Ae,ze;if(y._rangebreaks=y.locateBreaks(Math.min(re,ce),Math.max(re,ce)),y._rangebreaks.length){for(Ae=0;Aece&&(Re=!Re),Re&&y._rangebreaks.reverse();var We=Re?-1:1;for(y._m2=We*y._length/(Math.abs(ce-re)-y._lBreaks),y._B.push(-y._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(ne=0;ne_*2}function o(h){return Math.max(1,(h-1)/1e3)}function s(h,m){for(var d=h.length,T=o(d),l=0,_=0,w={},S=0;Sl*2}function c(h){return M(h[0])&&M(h[1])}}}),Yd=Ze({"src/plots/cartesian/autorange.js"(Z,q){"use strict";var v=Oi(),x=is(),A=ca(),M=Vs().FP_SAFE,e=oo(),t=as(),r=$c(),i=r.getFromId,a=r.isLinked;q.exports={applyAutorangeOptions:y,getAutoRange:n,makePadFn:s,doAutoRange:d,findExtremes:T,concatExtremes:m};function n(f,P){var L,z,F=[],B=f._fullLayout,O=s(B,P,0),I=s(B,P,1),N=m(f,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>ne?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(ut,Me){return Math.max(ut,I(Me))}if(Q===ue){var We=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,We),Math.max(1,it)]:F=[We,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-o(P,ee.val,re.val))/(oe-O(ce)-I(be)),F=[ce.val-j*O(ce),be.val+j*I(be)];return F=y(F,P),P.limitRange&&P.limitRange(),he&&F.reverse(),A.simpleMap(F,P.l2r||Number)}function o(f,P,L){var z=0;if(f.rangebreaks)for(var F=f.locateBreaks(P,L),B=0;B0?L.ppadplus:L.ppadminus)||L.ppad||0),ee=ne((f._m>0?L.ppadminus:L.ppadplus)||L.ppad||0),re=ne(L.vpadplus||L.vpad),ce=ne(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(f,P,L,z){w(f,P,L,z,E)}function _(f,P,L,z){w(f,P,L,z,g)}function w(f,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)&&(f.splice(N,1),N--)}if(I){var W=B&&P===0;f.push({val:P,pad:W?0:L,extrapad:W?!1:O})}}function S(f){return x(f)&&Math.abs(f)=P}function b(f,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(f,P.d2l(L.clipmin)):f}function p(f,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(f,P.d2l(L.clipmax)):f}function u(f,P,L){return P!==void 0&&L!==void 0?(P=f.d2l(P),L=f.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 v=Oi(),x=is(),A=xc(),M=oo(),e=ca(),t=e.strTranslate,r=fu(),i=Zg(),a=Yi(),n=as(),o=Wh(),s=lS(),c=Vs(),h=c.ONEMAXYEAR,m=c.ONEAVGYEAR,d=c.ONEMINYEAR,T=c.ONEMAXQUARTER,l=c.ONEAVGQUARTER,_=c.ONEMINQUARTER,w=c.ONEMAXMONTH,S=c.ONEAVGMONTH,E=c.ONEMINMONTH,g=c.ONEWEEK,b=c.ONEDAY,p=b/2,u=c.ONEHOUR,y=c.ONEMIN,f=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,se=Q.CAP_SHIFT,he=Q.LINE_SPACING,H=Q.OPPOSITE_SIDE,$=3,J=q.exports={};J.setConvert=wv();var X=a1(),oe=$c(),ne=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*g&&da===2*b&&(xt.dtick=g):aa===2*g&&da===3*b?xt.dtick=g:aa===g&&!(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>=d?aa>=d&&aa<=h?fa=aa:fa=m:Nr===l&&da>=_?aa>=_&&aa<=T?fa=aa:fa=l:da>=E?aa>=E&&aa<=w?fa=aa:fa=S:Nr===g&&da>=g?fa=g: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,na=0,Ca=0;Cag&&(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 Zn=!Da;Da?(ct._dtickInit=ct.dtick,ct._tick0Init=ct.tick0):(ct.minor._dtickInit=ct.minor.dtick,ct.minor._tick0Init=ct.minor.tick0);var Pn=Da?ct:e.extendFlat({},ct,ct.minor);if(Zn?J.prepMinorTicks(Pn,ct,Nr):J.prepTicks(Pn,Nr),Pn.tickmode==="array"){Da?(Ca=[],kr=Fe(ct,!Zn)):(Fa=[],na=Fe(ct,!Zn));continue}if(Pn.tickmode==="sync"){Ca=[],kr=fe(ct);continue}var fi=ce(aa),Ai=fi[0],ki=fi[1],zi=x(Pn.dtick),Xi=Or==="log"&&!(zi||Pn.dtick.charAt(0)==="L"),to=J.tickFirst(Pn,Nr);if(Da){if(ct._tmin=to,to=ki:pi<=ki;pi=J.tickIncrement(pi,Ts,da,Rr)){if(Da&&Jo++,Pn.rangebreaks&&!da){if(pi=It)break}if(Ca.length>dr||pi===go)break;go=pi;var Po={value:pi};Da?(Xi&&pi!==(pi|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);yn(so,ct.tickformat)||(Ur=!1)}if(!Ur)Ya=Ca;else{var qi=Ca.concat(Fa);Gr&&Ca.length&&(qi=qi.slice(1)),qi=qi.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=qi.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;jn--){if(Ca[jn].drop){Ca.splice(jn,1);continue}Ca[jn].value=ra(Ca[jn].value,ct);var uo=ct.c2p(Ca[jn].value);(Ci?Bs>uo-tl:BsIt||$iIt&&(al.periodX=It),$iRr&&Itm)ct/=m,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>y?xt.dtick=Sr(ct,y,Qe):Lr>f?xt.dtick=Sr(ct,f,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>=y&&Rr<=16||ct>=u)xt._tickround="M";else if(ct>=f&&Rr<=19||ct>=y)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"?qt:kt,Ur=xt+Rr*.01,aa=e.roundUp(e.mod(Ur,1),Kr,Nr);return Math.floor(Ur)+Math.log(v.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 na=String(ct.text).charAt(0);(na==="0"||na==="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=Ee(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 Ee(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 Ve=["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+=Ve[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&&rn(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),rn(ct,kr,Or,!0),rn(ct,ct.shift||0,Or,!1)}(Nr.skipTitle!==!0||ct._shift===void 0)&&(ct._shift=nn(ct,Or));var na=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?$i.bottom-As:0,al))));var xu=0,zl=0;if(ct._shiftPusher&&(xu=Math.max(al,$i.height>0?po==="l"?As-$i.left:$i.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],nu=typeof ct._shift=="number"?ct._shift:0;if(da==="x"){if(po==="b"?zs[po]=ct._depth:(zs[po]=ct._depth=Math.max($i.width>0?As-$i.top:0,al),Ns.reverse()),$i.width>0){var Eu=$i.right-(ct._offset+ct._length);Eu>0&&(zs.xr=1,zs.r=Eu);var Bc=ct._offset-$i.left;Bc>0&&(zs.xl=0,zs.l=Bc)}}else if(po==="l"?(ct._depth=Math.max($i.height>0?As-$i.left:0,al),zs[po]=ct._depth-nu):(ct._depth=Math.max($i.height>0?$i.right-As:0,al),zs[po]=ct._depth+nu,Ns.reverse()),$i.height>0){var Cu=$i.bottom-(ct._offset+ct._length);Cu>0&&(zs.yb=0,zs.b=Cu);var Af=ct._offset-$i.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]]))}Si&&(fl=M.getComponentMethod("rangeslider","autoMarginOpts")(xt,ct)),typeof ct.automargin=="string"&&(at(zs,ct.automargin),at(au,ct.automargin)),A.autoMargin(xt,kn(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*se,It+=(xt.linewidth||0)/2),(Lr||Gr)&&(fa+=(xt.linewidth||0)/2,It+=$),Ur&&da==="top"&&(It-=dr*(1-se)),(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(go){return Or.indexOf(go)!==-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,na=It?xt.ticklen:0;if(fa?na*=-1:da&&(na=0),It&&(dr+=na,Nr)){var Ca=e.deg2rad(Nr);dr=na*Math.cos(Ca)+1,kr=na*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,Zn,Pn=0,fi=xt.side,Ai=xt._id.charAt(0),ki=xt.tickangle,zi;if(Ai==="x")zi=!fa&&fi==="bottom"||fa&&fi==="top",Zn=zi?1:-1,fa&&(Zn*=-1),Ya=kr*Zn,ha=ct+dr*Zn,Da=zi?1:-.2,Math.abs(ki)===90&&(fa?Da+=ue:ki===-90&&fi==="bottom"?Da=se:ki===90&&fi==="top"?Da=ue:Da=.5,Pn=ue/2*(ki/90)),Fa.xFn=function(go){return go.dx+Ya+Pn*go.fontSize},Fa.yFn=function(go){return go.dy+ha+go.fontSize*Da},Fa.anchorFn=function(go,pi){if(da){if(Kr)return"end";if(Ur)return"start"}return!x(pi)||pi===0||pi===180?"middle":pi*Zn<0!==fa?"end":"start"},Fa.heightFn=function(go,pi,Jo){return pi<-60||pi>60?-.5*Jo:xt.side==="top"!==fa?-Jo:0};else if(Ai==="y"){if(zi=!fa&&fi==="left"||fa&&fi==="right",Zn=zi?1:-1,fa&&(Zn*=-1),Ya=dr,ha=kr*Zn,Da=0,!fa&&Math.abs(ki)===90&&(ki===-90&&fi==="left"||ki===90&&fi==="right"?Da=se:Da=.5),fa){var Xi=x(ki)?+ki:0;if(Xi!==0){var to=e.deg2rad(Xi);Pn=Math.abs(Math.sin(to))*se*Zn,Da=0}}Fa.xFn=function(go){return go.dx+ct-(Ya+go.fontSize*Da)*Zn+Pn*go.fontSize},Fa.yFn=function(go){return go.dy+ha+go.fontSize*ue},Fa.anchorFn=function(go,pi){return x(pi)&&Math.abs(pi)===90?"middle":zi?"end":"start"},Fa.heightFn=function(go,pi,Jo){return xt.side==="right"&&(pi*=-1),pi<-30?-Jo:pi<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(v.select(this),Gr.minor?ct.minor.tickcolor:ct.tickcolor)}).style("stroke-width",function(Gr){return n.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 na=kr?It:dr;if(na){var Ca=na.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(v.select(this),Fa.minor?ct.minor.gridcolor:ct.gridcolor||"#ddd")}).style("stroke-dasharray",function(Fa){return n.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 ne(Gr.id,Kr.id)})}),Lr.attr("transform",Nr.transFn).attr("d",Nr.path).call(a.stroke,ct.zerolinecolor||a.defaultLine).style("stroke-width",n.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 qi=v.select(this),To=xt._promises.length;qi.call(r.positionText,Ur.xFn(so),Ur.yFn(so)).call(n.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(qi,aa)})):dr(qi,aa)}),Ha(ct,[U]),fa.exit().remove(),Nr.repositionOnUpdate&&fa.each(function(so){v.select(this).select("text").call(r.positionText,Ur.xFn(so),Ur.yFn(so))});function dr(so,qi){so.each(function(To){var Vo=v.select(this),Oo=Vo.select(".text-math-group"),lo=Ur.anchorFn(To,qi),Co=Nr.transFn.call(Vo.node(),To)+(x(qi)&&+qi!=0?" rotate("+qi+","+Ur.xFn(To)+","+(Ur.yFn(To)-To.fontSize/2)+")":""),os=r.lineCount(Vo),Ys=he*To.fontSize,Os=Ur.heightFn(To,x(qi)?+qi:0,(os-1)*Ys);if(Os&&(Co+=t(0,Os)),Oo.empty()){var Yo=Vo.select("text");Yo.attr({transform:Co,"text-anchor":lo}),Yo.style("display",null),ct._adjustTickLabelsOverflow&&ct._adjustTickLabelsOverflow()}else{var jn=n.bBox(Oo.node()).width,Ci=jn*{end:-.5,start:.5}[lo];Oo.attr("transform",Co+t(Ci,0))}})}ct._adjustTickLabelsOverflow=function(){var so=ct.ticklabeloverflow;if(!(!so||so==="allow")){var qi=so.indexOf("hide")!==-1,To=ct._id.charAt(0)==="x",Vo=0,Oo=To?xt._fullLayout.width:xt._fullLayout.height;if(so.indexOf("domain")!==-1){var lo=e.simpleMap(ct.range,ct.r2l);Vo=ct.l2p(lo[0])+ct._offset,Oo=ct.l2p(lo[1])+ct._offset}var Co=Math.min(Vo,Oo),os=Math.max(Vo,Oo),Ys=ct.side,Os=1/0,Yo=-1/0;fa.each(function(Bs){var uo=v.select(this),$s=uo.select(".text-math-group");if($s.empty()){var ms=n.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 na=null;function Ca(){if(dr(fa,aa),Kr.length&&ct.autotickangles&&(ct.type!=="log"||String(ct.dtick).charAt(0)!=="D")){na=ct.autotickangles[0];var so=0,qi=[],To,Vo=1;fa.each(function(zs){so=Math.max(so,zs.fontSize);var au=ct.l2p(zs.x),fl=en(this),xu=n.bBox(fl.node());Vo=Math.max(Vo,r.lineCount(fl)),qi.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*Vo,Os=Math.sqrt(Math.pow(os,2)+Math.pow(Ys,2)),Yo=os/Os,jn=ct.autotickangles.map(function(zs){return zs*Math.PI/180}),Ci=jn.find(function(zs){return Math.abs(Math.cos(zs))<=Yo});Ci===void 0&&(Ci=jn.reduce(function(zs,au){return Math.abs(Math.cos(zs))Xo*Jo&&(to=Jo,ki[Ai]=zi[Ai]=go[Ai])}var Ts=Math.abs(to-Xi);Ts-Zn>0?(Ts-=Zn,Zn*=1+Zn/Ts):Zn=0,ct._id.charAt(0)!=="y"&&(Zn=-Zn),ki[fi]=ha.p2r(ha.r2p(zi[fi])+Pn*Zn),ha.autorange==="min"||ha.autorange==="max reversed"?(ki[0]=null,ha._rangeInitial0=void 0,ha._rangeInitial1=void 0):(ha.autorange==="max"||ha.autorange==="min reversed")&&(ki[1]=null,ha._rangeInitial0=void 0,ha._rangeInitial1=void 0),Or._insideTickLabelsUpdaterange[ha._name+".range"]=ki}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",n.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*(se+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*se:(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 na=ct._selections[ct._id+"tick"];if(kr={selection:na,side:ct.side},na&&na.node()&&na.node().parentNode){var Ca=n.getTranslate(na.node().parentNode);kr.offsetLeft=Ca.x,kr.offsetTop=Ca.y}ct.title.hasOwnProperty("standoff")&&(kr.pad=0)}return ct._titleStandoff=Gr,i.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)||!Qa(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>=f:/%M/.test(ct)?xt>=y:/%[HI]/.test(ct)?xt>=u:/%p/.test(ct)?xt>=p:/%[Aadejuwx]/.test(ct)?xt>=b:/%[UVW]/.test(ct)?xt>=g:/%[Bbm]/.test(ct)?xt>=E:/%[q]/.test(ct)?xt>=_:/%[Yy]/.test(ct)?xt>=d:!0}}}),fS=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 i=x("autorangeoptions.minallowed",t===null?e:void 0),a=x("autorangeoptions.maxallowed",e===null?t:void 0);i===void 0&&x("autorangeoptions.clipmin"),a===void 0&&x("autorangeoptions.clipmax"),x("autorangeoptions.include")}}}),hS=Ze({"src/plots/cartesian/range_defaults.js"(Z,q){"use strict";var v=fS();q.exports=function(A,M,e,t){var r=M._template||{},i=M.type||r.type||"-";e("minallowed"),e("maxallowed");var a=e("range");if(!a){var n;!t.noInsiderange&&i!=="log"&&(n=e("insiderange"),n&&(n[0]===null||n[1]===null)&&(M.insiderange=!1,n=void 0),n&&(a=e("range",n)))}var o=M.getAutorangeDflt(a,t),s=e("autorange",o),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||(o=M.getAutorangeDflt(a,t),s=e("autorange",o)),s&&(v(e,s,a),(i==="linear"||i==="-")&&e("rangemode")),M.cleanRange()}}}),lO=Ze({"node_modules/mouse-event-offset/index.js"(Z,q){var v={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,i=M.clientY||0,a=A(e);return t[0]=r-a.left,t[1]=i-a.top,t}function A(M){return M===window||M===document||M===document.body?v:M.getBoundingClientRect()}}}),x2=Ze({"node_modules/has-passive-events/index.js"(Z,q){"use strict";var v=aS();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=v&&x()}}),uO=Ze({"src/components/dragelement/align.js"(Z,q){"use strict";q.exports=function(x,A,M,e,t){var r=(x-M)/(e-M),i=r+A/(e-M),a=(r+i)/2;return t==="left"||t==="bottom"?r:t==="center"||t==="middle"?a:t==="right"||t==="top"?i:r<2/3-a?r:i>4/3-a?i:a}}}),cO=Ze({"src/components/dragelement/cursor.js"(Z,q){"use strict";var v=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=v.constrain(Math.floor(M*3),0,2),r==="bottom"?e=0:r==="middle"?e=1:r==="top"?e=2:e=v.constrain(Math.floor(e*3),0,2),x[e][M]}}}),fO=Ze({"src/components/dragelement/unhover.js"(Z,q){"use strict";var v=Qy(),x=g2(),A=T_().getGraphDiv,M=w_(),e=q.exports={};e.wrapped=function(t,r,i){t=A(t),t._fullLayout&&x.clear(t._fullLayout._uid+M.HOVERID),e.raw(t,r,i)},e.raw=function(r,i){var a=r._fullLayout,n=r._hoverdata;i||(i={}),!(i.target&&!r._dragged&&v.triggerHandler(r,"plotly_beforehover",i)===!1)&&(a._hoverlayer.selectAll("g").remove(),a._hoverlayer.selectAll("line").remove(),a._hoverlayer.selectAll("circle").remove(),r._hoverdata=void 0,i.target&&n&&r.emit("plotly_unhover",{event:i,points:n}))}}}),bp=Ze({"src/components/dragelement/index.js"(Z,q){"use strict";var v=lO(),x=nS(),A=x2(),M=ca().removeElement,e=kh(),t=q.exports={};t.align=uO(),t.getCursor=cO();var r=fO();t.unhover=r.wrapped,t.unhoverRaw=r.raw,t.init=function(o){var s=o.gd,c=1,h=s._context.doubleClickDelay,m=o.element,d,T,l,_,w,S,E,g;s._mouseDownTime||(s._mouseDownTime=0),m.style.pointerEvents="all",m.onmousedown=u,A?(m._ontouchstart&&m.removeEventListener("touchstart",m._ontouchstart),m._ontouchstart=u,m.addEventListener("touchstart",u,{passive:!1})):m.ontouchstart=u;function b(P,L,z){return Math.abs(P)"u"&&typeof P.clientY>"u"&&(P.clientX=d,P.clientY=T),l=new Date().getTime(),l-s._mouseDownTimeh&&(c=Math.max(c-1,1)),s._dragged)o.doneFn&&o.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)})),o.clickFn&&o.clickFn(c,L),g||E.dispatchEvent(new MouseEvent("click",P))}s._dragging=!1,s._dragged=!1}};function i(){var n=document.createElement("div");n.className="dragcover";var o=n.style;return o.position="fixed",o.left=0,o.right=0,o.top=0,o.bottom=0,o.zIndex=999999999,o.background="none",document.body.appendChild(n),n}t.coverSlip=i;function a(n){return v(n.changedTouches?n.changedTouches[0]:n,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)}}}),hO=Ze({"src/lib/override_cursor.js"(Z,q){"use strict";var v=Kd(),x="data-savedcursor",A="!!";q.exports=function(e,t){var r=e.attr(x);if(t){if(!r){for(var i=(e.attr("class")||"").split(" "),a=0;a(a==="legend"?1:0));if(P===!1&&(o[a]=void 0),!(P===!1&&!c.uirevision)&&(m("uirevision",o.uirevision),P!==!1)){m("borderwidth");var L=m("orientation"),z=m("yref"),F=m("xref"),B=L==="h",O=z==="paper",I=F==="paper",N,U,W,Q="left";B?(N=0,v.getComponentMethod("rangeslider","isVisible")(n.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,h,{x:{valType:"number",editType:"legend",min:I?-2:0,max:I?3:1,dflt:N}},"x"),x.coerce(c,h,{y:{valType:"number",editType:"legend",min:O?-2:0,max:O?3:1,dflt:U}},"y"),m("traceorder",b),r.isGrouped(o[a])&&m("tracegroupgap"),m("entrywidth"),m("entrywidthmode"),m("indentation"),m("itemsizing"),m("itemwidth"),m("itemclick"),m("itemdoubleclick"),m("groupclick"),m("xanchor",Q),m("yanchor",W),m("maxheight"),m("valign"),x.noneOrAll(c,h,["x","y"]);var ue=m("title.text");if(ue){m("title.side",B?"left":"top");var se=x.extendFlat({},d,{size:x.bigFont(d.size)});x.coerceFont(m,"title.font",se)}}}}q.exports=function(n,o,s){var c,h=s.slice(),m=o.shapes;if(m)for(c=0;cP&&(f=P)}u[d][0]._groupMinRank=f,u[d][0]._preGroupSort=d}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),d=0;d0)oe=$.width;else return 0;return p?X:Math.min(oe,J)};S.each(function(H){var $=v.select(this),J=A.ensureSingle($,"g","layers");J.style("opacity",H[0].trace.opacity);var X=g.indentation,oe=g.valign,ne=H[0].lineHeight,j=H[0].height;if(oe==="middle"&&X===0||!ne||!j)J.attr("transform",null);else{var ee={top:1,bottom:-1}[oe],re=ee*(.5*(ne-j+3))||0,ce=g.indentation;J.attr("transform",M(ce,re))}var be=J.selectAll("g.legendfill").data([H]);be.enter().append("g").classed("legendfill",!0);var Ae=J.selectAll("g.legendlines").data([H]);Ae.enter().append("g").classed("legendlines",!0);var ze=J.selectAll("g.legendsymbols").data([H]);ze.enter().append("g").classed("legendsymbols",!0),ze.selectAll("g.legendpoints").data([H]).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(H){var $=l(H),J=$.showFill,X=$.showLine,oe=$.showGradientLine,ne=$.showGradientFill,j=$.anyFill,ee=$.anyLine,re=H[0],ce=re.trace,be,Ae,ze=r(ce),Re=ze.colorscale,We=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(We),Re,"fill")}},ot=function(Fe){if(Fe.size()){var rt="legendline-"+ce.uid;e.lineGroupStyle(Fe),e.gradient(Fe,E,rt,T(We),Re,"stroke")}},tt=i.hasMarkers(ce)||!j?"M5,0":ee?"M5,-2":"M5,-3",ut=v.select(this),Me=ut.select(".legendfill").selectAll("path").data(J||ne?[H]:[]);if(Me.enter().append("path").classed("js-fill",!0),Me.exit().remove(),Me.attr("d",tt+"h"+u+"v6h-"+u+"z").call(it),X||oe){var _e=P(void 0,ce.line,m,c);Ae=A.minExtend(ce,{line:{width:_e}}),be=[A.minExtend(re,{trace:Ae})]}var fe=ut.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(H){var $=l(H),J=$.anyFill,X=$.anyLine,oe=$.showLine,ne=$.showMarker,j=H[0],ee=j.trace,re=!ne&&!X&&!J&&i.hasText(ee),ce,be;function Ae(Me,_e,fe,Fe){var rt=A.nestedProperty(ee,Me).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(Me){return j._distinct&&j.index&&Me[j.index]?Me[j.index]:Me[0]}if(ne||re||oe){var Re={},We={};if(ne){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],h),We.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var it=Ae("marker.size",A.mean,[2,16],s);Re.ms=it,We.marker.size=it}oe&&(We.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,We),be.selectedpoints=null,be.texttemplate=null}var ot=v.select(this).select("g.legendpoints"),tt=ot.selectAll("path.scatterpts").data(ne?ce:[]);tt.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform",f),tt.exit().remove(),tt.call(e.pointStyle,be,E),ne&&(ce[0].mrc=3);var ut=ot.selectAll("g.pointtext").data(re?ce:[]);ut.enter().append("g").classed("pointtext",!0).append("text").attr("transform",f),ut.exit().remove(),ut.selectAll("text").call(e.textPointStyle,be,E)}function F(H){var $=H[0].trace,J=$.type==="waterfall";if(H[0]._distinct&&J){var X=H[0].trace[H[0].dir].marker;return H[0].mc=X.color,H[0].mlw=X.line.width,H[0].mlc=X.line.color,I(H,this,"waterfall")}var oe=[];$.visible&&J&&(oe=H[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 ne=v.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(oe);ne.enter().append("path").classed("legendwaterfall",!0).attr("transform",f).style("stroke-miterlimit",1),ne.exit().remove(),ne.each(function(j){var ee=v.select(this),re=$[j[0]].marker,ce=P(void 0,re.line,d,h);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(H){I(H,this)}function O(H){I(H,this,"funnel")}function I(H,$,J){var X=H[0].trace,oe=X.marker||{},ne=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=v.select($).select("g.legendpoints").selectAll("path.legend"+J).data(ee?[H]:[]);re.enter().append("path").classed("legend"+J,!0).attr("d",j).attr("transform",f),re.exit().remove(),re.each(function(ce){var be=v.select(this),Ae=ce[0],ze=P(Ae.mlw,oe.line,d,h);be.style("stroke-width",ze+"px");var Re=Ae.mcc;if(!g._inHover&&"mc"in Ae){var We=r(oe),it=We.mid;it===void 0&&(it=(We.max+We.min)/2),Re=e.tryColorscale(oe,"")(it)}var ot=Re||Ae.mc||oe.color,tt=oe.pattern,ut=e.getPatternAttr,Me=tt&&(ut(tt.shape,0,"")||ut(tt.path,0,""));if(Me){var _e=ut(tt.bgcolor,0,null),fe=ut(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,Me,rt,st,Re,tt.fillmode,_e,fe,Fe)}else be.call(t.fill,ot);ze&&t.stroke(be,Ae.mlc||ne.color)})}function N(H){var $=H[0].trace,J=v.select(this).select("g.legendpoints").selectAll("path.legendbox").data($.visible&&x.traceIs($,"box-violin")?[H]:[]);J.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform",f),J.exit().remove(),J.each(function(){var X=v.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 ne=P(void 0,$.line,d,h);X.style("stroke-width",ne+"px").call(t.fill,$.fillcolor),ne&&t.stroke(X,$.line.color)}})}function U(H){var $=H[0].trace,J=v.select(this).select("g.legendpoints").selectAll("path.legendcandle").data($.visible&&$.type==="candlestick"?[H,H]:[]);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",f).style("stroke-miterlimit",1),J.exit().remove(),J.each(function(X,oe){var ne=v.select(this),j=$[oe?"increasing":"decreasing"],ee=P(void 0,j.line,d,h);ne.style("stroke-width",ee+"px").call(t.fill,j.fillcolor),ee&&t.stroke(ne,j.line.color)})}function W(H){var $=H[0].trace,J=v.select(this).select("g.legendpoints").selectAll("path.legendohlc").data($.visible&&$.type==="ohlc"?[H,H]:[]);J.enter().append("path").classed("legendohlc",!0).attr("d",function(X,oe){return oe?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"}).attr("transform",f).style("stroke-miterlimit",1),J.exit().remove(),J.each(function(X,oe){var ne=v.select(this),j=$[oe?"increasing":"decreasing"],ee=P(void 0,j.line,d,h);ne.style("fill","none").call(e.dashLine,j.line.dash,ee),ee&&t.stroke(ne,j.line.color)})}function Q(H){se(H,this,"pie")}function ue(H){se(H,this,"funnelarea")}function se(H,$,J){var X=H[0],oe=X.trace,ne=J?oe.visible&&oe.type===J:x.traceIs(oe,J),j=v.select($).select("g.legendpoints").selectAll("path.legend"+J).data(ne?[H]:[]);if(j.enter().append("path").classed("legend"+J,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",f),j.exit().remove(),j.size()){var ee=oe.marker||{},re=P(n(ee.line.width,X.pts),ee.line,d,h),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(H){var $=H[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=v.select(this).select("g.legendpoints").selectAll("path.legend3dandfriends").data(X);oe.enter().append("path").classed("legend3dandfriends",!0).attr("transform",f).style("stroke-miterlimit",1),oe.exit().remove(),oe.each(function(ne,j){var ee=v.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 We=ce.length;ze=j===0?ce[be?We-1:0][1]:j===1?ce[be?0:We-1][1]:ce[Math.floor((We-1)/2)][1]}}else{var Re=$.vertexcolor||$.facecolor||$.color;ze=A.isArrayOrTypedArray(Re)?Re[j]||Re[0]:Re}ee.attr("d",ne[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,g=i.hasLines(S),b=i.hasMarkers(S),p=S.visible&&S.fill&&S.fill!=="none",u=!1,y=!1;if(E){var f=E.coloring;f==="lines"?u=!0:g=f==="none"||f==="heatmap"||E.showlines,E.type==="constraint"?p=E._operation!=="=":(f==="fill"||f==="heatmap")&&(y=!0)}return{showMarker:b,showLine:g,showFill:p,showGradientLine:u,showGradientFill:y,anyLine:g||u,anyFill:p||y}}function _(w,S,E){return w&&A.isArrayOrTypedArray(w)?S:w>E?E:w}}}),gS=Ze({"src/components/legend/draw.js"(Z,q){"use strict";var v=Oi(),x=ca(),A=xc(),M=oo(),e=Qy(),t=bp(),r=as(),i=Yi(),a=fu(),n=pO(),o=vS(),s=mh(),c=s.LINE_SPACING,h=s.FROM_TL,m=s.FROM_BR,d=dO(),T=mS(),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,se=Q._infolayer.selectAll('[class^="legend"]');se.each(function(){var J=v.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(!H&&(!Q.showlegend||!$.length))return he.selectAll("."+ue).remove(),Q._topdefs.select("#"+se).remove(),A.autoMargin(N,ue);var re=x.ensureSingle(he,"g",ue,function(tt){H||tt.attr("pointer-events","all")}),ce=x.ensureSingleById(Q._topdefs,"clipPath",se,function(tt){tt.append("rect")}),be=x.ensureSingle(re,"rect","bg",function(tt){tt.attr("shape-rendering","crispEdges")});be.call(i.stroke,W.bordercolor).call(i.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),f(Re,Ae,N,W,_)):Ae.selectAll("."+ue+"titletext").remove();var We=x.ensureSingle(re,"rect","scrollbar",function(tt){tt.attr(o.scrollBarEnterAttrs).call(i.fill,o.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 ut=tt[0].trace;return M.traceIs(ut,"pie-like")?ee.indexOf(tt[0].label)!==-1?.5:1:ut.visible==="legendonly"?.5:1}).each(function(){v.select(this).call(p,N,W)}).call(T,N,W).each(function(){H||v.select(this).call(y,N,ue)}),x.syncOrAsync([A.previousPromises,function(){return z(N,it,ot,W)},function(){var tt=Q._size,ut=W.borderwidth,Me=W.xref==="paper",_e=W.yref==="paper";if(ze.text&&S(Re,W,ut),!H){var fe,Fe;Me?fe=tt.l+tt.w*W.x-h[B(W)]*W._width:fe=Q.width*W.x-h[B(W)]*W._width,_e?Fe=tt.t+tt.h*(1-W.y)-h[O(W)]*W._effHeight:Fe=Q.height*(1-W.y)-h[O(W)]*W._effHeight;var rt=F(N,ue,fe,Fe);if(rt)return;if(Q.margin.autoexpand){var st=fe,Qe=Fe;fe=Me?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(We.on(".drag",null),re.on("wheel",null),H||W._height<=W._maxHeight||N._context.staticPlot){var Lt=W._effHeight;H&&(Lt=W._height),be.attr({width:W._width-ut,height:Lt-ut,x:ut/2,y:ut/2}),r.setTranslate(Ae,0,0),ce.select("rect").attr({width:W._width-2*ut,height:Lt-2*ut,x:ut,y:ut}),r.setClipUrl(Ae,se,N),r.setRect(We,0,0,0,0),delete W._scrollY}else{var kt=Math.max(o.scrollBarMinHeight,W._effHeight*W._effHeight/W._height),qt=W._effHeight-kt-2*o.scrollBarMargin,Zt=W._height-W._effHeight,Sr=qt/Zt,xr=Math.min(W._scrollY||0,Zt);be.attr({width:W._width-2*ut+o.scrollBarWidth+o.scrollBarMargin,height:W._effHeight-ut,x:ut/2,y:ut/2}),ce.select("rect").attr({width:W._width-2*ut+o.scrollBarWidth+o.scrollBarMargin,height:W._effHeight-2*ut,x:ut,y:ut+xr}),r.setClipUrl(Ae,se,N),Ee(xr,kt,Sr),re.on("wheel",function(){xr=x.constrain(W._scrollY+v.event.deltaY/qt*Zt,0,Zt),Ee(xr,kt,Sr),xr!==0&&xr!==Zt&&v.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=v.behavior.drag().on("dragstart",function(){var at=v.event.sourceEvent;at.type==="touchstart"?jr=at.changedTouches[0].clientY:jr=at.clientY,Ir=xr}).on("drag",function(){var at=v.event.sourceEvent;at.buttons===2||at.ctrlKey||(at.type==="touchmove"?wr=at.changedTouches[0].clientY:wr=at.clientY,xr=bt(Ir,jr,wr),Ee(xr,kt,Sr))});We.call(Ke);var Ue=v.behavior.drag().on("dragstart",function(){var at=v.event.sourceEvent;at.type==="touchstart"&&(jr=at.changedTouches[0].clientY,Ir=xr)}).on("drag",function(){var at=v.event.sourceEvent;at.type==="touchmove"&&(wr=at.changedTouches[0].clientY,xr=Be(Ir,jr,wr),Ee(xr,kt,Sr))});Ae.call(Ue)}function Ee(at,yt,Tt){W._scrollY=N._fullLayout[ue]._scrollY=at,r.setTranslate(Ae,0,-at),r.setRect(We,W._width,o.scrollBarMargin+at*Tt,o.scrollBarWidth,yt),ce.select("rect").attr("y",ut+at)}if(N._context.edits.legendPosition){var Ve,Ce,Te,Pe;re.classed("cursor-move",!0),t.init({element:re.node(),gd:N,prepFn:function(at){if(at.target!==We.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),Ve=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(Ve!==void 0&&Ce!==void 0){var at={};at[ue+".x"]=Ve,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 g(N,U,W){var Q=N[0],ue=Q.width,se=U.entrywidthmode,he=Q.trace.legendwidth||U.entrywidth;return se==="fraction"?U._maxWidth*he:W+(he||ue)}function b(N,U,W,Q,ue){var se=W.data()[0][0].trace,he={event:ue,node:W.node(),curveNumber:se.index,expandedIndex:se.index,data:N.data,layout:N.layout,frames:N._transitionData._frames,config:N._context,fullData:N._fullData,fullLayout:N._fullLayout};se._group&&(he.group=se._group),M.traceIs(se,"pie-like")&&(he.label=W.datum()[0].label);var H=e.triggerHandler(N,"plotly_legendclick",he);if(Q===1){if(H===!1)return;U._clickTimeout=setTimeout(function(){N._fullLayout&&n(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&&H!==!1&&n(W,N,Q)}}function p(N,U,W){var Q=I(W),ue=N.data()[0][0],se=ue.trace,he=M.traceIs(se,"pie-like"),H=!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:se.name,se._meta&&(J=x.templateString(J,se._meta))));var oe=x.ensureSingle(N,"text",Q+"text");oe.attr("text-anchor","start").call(r.font,X).text(H?u(J,$):J);var ne=W.indentation+W.itemwidth+o.itemGap*2;a.positionText(oe,ne,0),H?oe.call(a.makeEditable,{gd:U,text:J}).call(f,N,U,W).on("edit",function(j){this.text(u(j,$)).call(f,N,U,W);var ee=ue.trace._fullInput||{},re={};return re.name=j,ee._isShape?M.call("_guiRelayout",U,"shapes["+se.index+"].name",re.name):M.call("_guiRestyle",U,re,se.index)}):f(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 y(N,U,W){var Q=U._context.doubleClickDelay,ue,se=1,he=x.ensureSingle(N,"rect",W+"toggle",function(H){U._context.staticPlot||H.style("cursor","pointer").attr("pointer-events","all"),H.call(i.fill,"rgba(0,0,0,0)")});U._context.staticPlot||(he.on("mousedown",function(){ue=new Date().getTime(),ue-U._legendMouseDownTimeQ&&(se=Math.max(se-1,1)),b(U,H,N,se,v.event)}}))}function f(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 se=N.select("g[class*=math-group]"),he=se.node(),H=I(W);W||(W=U._fullLayout[H]);var $=W.borderwidth,J;Q===_?J=W.title.font:ue.groupTitle?J=ue.groupTitle.font:J=W.font;var X=J.size*c,oe,ne;if(he){var j=r.bBox(he);oe=j.height,ne=j.width,Q===_?r.setTranslate(se,$,$+oe*.75):r.setTranslate(se,0,oe*.25)}else{var ee="."+H+(Q===_?"title":"")+"text",re=N.select(ee),ce=a.lineCount(re),be=re.node();if(oe=X*ce,ne=be?r.bBox(be).width:0,Q===_)W.title.side==="left"&&(ne+=o.itemGap*2),a.positionText(re,$+o.titlePad,$+X);else{var Ae=o.itemGap*2+W.indentation+W.itemwidth;ue.groupTitle&&(Ae=o.itemGap,ne-=W.indentation+W.itemwidth),a.positionText(re,Ae,-X*((ce-1)/2-.3))}}Q===_?(W._titleWidth=ne,W._titleHeight=oe):(ue.lineHeight=X,ue.height=Math.max(oe,16)+3,ue.width=ne)}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,se=I(Q);Q||(Q=ue[se]);var he=ue._size,H=l.isVertical(Q),$=l.isGrouped(Q),J=Q.entrywidthmode==="fraction",X=Q.borderwidth,oe=2*X,ne=o.itemGap,j=Q.indentation+Q.itemwidth+ne*2,ee=2*(X+ne),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:We}=Q,{maxheight:it}=Q,ot=ce||be||Re!=="v"||We!=="paper";it||(it=ot?.5:1);let tt=ot?ue.height:he.h;Q._maxHeight=Math.max(it>1?it:it*tt,30);var ut=0;Q._width=0,Q._height=0;var Me=L(Q);if(H)W.each(function(Ee){var Ve=Ee[0].height;r.setTranslate(this,X+Me[0],X+Me[1]+Q._height+Ve/2+ne),Q._height+=Ve,Q._width=Math.max(Q._width,Ee[0].width)}),ut=j+Q._width,Q._width+=ne+j+oe,Q._height+=ee,$&&(U.each(function(Ee,Ve){r.setTranslate(this,0,Ve*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(Ee){var Ve=g(Ee,Q,j);Qe=Math.max(Qe,Ve),Lt+=Ve}),ut=null;var kt=0;if($){var qt=0,Zt=0,Sr=0;U.each(function(){var Ee=0,Ve=0;v.select(this).selectAll("g.traces").each(function(Te){var Pe=g(Te,Q,j),at=Te[0].height;r.setTranslate(this,Me[0],Me[1]+X+ne+at/2+Ve),Ve+=at,Ee=Math.max(Ee,Pe),ze[Te[0].trace.legendgroup]=Ee});var Ce=Ee+ne;Zt>0&&Ce+X+Zt>Q._maxWidth?(kt=Math.max(kt,Zt),Zt=0,Sr+=qt+Ae,qt=Ve):qt=Math.max(qt,Ve),r.setTranslate(this,Zt,Sr),Zt+=Ce}),Q._width=Math.max(kt,Zt)+X,Q._height=Sr+qt+ee}else{var xr=W.size(),jr=Lt+oe+(xr-1)*ne=Q._maxWidth&&(kt=Math.max(kt,Be),Ir=0,bt+=wr,Q._height+=wr,wr=0),r.setTranslate(this,Me[0]+X+Ir,Me[1]+X+bt+Ve/2+ne),Be=Ir+Ce+ne,Ir+=Te,wr=Math.max(wr,Ve)}),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+Me[0],Q._titleWidth+2*(X+o.titlePad))),Q._height=Math.ceil(Math.max(Q._height+Me[1],Q._titleHeight+2*(X+o.itemGap))),Q._effHeight=Math.min(Q._height,Q._maxHeight);var Ke=N._context.edits,Ue=Ke.legendText||Ke.legendPosition;W.each(function(Ee){var Ve=v.select(this).select("."+se+"toggle"),Ce=Ee[0].height,Te=Ee[0].trace.legendgroup,Pe=g(Ee,Q,j);$&&Te!==""&&(Pe=ze[Te]);var at=Ue?j:ut||Pe;!H&&!J&&(at+=ne/2),r.setRect(Ve,0,-Ce/2,at,Ce)})}function F(N,U,W,Q){var ue=N._fullLayout,se=ue[U],he=B(se),H=O(se),$=se.xref==="paper",J=se.yref==="paper";N._fullLayout._reservedMargin[U]={};var X=se.y<.5?"b":"t",oe=se.x<.5?"l":"r",ne={r:ue.width-W,l:W+se._width,b:ue.height-Q,t:Q+se._effHeight};if($&&J)return A.autoMargin(N,U,{x:se.x,y:se.y,l:se._width*h[he],r:se._width*m[he],b:se._effHeight*m[H],t:se._effHeight*h[H]});$?N._fullLayout._reservedMargin[U][X]=ne[X]:J||se.orientation==="v"?N._fullLayout._reservedMargin[U][oe]=ne[oe]:N._fullLayout._reservedMargin[U][X]=ne[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"}}}),yS=Ze({"src/components/fx/hover.js"(Z){"use strict";var q=Oi(),v=is(),x=Ch(),A=ca(),M=A.pushUnique,e=A.strTranslate,t=A.strRotate,r=Qy(),i=fu(),a=hO(),n=as(),o=Yi(),s=bp(),c=Wo(),h=kh().zindexSeparator,m=oo(),d=Qp(),T=w_(),l=dS(),_=gS(),w=T.YANGLE,S=Math.PI*w/180,E=1/Math.sin(S),g=Math.cos(S),b=Math.sin(S),p=T.HOVERARROWSIZE,u=T.HOVERTEXTPAD,y={box:!0,ohlc:!0,violin:!0,candlestick:!0},f={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 qt=Math.min(rt,st),Zt=Math.max(rt,st),Sr=Math.min(Qe,Lt),xr=Math.max(Qe,Lt),jr=Fe.trace;if(m.traceIs(jr,"gl3d")){var wr=be._fullLayout[jr.scene]._scene.container,Ir=wr.offsetLeft,bt=wr.offsetTop;qt+=Ir,Zt+=Ir,Sr+=bt,xr+=bt}kt.bbox={x0:qt+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||o.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}}),We=!1,it=B(Re,{gd:be,hovermode:"closest",rotateLabels:We,bgColor:re.bgColor||o.background,container:q.select(re.container),outerContainer:re.outerContainer||re.container}),ot=it.hoverLabels,tt=5,ut=0,Me=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||Qa<0||Qa>Sr[0]._length)return s.unhoverRaw(j,ee)}if(ee.pointerX=Ra+Zt[0]._offset,ee.pointerY=Qa+Sr[0]._offset,"xval"in ee?Ue=d.flat(Ae,ee.xval):Ue=d.p2c(Zt,Ra),"yval"in ee?Ee=d.flat(Ae,ee.yval):Ee=d.p2c(Sr,Qa),!v(Ue[0])||!v(Ee[0]))return A.warn("Fx.hover failed",ee,j),s.unhoverRaw(j,ee)}var kn=1/0;function Jt(pi,Jo){for(Ce=0;CeQt&&(Be.splice(0,Qt),kn=Be[0].distance),tt&&bt!==0&&Be.length===0){rr.distance=bt,rr.index=!1;var qi=Pe._module.hoverPoints(rr,Ot,Gt,"closest",{hoverLayer:Re._hoverlayer});if(qi&&(qi=qi.filter(function(os){return os.spikeDistance<=bt})),qi&&qi.length){var To,Vo=qi.filter(function(os){return os.xa.showspikes&&os.xa.spikesnap!=="hovered data"});if(Vo.length){var Oo=Vo[0];v(Oo.x0)&&v(Oo.y0)&&(To=Kt(Oo),(!Tr.vLinePoint||Tr.vLinePoint.spikeDistance>To.spikeDistance)&&(Tr.vLinePoint=To))}var lo=qi.filter(function(os){return os.ya.showspikes&&os.ya.spikesnap!=="hovered data"});if(lo.length){var Co=lo[0];v(Co.x0)&&v(Co.y0)&&(To=Kt(Co),(!Tr.hLinePoint||Tr.hLinePoint.spikeDistance>To.spikeDistance)&&(Tr.hLinePoint=To))}}}}}Jt();function Nt(pi,Jo,Xo){for(var Ts=null,Po=1/0,so,qi=0;qi0&&Math.abs(pi.distance)Nr-1;aa--)Ur(Be[aa]);Be=Lr,ma()}var da=j._hoverdata,fa=[],It=X(j),dr=oe(j);for(Ve=0;Ve1||Be.length>1)||ut==="closest"&&la&&Be.length>1,zi=o.combine(Re.plot_bgcolor||o.background,Re.paper_bgcolor),Xi=B(Be,{gd:j,hovermode:ut,rotateLabels:ki,bgColor:zi,container:Re._hoverlayer,outerContainer:Re._paper.node(),commonLabelOpts:Re.hoverlabel,hoverdistance:Re.hoverdistance}),to=Xi.hoverLabels;if(d.isUnifiedHover(ut)||(I(to,ki,Re,Xi.commonLabelBoundingBox),W(to,ki,Re._invScaleX,Re._invScaleY)),be&&be.tagName){var go=m.getComponentMethod("annotations","hasClickToShow")(j,fa);a(q.select(be),go?"pointer":"")}!be||ce||!se(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:Ee}))}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,We=ee.outerContainer,it=ee.commonLabelOpts||{};if(j.length===0)return[[]];var ot=ee.fontFamily||T.HOVERFONT,tt=ee.fontSize||T.HOVERFONTSIZE,ut=ee.fontWeight||ce.font.weight,Me=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),qt=kt+"Label",Zt=st[qt];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 na,Ca,Fa;Lt.side==="right"?(na="start",Ca=1,Fa="",da=Qe._offset+Qe._length):(na="end",Ca=-1,Fa="-",da=Qe._offset),fa=Lt._offset+(st.y0+st.y1)/2,Or.attr("text-anchor",na),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,Zn;if(da=0?nn=ra:Ia+kn=0?nn=Ia:Ha+kn=0?yn=ta:ma+Jt=0?yn=ma:rn+Jt=0,(ct.idealAlign==="top"||!Ai)&&ki?(Fa-=ha/2,ct.anchor="end"):Ai?(Fa+=ha/2,ct.anchor="start"):ct.anchor="middle",ct.crossPos=Fa;else{if(ct.pos=Fa,Ai=Ca+Ya/2+fi<=wr,ki=Ca-Ya/2-fi>=0,(ct.idealAlign==="left"||!Ai)&&ki)Ca-=Ya/2,ct.anchor="end";else if(Ai)Ca+=Ya/2,ct.anchor="start";else{ct.anchor="middle";var zi=fi/2,Xi=Ca+zi-wr,to=Ca-zi;Xi>0&&(Ca-=Xi),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=H(j.name,j.nameLength));var We=re.charAt(0),it=We==="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[We+"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[We+"Label"]!==be&&(tt[We+"other"]=tt[We+"Val"],tt[We+"otherLabel"]=tt[We+"Label"]),Re=A.hovertemplateString(ot,tt,ce._d3locale,j.eventData[0]||{},j.trace._meta),Re=Re.replace(F,function(ut,Me){return ze=H(Me,j.nameLength),""})}return[Re,ze]}function I(j,ee,re,ce){var be=ee?"xa":"ya",Ae=ee?"ya":"xa",ze=0,Re=1,We=j.size(),it=new Array(We),ot=0,tt=ce.minX,ut=ce.maxX,Me=ce.minY,_e=ce.maxY,fe=function(Ue){return Ue*re._invScaleX},Fe=function(Ue){return Ue*re._invScaleY};j.each(function(Ue){var Ee=Ue[be],Ve=Ue[Ae],Ce=Ee._id.charAt(0)==="x",Te=Ee.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?Me!==void 0&&_e!==void 0&&Math.min(rr,_e)-Math.max(Gt,Me)>1&&(Ve.side==="left"?(Pe=Ve._mainLinePosition,at=re.width):at=Ve._mainLinePosition):tt!==void 0&&ut!==void 0&&Math.min(rr,ut)-Math.max(Gt,tt)>1&&(Ve.side==="top"?(Pe=Ve._mainLinePosition,at=re.height):at=Ve._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,Ee){return Ue[0].posref-Ee[0].posref||Re*(Ee[0].traceIndex-Ue[0].traceIndex)});var rt,st,Qe,Lt,kt,qt,Zt;function Sr(Ue){var Ee=Ue[0],Ve=Ue[Ue.length-1];if(st=Ee.pmin-Ee.pos-Ee.dp+Ee.size,Qe=Ve.pos+Ve.dp+Ve.size-Ee.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;LtEe.pmax&&Ce++;for(Lt=Ue.length-1;Lt>=0&&!(Ce<=0);Lt--)qt=Ue[Lt],qt.pos>Ee.pmax-1&&(qt.del=!0,Ce--);for(Lt=0;Lt=0;kt--)Ue[kt].dp-=Qe;for(Lt=Ue.length-1;Lt>=0&&!(Ce<=0);Lt--)qt=Ue[Lt],qt.pos+qt.dp+qt.size>Ee.pmax&&(qt.del=!0,Ce--)}}}for(;!rt&&ze<=We;){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*g),{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 We=Re.select("text.nums"),it=ze.anchor,ot=it==="end"?-1:1,tt=U(ze),ut=N(ze,ee),Me=ut.x,_e=ut.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+Me)+","+Ae(p+_e)+"v"+Ae(ze.by/2-p)+"h"+be(ot*ze.bx)+"v-"+Ae(ze.by)+"H"+be(ot*p+Me)+"V"+Ae(_e-p)+"Z":rt="M"+be(ot*p+Me)+","+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=Me+tt.textShiftX,Qe=_e+ze.ty0-ze.by/2+u,Lt=ze.textAlign||"auto";Lt!=="auto"&&(Lt==="left"&&it!=="start"?(We.attr("text-anchor","start"),st=fe?-ze.bx/2-ze.tx2width/2+u:-ze.bx-u):Lt==="right"&&it!=="end"&&(We.attr("text-anchor","end"),st=fe?ze.bx/2-ze.tx2width/2-u:ze.bx+u)),We.call(i.positionText,be(st),Ae(Qe)),ze.tx2width&&(Re.select("text.name").call(i.positionText,be(tt.text2ShiftX+tt.alignShift*u+Me),Ae(_e+ze.ty0-ze.by/2+u)),Re.select("rect").call(n.setRect,be(tt.text2ShiftX+(tt.alignShift-1)*ze.tx2width/2+Me),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(ut){return ut||v(ut)&&ut===0}var Re=Array.isArray(re)?function(ut,Me){var _e=A.castOption(be,re,ut);return ze(_e)?_e:A.extractOption({},ce,"",Me)}:function(ut,Me){return A.extractOption(Ae,ce,ut,Me)};function We(ut,Me,_e){var fe=Re(Me,_e);ze(fe)&&(j[ut]=fe)}if(We("hoverinfo","hi","hoverinfo"),We("bgcolor","hbg","hoverlabel.bgcolor"),We("borderColor","hbc","hoverlabel.bordercolor"),We("fontFamily","htf","hoverlabel.font.family"),We("fontSize","hts","hoverlabel.font.size"),We("fontColor","htc","hoverlabel.font.color"),We("fontWeight","htw","hoverlabel.font.weight"),We("fontStyle","hty","hoverlabel.font.style"),We("fontVariant","htv","hoverlabel.font.variant"),We("nameLength","hnl","hoverlabel.namelength"),We("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,We=!!ee.vLinePoint,it,ot;if(ce.selectAll(".spikeline").remove(),!!(We||Re)){var tt=o.combine(be.plot_bgcolor,be.paper_bgcolor);if(Re){var ut=ee.hLinePoint,Me,_e;it=ut&&ut.xa,ot=ut&&ut.ya;var fe=ot.spikesnap;fe==="cursor"?(Me=ze.pointerX,_e=ze.pointerY):(Me=it._offset+ut.x,_e=ot._offset+ut.y);var Fe=x.readability(ut.color,tt)<1.5?o.contrast(tt):ut.color,rt=ot.spikemode,st=ot.spikethickness,Qe=ot.spikecolor||Fe,Lt=c.getPxPosition(j,ot),kt,qt;if(rt.indexOf("toaxis")!==-1||rt.indexOf("across")!==-1){if(rt.indexOf("toaxis")!==-1&&(kt=Lt,qt=Me),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,qt=Ae.l+Sr*Ae.w}ce.insert("line",":first-child").attr({x1:kt,x2:qt,y1:_e,y2:_e,"stroke-width":st,stroke:Qe,"stroke-dasharray":n.dashStyle(ot.spikedash,st)}).classed("spikeline",!0).classed("crisp",!0),ce.insert("line",":first-child").attr({x1:kt,x2:qt,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(We){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?o.contrast(tt):xr.color,Be=it.spikemode,Ke=it.spikethickness,Ue=it.spikecolor||bt,Ee=c.getPxPosition(j,it),Ve,Ce;if(Be.indexOf("toaxis")!==-1||Be.indexOf("across")!==-1){if(Be.indexOf("toaxis")!==-1&&(Ve=Ee,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)),Ve=Ae.t+(1-Pe)*Ae.h,Ce=Ae.t+(1-Te)*Ae.h}ce.insert("line",":first-child").attr({x1:jr,x2:jr,y1:Ve,y2:Ce,"stroke-width":Ke,stroke:Ue,"stroke-dasharray":n.dashStyle(it.spikedash,Ke)}).classed("spikeline",!0).classed("crisp",!0),ce.insert("line",":first-child").attr({x1:jr,x2:jr,y1:Ve,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:Ee-(it.side!=="top"?Ke:-Ke),r:Ke,fill:Ue}).classed("spikeline",!0)}}}function se(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 H(j,ee){return i.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 v=32;q.exports={CIRCLE_SIDES:v,i000:0,i090:v/4,i180:v/2,i270:v/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 v=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(i){return x(t,i[r])}}function e(t){return v(t.xaxis._offset,t.yaxis._offset)}q.exports={p2r:x,r2p:A,axValue:M,getTransform:e}}}),tg=Ze({"src/components/shapes/draw_newshape/helpers.js"(Z){"use strict";var q=M_(),v=T2(),x=v.CIRCLE_SIDES,A=v.SQRT2,M=A2(),e=M.p2r,t=M.r2p,r=[0,3,4,5,6,1,2],i=[0,3,4,1,2];Z.writePaths=function(o){var s=o.length;if(!s)return"M0,0Z";for(var c="",h=0;h0&&_l&&(w="X"),w});return h>l&&(_=_.replace(/[\s,]*X.*/,""),v.log("Ignoring extra params in segment "+c)),m+_})}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}}}),bS=Ze({"src/components/shapes/display_labels.js"(Z,q){"use strict";var v=ca(),x=Wo(),A=fu(),M=as(),e=tg().readPaths,t=rg(),r=t.getPathString,i=d2(),a=mh().FROM_TL;q.exports=function(c,h,m,d){if(d.selectAll(".shape-label").remove(),!!(m.label.text||m.label.texttemplate)){var T;if(m.label.texttemplate){var l={};if(m.type!=="path"){var _=x.getFromId(c,m.xref),w=x.getFromId(c,m.yref);for(var S in i){var E=i[S](m,_,w);E!==void 0&&(l[S]=E)}}T=v.texttemplateStringForShapes(m.label.texttemplate,{},c._fullLayout._d3locale,l)}else T=m.label.text;var g={"data-index":h},b=m.label.font,p={"data-notex":1},u=d.append("g").attr(g).classed("shape-label",!0),y=u.append("text").attr(p).classed("shape-label-text",!0).text(T),f,P,L,z;if(m.path){var F=r(c,m),B=e(F,c);f=1/0,L=1/0,P=-1/0,z=-1/0;for(var O=0;O=s?d=c-m:d=m-c,-180/Math.PI*Math.atan2(d,T)}function o(s,c,h,m,d,T,l){var _=d.label.textposition,w=d.label.textangle,S=d.label.padding,E=d.type,g=Math.PI/180*T,b=Math.sin(g),p=Math.cos(g),u=d.label.xanchor,y=d.label.yanchor,f,P,L,z;if(E==="line"){_==="start"?(f=s,P=c):_==="end"?(f=h,P=m):(f=(s+h)/2,P=(c+m)/2),u==="auto"&&(_==="start"?w==="auto"?h>s?u="left":hs?u="right":hs?u="right":hs?u="left":h1&&!(tt.length===2&&tt[1][0]==="Z")&&(H===0&&(tt[0][0]="M"),f[he]=tt,B(),O())}}function ce(tt,ut){if(tt===2){he=+ut.srcElement.getAttribute("data-i"),H=+ut.srcElement.getAttribute("data-j");var Me=f[he];!T(Me)&&!l(Me)&&re()}}function be(tt){ue=[];for(var ut=0;utB&&Te>O&&!Ee.shiftKey?s.getCursor(Pe/Ce,1-at/Te):"move";c(f,yt),kt=yt.split("-")[0]}}function xr(Ee){l(y)||(I&&($=fe(P.xanchor)),N&&(J=Fe(P.yanchor)),P.type==="path"?Ae=P.path:(ue=I?P.x0:fe(P.x0),se=N?P.y0:Fe(P.y0),he=I?P.x1:fe(P.x1),H=N?P.y1:Fe(P.y1)),ueH?(X=se,ee="y0",oe=H,re="y1"):(X=H,ee="y1",oe=se,re="y0"),Sr(Ee),Be(z,P),Ue(f,P,y),Lt.moveFn=kt==="move"?Ir:bt,Lt.altKey=Ee.altKey)}function jr(){l(y)||(c(f),Ke(z),S(f,y,P),x.call("_guiRelayout",y,F.getUpdateObj()))}function wr(){l(y)||Ke(z)}function Ir(Ee,Ve){if(P.type==="path"){var Ce=function(at){return at},Te=Ce,Pe=Ce;I?Q("xanchor",P.xanchor=rt($+Ee)):(Te=function(yt){return rt(fe(yt)+Ee)},Re&&Re.type==="date"&&(Te=m.encodeDate(Te))),N?Q("yanchor",P.yanchor=st(J+Ve)):(Pe=function(yt){return st(Fe(yt)+Ve)},it&&it.type==="date"&&(Pe=m.encodeDate(Pe))),Q("path",P.path=g(Ae,Te,Pe))}else I?Q("xanchor",P.xanchor=rt($+Ee)):(Q("x0",P.x0=rt(ue+Ee)),Q("x1",P.x1=rt(he+Ee))),N?Q("yanchor",P.yanchor=st(J+Ve)):(Q("y0",P.y0=st(se+Ve)),Q("y1",P.y1=st(H+Ve)));f.attr("d",d(y,P)),Be(z,P),r(y,L,P,ze)}function bt(Ee,Ve){if(W){var Ce=function(za){return za},Te=Ce,Pe=Ce;I?Q("xanchor",P.xanchor=rt($+Ee)):(Te=function(en){return rt(fe(en)+Ee)},Re&&Re.type==="date"&&(Te=m.encodeDate(Te))),N?Q("yanchor",P.yanchor=st(J+Ve)):(Pe=function(en){return st(Fe(en)+Ve)},it&&it.type==="date"&&(Pe=m.encodeDate(Pe))),Q("path",P.path=g(Ae,Te,Pe))}else if(U){if(kt==="resize-over-start-point"){var at=ue+Ee,yt=N?se-Ve:se+Ve;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+Ee,Ot=N?H-Ve:H+Ve;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+Ve:X,Ba=Qt?oe+Ve:oe,Ra=Tr?ne+Ee:ne,Qa=la?j+Ee:j;N&&(rr&&(Ua=X-Ve),Qt&&(Ba=oe-Ve)),(!N&&Ba-Ua>O||N&&Ua-Ba>O)&&(Q(ee,P[ee]=N?Ua:st(Ua)),Q(re,P[re]=N?Ba:st(Ba))),Qa-Ra>B&&(Q(ce,P[ce]=I?Ra:rt(Ra)),Q(be,P[be]=I?Qa:rt(Qa)))}f.attr("d",d(y,P)),Be(z,P),r(y,L,P,ze)}function Be(Ee,Ve){(I||N)&&Ce();function Ce(){var Te=Ve.type!=="path",Pe=Ee.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?Ve.xanchor:A.midRange(Te?[Ve.x0,Ve.x1]:m.extractPathCoords(Ve.path,h.paramIsX))),Tt=Fe(N?Ve.yanchor:A.midRange(Te?[Ve.y0,Ve.y1]:m.extractPathCoords(Ve.path,h.paramIsY)));if(yt=m.roundPositionForSharpStrokeRendering(yt,at),Tt=m.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(Ee){Ee.selectAll(".visual-cue").remove()}function Ue(Ee,Ve,Ce){var Te=Ve.xref,Pe=Ve.yref,at=M.getFromId(Ce,Te),yt=M.getFromId(Ce,Pe),Tt="";Te!=="paper"&&!at.autorange&&(Tt+=Te),Pe!=="paper"&&!yt.autorange&&(Tt+=Pe),n.setClipUrl(Ee,Tt?"clip"+Ce._fullLayout._uid+Tt:null,Ce)}}function g(y,f,P){return y.replace(h.segmentRE,function(L){var z=0,F=L.charAt(0),B=h.paramIsX[F],O=h.paramIsY[F],I=h.numParams[F],N=L.substr(1).replace(h.paramRE,function(U){return z>=I||(B[z]?U=f(U):O[z]&&(U=P(U)),z++),U});return F+N})}function b(y,f){if(_(y)){var P=f.node(),L=+P.getAttribute("data-index");if(L>=0){if(L===y._fullLayout._activeShapeIndex){p(y);return}y._fullLayout._activeShapeIndex=L,y._fullLayout._deactivateShape=p,T(y)}}}function p(y){if(_(y)){var f=y._fullLayout._activeShapeIndex;f>=0&&(i(y),delete y._fullLayout._activeShapeIndex,T(y))}}function u(y){if(_(y)){i(y);var f=y._fullLayout._activeShapeIndex,P=(y.layout||{}).shapes||[];if(f1?(se=["toggleHover"],he=["resetViews"]):u?(ue=["zoomInGeo","zoomOutGeo"],se=["hoverClosestGeo"],he=["resetGeo"]):p?(se=["hoverClosest3d"],he=["resetCameraDefault3d","resetCameraLastSave3d"]):L?(ue=["zoomInMapbox","zoomOutMapbox"],se=["toggleHover"],he=["resetViewMapbox"]):z?(ue=["zoomInMap","zoomOutMap"],se=["toggleHover"],he=["resetViewMap"]):y?se=["hoverClosestPie"]:O?(se=["hoverClosestCartesian","hoverCompareCartesian"],he=["resetViewSankey"]):se=["toggleHover"],b&&se.push("toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"),(s(T)||N)&&(se=[]),b&&!I&&(ue=["zoomIn2d","zoomOut2d","autoScale2d"],he[0]!=="resetViews"&&(he=["resetScale2d"])),p?H=["zoom3d","pan3d","orbitRotation","tableRotation"]:b&&!I||P?H=["zoom2d","pan2d"]:L||z||u?H=["pan2d"]:F&&(H=["zoom2d"]),o(T)&&H.push("select2d","lasso2d");var $=[],J=function(j){$.indexOf(j)===-1&&se.indexOf(j)!==-1&&$.push(j)};if(Array.isArray(E)){for(var X=[],oe=0;oew?T.substr(w):l.substr(_))+S}function c(m,d){for(var T=d._size,l=T.h/T.w,_={},w=Object.keys(m),S=0;St*P&&!B)){for(w=0;wH&&rese&&(se=re);var be=(se-ue)/(2*he);u/=be,ue=g.l2r(ue),se=g.l2r(se),g.range=g._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=n.list(O,"",!0),Q,ue,se,he,H,$;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,Ee,Ve){var Ce=Ue._lw/2;if(Ue._id.charAt(0)==="x"){if(Ee){if(Ve==="top")return Ee._offset-U-Ce}else return N.t+N.h*(1-(Ue.position||0))+Ce%1;return Ee._offset+Ee._length+U+Ce}if(Ee){if(Ve==="right")return Ee._offset+Ee._length+U+Ce}else return N.l+N.w*(Ue.position||0)+Ce%1;return Ee._offset-U-Ce}for(Q=0;Q0){f(O,Q,H,he),se.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=o.LINE_SPACING*$+o.MID_SHIFT;I.y===0&&(J=-J),se.selectAll(".line").each(function(){var ee=+this.getAttribute("dy").slice(0,-2)-J+"em";this.setAttribute("dy",ee)})}var X=q.selectAll(".gtitle-subtitle");if(X.node()){var oe=se.node().getBBox(),ne=oe.y+oe.height,j=ne+i.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,se=N==="b"?Q-ue:ue;return A.isTopAnchor(I)&&N==="t"||A.isBottomAnchor(I)&&N==="b"?!1:se.5?"t":"b",ue=O._fullLayout.margin[Q],se=0;return I.yref==="paper"?se=N+I.pad.t+I.pad.b:I.yref==="container"&&(se=u(Q,U,W,O._fullLayout.height,N)+I.pad.t+I.pad.b),se>ue?se:0}function f(O,I,N,U){var W="title.automargin",Q=O._fullLayout.title,ue=Q.y>.5?"t":"b",se={x:Q.x,y:Q.y,t:0,b:0},he={};Q.yref==="paper"&&p(O,Q,ue,I,U)?se[ue]=N:Q.yref==="container"&&(he[ue]=N,O._fullLayout._reservedMargin[W]=he),x.allowAutoMargin(O,W),x.autoMargin(O,W,se)}function P(O,I){var N=O.title,U=O._size,W=0;switch(I===d?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===o.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"?o.CAP_SHIFT+.3+"em":O==="bottom"?"-0.3em":o.MID_SHIFT+"em"}function F(O){var I=O.title,N=T;return A.isRightAnchor(I)?N=l:A.isLeftAnchor(I)&&(N=d),N}function B(O){var I=O.title,N="0em";return A.isTopAnchor(I)?N=o.CAP_SHIFT+"em":A.isMiddleAnchor(I)&&(N=o.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,y).call(M.fill,u).call(e.dashLine,F?"solid":P,F?4+f:f);if(s(B,d,_),L){var O=t(d.layout,"selections",_);B.style({cursor:"move"});var I={element:B.node(),plotinfo:w,gd:d,editHelpers:O,isActiveSelection:!0},N=v(g,d);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(d,U)})}}function s(d,T,l){var _=l.xref+l.yref;e.setClipUrl(d,"clip"+T._fullLayout._uid+_,T)}function c(d,T){if(n(d)){var l=T.node(),_=+l.getAttribute("data-index");if(_>=0){if(_===d._fullLayout._activeSelectionIndex){m(d);return}d._fullLayout._activeSelectionIndex=_,d._fullLayout._deactivateSelection=m,a(d)}}}function h(d){if(n(d)){var T=d._fullLayout.selections.length-1;d._fullLayout._activeSelectionIndex=T,d._fullLayout._deactivateSelection=m,a(d)}}function m(d){if(n(d)){var T=d._fullLayout._activeSelectionIndex;T>=0&&(A(d),delete d._fullLayout._activeSelectionIndex,a(d))}}}}),AO=Ze({"node_modules/polybooljs/lib/build-log.js"(Z,q){function v(){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,i){return e("temp_status",{seg:t,above:r,below:i})},rewind:function(t){return e("rewind",{seg:t})},status:function(t,r,i){return e("status",{seg:t,above:r,below:i})},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=v}}),SO=Ze({"node_modules/polybooljs/lib/epsilon.js"(Z,q){function v(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],i=e[1],a=t[0],n=t[1],o=M[0],s=M[1];return(a-r)*(s-i)-(n-i)*(o-r)>=-x},pointBetween:function(M,e,t){var r=M[1]-e[1],i=t[0]-e[0],a=M[0]-e[0],n=t[1]-e[1],o=a*i+r*n;if(o-x)},pointsSameX:function(M,e){return Math.abs(M[0]-e[0])x!=a-r>x&&(i-s)*(r-c)/(a-c)+s-t>x&&(n=!n),i=s,a=c}return n}};return A}q.exports=v}}),MO=Ze({"node_modules/polybooljs/lib/linked-list.js"(Z,q){var v={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=v}}),EO=Ze({"node_modules/polybooljs/lib/intersecter.js"(Z,q){var v=MO();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 i=v.create();function a(T,l,_,w,S,E){var g=M.pointsCompare(l,S);return g!==0?g:M.pointsSame(_,E)?0:T!==w?T?1:-1:M.pointAboveOrOnLine(_,w?S:E,w?E:S)?1:-1}function n(T,l){i.insertBefore(T,function(_){var w=a(T.isStart,T.pt,l,_.isStart,_.pt,_.other.pt);return w<0})}function o(T,l){var _=v.node({isStart:!0,pt:T.start,seg:T,primary:l,other:null,status:null});return n(_,T.end),_}function s(T,l,_){var w=v.node({isStart:!1,pt:l.end,seg:l,primary:_,other:T,status:null});T.other=w,n(w,T.pt)}function c(T,l){var _=o(T,l);return s(_,T,l),_}function h(T,l){e&&e.segmentChop(T.seg,l),T.other.remove(),T.seg.end=l,T.other.pt=l,n(T.other,T.pt)}function m(T,l){var _=r(l,T.seg.end,T.seg);return h(T,l),c(_,T.primary)}function d(T,l){var _=v.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,se=U.end;e&&e.checkIntersection(N,U);var he=M.linesIntersect(W,Q,ue,se);if(he===!1){if(!M.pointsCollinear(W,Q,ue)||M.pointsSame(W,se)||M.pointsSame(Q,ue))return!1;var H=M.pointsSame(W,ue),$=M.pointsSame(Q,se);if(H&&$)return I;var J=!H&&M.pointBetween(W,ue,se),X=!$&&M.pointBetween(Q,ue,se);if(H)return X?m(I,Q):m(O,se),I;J&&($||(X?m(I,Q):m(O,se)),m(I,W))}else he.alongA===0&&(he.alongB===-1?m(O,ue):he.alongB===0?m(O,he.pt):he.alongB===1&&m(O,se)),he.alongB===0&&(he.alongA===-1?m(I,W):he.alongA===0?m(I,he.pt):he.alongA===1&&m(I,Q));return!1}for(var g=[];!i.isEmpty();){var b=i.getHead();if(e&&e.vert(b.pt[0]),b.isStart){let O=function(){if(y){var I=E(b,y);if(I)return I}return f?E(b,f):!1};var p=O;e&&e.segmentNew(b.seg,b.primary);var u=S(b),y=u.before?u.before.ev:null,f=u.after?u.after.ev:null;e&&e.tempStatus(b.seg,y?y.seg:!1,f?f.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(i.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,f?b.seg.myFill.below=f.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;f?b.primary===f.primary?z=f.seg.otherFill.above:z=f.seg.myFill.above:z=b.primary?l:T,b.seg.otherFill={above:z,below:z}}e&&e.status(b.seg,y?y.seg:!1,f?f.seg:!1),b.other.status=u.insert(v.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}g.push(b.seg)}i.getHead().remove()}return e&&e.done(),g}return A?{addRegion:function(T){for(var l,_=T[T.length-1],w=0;wr!=m>r&&t<(h-s)*(r-c)/(m-c)+s;d&&(i=!i)}return i}}}),P_=Ze({"src/lib/polygon.js"(Z,q){"use strict";var v=p2().dot,x=Vs().BADNUM,A=q.exports={};A.tester=function(e){var t=e.slice(),r=t[0][0],i=r,a=t[0][1],n=a,o;for((t[t.length-1][0]!==t[0][0]||t[t.length-1][1]!==t[0][1])&&t.push(t[0]),o=1;oi||S===x||Sn||_&&c(l))}function m(l,_){var w=l[0],S=l[1];if(w===x||wi||S===x||Sn)return!1;var E=t.length,g=t[0][0],b=t[0][1],p=0,u,y,f,P,L;for(u=1;uMath.max(y,g)||S>Math.max(f,b)))if(So||Math.abs(v(m,c))>i)return!0;return!1},A.filter=function(e,t){var r=[e[0]],i=0,a=0;function n(s){e.push(s);var c=r.length,h=i;r.splice(a+1);for(var m=h+1;m1){var o=e.pop();n(o)}return{addPt:n,raw:e,filtered:r}}}}),RO=Ze({"src/components/selections/constants.js"(Z,q){"use strict";q.exports={BENDPX:1.5,MINSELECT:12,SELECTDELAY:100,SELECTID:"-select"}}}),DO=Ze({"src/components/selections/select.js"(Z,q){"use strict";var v=PO(),x=IO(),A=oo(),M=as().dashStyle,e=Yi(),t=ef(),r=Qp().makeEventData,i=Jd(),a=i.freeMode,n=i.rectMode,o=i.drawMode,s=i.openMode,c=i.selectMode,h=rg(),m=k_(),d=M2(),T=Jm().clearOutline,l=tg(),_=l.handleEllipse,w=l.readPaths,S=S2().newShapes,E=xS(),g=ES().activateLastSelection,b=ca(),p=b.sorterAsc,u=P_(),y=g2(),f=$c().getFromId,P=C_(),L=L_().redrawReglTraces,z=RO(),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,Ee,Ve){var Ce=!Q(Ee),Te=a(Ve),Pe=n(Ve),at=s(Ve),yt=o(Ve),Tt=c(Ve),Ot=Ve==="drawline",Gt=Ve==="drawcircle",rr=Ot||Gt,Qt=Ee.gd,Tr=Qt._fullLayout,la=Tt&&Tr.newselection.mode==="immediate"&&Ce,Ua=Tr._zoomlayer,Ba=Ee.element.getBoundingClientRect(),Ra=Ee.plotinfo,Qa=W(Ra),za=Ke-Ba.left,en=Ue-Ba.top;Tr._calcInverseTransform(Qt);var kn=b.apply3DTransform(Tr._invTransform)(za,en);za=kn[0],en=kn[1];var Jt=Tr._invScaleX,Nt=Tr._invScaleY,Kt=za,Wt=en,Pr="M"+za+","+en,ta=Ee.xaxes[0],ma=Ee.yaxes[0],ra=ta._length,Ia=ma._length,Ha=Be.altKey&&!(o(Ve)&&at),rn,nn,yn,xt,ct,Nr,Or;X(Be,Qt,Ee),Te&&(rn=B([[za,en]],z.BENDPX));var Rr=Ua.selectAll("path.select-outline-"+Ra.id).data([1]),Lr=yt?Tr.newshape:Tr.newselection;yt&&(Ee.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",Qa).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",Qa).attr("d","M0,0Z");if(yt&&Ee.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,Ee.xaxes,Ee.yaxes,Ee.subplot);la&&!Be.shiftKey&&(Ee._clearSubplotSelections=function(){if(Ce){var kr=ta._id,na=ma._id;st(Qt,kr,na,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;y.done(da).then(function(){if(y.clear(da),kr===2){for(Rr.remove(),ct=0;ct-1&&se(na,Qt,Ee.xaxes,Ee.yaxes,Ee.subplot,Ee,Rr),Ca==="event"&&Ir(Qt,void 0);t.click(Qt,na,Ra.id)}).catch(b.error)}},Ee.doneFn=function(){Ur.remove(),y.done(da).then(function(){y.clear(da),!la&&xt&&Ee.selectionDefs&&(xt.subtract=Ha,Ee.selectionDefs.push(xt),Ee.mergedPolygons.length=0,[].push.apply(Ee.mergedPolygons,yn)),(la||yt)&&j(Ee,la),Ee.doneFnCompleted&&Ee.doneFnCompleted(fa),Tt&&Ir(Qt,Or)}).catch(b.error)}}function se(Be,Ke,Ue,Ee,Ve,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,Qa,za;if(be(Pe)){X(Be,Ke,Ce),Gt=re(Ke,Ue,Ee,Ve);var en=Ae(Pe,Gt),kn=en.pointNumbers.length>0;if(kn?Re(Gt,en):We(Gt)&&(Ba=ze(en))){for(Te&&Te.remove(),za=0;za=0}function ne(Be){return Be._fullLayout._activeSelectionIndex>=0}function j(Be,Ke){var Ue=Be.dragmode,Ee=Be.plotinfo,Ve=Be.gd;oe(Ve)&&Ve._fullLayout._deactivateShape(Ve),ne(Ve)&&Ve._fullLayout._deactivateSelection(Ve);var Ce=Ve._fullLayout,Te=Ce._zoomlayer,Pe=o(Ue),at=c(Ue);if(Pe||at){var yt=Te.selectAll(".select-outline-"+Ee.id);if(yt&&Ve._fullLayout._outlining){var Tt;Pe&&(Tt=S(yt,Be)),Tt&&A.call("_guiRelayout",Ve,{shapes:Tt});var Ot;at&&!Q(Be)&&(Ot=E(yt,Be)),Ot&&(Ve._fullLayout._noEmitSelectedAtStart=!0,A.call("_guiRelayout",Ve,{selections:Ot}).then(function(){Ke&&g(Ve)})),Ve._fullLayout._outlining=!1}}Ee.selection={},Ee.selection.selectionDefs=Be.selectionDefs=[],Ee.selection.mergedPolygons=Be.mergedPolygons=[]}function ee(Be){return Be._id}function re(Be,Ke,Ue,Ee){if(!Be.calcdata)return[];var Ve=[],Ce=Ke.map(ee),Te=Ue.map(ee),Pe,at,yt;for(yt=0;yt0,Ce=Ve?Ee[0]:Ue;return Ke.selectedpoints?Ke.selectedpoints.indexOf(Ce)>-1:!1}function Re(Be,Ke){var Ue=[],Ee,Ve,Ce,Te;for(Te=0;Te0&&Ue.push(Ee);if(Ue.length===1&&(Ce=Ue[0]===Ke.searchInfo,Ce&&(Ve=Ke.searchInfo.cd[0].trace,Ve.selectedpoints.length===Ke.pointNumbers.length))){for(Te=0;Te1||(Ke+=Ee.selectedpoints.length,Ke>1)))return!1;return Ke===1}function it(Be,Ke,Ue){var Ee;for(Ee=0;Ee-1&&Ke;if(!Te&&Ke){var kr=Lt(Be,!0);if(kr.length){var na=kr[0].xref,Ca=kr[0].yref;if(na&&Ca){var Fa=Zt(kr),Ya=xr([f(Be,na,"x"),f(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,Ee),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&&!Me&&nn(),ut)Kr.indexOf("select")>-1&&p(Lr,Gr,st,Qe,be.id,Tt),Kr.indexOf("event")>-1&&o.click(Gr,Lr,be.id);else if(Rr===1&&Me){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&&v.select(yt).call(i.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 na=Ur.d2r(kr);na!==void 0&&t.call("_guiRelayout",Gr,da,na)})}}h.init(Tt);var rr,Qt,Tr,la,Ua,Ba,Ra,Qa,za,en;function kn(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"+qt+"V"+Zt+"H0V0",Ba=!1,Ra="xy",en=!1,Qa=ue(tt,la,Lt,kt,Ua),za=se(tt,Lt,kt)}function Jt(Rr,Lr){if(ce._transitioningWithDuration)return!1;var Gr=Math.max(0,Math.min(qt,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/qt>aa/Zt?(aa=Ur*Zt/qt,Qt>Kr?Tr.t=Qt-aa:Tr.b=Qt+aa):(Ur=aa*qt/Zt,rr>Gr?Tr.l=rr-Ur:Tr.r=rr+Ur),za.attr("d",ne(Tr))):da();else if(xr.isSubplotConstrained)if(Ur>P||aa>P){Ra="xy";var fa=Math.min(Tr.l/qt,(Zt-Tr.b)/Zt),It=Math.max(Tr.r/qt,(Zt-Tr.t)/Zt);Tr.l=fa*qt,Tr.r=It*qt,Tr.b=(1-fa)*Zt,Tr.t=(1-It)*Zt,za.attr("d",ne(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 se(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,We){ce.attr("d",ze+"M"+Ae.l+","+Ae.t+"v"+Ae.h+"h"+Ae.w+"v-"+Ae.h+"h-"+Ae.w+"Z"),H(ce,be,Re,We)}function H(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){v.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 ne(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 We=!1,it={},ot={},tt,ut,Me,_e,fe=(Re||{}).xaHash,Fe=(Re||{}).yaHash,rt=0;rt1&&x.warn("Full array edits are incompatible with other edits",c);var w=n[""][""];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:(h(l,_),m(i),!0)}var S=Object.keys(n).map(Number).sort(A),E=a.get(),g=E||[],b=s(_,c).get(),p=[],u=-1,y=g.length,f,P,L,z,F,B,O,I;for(f=0;fg.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={}),g.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;f--)g.splice(p[f],1),b&&b.splice(p[f],1);if(g.length?E||a.set(g):a.set(null),T)return!1;if(h(l,_),d!==v){var N;if(u===-1)N=S;else{for(y=Math.max(g.length,y),N=[],f=0;f=u));f++)N.push(L);for(f=u;f0&&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,g=(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 n(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=d(_);w;){if(w in l)return!0;w=d(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],g=0;g<3;g++){var b=i(l,E,T[g]);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 y=p+".type";w[p]===void 0&&w[y]===void 0&&A.nestedProperty(l.layout,y).set(null)}}}}}),C2=Ze({"src/plot_api/plot_api.js"(Z){"use strict";var q=Oi(),v=is(),x=nS(),A=ca(),M=A.nestedProperty,e=Qy(),t=aO(),r=oo(),i=e1(),a=xc(),n=Wo(),o=hS(),s=Wh(),c=as(),h=Yi(),m=PS().initInteractions,d=vd(),T=Tf().clearOutline,l=Hg().dfltConfig,_=BO(),w=NO(),S=L_(),E=pc(),g=kh().AX_NAME_PATTERN,b=0,p=5;function u(Ee,Ve,Ce,Te){var Pe;if(Ee=A.getGraphDiv(Ee),e.init(Ee),A.isPlainObject(Ve)){var at=Ve;Ve=at.data,Ce=at.layout,Te=at.config,Pe=at.frames}var yt=e.triggerHandler(Ee,"plotly_beforeplot",[Ve,Ce,Te]);if(yt===!1)return Promise.reject();!Ve&&!Ce&&!A.isPlotDiv(Ee)&&A.warn("Calling _doPlot as if redrawing but this container doesn't yet have a plot.",Ee);function Tt(){if(Pe)return Z.addFrames(Ee,Pe)}z(Ee,Te),Ce||(Ce={}),q.select(Ee).classed("js-plotly-plot",!0),c.makeTester(),Array.isArray(Ee._promises)||(Ee._promises=[]);var Ot=(Ee.data||[]).length===0&&Array.isArray(Ve);Array.isArray(Ve)&&(w.cleanData(Ve),Ot?Ee.data=Ve:Ee.data.push.apply(Ee.data,Ve),Ee.empty=!1),(!Ee.layout||Ot)&&(Ee.layout=w.cleanLayout(Ce)),a.supplyDefaults(Ee);var Gt=Ee._fullLayout,rr=Gt._has("cartesian");Gt._replotting=!0,(Ot||Gt._shouldCreateBgLayer)&&(Ue(Ee),Gt._shouldCreateBgLayer&&delete Gt._shouldCreateBgLayer),c.initGradients(Ee),c.initPatterns(Ee),Ot&&n.saveShowSpikeInitial(Ee);var Qt=!Ee.calcdata||Ee.calcdata.length!==(Ee._fullData||[]).length;Qt&&a.doCalcdata(Ee);for(var Tr=0;Tr=Ee.data.length||Pe<-Ee.data.length)throw new Error(Ce+" must be valid indices for gd.data.");if(Ve.indexOf(Pe,Te+1)>-1||Pe>=0&&Ve.indexOf(-Ee.data.length+Pe)>-1||Pe<0&&Ve.indexOf(Ee.data.length+Pe)>-1)throw new Error("each index in "+Ce+" must be unique.")}}function N(Ee,Ve,Ce){if(!Array.isArray(Ee.data))throw new Error("gd.data must be an array.");if(typeof Ve>"u")throw new Error("currentIndices is a required argument.");if(Array.isArray(Ve)||(Ve=[Ve]),I(Ee,Ve,"currentIndices"),typeof Ce<"u"&&!Array.isArray(Ce)&&(Ce=[Ce]),typeof Ce<"u"&&I(Ee,Ce,"newIndices"),typeof Ce<"u"&&Ve.length!==Ce.length)throw new Error("current and new indices must be of equal length.")}function U(Ee,Ve,Ce){var Te,Pe;if(!Array.isArray(Ee.data))throw new Error("gd.data must be an array.");if(typeof Ve>"u")throw new Error("traces must be defined.");for(Array.isArray(Ve)||(Ve=[Ve]),Te=0;Te"u")throw new Error("indices must be an integer or array of integers");I(Ee,Ce,"indices");for(var at in Ve){if(!Array.isArray(Ve[at])||Ve[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!==Ve[at].length))throw new Error("when maxPoints is set as a key:value object it must contain a 1:1 corrispondence with the keys and number of traces in the update object")}}function Q(Ee,Ve,Ce,Te){var Pe=A.isPlainObject(Te),at=[],yt,Tt,Ot,Gt,rr;Array.isArray(Ce)||(Ce=[Ce]),Ce=O(Ce,Ee.data.length-1);for(var Qt in Ve)for(var Tr=0;Tr=0&&rr=0&&rr"u")return Gt=Z.redraw(Ee),t.add(Ee,Pe,yt,at,Tt),Gt;Array.isArray(Ce)||(Ce=[Ce]);try{N(Ee,Te,Ce)}catch(rr){throw Ee.data.splice(Ee.data.length-Ve.length,Ve.length),rr}return t.startSequence(Ee),t.add(Ee,Pe,yt,at,Tt),Gt=Z.moveTraces(Ee,Te,Ce),t.stopSequence(Ee),Gt}function J(Ee,Ve){Ee=A.getGraphDiv(Ee);var Ce=[],Te=Z.addTraces,Pe=J,at=[Ee,Ce,Ve],yt=[Ee,Ve],Tt,Ot;if(typeof Ve>"u")throw new Error("indices must be an integer or array of integers.");for(Array.isArray(Ve)||(Ve=[Ve]),I(Ee,Ve,"indices"),Ve=O(Ve,Ee.data.length-1),Ve.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("."),rn=M(Ee.layout,Ha).get(),nn=M(Te,Ha).get(),yn=Wt.get();if(Pr!==void 0){Qa[Kt]=Pr,za[Kt]=ra==="reverse"?Pr:ne(yn);var xt=i.getLayoutValObject(Te,Wt.parts);if(xt&&xt.impliedEdits&&Pr!==null)for(var ct in xt.impliedEdits)en(A.relativeAttr(Kt,ct),xt.impliedEdits[ct]);if(["width","height"].indexOf(Kt)!==-1)if(Pr){en("autosize",null);var Nr=Kt==="height"?"width":"height";en(Nr,Te[Nr])}else Te[Kt]=Ee._initialAutoSize[Kt];else if(Kt==="autosize")en("width",Pr?null:Te.width),en("height",Pr?null:Te.height);else if(Ia.match(Re))Nt(Ia),M(Te,Ha+"._inputRange").set(null);else if(Ia.match(We)){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=rn;var Rr=nn.type==="linear"&&Pr==="log",Lr=nn.type==="log"&&Pr==="linear";if(Rr||Lr){if(!Jt||!Jt.range)en(Ha+".autorange",!0);else if(nn.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&&en(Ha+".autorange",!0),Gr<=0?Gr=Kr/1e6:Kr<=0&&(Kr=Gr/1e6),en(Ha+".range[0]",Math.log(Gr)/Math.LN10),en(Ha+".range[1]",Math.log(Kr)/Math.LN10)):(en(Ha+".range[0]",Math.pow(10,Gr)),en(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")(Ee,nn,Pr,en),r.getComponentMethod("images","convertCoords")(Ee,nn,Pr,en)}else en(Ha+".autorange",!0),en(Ha+".range",null);M(Te,Ha+"._inputRange").set(null)}else if(ra.match(g)){var Ur=M(Te,Kt).get(),aa=(Pr||{}).type;(!aa||aa==="-")&&(aa="linear"),r.getComponentMethod("annotations","convertCoords")(Ee,Ur,aa,en),r.getComponentMethod("images","convertCoords")(Ee,Ur,aa,en)}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",Ve)),E.update(Ra,It),Gt[rr]||(Gt[rr]={});var dr=Gt[rr][Qt];dr||(dr=Gt[rr][Qt]={}),dr[fa]=Pr,delete Ve[Kt]}else ra==="reverse"?(rn.range?rn.range.reverse():(en(Ha+".autorange",!0),rn.range=[1,0]),nn.autorange?Ra.calc=!0:Ra.plot=!0):(Kt==="dragmode"&&(Pr===!1&&yn!==!1||Pr!==!1&&yn===!1)||Te._has("scatter-like")&&Te._has("regl")&&Kt==="dragmode"&&(Pr==="lasso"||Pr==="select")&&!(yn==="lasso"||yn==="select")?Ra.plot=!0:xt?E.update(Ra,xt):Ra.calc=!0,Wt.set(Pr))}}for(rr in Gt){var kr=_.applyContainerArrayChanges(Ee,at(Ce,rr),Gt[rr],Ra,at);kr||(Ra.plot=!0)}for(var na in kn){Jt=n.getFromId(Ee,na);var Ca=Jt&&Jt._constraintGroup;if(Ca){Ra.calc=!0;for(var Fa in Ca)kn[Fa]||(n.getFromId(Ee,Fa)._constraintShrinkable=!0)}}(tt(Ee)||Ve.height||Ve.width)&&(Ra.plot=!0);var Ya=Te.shapes;for(Qt=0;Qt1;)if(Te.pop(),Ce=M(Ve,Te.join(".")+".uirevision").get(),Ce!==void 0)return Ce;return Ve.uirevision}function st(Ee,Ve){for(var Ce=0;Ce=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()}Ee.emit("plotly_animationinterrupted",[])}}function Tr(ra){if(ra.length!==0){for(var Ia=0;IaTe._timeToNext&&Ua()};ra()}var Ra=0;function Qa(ra){return Array.isArray(Pe)?Ra>=Pe.length?ra.transitionOpts=Pe[Ra]:ra.transitionOpts=Pe[0]:ra.transitionOpts=Pe,Ra++,ra}var za,en,kn=[],Jt=Ve==null,Nt=Array.isArray(Ve),Kt=!Jt&&!Nt&&A.isPlainObject(Ve);if(Kt)kn.push({type:"object",data:Qa(A.extendFlat({},Ve))});else if(Jt||["string","number"].indexOf(typeof Ve)!==-1)for(za=0;za0&&tata)&&ma.push(en);kn=ma}}kn.length>0?Tr(kn):(Ee.emit("plotly_animated"),Gt())})}function Ir(Ee,Ve,Ce){if(Ee=A.getGraphDiv(Ee),Ve==null)return Promise.resolve();if(!A.isPlotDiv(Ee))throw new Error("This element is not a Plotly plot: "+Ee+". 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=Ee._transitionData._frames,Ot=Ee._transitionData._frameHash;if(!Array.isArray(Ve))throw new Error("addFrames failure: frameList must be an Array of frame definitions"+Ve);var Gt=Tt.length+Ve.length*2,rr=[],Qt={};for(Te=Ve.length-1;Te>=0;Te--)if(A.isPlainObject(Ve[Te])){var Tr=Ve[Te].name,la=(Ot[Tr]||Qt[Tr]||{}).name,Ua=Ve[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 "+Ee._transitionData._counter++];);if(Ot[Pe.name]){for(at=0;at=0;Ce--)Te=Ve[Ce],at.push({type:"delete",index:Te}),yt.unshift({type:"insert",index:Te,value:Pe[Te]});var Tt=a.modifyFrames,Ot=a.modifyFrames,Gt=[Ee,yt],rr=[Ee,at];return t&&t.add(Ee,Tt,Gt,Ot,rr),a.modifyFrames(Ee,at)}function Be(Ee){Ee=A.getGraphDiv(Ee);var Ve=Ee._fullLayout||{},Ce=Ee._fullData||[];return a.cleanPlot([],{},Ce,Ve),a.purge(Ee),e.purge(Ee),Ve._container&&Ve._container.remove(),delete Ee._context,Ee}function Ke(Ee){var Ve=Ee._fullLayout,Ce=Ee.getBoundingClientRect();if(!A.equalDomRects(Ce,Ve._lastBBox)){var Te=Ve._invTransform=A.inverseTransformMatrix(A.getFullTransformMatrix(Ee));Ve._invScaleX=Math.sqrt(Te[0][0]*Te[0][0]+Te[0][1]*Te[0][1]+Te[0][2]*Te[0][2]),Ve._invScaleY=Math.sqrt(Te[1][0]*Te[1][0]+Te[1][1]*Te[1][1]+Te[1][2]*Te[1][2]),Ve._lastBBox=Ce}}function Ue(Ee){var Ve=q.select(Ee),Ce=Ee._fullLayout;if(Ce._calcInverseTransform=Ke,Ce._calcInverseTransform(Ee),Ce._container=Ve.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(d.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"),Ee.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=H,Z.newPlot=B,Z._doPlot=u,Z.purge=Be,Z.react=qt,Z.redraw=F,Z.relayout=be,Z.restyle=oe,Z.setPlotConfig=f,Z.update=ut,Z._guiRelayout=Me(be),Z._guiRestyle=Me(oe),Z._guiUpdate=Me(ut),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 v=window.URL||window.webkitURL;Z.createObjectURL=function(A){return v.createObjectURL(A)},Z.revokeObjectURL=function(A){return v.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(h).text()});return s.remove(),c}function n(o){return o.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")}q.exports=function(s,c,h){var m=s._fullLayout,d=m._paper,T=m._toppaper,l=m.width,_=m.height,w;d.insert("rect",":first-child").call(A.setRect,0,0,l,_).call(M.fill,m.paper_bgcolor);var S=m._basePlotModules||[];for(w=0;w1&&E.push(s("object","layout"))),x.supplyDefaults(g);for(var u=g._fullData,y=b.length,f=0;fP.length&&S.push(s("unused",E,y.concat(P.length)));var I=P.length,N=Array.isArray(O);N&&(I=Math.min(I,O.length));var U,W,Q,ue,se;if(L.dimensions===2)for(W=0;WP[W].length&&S.push(s("unused",E,y.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=f[W][U],se=P[W][U],v.validate(ue,Q)?se!==ue&&se!==+ue&&S.push(s("dynamic",E,y.concat(W,U),ue,se)):S.push(s("value",E,y.concat(W,U),ue))}else S.push(s("array",E,y.concat(W),f[W]));else for(W=0;WF?S.push({code:"unused",traceType:f,templateCount:z,dataCount:F}):F>z&&S.push({code:"reused",traceType:f,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);v(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:g,layout:E},""),S.length)return S.map(h)};function c(m){for(var d=0;d=0;h--){var m=e[h];if(m.type==="scatter"&&m.xaxis===s.xaxis&&m.yaxis===s.yaxis){m.opacity=void 0;break}}}}}}}),WO=Ze({"src/traces/scatter/layout_defaults.js"(Z,q){"use strict";var v=ca(),x=y2();q.exports=function(A,M){function e(r,i){return v.coerce(A,M,x,r,i)}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 v=is(),x=ca(),A=x.dateTime2ms,M=x.incrementMonth,e=Vs(),t=e.ONEAVGMONTH;q.exports=function(i,a,n,o){if(a.type!=="date")return{vals:o};var s=i[n+"periodalignment"];if(!s)return{vals:o};var c=i[n+"period"],h;if(v(c)){if(c=+c,c<=0)return{vals:o}}else if(typeof c=="string"&&c.charAt(0)==="M"){var m=+c.substring(1);if(m>0&&Math.round(m)===m)h=m;else return{vals:o}}for(var d=a.calendar,T=s==="start",l=s==="end",_=i[n+"period0"],w=A(_,d)||0,S=[],E=[],g=[],b=o.length,p=0;pu;)P=M(P,-h,d);for(;P<=u;)P=M(P,h,d);f=M(P,-h,d)}else{for(y=Math.round((u-w)/c),P=w+y*c;P>u;)P-=c;for(;P<=u;)P+=c;f=P-c}S[p]=T?f:l?P:(f+P)/2,E[p]=f,g[p]=P}return{vals:S,starts:E,ends:g}}}}),Fd=Ze({"src/traces/scatter/colorscale_calc.js"(Z,q){"use strict";var v=Up().hasColorscale,x=jp(),A=Fu();q.exports=function(e,t){A.hasLines(t)&&v(t,"line")&&x(e,t,{vals:t.line.color,containerStr:"line",cLetter:"c"}),A.hasMarkers(t)&&(v(t,"marker")&&x(e,t,{vals:t.marker.color,containerStr:"marker",cLetter:"c"}),v(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 v=ca();q.exports=function(A,M){for(var e=0;eB&&f[I].gap;)I--;for(U=f[I].s,O=f.length-1;O>I;O--)f[O].s=U;for(;BN+O||!v(I))}for(var W=0;Wz[d]&&d0?e:t)/(d._m*_*(d._m>0?e:t)))),Ot*=1e3}if(Gt===A){if(l&&(Gt=d.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)We||yt[1]ot)return[a(yt[0],Re,We),a(yt[1],it,ot)]}function Lt(yt,Tt){if(yt[0]===Tt[0]&&(yt[0]===Re||yt[0]===We)||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 qt(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=qt(0,Re,We):p==="vhv"&&(Zt=qt(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:We,ot]:[Gt>0?We: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===We)&&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=h,yt.marker=wr?E[yt.i]:E,yt.backoff=S),re=yt[0]/_,ce=yt[1]/w,ut=yt[0]We?We:0,Me=yt[1]ot?ot:0,ut||Me){if(!F)z[F++]=[ut||yt[0],Me||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];ut&&Me&&(Ot[0]!==ut||Ot[1]!==Me)?(Fe&&(_e!==ut&&fe!==Me?xr(_e&&fe?Sr(Fe,yt):[_e||ut,fe||Me]):_e&&fe&&xr([_e,fe])),xr([ut,Me])):_e-ut&&fe-Me&&xr([ut||_e,Me||fe]),Fe=yt,_e=ut,fe=Me}else Fe&&jr(Zt(Fe,yt)[0]),z[F++]=yt}for(B=0;Bbe(W,bt))break;I=W,J=se[0]*ue[0]+se[1]*ue[1],J>H?(H=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]]),f.push(z.slice(0,F))}var Be=p.slice(p.length-1);if(S&&Be!=="h"&&Be!=="v"){for(var Ke=!1,Ue=-1,Ee=[],Ve=0;Ve=0?n=m:(n=m=h,h++),n0,p=a(m,d,T);if(S=l.selectAll("g.trace").data(p,function(y){return y[0].trace.uid}),S.enter().append("g").attr("class",function(y){return"trace scatter trace"+y[0].trace.uid}).style("stroke-miterlimit",2),S.order(),o(m,S,d),b){w&&(E=w());var u=v.transition().duration(_.duration).ease(_.easing).each("end",function(){E&&E()}).each("interrupt",function(){E&&E()});u.each(function(){l.selectAll("g.trace").each(function(y,f){s(m,f,d,y,p,this,_)})})}else S.each(function(y,f){s(m,f,d,y,p,this,_)});g&&S.exit().remove(),l.selectAll("path:not([d])").remove()};function o(h,m,d){m.each(function(T){var l=M(v.select(this),"g","fills");t.setClipUrl(l,d.layerClipId,h);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(v.select(this),"path","js-fill")})})}function s(h,m,d,T,l,_,w){var S=h._context.staticPlot,E;c(h,m,d,T,l);var g=!!w&&w.duration>0;function b(xr){return g?xr.transition():xr}var p=d.xaxis,u=d.yaxis,y=T[0].trace,f=y.line,P=v.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")(h,L,d,w),y.visible!==!0)return;b(P).style("opacity",y.opacity);var O,I,N=y.fill.charAt(y.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][d.isRangePlot?"nodeRangePlot3":"node3"]=P;var Q="",ue=[],se=y._prevtrace,he=null,H=null;se&&(Q=se._prevRevpath||"",I=se._nextFill,ue=se._ownPolygons,he=se._fillsegments,H=se._fillElement);var $,J,X="",oe="",ne,j,ee,re,ce,be,Ae=[];y._polygons=[];var ze=[],Re=[],We=A.noop;if(O=y._ownFill,r.hasLines(y)||y.fill!=="none"){I&&I.datum(T),["hv","vh","hvh","vhv"].indexOf(f.shape)!==-1?(ne=t.steps(f.shape),j=t.steps(f.shape.split("").reverse().join(""))):f.shape==="spline"?ne=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),f.smoothing):t.smoothopen(xr,f.smoothing)}:ne=j=function(xr){return"M"+xr.join("L")},ee=function(xr){return j(xr.reverse())},Re=i(T,{xaxis:p,yaxis:u,trace:y,connectGaps:y.connectgaps,baseTolerance:Math.max(f.width||1,3)/4,shape:f.shape,backoff:f.backoff,simplify:f.simplify,fill:y.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),y=0;l.forEach(function(P,L){var z=P[0].trace;r.hasMarkers(z)&&z.marker.maxdisplayed>0&&L=Math.min(se,he)&&d<=Math.max(se,he)?0:1/0}var H=Math.max(3,ue.mrc||0),$=1-1/H,J=Math.abs(h.c2p(ue.x)-d);return J=Math.min(se,he)&&T<=Math.max(se,he)?0:1/0}var H=Math.max(3,ue.mrc||0),$=1-1/H,J=Math.abs(m.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),H=Math.min(H,re),$=Math.max($,re)));return H=Math.max(H,0),$=Math.min($,h._length),{x0:H,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),v.extendFlat(i,{distance:i.maxHoverDistance,x0:W.x0,x1:W.x1,y0:W.y0,y1:W.y1,color:Q,hovertemplate:!1}),delete i.index,c.text&&!v.isArrayOrTypedArray(c.text)?i.text=String(c.text):i.text=c.name,[i]}}}}}),c1=Ze({"src/traces/scatter/select.js"(Z,q){"use strict";var v=Fu();q.exports=function(A,M){var e=A.cd,t=A.xaxis,r=A.yaxis,i=[],a=e[0].trace,n,o,s,c,h=!v.hasMarkers(a)&&!v.hasText(a);if(h)return[];if(M===!1)for(n=0;n0&&(o["_"+a+"axes"]||{})[i])return o;if((o[a+"axis"]||a)===i){if(t(o,a))return o;if((o[a]||[]).length||o[a+"0"])return o}}}function e(r){return{v:"x",h:"y"}[r.orientation||"v"]}function t(r,i){var a=e(r),n=v(r,"box-violin"),o=v(r._fullInput||{},"candlestick");return n&&!o&&i===a&&r[a]===void 0&&r[a+"0"]===void 0}}}),I2=Ze({"src/plots/cartesian/category_order_defaults.js"(Z,q){"use strict";var v=xp().isTypedArraySpec;function x(A,M){var e=M.dataAttr||A._id.charAt(0),t={},r,i,a;if(M.axData)r=M.axData;else for(r=[],i=0;i0||v(i),n;a&&(n="array");var o=t("categoryorder",n),s;o==="array"&&(s=t("categoryarray")),!a&&o==="array"&&(o=e.categoryorder="trace"),o==="trace"?e._initialCategories=[]:o==="array"?e._initialCategories=s.slice():(s=x(e,r).sort(),o==="category ascending"?e._initialCategories=s:o==="category descending"&&(e._initialCategories=s.reverse()))}}}}),D_=Ze({"src/plots/cartesian/line_grid_defaults.js"(Z,q){"use strict";var v=Ch().mix,x=oh(),A=ca();q.exports=function(e,t,r,i){i=i||{};var a=i.dfltColor;function n(f,P){return A.coerce2(e,t,i.attributes,f,P)}var o=n("linecolor",a),s=n("linewidth"),c=r("showline",i.showLine||!!o||!!s);c||(delete t.linecolor,delete t.linewidth);var h=v(a,i.bgColor,i.blend||x.lightFraction).toRgbString(),m=n("gridcolor",h),d=n("gridwidth"),T=n("griddash"),l=r("showgrid",i.showGrid||!!m||!!d||!!T);if(l||(delete t.gridcolor,delete t.gridwidth,delete t.griddash),i.hasMinor){var _=v(t.gridcolor,i.bgColor,67).toRgbString(),w=n("minor.gridcolor",_),S=n("minor.gridwidth",t.gridwidth||1),E=n("minor.griddash",t.griddash||"solid"),g=r("minor.showgrid",!!w||!!S||!!E);g||(delete t.minor.gridcolor,delete t.minor.gridwidth,delete t.minor.griddash)}if(!i.noZeroLine){var b=n("zerolinelayer"),p=n("zerolinecolor",a),u=n("zerolinewidth"),y=r("zeroline",i.showGrid||!!p||!!u);y||(delete t.zerolinelayer,delete t.zerolinecolor,delete t.zerolinewidth)}}}}),z_=Ze({"src/plots/cartesian/axis_defaults.js"(Z,q){"use strict";var v=is(),x=oo(),A=ca(),M=Dl(),e=fp(),t=Wh(),r=Xg(),i=t1(),a=$m(),n=Qm(),o=I2(),s=D_(),c=hS(),h=wv(),m=kh().WEEKDAY_PATTERN,d=kh().HOUR_PATTERN;q.exports=function(S,E,g,b,p){var u=b.letter,y=b.font||{},f=b.splomStash||{},P=g("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=g("ticklabelmode"))}!b.noTicklabelindex&&(z==="date"||z==="linear")&&g("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||g("ticklabeloverflow",O.indexOf("inside")!==-1?"hide past domain":z==="category"||z==="multicategory"?"allow":"hide past div"),h(E,p),c(S,E,g,b),o(S,E,g,b),b.noHover||(z!=="category"&&g("hoverformat"),b.noUnifiedhovertitle||g("unifiedhovertitle.text"));var I=g("color"),N=I!==t.color.dflt?I:y.color,U=f.label||p._dfltTitle[u];if(n(S,E,g,z,b),!P)return E;g("title.text",U),A.coerceFont(g,"title.font",y,{overrideDflt:{size:A.bigFont(y.size),color:N}}),r(S,E,g,z);var W=b.hasMinor;if(W&&(M.newContainer(E,"minor"),r(S,E,g,z,{isMinor:!0})),a(S,E,g,z,b),i(S,E,g,b),W){var Q=b.isMinor;b.isMinor=!0,i(S,E,g,b),b.isMinor=Q}s(S,E,g,{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)&&g("mirror");var ue=z==="multicategory";if(!b.noTickson&&(z==="category"||ue)&&(E.ticks||E.showgrid)&&(ue?(g("tickson","boundaries"),delete E.ticklabelposition):g("tickson")),ue){var se=g("showdividers");se&&(g("dividercolor"),g("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="",y,f;if(p.length===2){for(y=0;y<2;y++)if(f=_(p[y]),f){u=m;break}}var P=g("pattern",u);if(P===m)for(y=0;y<2;y++)f=_(p[y]),f&&(S.bounds[y]=p[y]=f-1);if(P)for(y=0;y<2;y++)switch(f=p[y],P){case m:if(!v(f)){S.enabled=!1;return}if(f=+f,f!==Math.floor(f)||f<0||f>=7){S.enabled=!1;return}S.bounds[y]=p[y]=f;break;case d:if(!v(f)){S.enabled=!1;return}if(f=+f,f<0||f>24){S.enabled=!1;return}S.bounds[y]=p[y]=f;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]g[1]-1/4096&&(e.domain=h),x.noneOrAll(M.domain,e.domain,h),e.tickmode==="sync"&&(e.tickmode="auto")}return t("layer"),e}}}),KO=Ze({"src/plots/cartesian/layout_defaults.js"(Z,q){"use strict";var v=ca(),x=Yi(),A=Qp().isUnifiedHover,M=_S(),e=Dl(),t=$y(),r=Wh(),i=OS(),a=z_(),n=Yg(),o=R2(),s=$c(),c=s.id2name,h=s.name2id,m=kh().AX_ID_PATTERN,d=oo(),T=d.traceIs,l=d.getComponentMethod;function _(w,S,E){Array.isArray(w[S])?w[S].push(E):w[S]=[E]}q.exports=function(S,E,g){var b=E.autotypenumbers,p={},u={},y={},f={},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,g._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,g){var b=E.plotinfo,p=b.xaxis,u=b.yaxis,y=p._length,f=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-g)+g*B[0]-F[0])/(F[1]-F[0])*y,z[2]=y*(1-g+g*I/O),p.range[0]=p.l2r(F[0]*(1-g)+g*B[0]),p.range[1]=p.l2r(F[1]*(1-g)+g*B[1])}else z[0]=0,z[2]=y;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-g)+g*U[1]-N[1])/(N[0]-N[1])*f,z[3]=f*(1-g+g*Q/W),u.range[0]=p.l2r(N[0]*(1-g)+g*U[0]),u.range[1]=u.l2r(N[1]*(1-g)+g*U[1])}else z[1]=0,z[3]=f;e.drawOne(r,p,{skipTitle:!0}),e.drawOne(r,u,{skipTitle:!0}),e.redrawComponents(r,[p._id,u._id]);var ue=P?y/z[2]:1,se=L?f/z[3]:1,he=P?z[0]:0,H=L?z[1]:0,$=P?z[0]/z[2]*y:0,J=L?z[1]/z[3]*f:0,X=p._offset-$,oe=u._offset-J;b.clipRect.call(M.setTranslate,he,H).call(M.setScale,1/ue,1/se),b.plot.call(M.setTranslate,X,oe).call(M.setScale,ue,se),M.setPointGroupScale(b.zoomScalePts,1/ue,1/se),M.setTextPointsScale(b.zoomScaleTxt,1/ue,1/se)}var h;n&&(h=n());function m(){for(var E={},g=0;ga.duration?(m(),_=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=Oi(),v=oo(),x=ca(),A=xc(),M=as(),e=Hh().getModuleCalcData,t=$c(),r=kh(),i=vd(),a=x.ensureSingle;function n(T,l,_){return x.ensureSingle(T,l,_,function(w){w.datum(_)})}var o=r.zindexSeparator;Z.name="cartesian",Z.attr=["xaxis","yaxis"],Z.idRoot=["x","y"],Z.idRegex=r.idRegex,Z.attrRegex=r.attrRegex,Z.attributes=YO(),Z.layoutAttributes=Wh(),Z.supplyLayoutDefaults=KO(),Z.transitionAxes=JO(),Z.finalizeSubplots=function(T,l){var _=l._subplots,w=_.xaxis,S=_.yaxis,E=_.cartesian,g=E,b={},p={},u,y,f;for(u=0;u0){var L=P.id;if(L.indexOf(o)!==-1)continue;L+=o+(u+1),P=x.extendFlat({},P,{id:L,plot:S._cartesianlayer.selectAll(".subplot").select("."+L)})}for(var z=[],F,B=0;B1&&(W+=o+U),N.push(b+W),g=0;g1,f=l.mainplotinfo;if(!l.mainplot||y)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(!g){var P=a(w,"g","layer-subplot");l.shapelayer=a(P,"g","shapelayer"),l.imagelayer=a(P,"g","imagelayer"),f&&y?(l.minorGridlayer=f.minorGridlayer,l.gridlayer=f.gridlayer,l.zerolinelayer=f.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),f&&y?l.zerolinelayerAbove=f.zerolinelayerAbove:l.zerolinelayerAbove=a(w,"g","zerolinelayer-above"),g||(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=f.plotgroup,F=S+"-x",B=S+"-y";l.minorGridlayer=f.minorGridlayer,l.gridlayer=f.gridlayer,l.zerolinelayer=f.zerolinelayer,l.zerolinelayerAbove=f.zerolinelayerAbove,a(f.overlinesBelow,"path",F),a(f.overlinesBelow,"path",B),a(f.overaxesBelow,"g",F),a(f.overaxesBelow,"g",B),l.plot=a(f.overplot,"g",S),a(f.overlinesAbove,"path",F),a(f.overlinesAbove,"path",B),a(f.overaxesAbove,"g",F),a(f.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)}g||(u||(n(l.minorGridlayer,"g",l.xaxis._id),n(l.minorGridlayer,"g",l.yaxis._id),l.minorGridlayer.selectAll("g").map(function(O){return O[0]}).sort(t.idSort),n(l.gridlayer,"g",l.xaxis._id),n(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 m(T,l){if(T){var _={};T.each(function(p){var u=p[0],y=q.select(this);y.remove(),d(u,l),_[u]=!0});for(var w in l._plots)for(var S=l._plots[w],E=S.overlays||[],g=0;g=0,l=n.indexOf("end")>=0,_=c.backoff*m+o.standoff,w=h.backoff*d+o.startstandoff,S,E,g,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(g=Math.atan2(u,p),b=g+Math.PI,_&&w&&_+w>Math.sqrt(p*p+u*u)){W();return}if(_){if(_*_>p*p+u*u){W();return}var y=_*Math.cos(g),f=_*Math.sin(g);E.x+=y,E.y+=f,a.attr({x2:E.x,y2:E.y})}if(w){if(w*w>p*p+u*u){W();return}var P=w*Math.cos(g),L=w*Math.sin(g);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);g=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,se,he,H){ue.path&&(ue.noRotate&&(he=0),v.select(s.parentNode).append("path").attr({class:a.attr("class"),d:ue.path,transform:r(se.x,se.y)+t(he*180/Math.PI)+e(H)}).style({fill:x.rgb(o.arrowcolor),"stroke-width":0}))}T&&Q(h,S,g,d),l&&Q(c,E,b,m)}}}),D2=Ze({"src/components/annotations/draw.js"(Z,q){"use strict";var v=Oi(),x=oo(),A=xc(),M=ca(),e=M.strTranslate,t=Wo(),r=Yi(),i=as(),a=ef(),n=fu(),o=Kd(),s=bp(),c=Dl().arrayEditor,h=QO();q.exports={draw:m,drawOne:d,drawRaw:l};function m(_){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)&&(qt===kt?(Pe=Zt.r2fraction(w["a"+Lt]),(Pe<0||Pe>1)&&(rt=!0)):rt=!0),Ke=Zt._offset+Zt.r2p(w[Lt]),Ve=.5}else{var at=Te==="domain";Lt==="x"?(Ee=w[Lt],Ke=at?Zt._offset+Zt._length*Ee:Ke=u.l+u.w*Ee):(Ee=1-w[Lt],Ke=at?Zt._offset+Zt._length*Ee:Ke=u.t+u.h*Ee),Ve=w.showarrow?.5:Ee}if(w.showarrow){Be.head=Ke;var yt=w["a"+Lt];if(Ce=xr*Fe(.5,w.xanchor)-jr*Fe(.5,w.yanchor),qt===kt){var Tt=t.getRefType(qt);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)),qt==="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(Ve,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=(ut-ot)*(w.align==="center"?.5:1)),w.valign!=="top"&&(Tr=(Me-tt)*(w.valign==="middle"?.5:1)),We)Re.select("svg").attr({x:J+Qt-1,y:J+Tr}).call(i.setClipUrl,oe?O:null,_);else{var la=J+Tr-it.top,Ua=J+Qt-it.left;re.call(n.positionText,Ua,la).call(i.setClipUrl,oe?O:null,_)}ne.select("rect").call(i.setRect,J,J,ut,Me),X.call(i.setRect,H/2,H/2,_e-H,fe-H),he.call(i.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(Qa,za){U.selectAll(".annotation-arrow-g").remove();var en=I.x.head,kn=I.y.head,Jt=I.x.tail+Qa,Nt=I.y.tail+za,Kt=I.x.text+Qa,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,rn=Ha+ra,nn=Wt-.5*Ia,yn=nn+Ia,xt=[[Ha,nn,Ha,yn],[Ha,yn,rn,yn],[rn,yn,rn,nn],[rn,nn,Ha,nn]].map(ma);if(!xt.reduce(function(It,dr){return It^!!M.segmentsIntersect(en,kn,en+1e6,kn+1e6,dr[0],dr[1],dr[2],dr[3])},!1)){xt.forEach(function(It){var dr=M.segmentsIntersect(Jt,Nt,en,kn,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"+en+","+kn).style("stroke-width",ct+"px").call(r.stroke,r.rgb(Nr));if(h(Lr,Or,w),y.annotationPosition&&Lr.node().parentNode&&!E){var Gr=en,Kr=kn;if(w.standoff){var Ur=Math.sqrt(Math.pow(en-Jt,2)+Math.pow(kn-Nt,2));Gr+=w.standoff*(Jt-en)/Ur,Kr+=w.standoff*(Nt-kn)/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=i.getTranslate(he);da=It.x,fa=It.y,g&&g.autorange&&z(g._name+".autorange",!0),b&&b.autorange&&z(b._name+".autorange",!0)},moveFn:function(It,dr){var kr=ta(da,fa),na=kr[0]+It,Ca=kr[1]+dr;he.call(i.setTranslate,na,Ca),F("x",T(g,It,"x",u,w)),F("y",T(b,dr,"y",u,w)),w.axref===w.xref&&F("ax",T(g,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+","+na+","+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(Qa,za){var en="pointer";if(w.showarrow)w.axref===w.xref?F("ax",T(g,Qa,"ax",u,w)):F("ax",w.ax+Qa),w.ayref===w.yref?F("ay",T(b,za,"ay",u.w,w)):F("ay",w.ay+za),Ba(Qa,za);else{if(E)return;var kn,Jt;if(g)kn=T(g,Qa,"x",u,w);else{var Nt=w._xsize/u.w,Kt=w.x+(w._xshift-w.xshift)/u.w-Nt/2;kn=s.align(Kt+Qa/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",kn),F("y",Jt),(!g||!b)&&(en=s.getCursor(g?.5:kn,b?.5:Jt,w.xanchor,w.yanchor))}W.attr({transform:e(Qa,za)+Ra}),o(he,en)},clickFn:function(Qa,za){w.captureevents&&_.emit("plotly_clickannotation",se(za))},doneFn:function(){o(he),x.call("_guiRelayout",_,B());var Qa=document.querySelector(".js-notes-box-panel");Qa&&Qa.redraw(Qa.selectedObj)}})}}y.annotationText?re.call(n.makeEditable,{delegate:he,gd:_}).call(ce).on("edit",function(Ae){w.text=Ae,this.call(ce),F("text",Ae),g&&g.autorange&&z(g._name+".autorange",!0),b&&b.autorange&&z(b._name+".autorange",!0),x.call("_guiRelayout",_,B())}):re.call(ce)}}}),eB=Ze({"src/components/annotations/click.js"(Z,q){"use strict";var v=ca(),x=oo(),A=Dl().arrayEditor;q.exports={hasClickToShow:M,onClick:e};function M(i,a){var n=t(i,a);return n.on.length>0||n.explicitOff.length>0}function e(i,a){var n=t(i,a),o=n.on,s=n.off.concat(n.explicitOff),c={},h=i._fullLayout.annotations,m,d;if(o.length||s.length){for(m=0;m1){o=!0;break}}o?e.fullLayout._infolayer.select(".annotation-"+e.id+'[data-index="'+a+'"]').remove():(n._pdata=x(e.glplot.cameraParams,[t.xaxis.r2l(n.x)*r[0],t.yaxis.r2l(n.y)*r[1],t.zaxis.r2l(n.z)*r[2]]),v(e.graphDiv,n,a,e.id,n._xa,n._ya))}}}}),lB=Ze({"src/components/annotations3d/index.js"(Z,q){"use strict";var v=oo(),x=ca();q.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:z2()}}},layoutAttributes:z2(),handleDefaults:iB(),includeBasePlot:A,convert:oB(),draw:sB()};function A(M,e){var t=v.subplotsRegistry.gl3d;if(t)for(var r=t.attrRegex,i=Object.keys(M),a=0;a0?l+m:m;return{ppad:m,ppadplus:d?w:S,ppadminus:d?S:w}}else return{ppad:m}}function i(a,n,o){var s=a._id.charAt(0)==="x"?"x":"y",c=a.type==="category"||a.type==="multicategory",h,m,d=0,T=0,l=c?a.r2c:a.d2c,_=n[s+"sizemode"]==="scaled";if(_?(h=n[s+"0"],m=n[s+"1"],c&&(d=n[s+"0shift"],T=n[s+"1shift"])):(h=n[s+"anchor"],m=n[s+"anchor"]),h!==void 0)return[l(h)+d,l(m)+T];if(n.path){var w=1/0,S=-1/0,E=n.path.match(A.segmentRE),g,b,p,u,y;for(a.type==="date"&&(l=M.decodeDate(l)),g=0;gS&&(S=y)));if(S>=w)return[w,S]}}}}),hB=Ze({"src/components/shapes/index.js"(Z,q){"use strict";var v=E2();q.exports={moduleType:"component",name:"shapes",layoutAttributes:US(),supplyLayoutDefaults:uB(),supplyDrawNewShapeDefaults:cB(),includeBasePlot:R_()("shapes"),calcAutorange:fB(),draw:v.draw,drawOne:v.drawOne}}}),jS=Ze({"src/components/images/attributes.js"(Z,q){"use strict";var v=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",v.idRegex.x.toString()],dflt:"paper",editType:"arraydraw"},yref:{valType:"enumerated",values:["paper",v.idRegex.y.toString()],dflt:"paper",editType:"arraydraw"},editType:"arraydraw"})}}),pB=Ze({"src/components/images/defaults.js"(Z,q){"use strict";var v=ca(),x=Wo(),A=fp(),M=jS(),e="images";q.exports=function(i,a){var n={name:e,handleItemDefaults:t};A(i,a,n)};function t(r,i,a){function n(_,w){return v.coerce(r,i,M,_,w)}var o=n("source"),s=n("visible",!!o);if(!s)return i;n("layer"),n("xanchor"),n("yanchor"),n("sizex"),n("sizey"),n("sizing"),n("opacity");for(var c={_fullLayout:a},h=["x","y"],m=0;m<2;m++){var d=h[m],T=x.coerceRef(r,i,c,d,"paper",void 0);if(T!=="paper"){var l=x.getFromId(c,T);l._imgIndices.push(i._index)}x.coercePosition(i,c,n,T,d,0)}return i}}}),dB=Ze({"src/components/images/draw.js"(Z,q){"use strict";var v=Oi(),x=as(),A=Wo(),M=$c(),e=vd();q.exports=function(r){var i=r._fullLayout,a=[],n={},o=[],s,c;for(c=0;c0);h&&(s("active"),s("direction"),s("type"),s("showactive"),s("x"),s("y"),v.noneOrAll(a,n,["x","y"]),s("xanchor"),s("yanchor"),s("pad.t"),s("pad.r"),s("pad.b"),s("pad.l"),v.coerceFont(s,"font",o.font),s("bgcolor",o.paper_bgcolor),s("bordercolor"),s("borderwidth"))}function i(a,n){function o(c,h){return v.coerce(a,n,t,c,h)}var s=o("visible",a.method==="skip"||Array.isArray(a.args));s&&(o("method"),o("args"),o("args2"),o("label"),o("execute"))}}}),yB=Ze({"src/components/updatemenus/scrollbox.js"(Z,q){"use strict";q.exports=e;var v=Oi(),x=Yi(),A=as(),M=ca();function e(t,r,i){this.gd=t,this.container=r,this.id=i,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,i,a){var n=this.gd._fullLayout,o=n.width,s=n.height;this.position=r;var c=this.position.l,h=this.position.w,m=this.position.t,d=this.position.h,T=this.position.direction,l=T==="down",_=T==="left",w=T==="right",S=T==="up",E=h,g=d,b,p,u,y;!l&&!_&&!w&&!S&&(this.position.direction="down",l=!0);var f=l||S;f?(b=c,p=b+E,l?(u=m,y=Math.min(u+g,s),g=y-u):(y=m+g,u=Math.max(y-g,0),g=y-u)):(u=m,y=u+g,_?(p=c+E,b=Math.max(p-E,0),E=p-b):(b=c,p=Math.min(b+E,o),E=p-b)),this._box={l:b,t:u,w:E,h:g};var P=h>E,L=e.barLength+2*e.barPad,z=e.barWidth+2*e.barPad,F=c,B=m+d;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=d>g,N=e.barWidth+2*e.barPad,U=e.barLength+2*e.barPad,W=c+h,Q=m;W+N>o&&(W=o-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=g-U):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var se=this.id,he=b-.5,H=I?p+N+.5:p+.5,$=u-.5,J=P?y+z+.5:y+.5,X=n._topdefs.selectAll("#"+se).data(P||I?[0]:[]);if(X.exit().remove(),X.enter().append("clipPath").attr("id",se).append("rect"),P||I?(this._clipRect=X.select("rect").attr({x:Math.floor(he),y:Math.floor($),width:Math.ceil(H)-Math.floor(he),height:Math.ceil(J)-Math.floor($)}),this.container.call(A.setClipUrl,se,this.gd),this.bg.attr({x:c,y:m,width:h,height:d})):(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=v.behavior.drag().on("dragstart",function(){v.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 ne=v.behavior.drag().on("dragstart",function(){v.event.sourceEvent.preventDefault(),v.event.sourceEvent.stopPropagation()}).on("drag",this._onBarDrag.bind(this));P&&this.hbar.on(".drag",null).call(ne),I&&this.vbar.on(".drag",null).call(ne)}this.setTranslate(i,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,i=this.translateY;this.hbar&&(r-=v.event.dx),this.vbar&&(i-=v.event.dy),this.setTranslate(r,i)},e.prototype._onBoxWheel=function(){var r=this.translateX,i=this.translateY;this.hbar&&(r+=v.event.deltaY),this.vbar&&(i+=v.event.deltaY),this.setTranslate(r,i)},e.prototype._onBarDrag=function(){var r=this.translateX,i=this.translateY;if(this.hbar){var a=r+this._hbarXMin,n=a+this._hbarTranslateMax,o=M.constrain(v.event.x,a,n),s=(o-a)/(n-a),c=this.position.w-this._box.w;r=s*c}if(this.vbar){var h=i+this._vbarYMin,m=h+this._vbarTranslateMax,d=M.constrain(v.event.y,h,m),T=(d-h)/(m-h),l=this.position.h-this._box.h;i=T*l}this.setTranslate(r,i)},e.prototype.setTranslate=function(r,i){var a=this.position.w-this._box.w,n=this.position.h-this._box.h;if(r=M.constrain(r||0,0,a),i=M.constrain(i||0,0,n),this.translateX=r,this.translateY=i,this.container.call(A.setTranslate,this._box.l-this.position.l-r,this._box.t-this.position.t-i),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+r-.5),y:Math.floor(this.position.t+i-.5)}),this.hbar){var o=r/a;this.hbar.call(A.setTranslate,r+o*this._hbarTranslateMax,i)}if(this.vbar){var s=i/n;this.vbar.call(A.setTranslate,r,i+s*this._vbarTranslateMax)}}}}),_B=Ze({"src/components/updatemenus/draw.js"(Z,q){"use strict";var v=Oi(),x=xc(),A=Yi(),M=as(),e=ca(),t=fu(),r=Dl().arrayEditor,i=mh().LINE_SPACING,a=F2(),n=yB();q.exports=function(L){var z=L._fullLayout,F=e.filterVisible(z[a.name]);function B(se){x.autoMargin(L,u(se))}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(){v.select(this).selectAll("g."+a.headerGroupClassName).each(B)}).remove(),F.length!==0){var I=O.selectAll("g."+a.headerGroupClassName).data(F,o);I.enter().append("g").classed(a.headerGroupClassName,!0);for(var N=e.ensureSingle(O,"g",a.dropdownButtonGroupClassName,function(se){se.style("pointer-events","all")}),U=0;U0?[0]:[]);W.enter().append("g").classed(a.containerClassName,!0).style("cursor",I?null:"ew-resize");function Q(H){H._commandObserver&&(H._commandObserver.remove(),delete H._commandObserver),x.autoMargin(O,h(H))}if(W.exit().each(function(){v.select(this).selectAll("g."+a.groupClassName).each(Q)}).remove(),U.length!==0){var ue=W.selectAll("g."+a.groupClassName).data(U,d);ue.enter().append("g").classed(a.groupClassName,!0),ue.exit().each(Q).remove();for(var se=0;se0&&(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)}}}),TB=Ze({"src/components/sliders/index.js"(Z,q){"use strict";var v=F_();q.exports={moduleType:"component",name:v.name,layoutAttributes:qS(),supplyLayoutDefaults:bB(),draw:wB()}}}),O2=Ze({"src/components/rangeslider/attributes.js"(Z,q){"use strict";var v=oh();q.exports={bgcolor:{valType:"color",dflt:v.background,editType:"plot"},bordercolor:{valType:"color",dflt:v.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"}}}),GS=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}}}),AB=Ze({"src/components/rangeslider/helpers.js"(Z){"use strict";var q=$c(),v=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),i=t.margin,a=[],n=0;n=ot.max)We=ce[it+1];else if(Re=ot.pmax)We=ce[it+1];else if(Re0?p.touches[0].clientX:0}function m(p,u,y,f){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=v.event,O=B.target,I=h(B),N=I-p.node().getBoundingClientRect().left,U=f.d2p(y._rl[0]),W=f.d2p(y._rl[1]),Q=o.coverSlip();this.addEventListener("touchmove",ue),this.addEventListener("touchend",se),Q.addEventListener("mousemove",ue),Q.addEventListener("mouseup",se);function ue(he){var H=h(he),$=+H-I,J,X,oe;switch(O){case P:if(oe="ew-resize",U+$>y._length||W+$<0)return;J=U+$,X=W+$;break;case L:if(oe="col-resize",U+$>y._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=i(o,s,c);T("x",w[0]),T("y",w[1]),v.noneOrAll(n,o,["x","y"]),T("xanchor"),T("yanchor"),v.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,n,o,s){var c=s.calendar;function h(T,l){return v.coerce(a,n,e.buttons,T,l)}var m=h("visible");if(m){var d=h("step");d!=="all"&&(c&&c!=="gregorian"&&(d==="month"||d==="year")?n.stepmode="backward":h("stepmode"),h("count")),h("label")}}function i(a,n,o){for(var s=o.filter(function(d){return n[d].anchor===a._id}),c=0,h=0;h1)){delete c.grid;return}if(!T&&!l&&!_){var y=b("pattern")==="independent";y&&(T=!0)}g._hasSubplotGrid=T;var f=b("roworder"),P=f==="top to bottom",L=T?.2:.1,z=T?.3:.1,F,B;w&&c._splomGridDflt&&(F=c._splomGridDflt.xside,B=c._splomGridDflt.yside),g._domains={x:a("x",b,L,F,u),y:a("y",b,z,B,p,P)}}function a(s,c,h,m,d,T){var l=c(s+"gap",h),_=c("domain."+s);c(s+"side",m);for(var w=new Array(d),S=_[0],E=(_[1]-S)/(d-l),g=E*(1-l),b=0;b0,m=r._context.staticPlot;i.each(function(d){var T=d[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&&(d=[]);var E=v.select(this).selectAll("g.errorbar").data(d,w);if(E.exit().remove(),!!d.length){l.visible||E.selectAll("path.xerror").remove(),_.visible||E.selectAll("path.yerror").remove(),E.style("opacity",1);var g=E.enter().append("g").classed("errorbar",!0);h&&g.style("opacity",0).transition().duration(n.duration).style("opacity",1),A.setClipUrl(E,a.layerClipId,r),E.each(function(b){var p=v.select(this),u=e(b,s,c);if(!(S&&!b.vis)){var y,f=p.select("path.yerror");if(_.visible&&x(u.x)&&x(u.yh)&&x(u.ys)){var P=_.width;y="M"+(u.x-P)+","+u.yh+"h"+2*P+"m-"+P+",0V"+u.ys,u.noYS||(y+="m-"+P+",0h"+2*P),o=!f.size(),o?f=p.append("path").style("vector-effect",m?"none":"non-scaling-stroke").classed("yerror",!0):h&&(f=f.transition().duration(n.duration).ease(n.easing)),f.attr("d",y)}else f.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;y="M"+u.xh+","+(u.y-z)+"v"+2*z+"m0,-"+z+"H"+u.xs,u.noXS||(y+="m0,-"+z+"v"+2*z),o=!L.size(),o?L=p.append("path").style("vector-effect",m?"none":"non-scaling-stroke").classed("xerror",!0):h&&(L=L.transition().duration(n.duration).ease(n.easing)),L.attr("d",y)}else L.remove()}})}})};function e(t,r,i){var a={x:r.c2p(t.x),y:i.c2p(t.y)};return t.yh!==void 0&&(a.yh=i.c2p(t.yh),a.ys=i.c2p(t.ys),x(a.ys)||(a.noYS=!0,a.ys=i.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}}}),FB=Ze({"src/components/errorbars/style.js"(Z,q){"use strict";var v=Oi(),x=Yi();q.exports=function(M){M.each(function(e){var t=e[0].trace,r=t.error_y||{},i=t.error_x||{},a=v.select(this);a.selectAll("path.yerror").style("stroke-width",r.thickness+"px").call(x.stroke,r.color),i.copy_ystyle&&(i=r),a.selectAll("path.xerror").style("stroke-width",i.thickness+"px").call(x.stroke,i.color)})}}}),OB=Ze({"src/components/errorbars/index.js"(Z,q){"use strict";var v=ca(),x=pc().overrideAll,A=XS(),M={error_x:v.extendFlat({},A),error_y:v.extendFlat({},A)};delete M.error_x.copy_zstyle,delete M.error_y.copy_zstyle,delete M.error_y.copy_ystyle;var e={error_x:v.extendFlat({},A),error_y:v.extendFlat({},A),error_z:v.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:RB(),calc:DB(),makeComputeError:ZS(),plot:zB(),style:FB(),hoverInfo:t};function t(r,i,a){(i.error_y||{}).visible&&(a.yerr=r.yh-r.y,i.error_y.symmetric||(a.yerrneg=r.y-r.ys)),(i.error_x||{}).visible&&(a.xerr=r.xh-r.x,i.error_x.symmetric||(a.xerrneg=r.x-r.xs))}}}),BB=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"}}}}),NB=Ze({"src/components/colorbar/draw.js"(Z,q){"use strict";var v=Oi(),x=Ch(),A=xc(),M=oo(),e=Wo(),t=bp(),r=ca(),i=r.strTranslate,a=rs().extendFlat,n=Kd(),o=as(),s=Yi(),c=Zg(),h=fu(),m=Up().flipScale,d=z_(),T=R2(),l=Wh(),_=mh(),w=_.LINE_SPACING,S=_.FROM_TL,E=_.FROM_BR,g=BB().cn;function b(L){var z=L._fullLayout,F=z._infolayer.selectAll("g."+g.colorbar).data(p(L),function(B){return B._id});F.enter().append("g").attr("class",function(B){return B._id}).classed(g.colorbar,!0),F.each(function(B){var O=v.select(this);r.ensureSingle(O,"rect",g.cbbg),r.ensureSingle(O,"g",g.cbfills),r.ensureSingle(O,"g",g.cblines),r.ensureSingle(O,"g",g.cbaxis,function(N){N.classed(g.crisp,!0)}),r.ensureSingle(O,"g",g.cbtitleunshift,function(N){N.append("g").classed(g.cbtitle,!0)}),r.ensureSingle(O,"rect",g.cboutline);var I=u(O,B,L);I&&I.then&&(L._promises||[]).push(I),L._context.edits.colorbarPosition&&y(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?m(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+H/ee.w,Zt+Fe-H/ee.w],xr.setScale(),L.attr("transform",i(Math.round(ee.l),Math.round(ee.t)));var Ke=L.select("."+g.cbtitleunshift).attr("transform",i(-Math.round(ee.l),-Math.round(ee.t))),Ue=xr.ticklabelposition,Ee=xr.title.font.size,Ve=L.select("."+g.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("."+g.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=H+ee.l+rt*J,Qt=$+ee.t+st*(1-Zt-Fe)+3+Ee*.75),Ae==="bottom"&&(rr=H+ee.l+rt*J,Qt=$+ee.t+st*(1-Zt)-3-Ee*.25),Ae==="right"&&(Qt=$+ee.t+st*X+3+Ee*.75,rr=H+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+Ee*(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!=="intside"&&z.ticklen||0)),Ae==="top"){var Ua=be.text.split("
").length;la=ee.t+st*rr+10-Me-w*Ee*Ua}at((B?"h":"v")+xr._id+"title",{avoid:{selection:v.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("."+g.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=o.bBox(la),Pe=Ba.width,Te=Ba.height,Te>Ua&&(Tr[1]-=(Te-Ua)/2)):Qt.node()&&!Qt.classed(g.jsPlaceholder)&&(Ba=o.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=h.lineCount(Qt);Tr[1]+=(1-Ra)*Ua}rr.attr("transform",i(Tr[0],Tr[1])),xr.setScale()}}else Pe&&(Ae==="right"&&(xr.domain[0]+=(Pe+Ee/2)/ee.w),rr.attr("transform",i(Tr[0],Tr[1])),xr.setScale())}L.selectAll("."+g.cbfills+",."+g.cblines).attr("transform",B?i(0,Math.round(ee.h*(1-xr.domain[1]))):i(Math.round(ee.w*xr.domain[0]),0)),Ve.attr("transform",B?i(0,Math.round(-ee.t)):i(Math.round(-ee.l),0));var Qa=L.select("."+g.cbfills).selectAll("rect."+g.cbfill).attr("style","").data(tt);Qa.enter().append("rect").classed(g.cbfill,!0).attr("style",""),Qa.exit().remove();var za=ze.map(xr.c2p).map(Math.round).sort(function(Kt,Wt){return Kt-Wt});Qa.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=v.select(this).attr(B?"x":"y",Qe).attr(B?"y":"x",v.min(Pr)).attr(B?"width":"height",Math.max(Me,2)).attr(B?"height":"width",Math.max(v.max(Pr)-v.min(Pr),2));if(z._fillgradient)o.gradient(ta,F,z._id,B?"vertical":"horizontalreversed",z._fillgradient,"fill");else{var ma=We(Kt).replace("e-","");ta.attr("fill",x(ma).toHexString())}});var en=L.select("."+g.cblines).selectAll("path."+g.cbline).data(ce.color&&ce.width?ut:[]);en.enter().append("path").classed(g.cbline,!0),en.exit().remove(),en.each(function(Kt){var Wt=Qe,Pr=Math.round(xr.c2p(Kt))+ce.width/2%1;v.select(this).attr("d","M"+(B?Wt+","+Pr:Pr+","+Wt)+(B?"h":"v")+Me).call(o.lineGroupStyle,ce.width,Re(Kt),ce.dash)}),Ve.selectAll("g."+xr._id+"tick,path").remove();var kn=Qe+Me+(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:Ve,path:e.makeTickPath(xr,kn,Nt),transFn:e.makeTransTickFn(xr)}),e.drawLabels(F,xr,{vals:Jt,layer:Ve,transFn:e.makeTransTickLabelFn(xr),labelFns:e.makeLabelFns(xr,kn)})}function Gt(){var rr,Qt=Me+W/2;Ue.indexOf("inside")===-1&&(rr=o.bBox(Ve.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(g.jsPlaceholder)){var Ra,Qa=Ke.select(".h"+xr._id+"title-math-group").node();Qa&&(B&&jr||!B&&!jr)?(rr=o.bBox(Qa),Tr=rr.width,Ra=rr.height):(rr=o.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",i(Tr/2+Ee/2,0)),Tr*=2),Qt=Math.max(Qt,B?Tr:Ra)}var za=(B?H:$)*2+Qt+Q+W/2,en=0;!B&&be.text&&he==="bottom"&&X<=0&&(en=za/2,za+=en,Ba+=en),j._hColorbarMoveTitle=en,j._hColorbarMoveCBTitle=Ba;var kn=Q+W,Jt=(B?Qe:Sr)-kn/2-(B?H:0),Nt=(B?Sr:Qe)-(B?fe:$+Ba-en);L.select("."+g.cbbg).attr("x",Jt).attr("y",Nt).attr(B?"width":"height",Math.max(za-en,2)).attr(B?"height":"width",Math.max(fe+kn,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("."+g.cboutline).attr("x",(B?Qe:Sr+H)+Kt).attr("y",(B?Sr+$-fe:Qe)+(la?Te:0)).attr(B?"width":"height",Math.max(Me,2)).attr(B?"height":"width",Math.max(fe-(B?2*$+Te:2*H+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=ne?ee.l-Wt:-Wt,Pr=oe?ee.t-Pr:-Pr,L.attr("transform",i(Wt,Pr)),!B&&(Q||x(ue).getAlpha()&&!x.equals(j.paper_bgcolor,ue))){var ta=Ve.selectAll("text"),ma=ta[0].length,ra=L.select("."+g.cbbg).node(),Ia=o.bBox(ra),Ha=o.getTranslate(L),rn=2;ta.each(function(Kr,Ur){var aa=0,da=ma-1;if(Ur===aa||Ur===da){var fa=o.bBox(this),It=o.getTranslate(this),dr;if(Ur===da){var kr=fa.right+It.x,na=Ia.right+Ha.x+Sr-Q-rn+J;dr=na-kr,dr>0&&(dr=0)}else if(Ur===aa){var Ca=fa.left+It.x,Fa=Ia.left+Ha.x+Sr+Q+rn;dr=Fa-Ca,dr<0&&(dr=0)}dr&&(ma<3?this.setAttribute("transform","translate("+dr+",0) "+this.getAttribute("transform")):this.setAttribute("visibility","hidden"))}})}var nn={},yn=S[se],xt=E[se],ct=S[he],Nr=E[he],Or=za-Me;B?(I==="pixels"?(nn.y=X,nn.t=fe*ct,nn.b=fe*Nr):(nn.t=nn.b=0,nn.yt=X+O*ct,nn.yb=X-O*Nr),U==="pixels"?(nn.x=J,nn.l=za*yn,nn.r=za*xt):(nn.l=Or*yn,nn.r=Or*xt,nn.xl=J-N*yn,nn.xr=J+N*xt)):(I==="pixels"?(nn.x=J,nn.l=fe*yn,nn.r=fe*xt):(nn.l=nn.r=0,nn.xl=J+O*yn,nn.xr=J-O*xt),U==="pixels"?(nn.y=1-X,nn.t=za*ct,nn.b=za*Nr):(nn.t=Or*ct,nn.b=Or*Nr,nn.yt=X-N*ct,nn.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+nn.r,b:j.height-Nt-Pr,t:Nt+nn.b};ne&&oe?A.autoMargin(F,z._id,nn):ne?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 y(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"),n(L)},moveFn:function(Q,ue){L.attr("transform",N+i(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 se=t.getCursor(U,W,z.xanchor,z.yanchor);n(L,se)},doneFn:function(){if(n(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 f(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],se=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(i,a){var n,o=i.data,s=i.layout,c=M([],o),h=M({},s,e(a.tileClass)),m=i._context||{};if(a.width&&(h.width=a.width),a.height&&(h.height=a.height),a.tileClass==="thumbnail"||a.tileClass==="themes__thumb"){h.annotations=[];var d=Object.keys(h);for(n=0;n=0)return m}else if(typeof m=="string"&&(m=m.trim(),m.slice(-1)==="%"&&v(m.slice(0,-1))&&(m=+m.slice(0,-1),m>=0)))return m+"%"}function h(m,d,T,l,_,w){w=w||{};var S=w.moduleHasSelected!==!1,E=w.moduleHasUnselected!==!1,g=w.moduleHasConstrain!==!1,b=w.moduleHasCliponaxis!==!1,p=w.moduleHasTextangle!==!1,u=w.moduleHasInsideanchor!==!1,y=!!w.hasPathbar,f=Array.isArray(_)||_==="auto",P=f||_==="inside",L=f||_==="outside";if(P||L){var z=n(l,"textfont",T.font),F=x.extendFlat({},z),B=m.textfont&&m.textfont.color,O=!B;if(O&&delete F.color,n(l,"insidetextfont",F),y){var I=x.extendFlat({},z);O&&delete I.color,n(l,"pathbar.textfont",I)}L&&n(l,"outsidetextfont",z),S&&l("selected.textfont.color"),E&&l("unselected.textfont.color"),g&&l("constraintext"),b&&l("cliponaxis"),p&&l("textangle"),l("texttemplate")}P&&u&&l("insidetextanchor")}q.exports={supplyDefaults:o,crossTraceDefaults:s,handleText:h,validateCornerradius:c}}}),KS=Ze({"src/traces/bar/layout_defaults.js"(Z,q){"use strict";var v=oo(),x=Wo(),A=ca(),M=U2(),e=gd().validateCornerradius;q.exports=function(t,r,i){function a(S,E){return A.coerce(t,r,M,S,E)}for(var n=!1,o=!1,s=!1,c={},h=a("barmode"),m=h==="group",d=0;d0&&!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"&&(o=!0)}}if(!n){delete r.barmode;return}h!=="overlay"&&a("barnorm"),a("bargap",o&&!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 v=ca();q.exports=function(A,M){for(var e=0;er;if(!i)return M}return e!==void 0?e:A.dflt},Z.coerceColor=function(A,M,e){return v(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||y.bargap===0&&y.bargroupgap===0&&!f[0].trace.marker.line.width)&&v.select(this).attr("shape-rendering","crispEdges")}),p.selectAll("g.points").each(function(f){var P=v.select(this),L=f[0].trace;c(P,L,b)}),e.getComponentMethod("errorbars","style")(p)}function c(b,p,u){A.pointStyle(b.selectAll("path"),p,u),h(b,p,u)}function h(b,p,u){b.selectAll("text").each(function(y){var f=v.select(this),P=M.ensureUniformFontSize(u,l(f,y,p,u));A.font(f,P)})}function m(b,p,u){var y=p[0].trace;y.selectedpoints?d(u,y,b):(c(u,y,b),e.getComponentMethod("errorbars","style")(u))}function d(b,p,u){A.selectedPointStyle(b.selectAll("path"),p),T(b.selectAll("text"),p,u)}function T(b,p,u){b.each(function(y){var f=v.select(this),P;if(y.selected){P=M.ensureUniformFontSize(u,l(f,y,p,u));var L=p.selected.textfont&&p.selected.textfont.color;L&&(P.color=L),A.font(f,P)}else A.selectedTextStyle(f,p)})}function l(b,p,u,y){var f=y._fullLayout.font,P=u.textfont;if(b.classed("bartext-inside")){var L=g(p,u);P=w(u,p.i,f,L)}else b.classed("bartext-outside")&&(P=S(u,p.i,f));return P}function _(b,p,u){return E(i,b.textfont,p,u)}function w(b,p,u,y){var f=_(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&&(f={color:x.contrast(y),family:f.family,size:f.size,weight:f.weight,style:f.style,variant:f.variant,textcase:f.textcase,lineposition:f.lineposition,shadow:f.shadow}),E(a,b.insidetextfont,p,f)}function S(b,p,u){var y=_(b,p,u);return E(n,b.outsidetextfont,p,y)}function E(b,p,u,y){p=p||{};var f=o.getValue(p.family,u),P=o.getValue(p.size,u),L=o.getValue(p.color,u),z=o.getValue(p.weight,u),F=o.getValue(p.style,u),B=o.getValue(p.variant,u),O=o.getValue(p.textcase,u),I=o.getValue(p.lineposition,u),N=o.getValue(p.shadow,u);return{family:o.coerceString(b.family,f,y.family),size:o.coerceNumber(b.size,P,y.size),color:o.coerceColor(b.color,L,y.color),weight:o.coerceString(b.weight,z,y.weight),style:o.coerceString(b.style,F,y.style),variant:o.coerceString(b.variant,B,y.variant),textcase:o.coerceString(b.variant,O,y.textcase),lineposition:o.coerceString(b.variant,I,y.lineposition),shadow:o.coerceString(b.variant,N,y.shadow)}}function g(b,p){return p.type==="waterfall"?p[b.dir].marker.color:b.mcc||b.mc||p.marker.color}q.exports={style:s,styleTextPoints:h,styleOnSelect:m,getInsideTextFont:w,getOutsideTextFont:S,getBarColor:g,resizeText:t}}}),e0=Ze({"src/traces/bar/plot.js"(Z,q){"use strict";var v=Oi(),x=is(),A=ca(),M=fu(),e=Yi(),t=as(),r=oo(),i=Wo().tickText,a=wp(),n=a.recordMinTextSize,o=a.clearMinTextSize,s=Nd(),c=V2(),h=Qg(),m=Sv(),d=m.text,T=m.textposition,l=Qp().appendArrayPointValue,_=h.TEXTPAD;function w(Q){return Q.id}function S(Q){if(Q.ids)return w}function E(Q){return(Q>0)-(Q<0)}function g(Q,ue){return Q0}function y(Q,ue,se,he,H,$){var J=ue.xaxis,X=ue.yaxis,oe=Q._fullLayout,ne=Q._context.staticPlot;H||(H={mode:oe.barmode,norm:oe.barmode,gap:oe.bargap,groupgap:oe.bargroupgap},o("bar",oe));var j=A.makeTraceGroups(he,se,"trace bars").each(function(ee){var re=v.select(this),ce=ee[0].trace,be=ee[0].t,Ae=ce.type==="waterfall",ze=ce.type==="funnel",Re=ce.type==="histogram",We=ce.type==="bar",it=We||ze,ot=0;Ae&&ce.connector.visible&&ce.connector.mode==="between"&&(ot=ce.connector.line.width/2);var tt=ce.orientation==="h",ut=u(H),Me=A.ensureSingle(re,"g","points"),_e=S(ce),fe=Me.selectAll("g.point").data(A.identity,_e);fe.enter().append("g").classed("point",!0),fe.exit().remove(),fe.each(function(rt,st){var Qe=v.select(this),Lt=b(rt,J,X,tt),kt=Lt[0][0],qt=Lt[0][1],Zt=Lt[1][0],Sr=Lt[1][1],xr=(tt?qt-kt:Sr-Zt)===0;xr&&it&&c.getLineWidth(ce,rt)&&(xr=!1),xr||(xr=!x(kt)||!x(qt)||!x(Zt)||!x(Sr)),rt.isBlank=xr,xr&&(tt?qt=kt:Sr=Zt),ot&&!xr&&(tt?(kt-=g(kt,qt)*ot,qt+=g(kt,qt)*ot):(Zt-=g(Zt,Sr)*ot,Sr+=g(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(kn){var Jt=v.round(jr/2%1,2);return H.gap===0&&H.groupgap===0?v.round(Math.round(kn)-Jt,2):kn}function Be(kn,Jt,Nt){return Nt&&kn===Jt?kn:Math.abs(kn-Jt)>=2?bt(kn):kn>Jt?Math.ceil(kn):Math.floor(kn)}var Ke=e.opacity(wr),Ue=Ke<1||jr>.01?bt:Be;Q._context.staticPlot||(kt=Ue(kt,qt,tt),qt=Ue(qt,kt,tt),Zt=Ue(Zt,Sr,!tt),Sr=Ue(Sr,Zt,!tt));var Ee=tt?J.c2p:X.c2p,Ve;rt.s0>0?Ve=rt._sMax:rt.s0<0?Ve=rt._sMin:Ve=rt.s1>0?rt._sMax:rt._sMin;function Ce(kn,Jt){if(!kn)return 0;var Nt=Math.abs(tt?Sr-Zt:qt-kt),Kt=Math.abs(tt?qt-kt:Sr-Zt),Wt=Ue(Math.abs(Ee(Ve,!0)-Ee(0,!0))),Pr=rt.hasB?Math.min(Nt/2,Kt/2):Math.min(Nt/2,Wt),ta;if(Jt==="%"){var ma=Math.min(50,kn);ta=Nt*(ma/100)}else ta=kn;return Ue(Math.max(Math.min(ta,Pr),0))}var Te=We||Re?Ce(be.cornerradiusvalue,be.cornerradiusform):0,Pe,at,yt="M"+kt+","+Zt+"V"+Sr+"H"+qt+"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(Ee(Ve,!0)-Ee(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(qt-(Te-Tt)*Gt,kt)+"A "+Te+","+Te+" 0 0 "+Qt+" "+qt+","+(Sr-Te*rr-la)+"V"+(Zt+Te*rr+la)+"A "+Te+","+Te+" 0 0 "+Qt+" "+Ua(qt-(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"+(qt-Te*Gt)+"A "+Te+","+Te+" 0 0 "+Qt+" "+qt+","+(Sr-Te*rr)+"V"+(Zt+Te*rr)+"A "+Te+","+Te+" 0 0 "+Qt+" "+(qt-Te*Gt)+","+Zt+"Z";else{at=Math.abs(Sr-Zt)+Tt;var Ba=at0?Math.sqrt(Tt*(2*Te-Tt)):0,Qa=rr>0?Math.max:Math.min;Pe="M"+(kt+Ba*Gt)+","+Zt+"V"+Qa(Sr-(Te-Tt)*rr,Zt)+"A "+Te+","+Te+" 0 0 "+Qt+" "+(kt+Te*Gt-Ra)+","+Sr+"H"+(qt-Te*Gt+Ra)+"A "+Te+","+Te+" 0 0 "+Qt+" "+(qt-Ba*Gt)+","+Qa(Sr-(Te-Tt)*rr,Zt)+"V"+Zt+"Z"}}else Pe=yt}else Pe=yt;var za=p(A.ensureSingle(Qe,"path"),oe,H,$);if(za.style("vector-effect",ne?"none":"non-scaling-stroke").attr("d",isNaN((qt-kt)*(Sr-Zt))||xr&&Q._context.staticPlot?"M0,0Z":Pe).call(t.setClipUrl,ue.layerClipId,Q),!oe.uniformtext.mode&&ut){var en=t.makePointStyleFns(ce);t.singlePointStyle(rt,za,ce,en,Q)}f(Q,ue,Qe,ee,st,kt,qt,Zt,Sr,Te,Tt,H,$),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,H)}function f(Q,ue,se,he,H,$,J,X,oe,ne,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 We=he[0].trace,it=We.orientation==="h",ot=I(Ae,he,H,ce,be);ze=N(We,H);var tt=ee.mode==="stack"||ee.mode==="relative",ut=he[H],Me=!tt||ut._outmost,_e=ut.hasB,fe=ne&&ne-j>_;if(!ot||ze==="none"||(ut.isBlank||$===J||X===oe)&&(ze==="auto"||ze==="inside")){se.select("text").remove();return}var Fe=Ae.font,rt=s.getBarColor(he[H],We),st=s.getInsideTextFont(We,H,Fe,rt),Qe=s.getOutsideTextFont(We,H,Fe),Lt=We.insidetextanchor||"end",kt=se.datum();it?ce.type==="log"&&kt.s0<=0&&(ce.range[0]0&&bt>0,Ue;fe?_e?Ue=P(Sr-2*ne,xr,Ir,bt,it)||P(Sr,xr-2*ne,Ir,bt,it):it?Ue=P(Sr-(ne-j),xr,Ir,bt,it)||P(Sr,xr-2*(ne-j),Ir,bt,it):Ue=P(Sr,xr-(ne-j),Ir,bt,it)||P(Sr-2*(ne-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(se,ot,Be);var Ee=jr.attr("transform");if(jr.attr("transform",""),wr=t.bBox(jr.node()),Ir=wr.width,bt=wr.height,jr.attr("transform",Ee),Ir<=0||bt<=0){jr.remove();return}}var Ve=We.textangle,Ce,Te;ze==="outside"?(Te=We.constraintext==="both"||We.constraintext==="outside",Ce=O($,J,X,oe,wr,{isHorizontal:it,constrained:Te,angle:Ve})):(Te=We.constraintext==="both"||We.constraintext==="inside",Ce=F($,J,X,oe,wr,{isHorizontal:it,constrained:Te,angle:Ve,anchor:Lt,hasB:_e,r:ne,overhead:j})),Ce.fontSize=Be.size,n(We.type==="histogram"?"bar":We.type,Ce,Ae),ut.transform=Ce;var Pe=p(jr,Ae,ee,re);A.setTransormAndDisplay(Pe,Ce)}function P(Q,ue,se,he,H){if(Q<0||ue<0)return!1;var $=se<=Q&&he<=ue,J=se<=ue&&he<=Q,X=H?Q>=se*(ue/he):ue>=he*(Q/se);return $||J||X}function L(Q){return Q==="auto"?0:Q}function z(Q,ue){var se=Math.PI/180*ue,he=Math.abs(Math.sin(se)),H=Math.abs(Math.cos(se));return{x:Q.width*H+Q.height*he,y:Q.width*he+Q.height*H}}function F(Q,ue,se,he,H,$){var J=!!$.isHorizontal,X=!!$.constrained,oe=$.angle||0,ne=$.anchor,j=ne==="end",ee=ne==="start",re=$.leftToRight||0,ce=(re+1)/2,be=1-ce,Ae=$.hasB,ze=$.r,Re=$.overhead,We=H.width,it=H.height,ot=Math.abs(ue-Q),tt=Math.abs(he-se),ut=ot>2*_&&tt>2*_?_:0;ot-=2*ut,tt-=2*ut;var Me=L(oe);oe==="auto"&&!(We<=ot&&it<=tt)&&(We>ot||it>tt)&&(!(We>tt||it>ot)||We_){var rt=B(Q,ue,se,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=H.left*be+H.right*ce,Qe=(H.top+H.bottom)/2,Lt=(Q+_)*be+(ue-_)*ce,kt=(se+he)/2,qt=0,Zt=0;if(ee||j){var Sr=(J?_e.x:_e.y)/2;ze&&(j||Ae)&&(ut+=Fe);var xr=J?g(Q,ue):g(se,he);J?ee?(Lt=Q+xr*ut,qt=-xr*Sr):(Lt=ue-xr*ut,qt=xr*Sr):ee?(kt=se+xr*ut,Zt=-xr*Sr):(kt=he-xr*ut,Zt=xr*Sr)}return{textX:st,textY:Qe,targetX:Lt,targetY:kt,anchorX:qt,anchorY:Zt,scale:fe,rotate:Me}}function B(Q,ue,se,he,H,$,J,X,oe){var ne=Math.max(0,Math.abs(ue-Q)-2*_),j=Math.max(0,Math.abs(he-se)-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,We,it;return H.y/H.x>=j/(ne-ce)?We=j/H.y:H.y/H.x<=(j-be)/ne?We=ne/H.x:!oe&&X?(Ae=H.x*H.x+H.y*H.y/4,ze=-2*H.x*(ne-ee)-H.y*(j/2-ee),Re=(ne-ee)*(ne-ee)+(j/2-ee)*(j/2-ee)-ee*ee,We=(-ze+Math.sqrt(ze*ze-4*Ae*Re))/(2*Ae)):oe?(Ae=(H.x*H.x+H.y*H.y)/4,ze=-H.x*(ne/2-ee)-H.y*(j/2-ee),Re=(ne/2-ee)*(ne/2-ee)+(j/2-ee)*(j/2-ee)-ee*ee,We=(-ze+Math.sqrt(ze*ze-4*Ae*Re))/(2*Ae)):(Ae=H.x*H.x/4+H.y*H.y,ze=-H.x*(ne/2-ee)-2*H.y*(j-ee),Re=(ne/2-ee)*(ne/2-ee)+(j-ee)*(j-ee)-ee*ee,We=(-ze+Math.sqrt(ze*ze-4*Ae*Re))/(2*Ae)),We=Math.min(1,We),X?it=Math.max(0,ee-Math.sqrt(Math.max(0,ee*ee-(ee-(j-H.y*We)/2)*(ee-(j-H.y*We)/2)))-J):it=Math.max(0,ee-Math.sqrt(Math.max(0,ee*ee-(ee-(ne-H.x*We)/2)*(ee-(ne-H.x*We)/2)))-J),{scale:We,pad:it}}function O(Q,ue,se,he,H,$){var J=!!$.isHorizontal,X=!!$.constrained,oe=$.angle||0,ne=H.width,j=H.height,ee=Math.abs(ue-Q),re=Math.abs(he-se),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/ne));var Ae=L(oe),ze=z(H,Ae),Re=(J?ze.x:ze.y)/2,We=(H.left+H.right)/2,it=(H.top+H.bottom)/2,ot=(Q+ue)/2,tt=(se+he)/2,ut=0,Me=0,_e=J?g(ue,Q):g(se,he);return J?(ot=ue-_e*ce,ut=_e*Re):(tt=he+_e*ce,Me=-_e*Re),{textX:We,textY:it,targetX:ot,targetY:tt,anchorX:ut,anchorY:Me,scale:be,rotate:Ae}}function I(Q,ue,se,he,H){var $=ue[0].trace,J=$.texttemplate,X;return J?X=U(Q,ue,se,he,H):$.textinfo?X=W(ue,se,he,H):X=c.getValue($.text,se),c.coerceString(d,X)}function N(Q,ue){var se=c.getValue(Q.textposition,ue);return c.coerceEnumerated(T,se)}function U(Q,ue,se,he,H){var $=ue[0].trace,J=A.castOption($,se,"texttemplate");if(!J)return"";var X=$.type==="histogram",oe=$.type==="waterfall",ne=$.type==="funnel",j=$.orientation==="h",ee,re,ce,be;j?(ee="y",re=H,ce="x",be=he):(ee="x",re=he,ce="y",be=H);function Ae(ut){return i(re,re.c2l(ut),!0).text}function ze(ut){return i(be,be.c2l(ut),!0).text}var Re=ue[se],We={};We.label=Re.p,We.labelLabel=We[ee+"Label"]=Ae(Re.p);var it=A.castOption($,Re.i,"text");(it===0||it)&&(We.text=it),We.value=Re.s,We.valueLabel=We[ce+"Label"]=ze(Re.s);var ot={};l(ot,$,Re.i),(X||ot.x===void 0)&&(ot.x=j?We.value:We.label),(X||ot.y===void 0)&&(ot.y=j?We.label:We.value),(X||ot.xLabel===void 0)&&(ot.xLabel=j?We.valueLabel:We.labelLabel),(X||ot.yLabel===void 0)&&(ot.yLabel=j?We.labelLabel:We.valueLabel),oe&&(We.delta=+Re.rawS||Re.s,We.deltaLabel=ze(We.delta),We.final=Re.v,We.finalLabel=ze(We.final),We.initial=We.final-We.delta,We.initialLabel=ze(We.initial)),ne&&(We.value=Re.s,We.valueLabel=ze(We.value),We.percentInitial=Re.begR,We.percentInitialLabel=A.formatPercent(Re.begR),We.percentPrevious=Re.difR,We.percentPreviousLabel=A.formatPercent(Re.difR),We.percentTotal=Re.sumR,We.percenTotalLabel=A.formatPercent(Re.sumR));var tt=A.castOption($,Re.i,"customdata");return tt&&(We.customdata=tt),A.texttemplateString(J,We,Q._d3locale,ot,We,$._meta||{})}function W(Q,ue,se,he){var H=Q[0].trace,$=H.orientation==="h",J=H.type==="waterfall",X=H.type==="funnel";function oe(tt){var ut=$?he:se;return i(ut,tt,!0).text}function ne(tt){var ut=$?se:he;return i(ut,+tt,!0).text}var j=H.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(H,ee.i,"text"),(be===0||be)&&ce.push(be)),J){var ze=+ee.rawS||ee.s,Re=ee.v,We=Re-ze;Ae("initial")&&ce.push(ne(We)),Ae("delta")&&ce.push(ne(ze)),Ae("final")&&ce.push(ne(Re))}if(X){Ae("value")&&ce.push(ne(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:y,toMoveInsideBar:F}}}),f1=Ze({"src/traces/bar/hover.js"(Z,q){"use strict";var v=ef(),x=oo(),A=Yi(),M=ca().fillText,e=V2().getLineWidth,t=Wo().hoverLabelText,r=Vs().BADNUM;function i(o,s,c,h,m){var d=a(o,s,c,h,m);if(d){var T=d.cd,l=T[0].trace,_=T[d.index];return d.color=n(l,_),x.getComponentMethod("errorbars","hoverInfo")(_,l,d),[d]}}function a(o,s,c,h,m){var d=o.cd,T=d[0].trace,l=d[0].t,_=h==="closest",w=T.type==="waterfall",S=o.maxHoverDistance,E=o.maxSpikeDistance,g,b,p,u,y,f,P;T.orientation==="h"?(g=c,b=s,p="y",u="x",y=he,f=Q):(g=s,b=c,p="x",u="y",f=he,y=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 m.finiteRange&&(ze=0),v.inbox(be-g,Ae-g,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 se(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=se(be);return v.inbox(ze-Ae,Re-Ae,S+(Re-Ae)/(Re-ze)-1)}function H(be){var Ae=b,ze=be.b,Re=se(be);return v.inbox(ze-Ae,Re-Ae,E+(Re-Ae)/(Re-ze)-1)}var $=o[p+"a"],J=o[u+"a"];P=Math.abs($.r2c($.range[1])-$.r2c($.range[0]));function X(be){return(y(be)+f(be))/2}var oe=v.getDistanceFunction(h,y,f,X);if(v.getClosest(d,oe,o),o.index!==!1&&d[o.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 ne=o.index,j=d[ne],ee=T.base?j.b+j.s:j.s;o[u+"0"]=o[u+"1"]=J.c2p(j[u],!0),o[u+"LabelVal"]=ee;var re=l.extents[l.extents.round(j.p)];o[p+"0"]=$.c2p(_?N(j):re[0],!0),o[p+"1"]=$.c2p(_?U(j):re[1],!0);var ce=j.orig_p!==void 0;return o[p+"LabelVal"]=ce?j.orig_p:j.p,o.labelLabel=t($,o[p+"LabelVal"],T[p+"hoverformat"]),o.valueLabel=t(J,o[u+"LabelVal"],T[u+"hoverformat"]),o.baseLabel=t(J,j.b,T[u+"hoverformat"]),o.spikeDistance=(H(j)+ue(j))/2,o[p+"Spike"]=$.c2p(j.p,!0),M(j,T,o),o.hovertemplate=T.hovertemplate,o}}function n(o,s){var c=s.mcc||o.marker.color,h=s.mlcc||o.marker.line.color,m=e(o,s);if(A.opacity(c))return c;if(A.opacity(h)&&m)return h}q.exports={hoverPoints:i,hoverOnBars:a,getTraceColor:n}}}),YB=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,i=e[0].trace,a=i.type==="funnel",n=i.orientation==="h",o=[],s;if(M===!1)for(s=0;s0?(L="v",p>0?z=Math.min(y,u):z=Math.min(u)):p>0?(L="h",z=Math.min(y)):z=0;if(!z){c.visible=!1;return}c._length=z;var N=h("orientation",L);c._hasPreCompStats?N==="v"&&p===0?(h("x0",0),h("dx",1)):N==="h"&&b===0&&(h("y0",0),h("dy",1)):N==="v"&&p===0?h("x0"):N==="h"&&b===0&&h("y0");var U=x.getComponentMethod("calendars","handleTraceDefaults");U(s,c,["x","y"],m)}function n(s,c,h,m){var d=m.prefix,T=v.coerce2(s,c,r,"marker.outliercolor"),l=h("marker.line.outliercolor"),_="outliers";c._hasPreCompStats?_="all":(T||l)&&(_="suspectedoutliers");var w=h(d+"points",_);w?(h("jitter",w==="all"?.3:0),h("pointpos",w==="all"?-1.5:0),h("marker.symbol"),h("marker.opacity"),h("marker.size"),h("marker.angle"),h("marker.color",c.line.color),h("marker.line.color"),h("marker.line.width"),w==="suspectedoutliers"&&(h("marker.line.outliercolor",c.marker.color),h("marker.line.outlierwidth")),h("selected.marker.color"),h("unselected.marker.color"),h("selected.marker.size"),h("unselected.marker.size"),h("text"),h("hovertext")):delete c.marker;var S=h("hoveron");(S==="all"||S.indexOf("points")!==-1)&&h("hovertemplate"),v.coerceSelectionMarkerOpacity(c,h)}function o(s,c){var h,m;function d(w){return v.coerce(m._input,m,r,w)}for(var T=0;Tse.uf};if(E._hasPreCompStats){var ne=E[z],j=function(xr){return L.d2c((E[xr]||[])[f])},ee=1/0,re=-1/0;for(f=0;f=se.q1&&se.q3>=se.med){var be=j("lowerfence");se.lf=be!==e&&be<=se.q1?be:m(se,H,$);var Ae=j("upperfence");se.uf=Ae!==e&&Ae>=se.q3?Ae:d(se,H,$);var ze=j("mean");se.mean=ze!==e?ze:$?M.mean(H,$):(se.q1+se.q3)/2;var Re=j("sd");se.sd=ze!==e&&Re>=0?Re:$?M.stdev(H,$,se.mean):se.q3-se.q1,se.lo=T(se),se.uo=l(se);var We=j("notchspan");We=We!==e&&We>0?We:_(se,$),se.ln=se.med-We,se.un=se.med+We;var it=se.lf,ot=se.uf;E.boxpoints&&H.length&&(it=Math.min(it,H[0]),ot=Math.max(ot,H[$-1])),E.notched&&(it=Math.min(it,se.ln),ot=Math.max(ot,se.un)),se.min=it,se.max=ot}else{M.warn(["Invalid input - make sure that q1 <= median <= q3","q1 = "+se.q1,"median = "+se.med,"q3 = "+se.q3].join(` `));var tt;se.med!==e?tt=se.med:se.q1!==e?se.q3!==e?tt=(se.q1+se.q3)/2:tt=se.q1:se.q3!==e?tt=se.q3:tt=0,se.med=tt,se.q1=se.q3=tt,se.lf=se.uf=tt,se.mean=se.sd=tt,se.ln=se.un=tt,se.min=se.max=tt}ee=Math.min(ee,se.min),re=Math.max(re,se.max),se.pts2=he.filter(oe),u.push(se)}}E._extremes[L._id]=x.findExtremes(L,[ee,re],{padded:!0})}else{var ut=L.makeCalcdata(E,z),Me=i(Q,ue),_e=Q.length,fe=a(_e);for(f=0;f=0&&Fe<_e&&(J={v:X,i:f},o(J,E,f),fe[Fe].push(J))}var rt=1/0,st=-1/0,Qe=E.quartilemethod,Lt=Qe==="exclusive",kt=Qe==="inclusive";for(f=0;f<_e;f++)if(fe[f].length>0){if(se={},se.pos=se[B]=Q[f],he=se.pts=fe[f].sort(c),H=se[z]=he.map(h),$=H.length,se.min=H[0],se.max=H[$-1],se.mean=M.mean(H,$),se.sd=M.stdev(H,$,se.mean)*E.sdmultiple,se.med=M.interp(H,.5),$%2&&(Lt||kt)){var qt,Zt;Lt?(qt=H.slice(0,$/2),Zt=H.slice($/2+1)):kt&&(qt=H.slice(0,$/2+1),Zt=H.slice($/2)),se.q1=M.interp(qt,.5),se.q3=M.interp(Zt,.5)}else se.q1=M.interp(H,.25),se.q3=M.interp(H,.75);se.lf=m(se,H,$),se.uf=d(se,H,$),se.lo=T(se),se.uo=l(se);var Sr=_(se,$);se.ln=se.med-Sr,se.un=se.med+Sr,rt=Math.min(rt,se.ln),st=Math.max(st,se.un),se.pts2=he.filter(oe),u.push(se)}E.notched&&M.isTypedArray(ut)&&(ut=Array.from(ut)),E._extremes[L._id]=x.findExtremes(L,E.notched?ut.concat([rt,st]):ut,{padded:!0})}return s(u,E),u.length>0?(u[0].t={num:g[y],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:")}},g[y]++,u):[{t:{empty:!0}}]};function r(w,S,E,g){var b=S in w,p=S+"0"in w,u="d"+S in w;if(b||p&&u){var y=E.makeCalcdata(w,S),f=A(w,E,S,y).vals;return[f,y]}var P;p?P=w[S+"0"]:"name"in w&&(E.type==="category"||v(w.name)&&["linear","log"].indexOf(E.type)!==-1||M.isDateTime(w.name)&&E.type==="date")?P=w.name:P=g;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(m=0;m0;if(L==="positive"?(se=z*(P?1:.5),$=H,he=$=B):L==="negative"?(se=$=B,he=z*(P?1:.5),J=H):(se=he=z,$=J=H),re){var ce=y.pointpos,be=y.jitter,Ae=y.marker.size/2,ze=0;ce+be>=0&&(ze=H*(ce+be),ze>se?(ee=!0,ne=Ae,X=ze):ze>$&&(ne=Ae,X=se)),ze<=se&&(X=se);var Re=0;ce-be<=0&&(Re=-H*(ce-be),Re>he?(ee=!0,j=Ae,oe=Re):Re>J&&(j=Ae,oe=he)),Re<=he&&(oe=he)}else X=se,oe=he;var We=new Array(T.length);for(d=0;dE.lo&&(N.so=!0)}return b});S.enter().append("path").classed("point",!0),S.exit().remove(),S.call(A.translatePoints,h,m)}function a(n,o,s,c){var h=o.val,m=o.pos,d=!!m.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=n.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(g){var b=m.c2l(g.pos+T,!0),p=m.l2p(b-w)+l,u=m.l2p(b+S)+l,y=d?(p+u)/2:m.l2p(b)+l,f=h.c2p(g.mean,!0),P=h.c2p(g.mean-g.sd,!0),L=h.c2p(g.mean+g.sd,!0);s.orientation==="h"?v.select(this).attr("d","M"+f+","+p+"V"+u+(_==="sd"?"m0,0L"+P+","+y+"L"+f+","+p+"L"+L+","+y+"Z":"")):v.select(this).attr("d","M"+p+","+f+"H"+u+(_==="sd"?"m0,0L"+y+","+P+"L"+p+","+f+"L"+y+","+L+"Z":""))})}q.exports={plot:t,plotBoxAndWhiskers:r,plotPoints:i,plotBoxMean:a}}}),W2=Ze({"src/traces/box/style.js"(Z,q){"use strict";var v=Oi(),x=Yi(),A=as();function M(t,r,i){var a=i||v.select(t).selectAll("g.trace.boxes");a.style("opacity",function(n){return n[0].trace.opacity}),a.each(function(n){var o=v.select(this),s=n[0].trace,c=s.line.width;function h(T,l,_,w){T.style("stroke-width",l+"px").call(x.stroke,_).call(x.fill,w)}var m=o.selectAll("path.box");if(s.type==="candlestick")m.each(function(T){if(!T.empty){var l=v.select(this),_=s[T.dir];h(l,_.line.width,_.line.color,_.fillcolor),l.style("opacity",s.selectedpoints&&!T.selected?.3:1)}});else{h(m,c,s.line.color,s.fillcolor),o.selectAll("path.mean").style({"stroke-width":c,"stroke-dasharray":2*c+"px,"+c+"px"}).call(x.stroke,s.line.color);var d=o.selectAll("path.point");A.pointStyle(d,s,t)}})}function e(t,r,i){var a=r[0].trace,n=i.selectAll("path.point");a.selectedpoints?A.selectedPointStyle(n,a):A.pointStyle(n,a,t)}q.exports={style:M,styleOnSelect:e}}}),$S=Ze({"src/traces/box/hover.js"(Z,q){"use strict";var v=Wo(),x=ca(),A=ef(),M=Yi(),e=x.fillText;function t(a,n,o,s){var c=a.cd,h=c[0].trace,m=h.hoveron,d=[],T;return m.indexOf("boxes")!==-1&&(d=d.concat(r(a,n,o,s))),m.indexOf("points")!==-1&&(T=i(a,n,o)),s==="closest"?T?[T]:d:(T&&d.push(T),d)}function r(a,n,o,s){var c=a.cd,h=a.xa,m=a.ya,d=c[0].trace,T=c[0].t,l=d.type==="violin",_,w,S,E,g,b,p,u,y,f,P,L=T.bdPos,z,F,B=T.wHover,O=function(Re){return S.c2l(Re.pos)+T.bPos-S.c2l(b)};l&&d.side!=="both"?(d.side==="positive"&&(y=function(Re){var We=O(Re);return A.inbox(We,We+B,f)},z=L,F=0),d.side==="negative"&&(y=function(Re){var We=O(Re);return A.inbox(We-B,We,f)},z=0,F=L)):(y=function(Re){var We=O(Re);return A.inbox(We-B,We+B,f)},z=F=L);var I;l?I=function(Re){return A.inbox(Re.span[0]-g,Re.span[1]-g,f)}:I=function(Re){return A.inbox(Re.min-g,Re.max-g,f)},d.orientation==="h"?(g=n,b=o,p=I,u=y,_="y",S=m,w="x",E=h):(g=o,b=n,p=y,u=I,_="x",S=h,w="y",E=m);var N=Math.min(1,L/Math.abs(S.r2c(S.range[1])-S.r2c(S.range[0])));f=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=d.line.color,se=(d.marker||{}).color;M.opacity(ue)&&d.line.width?a.color=ue:M.opacity(se)&&d.boxpoints?a.color=se:a.color=d.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/f,a[he]=S.c2p(Q.pos,!0);var H=d.boxmean||d.sizemode==="sd"||(d.meanline||{}).visible,$=d.boxpoints||d.points,J=$&&H?["max","uf","q3","med","mean","q1","lf","min"]:$&&!H?["max","uf","q3","med","q1","lf","min"]:!$&&H?["max","q3","med","mean","q1","min"]:["max","q3","med","q1","min"],X=E.range[1]0&&(i=!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(v(t))if(t=Number(t),v(M[x])){if(M[x]p&&pM){var f=u===x?1:6,P=u===x?"M12":"M1";return function(L,z){var F=T.c2d(L,x,l),B=F.indexOf("-",f);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 o(c,h,m,d,T,l){if(d&&c>M){var _=s(h,T,l),w=s(m,T,l),S=c===x?0:1;return _[S]!==w[S]}return Math.floor(m/c)-Math.floor(h/c)>.1}function s(c,h,m){var d=h.c2d(c,x,m).split("-");return d[0]===""&&(d.unshift(),d[0]="-"+d[0]),d}}}),iM=Ze({"src/traces/histogram/calc.js"(Z,q){"use strict";var v=is(),x=ca(),A=oo(),M=Wo(),e=O_(),t=tM(),r=rM(),i=aM(),a=nM();function n(m,d){var T=[],l=[],_=d.orientation==="h",w=M.getFromId(m,_?d.yaxis:d.xaxis),S=_?"y":"x",E={x:"y",y:"x"}[S],g=d[S+"calendar"],b=d.cumulative,p,u=o(m,d,w,S),y=u[0],f=u[1],P=typeof y.size=="string",L=[],z=P?L:y,F=[],B=[],O=[],I=0,N=d.histnorm,U=d.histfunc,W=N.indexOf("density")!==-1,Q,ue,se;b.enabled&&W&&(N=N.replace(/ ?density$/,""),W=!1);var he=U==="max"||U==="min",H=he?null:0,$=t.count,J=r[N],X=!1,oe=function(_e){return w.r2c(_e,0,g)},ne;for(x.isArrayOrTypedArray(d[E])&&U!=="count"&&(ne=d[E],X=U==="avg",$=t[U]),p=oe(y.start),ue=oe(y.end)+(p-M.tickIncrement(p,y.size,!1,g))/1e6;p=0&&se=tt;p--)if(l[p]){ut=p;break}for(p=tt;p<=ut;p++)if(v(T[p])&&v(l[p])){var Me={p:T[p],s:l[p],b:0};b.enabled||(Me.pts=O[p],ce?Me.ph0=Me.ph1=O[p].length?f[O[p][0]]:T[p]:(d._computePh=!0,Me.ph0=We(L[p]),Me.ph1=We(L[p+1],!0))),ot.push(Me)}return ot.length===1&&(ot[0].width1=M.tickIncrement(ot[0].p,y.size,!1,g)-ot[0].p),e(ot,d),x.isArrayOrTypedArray(d.selectedpoints)&&x.tagSelected(ot,d,ze),ot}function o(m,d,T,l,_){var w=l+"bins",S=m._fullLayout,E=d["_"+l+"bingroup"],g=S._histogramBinOpts[E],b=S.barmode==="overlay",p,u,y,f,P,L,z,F=function(Re){return T.r2c(Re,0,f)},B=function(Re){return T.c2r(Re,0,f)},O=T.type==="date"?function(Re){return Re||Re===0?x.cleanDate(Re,null,f):null}:function(Re){return v(Re)?Number(Re):null};function I(Re,We,it){We[Re+"Found"]?(We[Re]=O(We[Re]),We[Re]===null&&(We[Re]=it[Re])):(L[Re]=We[Re]=it[Re],x.nestedProperty(u[0],w+"."+Re).set(it[Re]))}if(d["_"+l+"autoBinFinished"])delete d["_"+l+"autoBinFinished"];else{u=g.traces;var N=[],U=!0,W=!1,Q=!1;for(p=0;p"u"){if(_)return[se,P,!0];se=s(m,d,T,l,w)}z=y.cumulative||{},z.enabled&&z.currentbin!=="include"&&(z.direction==="decreasing"?se.start=B(M.tickIncrement(F(se.start),se.size,!0,f)):se.end=B(M.tickIncrement(F(se.end),se.size,!1,f))),g.size=se.size,g.sizeFound||(L.size=se.size,x.nestedProperty(u[0],w+".size").set(se.size)),I("start",g,se),I("end",g,se)}P=d["_"+l+"pos0"],delete d["_"+l+"pos0"];var H=d._input[w]||{},$=x.extendFlat({},g),J=g.start,X=T.r2l(H.start),oe=X!==void 0;if((g.startFound||oe)&&X!==T.r2l(J)){var ne=oe?X:x.aggNums(Math.min,null,P),j={type:T.type==="category"||T.type==="multicategory"?"linear":T.type,r2l:T.r2l,dtick:g.size,tick0:J,calendar:f,range:[ne,M.tickIncrement(ne,g.size,!1,f)].map(T.l2r)},ee=M.tickFirst(j);ee>T.r2l(ne)&&(ee=M.tickIncrement(ee,g.size,!0,f)),$.start=T.l2r(ee),oe||x.nestedProperty(d,w+".start").set($.start)}var re=g.end,ce=T.r2l(H.end),be=ce!==void 0;if((g.endFound||be)&&ce!==T.r2l(re)){var Ae=be?ce:x.aggNums(Math.max,null,P);$.end=T.l2r(Ae),be||x.nestedProperty(d,w+".start").set($.end)}var ze="autobin"+l;return d._input[ze]===!1&&(d._input[w]=x.extendFlat({},d[w]||{}),delete d._input[ze],delete d[ze]),[$,P]}function s(m,d,T,l,_){var w=m._fullLayout,S=c(m,d),E=!1,g=1/0,b=[d],p,u,y;for(p=0;p=0;l--)E(l);else if(d==="increasing"){for(l=1;l=0;l--)m[l]+=m[l+1];T==="exclude"&&(m.push(0),m.shift())}}q.exports={calc:n,calcAllAutoBins:o}}}),r4=Ze({"src/traces/histogram2d/calc.js"(Z,q){"use strict";var v=ca(),x=Wo(),A=tM(),M=rM(),e=aM(),t=nM(),r=iM().calcAllAutoBins;q.exports=function(s,c){var h=x.getFromId(s,c.xaxis),m=x.getFromId(s,c.yaxis),d=c.xcalendar,T=c.ycalendar,l=function(Be){return h.r2c(Be,0,d)},_=function(Be){return m.r2c(Be,0,T)},w=function(Be){return h.c2r(Be,0,d)},S=function(Be){return m.c2r(Be,0,T)},E,g,b,p,u=r(s,c,h,"x"),y=u[0],f=u[1],P=r(s,c,m,"y"),L=P[0],z=P[1],F=c._length;f.length>F&&f.splice(F,f.length-F),z.length>F&&z.splice(F,z.length-F);var B=[],O=[],I=[],N=typeof y.size=="string",U=typeof L.size=="string",W=[],Q=[],ue=N?W:y,se=U?Q:L,he=0,H=[],$=[],J=c.histnorm,X=c.histfunc,oe=J.indexOf("density")!==-1,ne=X==="max"||X==="min",j=ne?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=y.size,We=l(y.start),it=l(y.end)+(We-x.tickIncrement(We,Re,!1,d))/1e6;for(E=We;E=0&&b=0&&px;n++)a=e(r,i,M(a));return a>x&&v.log("interp2d didn't converge quickly",a),r};function e(t,r,i){var a=0,n,o,s,c,h,m,d,T,l,_,w,S,E;for(c=0;cS&&(a=Math.max(a,Math.abs(t[o][s]-w)/(E-S))))}return a}}}),J2=Ze({"src/traces/heatmap/find_empties.js"(Z,q){"use strict";var v=ca().maxRowLength;q.exports=function(A){var M=[],e={},t=[],r=A[0],i=[],a=[0,0,0],n=v(A),o,s,c,h,m,d,T,l;for(s=0;s=0;m--)h=t[m],s=h[0],c=h[1],d=((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,d&&(T[h]=[s,c,d],t.splice(m,1),l=!0);if(!l)throw"findEmpties iterated with no new neighbors";for(h in T)e[h]=T[h],M.push(T[h])}return M.sort(function(_,w){return w[2]-_[2]})}}}),oM=Ze({"src/traces/heatmap/make_bound_array.js"(Z,q){"use strict";var v=oo(),x=ca().isArrayOrTypedArray;q.exports=function(M,e,t,r,i,a){var n=[],o=v.traceIs(M,"contour"),s=v.traceIs(M,"histogram"),c,h,m,d=x(e)&&e.length>1;if(d&&!s&&a.type!=="category"){var T=e.length;if(T<=i){if(o)n=Array.from(e).slice(0,i);else if(i===1)a.type==="log"?n=[.5*e[0],2*e[0]]:n=[e[0]-.5,e[0]+.5];else if(a.type==="log"){for(n=[Math.pow(e[0],1.5)/Math.pow(e[1],.5)],m=1;m1){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(g)?N(y)?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"?"":g,Q=o(T,W,b,p,U,l),ue=T.ytype==="scaled"?"":y,se=o(T,ue,f,P,z.length,_);T._extremes[l._id]=A.findExtremes(l,Q),T._extremes[_._id]=A.findExtremes(_,se);var he={x:Q,y:se,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===se.length-1&&(he.yCenter=ue),S&&(he.xRanges=B.xRanges,he.yRanges=B.yRanges,he.pts=B.pts),w||t(d,T,{vals:z,cLetter:"z"}),w&&T.contours&&T.contours.coloring==="heatmap"){var H={type:T.type==="contour"?"heatmap":"histogram2d",xcalendar:T.xcalendar,ycalendar:T.ycalendar};he.xfill=o(H,W,b,p,U,l),he.yfill=o(H,ue,f,P,z.length,_)}return[he]};function c(m){for(var d=[],T=m.length,l=0;l0;)oe=y.c2p(N[re]),re--;for(oe0;)ee=f.c2p(U[re]),re--;ee=y._length||oe<=0||j>=f._length||ee<=0;if(it){var ot=L.selectAll("image").data([]);ot.exit().remove(),_(L);return}var tt,ut;Ae==="fast"?(tt=H,ut=he):(tt=Re,ut=We);var Me=document.createElement("canvas");Me.width=tt,Me.height=ut;var _e=Me.getContext("2d",{willReadFrequently:!0}),fe=o(F,{noNumericCheck:!0,returnArray:!0}),Fe,rt;Ae==="fast"?(Fe=$?function(Da){return H-1-Da}:t.identity,rt=J?function(Da){return he-1-Da}:t.identity):(Fe=function(Da){return t.constrain(Math.round(y.c2p(N[Da])-X),0,Re)},rt=function(Da){return t.constrain(Math.round(f.c2p(U[Da])-j),0,We)});var st=rt(0),Qe=[st,st],Lt=$?0:1,kt=J?0:1,qt=0,Zt=0,Sr=0,xr=0,jr,wr,Ir,bt,Be;function Ke(Da,Zn){if(Da!==void 0){var Pn=fe(Da);return Pn[0]=Math.round(Pn[0]),Pn[1]=Math.round(Pn[1]),Pn[2]=Math.round(Pn[2]),qt+=Zn,Zt+=Pn[0]*Zn,Sr+=Pn[1]*Zn,xr+=Pn[2]*Zn,Pn}return[0,0,0,0]}function Ue(Da,Zn,Pn,fi){var Ai=Da[Pn.bin0];if(Ai===void 0)return Ke(void 0,1);var ki=Da[Pn.bin1],zi=Zn[Pn.bin0],Xi=Zn[Pn.bin1],to=ki-Ai||0,go=zi-Ai||0,pi;return ki===void 0?Xi===void 0?pi=0:zi===void 0?pi=2*(Xi-Ai):pi=(2*Xi-zi-Ai)*2/3:Xi===void 0?zi===void 0?pi=0:pi=(2*Ai-ki-zi)*2/3:zi===void 0?pi=(2*Xi-ki-Ai)*2/3:pi=Xi+Ai-ki-zi,Ke(Ai+Pn.frac*to+fi.frac*(go+Pn.frac*pi))}if(Ae!=="default"){var Ee=0,Ve;try{Ve=new Uint8Array(tt*ut*4)}catch{Ve=new Array(tt*ut*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>f._length))for(ce=ta;cenn||nn>y._length)){var yn=i({x:rn,y:Ia},F,g._fullLayout);yn.x=rn,yn.y=Ia;var xt=z.z[re][ce];xt===void 0?(yn.z="",yn.zLabel=""):(yn.z=xt,yn.zLabel=e.tickText(Jt,xt,"hover").text);var ct=z.text&&z.text[re]&&z.text[re][ce];(ct===void 0||ct===!1)&&(ct=""),yn.text=ct;var Nr=t.texttemplateString(en,yn,g._fullLayout._d3locale,yn,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(v.inbox(i-T[0],i-T[T.length-1],0)>0||v.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:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}}}),V_=Ze({"src/traces/contour/attributes.js"(Z,q){"use strict";var v=p1(),x=tf(),A=Qc(),M=A.axisHoverFormat,e=A.descriptionOnlyNumbers,t=Mu(),r=Gh().dash,i=tc(),a=rs().extendFlat,n=o3(),o=n.COMPARISON_OPS2,s=n.INTERVAL_OPS,c=x.line;q.exports=a({z:v.z,x:v.x,x0:v.x0,dx:v.dx,y:v.y,y0:v.y0,dy:v.dy,xperiod:v.xperiod,yperiod:v.yperiod,xperiod0:x.xperiod0,yperiod0:x.yperiod0,xperiodalignment:v.xperiodalignment,yperiodalignment:v.yperiodalignment,text:v.text,hovertext:v.hovertext,transpose:v.transpose,xtype:v.xtype,ytype:v.ytype,xhoverformat:M("x"),yhoverformat:M("y"),zhoverformat:M("z",1),hovertemplate:v.hovertemplate,texttemplate:a({},v.texttemplate,{}),textfont:a({},v.textfont,{}),hoverongaps:v.hoverongaps,connectgaps:a({},v.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:i({editType:"plot",colorEditType:"style"}),labelformat:{valType:"string",dflt:"",editType:"plot",description:e("contour label")},operation:{valType:"enumerated",values:[].concat(o).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"}))}}),fM=Ze({"src/traces/histogram2dcontour/attributes.js"(Z,q){"use strict";var v=i3(),x=V_(),A=Mu(),M=Qc().axisHoverFormat,e=rs().extendFlat;q.exports=e({x:v.x,y:v.y,z:v.z,marker:v.marker,histnorm:v.histnorm,histfunc:v.histfunc,nbinsx:v.nbinsx,xbins:v.xbins,nbinsy:v.nbinsy,ybins:v.ybins,autobinx:v.autobinx,autobiny:v.autobiny,bingroup:v.bingroup,xbingroup:v.xbingroup,ybingroup:v.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:v.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"),i=t===!1||r===!1,a=M("contours.size"),n;i?n=A.autocontour=!0:n=M("autocontour",!1),(n||!a)&&M("ncontours")}}}),hM=Ze({"src/traces/contour/label_defaults.js"(Z,q){"use strict";var v=ca();q.exports=function(A,M,e,t){t||(t={});var r=A("contours.showlabels");if(r){var i=M.font;v.coerceFont(A,"contours.labelfont",i,{overrideDflt:{color:e}}),A("contours.labelformat")}t.hasHover!==!1&&A("zhoverformat")}}}),l3=Ze({"src/traces/contour/style_defaults.js"(Z,q){"use strict";var v=gh(),x=hM();q.exports=function(M,e,t,r,i){var a=t("contours.coloring"),n,o="";a==="fill"&&(n=t("contours.showlines")),n!==!1&&(a!=="lines"&&(o=t("line.color","#000")),t("line.width",.5),t("line.dash")),a!=="none"&&(M.showlegend!==!0&&(e.showlegend=!1),e._dfltShowLegend=!1,v(M,e,r,t,{prefix:"",cLetter:"z"})),t("line.smoothing"),x(t,r,o,i)}}}),d4=Ze({"src/traces/histogram2dcontour/defaults.js"(Z,q){"use strict";var v=ca(),x=cM(),A=s3(),M=l3(),e=j_(),t=fM();q.exports=function(i,a,n,o){function s(h,m){return v.coerce(i,a,t,h,m)}function c(h){return v.coerce2(i,a,t,h)}x(i,a,s,o),a.visible!==!1&&(A(i,a,s,c),M(i,a,s,o),s("xhoverformat"),s("yhoverformat"),s("hovertemplate"),a.contours&&a.contours.coloring==="heatmap"&&e(s,o))}}}),pM=Ze({"src/traces/contour/set_contours.js"(Z,q){"use strict";var v=Wo(),x=ca();q.exports=function(e,t){var r=e.contours;if(e.autocontour){var i=e.zmin,a=e.zmax;(e.zauto||i===void 0)&&(i=x.aggNums(Math.min,null,t)),(e.zauto||a===void 0)&&(a=x.aggNums(Math.max,null,t));var n=A(i,a,e.ncontours);r.size=n.dtick,r.start=v.tickFirst(n),n.range.reverse(),r.end=v.tickFirst(n),r.start===i&&(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 o=r.start,s=r.end,c=e._input.contours;if(o>s&&(r.start=c.start=s,s=r.end=c.end=o,o=r.start),!(r.size>0)){var h;o===s?h=1:h=A(o,s,e.ncontours).dtick,c.size=r.size=h}}};function A(M,e,t){var r={type:"linear",range:[M,e]};return v.autoTicks(r,(e-M)/(t||15)),r}}}),q_=Ze({"src/traces/contour/end_plus.js"(Z,q){"use strict";q.exports=function(x){return x.end+x.size/1e6}}}),dM=Ze({"src/traces/contour/calc.js"(Z,q){"use strict";var v=rc(),x=$2(),A=pM(),M=q_();q.exports=function(t,r){var i=x(t,r),a=i[0].z;A(r,a);var n=r.contours,o=v.extractOpts(r),s;if(n.coloring==="heatmap"&&o.auto&&r.autocontour===!1){var c=n.start,h=M(n),m=n.size||1,d=Math.floor((h-c)/m)+1;isFinite(m)||(m=1,d=1);var T=c-m/2,l=T+d*m;s=[T,l]}else s=a;return v.calc(t,r,{vals:s,cLetter:"z"}),i}}}),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}}}}),vM=Ze({"src/traces/contour/make_crossings.js"(Z,q){"use strict";var v=G_();q.exports=function(M){var e=M[0].z,t=e.length,r=e[0].length,i=t===2||r===2,a,n,o,s,c,h,m,d,T;for(n=0;nA?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}}}),mM=Ze({"src/traces/contour/find_all_paths.js"(Z,q){"use strict";var v=ca(),x=G_();q.exports=function(a,n,o){var s,c,h,m,d;for(n=n||.01,o=o||.01,h=0;h20?(h=x.CHOOSESADDLE[h][(m[0]||m[1])<0?0:1],i.crossings[c]=x.SADDLEREMAINDER[h]):delete i.crossings[c],m=x.NEWDELTA[h],!m){v.log("Found bad marching index:",h,a,i.level);break}d.push(r(i,a,m)),a[0]+=m[0],a[1]+=m[1],c=a.join(","),A(d[d.length-1],d[d.length-2],o,s)&&d.pop();var E=m[0]&&(a[0]<0||a[0]>l-2)||m[1]&&(a[1]<0||a[1]>T-2),g=a[0]===_[0]&&a[1]===_[1]&&m[0]===w[0]&&m[1]===w[1];if(g||n&&E)break;h=i.crossings[c]}S===1e4&&v.log("Infinite loop in contour?");var b=A(d[0],d[d.length-1],o,s),p=0,u=.2*i.smoothing,y=[],f=0,P,L,z,F,B,O,I,N,U,W,Q;for(S=1;S=f;S--)if(P=y[S],P=f&&P+y[L]N&&U--,i.edgepaths[U]=Q.concat(d,W));break}H||(i.edgepaths[N]=d.concat(W))}for(N=0;N20&&a?i===208||i===1114?o=n[0]===0?1:-1:s=n[1]===0?1:-1:x.BOTTOMSTART.indexOf(i)!==-1?s=1:x.LEFTSTART.indexOf(i)!==-1?o=1:x.TOPSTART.indexOf(i)!==-1?s=-1:o=-1,[o,s]}function r(i,a,n){var o=a[0]+Math.max(n[0],0),s=a[1]+Math.max(n[1],0),c=i.z[s][o],h=i.xaxis,m=i.yaxis;if(n[1]){var d=(i.level-c)/(i.z[s][o+1]-c),T=(d!==1?(1-d)*h.c2l(i.x[o]):0)+(d!==0?d*h.c2l(i.x[o+1]):0);return[h.c2p(h.l2c(T),!0),m.c2p(i.y[s],!0),o+d,s]}else{var l=(i.level-c)/(i.z[s+1][o]-c),_=(l!==1?(1-l)*m.c2l(i.y[s]):0)+(l!==0?l*m.c2l(i.y[s+1]):0);return[h.c2p(i.x[o],!0),m.c2p(m.l2c(_),!0),o,s+l]}}}}),v4=Ze({"src/traces/contour/constraint_mapping.js"(Z,q){"use strict";var v=o3(),x=is();q.exports={"[]":M("[]"),"][":M("]["),">":e(">"),"<":e("<"),"=":e("=")};function A(t,r){var i=Array.isArray(r),a;function n(o){return x(o)?+o:null}return v.COMPARISON_OPS2.indexOf(t)!==-1?a=n(i?r[0]:r):v.INTERVAL_OPS.indexOf(t)!==-1?a=i?[n(r[0]),n(r[1])]:[n(r),n(r)]:v.SET_OPS.indexOf(t)!==-1&&(a=i?r.map(n):[n(r)]),a}function M(t){return function(r){r=A(t,r);var i=Math.min(r[0],r[1]),a=Math.max(r[0],r[1]);return{start:i,end:a,size:a-i}}}function e(t){return function(r){return r=A(t,r),{start:r,end:1/0,size:1/0}}}}}),gM=Ze({"src/traces/contour/empty_pathinfo.js"(Z,q){"use strict";var v=ca(),x=v4(),A=q_();q.exports=function(e,t,r){for(var i=e.type==="constraint"?x[e._operation](e.value):e,a=i.size,n=[],o=A(i),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},h=i.start;h1e3){v.warn("Too many contours, clipping at 1000",e);break}return n}}}),yM=Ze({"src/traces/contour/convert_to_constraints.js"(Z,q){"use strict";var v=ca();q.exports=function(A,M){var e,t,r,i=function(o){return o.reverse()},a=function(o){return o};switch(M){case"=":case"<":return A;case">":for(A.length!==1&&v.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 i=A.x.length,a=A.y.length,n=-1/0,o=1/0;for(e=0;e":s>n&&(A.prefixBoundary=!0);break;case"<":(sn||A.starts.length&&h===o)&&(A.prefixBoundary=!0);break;case"][":c=Math.min(s[0],s[1]),h=Math.max(s[0],s[1]),cn&&(A.prefixBoundary=!0);break}break}}}}),u3=Ze({"src/traces/contour/plot.js"(Z){"use strict";var q=Oi(),v=ca(),x=as(),A=rc(),M=fu(),e=Wo(),t=wv(),r=e3(),i=vM(),a=mM(),n=gM(),o=yM(),s=_M(),c=G_(),h=c.LABELOPTIMIZER;Z.plot=function(g,b,p,u){var y=b.xaxis,f=b.yaxis;v.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=n(I,b,z),U=v.ensureSingle(L,"g","heatmapcoloring"),W=[];I.coloring==="heatmap"&&(W=[P]),r(g,b,W,U),i(N),a(N);var Q=y.c2p(B[0],!0),ue=y.c2p(B[B.length-1],!0),se=f.c2p(O[0],!0),he=f.c2p(O[O.length-1],!0),H=[[Q,he],[ue,he],[ue,se],[Q,se]],$=N;I.type==="constraint"&&($=o(N,I._operation)),m(L,H,I),d(L,$,H,I),l(L,N,g,z,I),w(L,b,g,z,H)})};function m(E,g,b){var p=v.ensureSingle(E,"g","contourbg"),u=p.selectAll("path").data(b.coloring==="fill"?[0]:[]);u.enter().append("path"),u.exit().remove(),u.attr("d","M"+g.join("L")+"Z").style("stroke","none")}function d(E,g,b,p){var u=p.coloring==="fill"||p.type==="constraint"&&p._operation!=="=",y="M"+b.join("L")+"Z";u&&s(g,p);var f=v.ensureSingle(E,"g","contourfill"),P=f.selectAll("path").data(u?g:[]);P.enter().append("path"),P.exit().remove(),P.each(function(L){var z=(L.prefixBoundary?y:"")+T(L,b);z?q.select(this).attr("d",z).style("stroke","none"):q.select(this).remove()})}function T(E,g){var b="",p=0,u=E.edgepaths.map(function(Q,ue){return ue}),y=!0,f,P,L,z,F,B;function O(Q){return Math.abs(Q[1]-g[0][1])<.01}function I(Q){return Math.abs(Q[1]-g[2][1])<.01}function N(Q){return Math.abs(Q[0]-g[0][0])<.01}function U(Q){return Math.abs(Q[0]-g[2][0])<.01}for(;u.length;){for(B=x.smoothopen(E.edgepaths[p],E.smoothing),b+=y?B:B.replace(/^M/,"L"),u.splice(u.indexOf(p),1),f=E.edgepaths[p][E.edgepaths[p].length-1],z=-1,L=0;L<4;L++){if(!f){v.log("Missing end?",p,E);break}for(O(f)&&!U(f)?P=g[1]:N(f)?P=g[0]:I(f)?P=g[3]:U(f)&&(P=g[2]),F=0;F=0&&(P=W,z=F):Math.abs(f[1]-P[1])<.01?Math.abs(f[1]-W[1])<.01&&(W[0]-f[0])*(P[0]-W[0])>=0&&(P=W,z=F):v.log("endpt to newendpt is not vert. or horz.",f,P,W)}if(f=P,z>=0)break;b+="L"+P}if(z===E.edgepaths.length){v.log("unclosed perimeter path");break}p=z,y=u.indexOf(p)===-1,y&&(p=u[0],b+="Z")}for(p=0;ph.MAXCOST*2)break;O&&(P/=2),f=z-P/2,L=f+P*1.5}if(B<=h.MAXCOST)return F};function _(E,g,b,p){var u=g.width/2,y=g.height/2,f=E.x,P=E.y,L=E.theta,z=Math.cos(L)*u,F=Math.sin(L)*u,B=(f>p.center?p.right-f:f-p.left)/(z+Math.abs(Math.sin(L)*y)),O=(P>p.middle?p.bottom-P:P-p.top)/(Math.abs(F)+Math.cos(L)*y);if(B<1||O<1)return 1/0;var I=h.EDGECOST*(1/(B-1)+1/(O-1));I+=h.ANGLECOST*L*L;for(var N=f-z,U=P-F,W=f+z,Q=P+F,ue=0;ue=w)&&(r<=_&&(r=_),i>=w&&(i=w),n=Math.floor((i-r)/a)+1,o=0),l=0;l_&&(m.unshift(_),d.unshift(d[0])),m[m.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])]:v(s.value)&&(c=parseFloat(s.value),s.value=[c,c+1])):(o("contours.value",0),v(s.value)||(r(s.value)?s.value=parseFloat(s.value[0]):s.value=0))}}}),y4=Ze({"src/traces/contour/defaults.js"(Z,q){"use strict";var v=ca(),x=X2(),A=Qd(),M=wM(),e=s3(),t=l3(),r=j_(),i=V_();q.exports=function(n,o,s,c){function h(l,_){return v.coerce(n,o,i,l,_)}function m(l){return v.coerce2(n,o,i,l)}var d=x(n,o,h,c);if(!d){o.visible=!1;return}A(n,o,c,h),h("xhoverformat"),h("yhoverformat"),h("text"),h("hovertext"),h("hoverongaps"),h("hovertemplate");var T=h("contours.type")==="constraint";h("connectgaps",v.isArray1D(o.z)),T?M(n,o,h,c,s):(e(n,o,h,m),t(n,o,h,c)),o.contours&&o.contours.coloring==="heatmap"&&r(h,c),h("zorder")}}}),_4=Ze({"src/traces/contour/index.js"(Z,q){"use strict";q.exports={attributes:V_(),supplyDefaults:y4(),calc:dM(),plot:u3().plot,style:c3(),colorbar:f3(),hoverPoints:bM(),moduleType:"trace",name:"contour",basePlotModule:Zf(),categories:["cartesian","svg","2dMap","contour","showLegend"],meta:{}}}}),x4=Ze({"lib/contour.js"(Z,q){"use strict";q.exports=_4()}}),TM=Ze({"src/traces/scatterternary/attributes.js"(Z,q){"use strict";var v=Cs().hovertemplateAttrs,x=Cs().texttemplateAttrs,A=$d(),M=tf(),e=eu(),t=Mu(),r=Gh().dash,i=rs().extendFlat,a=M.marker,n=M.line,o=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:i({},M.mode,{dflt:"markers"}),text:i({},M.text,{}),texttemplate:x({editType:"plot"},{keys:["a","b","c","text"]}),hovertext:i({},M.hovertext,{}),line:{color:n.color,width:n.width,dash:r,backoff:n.backoff,shape:i({},n.shape,{values:["linear","spline"]}),smoothing:n.smoothing,editType:"calc"},connectgaps:M.connectgaps,cliponaxis:M.cliponaxis,fill:i({},M.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:A(),marker:i({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:i({width:o.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:i({},e.hoverinfo,{flags:["a","b","c","text","name"]}),hoveron:M.hoveron,hovertemplate:v()}}}),b4=Ze({"src/traces/scatterternary/defaults.js"(Z,q){"use strict";var v=ca(),x=Tv(),A=Fu(),M=md(),e=Dd(),t=o1(),r=zd(),i=ev(),a=TM();q.exports=function(o,s,c,h){function m(E,g){return v.coerce(o,s,a,E,g)}var d=m("a"),T=m("b"),l=m("c"),_;if(d?(_=d.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=_,m("sum"),m("text"),m("hovertext"),s.hoveron!=="fills"&&m("hovertemplate");var w=_"),i.hovertemplate=h.hovertemplate,r}}}),M4=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}}}),E4=Ze({"src/plots/ternary/ternary.js"(Z,q){"use strict";var v=Oi(),x=Ch(),A=oo(),M=ca(),e=M.strTranslate,t=M._,r=Yi(),i=as(),a=wv(),n=rs().extendFlat,o=xc(),s=Wo(),c=bp(),h=ef(),m=Jd(),d=m.freeMode,T=m.rectMode,l=Zg(),_=Tf().prepSelect,w=Tf().selectOnClick,S=Tf().clearOutline,E=Tf().clearSelectionsCache,g=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=H,ce=re/u),be=se*re/H,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*ne-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-ne],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=n({},I.aaxis,{range:[X,J-oe-ne],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 We=U.baxis=n({},I.baxis,{range:[J-X-ne,oe],side:"bottom",domain:U.xaxis.domain,anchor:"free",position:0,_id:"x",_length:re});a(We,U.graphDiv._fullLayout),We.setScale();var it=U.caxis=n({},I.caxis,{range:[J-X-oe,ne],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 ut=e(j,ee);U.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",ut),U.clipDefRelative.select("path").attr("transform",null);var Me=e(j-We._offset,ee+ce);U.layers.baxis.attr("transform",Me),U.layers.bgrid.attr("transform",Me);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",We.showline?"M"+j+","+(ee+ce)+"h"+re:"M0,0").call(r.stroke,We.linecolor||"#000").style("stroke-width",(We.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(),i.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,se=N.baxis,he=N.caxis;if(N.drawAx(ue),N.drawAx(se),N.drawAx(he),I){var H=Math.max(ue.showticklabels?ue.tickfont.size/2:0,(he.showticklabels?he.tickfont.size*.75:0)+(he.ticks==="outside"?he.ticklen*.87:0)),$=(se.showticklabels?se.tickfont.size:0)+(se.ticks==="outside"?se.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-H,"text-anchor":"middle"}}),Q["b-title"]=l.draw(U,"b"+W,{propContainer:se,propName:N.id+".baxis.title",placeholder:t(U,"Click to enter Component B title"),attributes:{x:N.x0-$,y:N.y0+N.h+se.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,se=N.layers[W],he=30,H=Q+"tickLayout",$=y(I);N[H]!==$&&(se.selectAll("."+ue+"tick").remove(),N[H]=$),I.setScale();var J=s.calcTicks(I),X=s.clipEnds(I,J),oe=s.makeTransTickFn(I),ne=s.getTickSigns(I)[2],j=M.deg2rad(he),ee=ne*(I.linewidth||1)/2,re=ne*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:se,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:se,transFn:oe,labelFns:s.makeLabelFns(I,0,he)})};function y(I){return I.ticks+String(I.ticklen)+String(I.showticklabels)}var f=g.MINZOOM/2+.87,P="m-0.87,.5h"+f+"v3h-"+(f+5.2)+"l"+(f/2+2.6)+",-"+(f*.87+4.5)+"l2.6,1.5l-"+f/2+","+f*.87+"Z",L="m0.87,.5h-"+f+"v3h"+(f+5.2)+"l-"+(f/2+2.6)+",-"+(f*.87+4.5)+"l-2.6,1.5l"+f/2+","+f*.87+"Z",z="m0,1l"+f/2+","+f*.87+"l2.6,-1.5l-"+(f/2+2.6)+",-"+(f*.87+4.5)+"l-"+(f/2+2.6)+","+(f*.87+4.5)+"l2.6,1.5l"+f/2+",-"+f*.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(Me,_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;d(Fe)?I.dragOptions.minDrag=1:I.dragOptions.minDrag=void 0,Fe==="zoom"?(I.dragOptions.moveFn=We,I.dragOptions.clickFn=ce,I.dragOptions.doneFn=it,be(Me,_e,fe)):Fe==="pan"?(I.dragOptions.moveFn=tt,I.dragOptions.clickFn=ce,I.dragOptions.doneFn=ut,ot(),I.clearOutline(U)):(T(Fe)||d(Fe))&&_(Me,_e,fe,I.dragOptions,Fe)}};var se,he,H,$,J,X,oe,ne,j,ee;function re(Me){var _e={};return _e[I.id+".aaxis.min"]=Me.a,_e[I.id+".baxis.min"]=Me.b,_e[I.id+".caxis.min"]=Me.c,_e}function ce(Me,_e){var fe=U._fullLayout.clickmode;O(U),Me===2&&(U.emit("plotly_doubleclick",null),A.call("_guiRelayout",U,re({a:0,b:0,c:0}))),fe.indexOf("select")>-1&&Me===1&&w(_e,U,[I.xaxis],[I.yaxis],I.id,I.dragOptions),fe.indexOf("event")>-1&&h.click(U,_e,I.id)}function be(Me,_e,fe){var Fe=N.getBoundingClientRect();se=_e-Fe.left,he=fe-Fe.top,U._fullLayout._calcInverseTransform(U);var rt=U._fullLayout._invTransform,st=M.apply3DTransform(rt)(se,he);se=st[0],he=st[1],H={a:I.aaxis.range[0],b:I.baxis.range[1],c:I.caxis.range[1]},J=H,$=I.aaxis.range[1]-H.a,X=x(I.graphDiv._fullLayout[I.id].bgcolor).getLuminance(),oe="M0,"+I.h+"L"+I.w/2+", 0L"+I.w+","+I.h+"Z",ne=!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(Me,_e){return 1-_e/I.h}function ze(Me,_e){return 1-(Me+(I.h-_e)/Math.sqrt(3))/I.w}function Re(Me,_e){return(Me-(I.h-_e)/Math.sqrt(3))/I.w}function We(Me,_e){var fe=se+Me*Q,Fe=he+_e*ue,rt=Math.max(0,Math.min(1,Ae(se,he),Ae(fe,Fe))),st=Math.max(0,Math.min(1,ze(se,he),ze(fe,Fe))),Qe=Math.max(0,Math.min(1,Re(se,he),Re(fe,Fe))),Lt=(rt/2+Qe)*I.w,kt=(1-rt/2-st)*I.w,qt=(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),ne=!0),U.emit("plotly_relayouting",re(J))}function it(){O(U),J!==H&&(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(){H={a:I.aaxis.range[0],b:I.baxis.range[1],c:I.caxis.range[1]},J=H}function tt(Me,_e){var fe=Me/I.xaxis._m,Fe=_e/I.yaxis._m;J={a:H.a-Fe,b:H.b+(fe+Fe)/2,c:H.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=(H.a-J.a)*I.yaxis._m,Me=(H.c-J.c-H.b+J.b)*I.xaxis._m);var Qe=e(I.x0+Me,I.y0+_e);I.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",Qe);var Lt=e(-Me,-_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(i.hideOutsideRangePoints,I),U.emit("plotly_relayouting",re(J))}function ut(){A.call("_guiRelayout",U,re(J))}N.onmousemove=function(Me){h.hover(U,Me,I.id),U._fullLayout._lasthover=N,U._fullLayout._hoversubplot=I.id},N.onmouseout=function(Me){U._dragging||c.unhover(U,Me)},c.init(this.dragOptions)};function O(I){v.select(I).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}}}),AM=Ze({"src/plots/ternary/layout_attributes.js"(Z,q){"use strict";var v=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:v.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"}}}),ng=Ze({"src/plots/subplot_defaults.js"(Z,q){"use strict";var v=ca(),x=Dl(),A=bc().defaults;q.exports=function(e,t,r,i){var a=i.type,n=i.attributes,o=i.handleDefaults,s=i.partition||"x",c=t._subplots[a],h=c.length,m=h&&c[0].replace(/\d+$/,""),d,T;function l(E,g){return v.coerce(d,T,n,E,g)}for(var _=0;_=_&&(b.min=0,p.min=0,u.min=0,h.aaxis&&delete h.aaxis.min,h.baxis&&delete h.baxis.min,h.caxis&&delete h.caxis.min)}function c(h,m,d,T){var l=n[m._name];function _(y,f){return A.coerce(h,m,l,y,f)}_("uirevision",T.uirevision),m.type="linear";var w=_("color"),S=w!==l.color.dflt?w:d.font.color,E=m._name,g=E.charAt(0).toUpperCase(),b="Component "+g,p=_("title.text",b);m._hovertitle=p===b?p:g,A.coerceFont(_,"title.font",d.font,{overrideDflt:{size:A.bigFont(d.font.size),color:S}}),_("min"),i(h,m,_,"linear"),t(h,m,_,"linear"),e(h,m,_,"linear",{noAutotickangles:!0,noTicklabelshift:!0,noTicklabelstandoff:!0}),r(h,m,_,{outerTicks:!0});var u=_("showticklabels");u&&(A.coerceFont(_,"tickfont",d.font,{overrideDflt:{color:S}}),_("tickangle"),_("tickformat")),a(h,m,_,{dfltColor:w,bgColor:d.bgColor,blend:60,showLine:!0,showGrid:!0,noZeroLine:!0,attributes:l}),_("hoverformat"),_("layer")}}}),k4=Ze({"src/plots/ternary/index.js"(Z){"use strict";var q=E4(),v=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=AM(),Z.supplyLayoutDefaults=C4(),Z.plot=function(r){for(var i=r._fullLayout,a=r.calcdata,n=i._subplots[A],o=0;o0){var E=r.xa,g=r.ya,b,p,u,y,f;h.orientation==="h"?(f=i,b="y",u=g,p="x",y=E):(f=a,b="x",u=E,p="y",y=g);var P=c[r.index];if(f>=P.span[0]&&f<=P.span[1]){var L=x.extendFlat({},r),z=y.c2p(f,!0),F=e.getKdeValue(P,h,f),B=e.getPositionOnKdePath(P,h,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(y,f,h[p+"hoverformat"])+", "+c[0].t.labels.kde+" "+F.toFixed(3);for(var N=0,U=0;U path").each(function(d){if(!d.isBlank){var T=m.marker;v.select(this).call(A.fill,d.mc||T.color).call(A.stroke,d.mlc||T.line.color).call(x.dashLine,T.line.dash,d.mlw||T.line.width).style("opacity",m.selectedpoints&&!d.selected?M:1)}}),r(h,m,a),h.selectAll(".regions").each(function(){v.select(this).selectAll("path").style("stroke-width",0).call(A.fill,m.connector.fillcolor)}),h.selectAll(".lines").each(function(){var d=m.connector.line;x.lineGroupStyle(v.select(this).selectAll("path"),d.width,d.color,d.dash)})})}q.exports={style:i}}}),Z4=Ze({"src/traces/funnel/hover.js"(Z,q){"use strict";var v=Yi().opacity,x=f1().hoverOnBars,A=ca().formatPercent;q.exports=function(t,r,i,a,n){var o=x(t,r,i,a,n);if(o){var s=o.cd,c=s[0].trace,h=c.orientation==="h",m=o.index,d=s[m],T=h?"x":"y";o[T+"LabelVal"]=d.s,o.percentInitial=d.begR,o.percentInitialLabel=A(d.begR,1),o.percentPrevious=d.difR,o.percentPreviousLabel=A(d.difR,1),o.percentTotal=d.sumR,o.percentTotalLabel=A(d.sumR,1);var l=d.hi||c.hoverinfo,_=[];if(l&&l!=="none"&&l!=="skip"){var w=l==="all",S=l.split("+"),E=function(g){return w||S.indexOf(g)!==-1};E("percent initial")&&_.push(o.percentInitialLabel+" of initial"),E("percent previous")&&_.push(o.percentPreviousLabel+" of previous"),E("percent total")&&_.push(o.percentTotalLabel+" of total")}return o.extraText=_.join("
"),o.color=M(c,d),[o]}};function M(e,t){var r=e.marker,i=t.mc||r.color,a=t.mlc||r.line.color,n=t.mlw||r.line.width;if(v(i))return i;if(v(a)&&n)return a}}}),Y4=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}}}),K4=Ze({"src/traces/funnel/index.js"(Z,q){"use strict";q.exports={attributes:EM(),layoutAttributes:CM(),supplyDefaults:kM().supplyDefaults,crossTraceDefaults:kM().crossTraceDefaults,supplyLayoutDefaults:V4(),calc:G4(),crossTraceCalc:H4(),plot:W4(),style:X4().style,hoverPoints:Z4(),eventData:Y4(),selectPoints:h1(),moduleType:"trace",name:"funnel",basePlotModule:Zf(),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}}}),J4=Ze({"lib/funnel.js"(Z,q){"use strict";q.exports=K4()}}),$4=Ze({"src/traces/waterfall/constants.js"(Z,q){"use strict";q.exports={eventDataKeys:["initial","delta","final"]}}}),LM=Ze({"src/traces/waterfall/attributes.js"(Z,q){"use strict";var v=Sv(),x=tf().line,A=eu(),M=Qc().axisHoverFormat,e=Cs().hovertemplateAttrs,t=Cs().texttemplateAttrs,r=$4(),i=rs().extendFlat,a=Yi();function n(o){return{marker:{color:i({},v.marker.color,{arrayOk:!1,editType:"style"}),line:{color:i({},v.marker.line.color,{arrayOk:!1,editType:"style"}),width:i({},v.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:v.x,x0:v.x0,dx:v.dx,y:v.y,y0:v.y0,dy:v.dy,xperiod:v.xperiod,yperiod:v.yperiod,xperiod0:v.xperiod0,yperiod0:v.yperiod0,xperiodalignment:v.xperiodalignment,yperiodalignment:v.yperiodalignment,xhoverformat:M("x"),yhoverformat:M("y"),hovertext:v.hovertext,hovertemplate:e({},{keys:r.eventDataKeys}),hoverinfo:i({},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:v.text,textposition:v.textposition,insidetextanchor:v.insidetextanchor,textangle:v.textangle,textfont:v.textfont,insidetextfont:v.insidetextfont,outsidetextfont:v.outsidetextfont,constraintext:v.constraintext,cliponaxis:v.cliponaxis,orientation:v.orientation,offset:v.offset,width:v.width,increasing:n("increasing"),decreasing:n("decreasing"),totals:n("intermediate sums and total"),connector:{line:{color:i({},x.color,{dflt:a.defaultLine}),width:i({},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:v.offsetgroup,alignmentgroup:v.alignmentgroup,zorder:v.zorder}}}),PM=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"}}}}),IM=Ze({"src/traces/waterfall/defaults.js"(Z,q){"use strict";var v=ca(),x=Jg(),A=gd().handleText,M=i1(),e=Qd(),t=LM(),r=Yi(),i=d1(),a=i.INCREASING.COLOR,n=i.DECREASING.COLOR,o="#4499FF";function s(m,d,T){m(d+".marker.color",T),m(d+".marker.line.color",r.defaultLine),m(d+".marker.line.width")}function c(m,d,T,l){function _(b,p){return v.coerce(m,d,t,b,p)}var w=M(m,d,l,_);if(!w){d.visible=!1;return}e(m,d,l,_),_("xhoverformat"),_("yhoverformat"),_("measure"),_("orientation",d.x&&!d.y?"h":"v"),_("base"),_("offset"),_("width"),_("text"),_("hovertext"),_("hovertemplate");var S=_("textposition");A(m,d,l,_,S,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),d.textposition!=="none"&&(_("texttemplate"),d.texttemplate||_("textinfo")),s(_,"increasing",a),s(_,"decreasing",n),s(_,"totals",o);var E=_("connector.visible");if(E){_("connector.mode");var g=_("connector.line.width");g&&(_("connector.line.color"),_("connector.line.dash"))}_("zorder")}function h(m,d){var T,l;function _(S){return v.coerce(l._input,l,t,S)}if(d.waterfallmode==="group")for(var w=0;w0&&(_?f+="M"+u[0]+","+y[1]+"V"+y[0]:f+="M"+u[1]+","+y[0]+"H"+u[0]),w!=="between"&&(g.isSum||b path").each(function(d){if(!d.isBlank){var T=m[d.dir].marker;v.select(this).call(A.fill,T.color).call(A.stroke,T.line.color).call(x.dashLine,T.line.dash,T.line.width).style("opacity",m.selectedpoints&&!d.selected?M:1)}}),r(h,m,a),h.selectAll(".lines").each(function(){var d=m.connector.line;x.lineGroupStyle(v.select(this).selectAll("path"),d.width,d.color,d.dash)})})}q.exports={style:i}}}),n7=Ze({"src/traces/waterfall/hover.js"(Z,q){"use strict";var v=Wo().hoverLabelText,x=Yi().opacity,A=f1().hoverOnBars,M=d1(),e={increasing:M.INCREASING.SYMBOL,decreasing:M.DECREASING.SYMBOL};q.exports=function(i,a,n,o,s){var c=A(i,a,n,o,s);if(!c)return;var h=c.cd,m=h[0].trace,d=m.orientation==="h",T=d?"x":"y",l=d?i.xa:i.ya;function _(P){return v(l,P,m[T+"hoverformat"])}var w=c.index,S=h[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 g=_(Math.abs(c.delta));c.deltaLabel=E<0?"("+g+")":g,c.finalLabel=_(c.final),c.initialLabel=_(c.initial);var b=S.hi||m.hoverinfo,p=[];if(b&&b!=="none"&&b!=="skip"){var u=b==="all",y=b.split("+"),f=function(P){return u||y.indexOf(P)!==-1};S.isSum||(f("final")&&(d?!f("x"):!f("y"))&&p.push(c.finalLabel),f("delta")&&(E<0?p.push(c.deltaLabel+" "+e.decreasing):p.push(c.deltaLabel+" "+e.increasing)),f("initial")&&p.push("Initial: "+c.initialLabel))}return p.length&&(c.extraText=p.join("
")),c.color=t(m,S),[c]};function t(r,i){var a=r[i.dir].marker,n=a.color,o=a.line.color,s=a.line.width;if(x(n))return n;if(x(o)&&s)return o}}}),i7=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}}}),o7=Ze({"src/traces/waterfall/index.js"(Z,q){"use strict";q.exports={attributes:LM(),layoutAttributes:PM(),supplyDefaults:IM().supplyDefaults,crossTraceDefaults:IM().crossTraceDefaults,supplyLayoutDefaults:Q4(),calc:e7(),crossTraceCalc:t7(),plot:r7(),style:a7().style,hoverPoints:n7(),eventData:i7(),selectPoints:h1(),moduleType:"trace",name:"waterfall",basePlotModule:Zf(),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}}}),s7=Ze({"lib/waterfall.js"(Z,q){"use strict";q.exports=o7()}}),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(v){return v.slice(0,3)},suffix:["","",""]},rgba:{min:[0,0,0,0],max:[255,255,255,1],fmt:function(v){return v.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(v){return v.slice(0,4)},suffix:["","","",""]},hsl:{min:[0,0,0],max:[360,100,100],fmt:function(v){var x=v.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(v){var x=v.slice(0,4);return x[1]=x[1]+"%",x[2]=x[2]+"%",x},suffix:["\xB0","%","%",""]}}}}}),RM=Ze({"src/traces/image/attributes.js"(Z,q){"use strict";var v=eu(),x=tf().zorder,A=Cs().hovertemplateAttrs,M=rs().extendFlat,e=v1().colormodel,t=["rgb","rgba","rgba256","hsl","hsla"],r=[],i=[];for(n=0;n0)throw new Error("Invalid string. Length must be a multiple of 4");var m=c.indexOf("=");m===-1&&(m=h);var d=m===h?0:4-m%4;return[m,d]}function r(c){var h=t(c),m=h[0],d=h[1];return(m+d)*3/4-d}function i(c,h,m){return(h+m)*3/4-m}function a(c){var h,m=t(c),d=m[0],T=m[1],l=new x(i(c,d,T)),_=0,w=T>0?d-4:d,S;for(S=0;S>16&255,l[_++]=h>>8&255,l[_++]=h&255;return T===2&&(h=v[c.charCodeAt(S)]<<2|v[c.charCodeAt(S+1)]>>4,l[_++]=h&255),T===1&&(h=v[c.charCodeAt(S)]<<10|v[c.charCodeAt(S+1)]<<4|v[c.charCodeAt(S+2)]>>2,l[_++]=h>>8&255,l[_++]=h&255),l}function n(c){return q[c>>18&63]+q[c>>12&63]+q[c>>6&63]+q[c&63]}function o(c,h,m){for(var d,T=[],l=h;lw?w:_+l));return d===1?(h=c[m-1],T.push(q[h>>2]+q[h<<4&63]+"==")):d===2&&(h=(c[m-2]<<8)+c[m-1],T.push(q[h>>10]+q[h>>4&63]+q[h<<2&63]+"=")),T.join("")}}}),c7=Ze({"node_modules/ieee754/index.js"(Z){Z.read=function(q,v,x,A,M){var e,t,r=M*8-A-1,i=(1<>1,n=-7,o=x?M-1:0,s=x?-1:1,c=q[v+o];for(o+=s,e=c&(1<<-n)-1,c>>=-n,n+=r;n>0;e=e*256+q[v+o],o+=s,n-=8);for(t=e&(1<<-n)-1,e>>=-n,n+=A;n>0;t=t*256+q[v+o],o+=s,n-=8);if(e===0)e=1-a;else{if(e===i)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,v,x,A,M,e){var t,r,i,a=e*8-M-1,n=(1<>1,s=M===23?Math.pow(2,-24)-Math.pow(2,-77):0,c=A?0:e-1,h=A?1:-1,m=v<0||v===0&&1/v<0?1:0;for(v=Math.abs(v),isNaN(v)||v===1/0?(r=isNaN(v)?1:0,t=n):(t=Math.floor(Math.log(v)/Math.LN2),v*(i=Math.pow(2,-t))<1&&(t--,i*=2),t+o>=1?v+=s/i:v+=s*Math.pow(2,1-o),v*i>=2&&(t++,i/=2),t+o>=n?(r=0,t=n):t+o>=1?(r=(v*i-1)*Math.pow(2,M),t=t+o):(r=v*Math.pow(2,o-1)*Math.pow(2,M),t=0));M>=8;q[x+c]=r&255,c+=h,r/=256,M-=8);for(t=t<0;q[x+c]=t&255,c+=h,t/=256,a-=8);q[x+c-h]|=m*128}}}),t0=Ze({"node_modules/buffer/index.js"(Z){"use strict";var q=u7(),v=c7(),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 Me=new Uint8Array(1),_e={foo:function(){return 42}};return Object.setPrototypeOf(_e,Uint8Array.prototype),Object.setPrototypeOf(Me,_e),Me.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(Me){if(Me>A)throw new RangeError('The value "'+Me+'" is invalid for option "size"');let _e=new Uint8Array(Me);return Object.setPrototypeOf(_e,t.prototype),_e}function t(Me,_e,fe){if(typeof Me=="number"){if(typeof _e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return n(Me)}return r(Me,_e,fe)}t.poolSize=8192;function r(Me,_e,fe){if(typeof Me=="string")return o(Me,_e);if(ArrayBuffer.isView(Me))return c(Me);if(Me==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Me);if(We(Me,ArrayBuffer)||Me&&We(Me.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(We(Me,SharedArrayBuffer)||Me&&We(Me.buffer,SharedArrayBuffer)))return h(Me,_e,fe);if(typeof Me=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let Fe=Me.valueOf&&Me.valueOf();if(Fe!=null&&Fe!==Me)return t.from(Fe,_e,fe);let rt=m(Me);if(rt)return rt;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof Me[Symbol.toPrimitive]=="function")return t.from(Me[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 Me)}t.from=function(Me,_e,fe){return r(Me,_e,fe)},Object.setPrototypeOf(t.prototype,Uint8Array.prototype),Object.setPrototypeOf(t,Uint8Array);function i(Me){if(typeof Me!="number")throw new TypeError('"size" argument must be of type number');if(Me<0)throw new RangeError('The value "'+Me+'" is invalid for option "size"')}function a(Me,_e,fe){return i(Me),Me<=0?e(Me):_e!==void 0?typeof fe=="string"?e(Me).fill(_e,fe):e(Me).fill(_e):e(Me)}t.alloc=function(Me,_e,fe){return a(Me,_e,fe)};function n(Me){return i(Me),e(Me<0?0:d(Me)|0)}t.allocUnsafe=function(Me){return n(Me)},t.allocUnsafeSlow=function(Me){return n(Me)};function o(Me,_e){if((typeof _e!="string"||_e==="")&&(_e="utf8"),!t.isEncoding(_e))throw new TypeError("Unknown encoding: "+_e);let fe=l(Me,_e)|0,Fe=e(fe),rt=Fe.write(Me,_e);return rt!==fe&&(Fe=Fe.slice(0,rt)),Fe}function s(Me){let _e=Me.length<0?0:d(Me.length)|0,fe=e(_e);for(let Fe=0;Fe<_e;Fe+=1)fe[Fe]=Me[Fe]&255;return fe}function c(Me){if(We(Me,Uint8Array)){let _e=new Uint8Array(Me);return h(_e.buffer,_e.byteOffset,_e.byteLength)}return s(Me)}function h(Me,_e,fe){if(_e<0||Me.byteLength<_e)throw new RangeError('"offset" is outside of buffer bounds');if(Me.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(Me):fe===void 0?Fe=new Uint8Array(Me,_e):Fe=new Uint8Array(Me,_e,fe),Object.setPrototypeOf(Fe,t.prototype),Fe}function m(Me){if(t.isBuffer(Me)){let _e=d(Me.length)|0,fe=e(_e);return fe.length===0||Me.copy(fe,0,0,_e),fe}if(Me.length!==void 0)return typeof Me.length!="number"||it(Me.length)?e(0):s(Me);if(Me.type==="Buffer"&&Array.isArray(Me.data))return s(Me.data)}function d(Me){if(Me>=A)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+A.toString(16)+" bytes");return Me|0}function T(Me){return+Me!=Me&&(Me=0),t.alloc(+Me)}t.isBuffer=function(_e){return _e!=null&&_e._isBuffer===!0&&_e!==t.prototype},t.compare=function(_e,fe){if(We(_e,Uint8Array)&&(_e=t.from(_e,_e.offset,_e.byteLength)),We(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(Me,_e){if(t.isBuffer(Me))return Me.length;if(ArrayBuffer.isView(Me)||We(Me,ArrayBuffer))return Me.byteLength;if(typeof Me!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof Me);let fe=Me.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(Me).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return fe*2;case"hex":return fe>>>1;case"base64":return ze(Me).length;default:if(rt)return Fe?-1:ce(Me).length;_e=(""+_e).toLowerCase(),rt=!0}}t.byteLength=l;function _(Me,_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(Me||(Me="utf8");;)switch(Me){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 f(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: "+Me);Me=(Me+"").toLowerCase(),Fe=!0}}t.prototype._isBuffer=!0;function w(Me,_e,fe){let Fe=Me[_e];Me[_e]=Me[fe],Me[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(We(_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),qt=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:Me.length-1),fe<0&&(fe=Me.length+fe),fe>=Me.length){if(rt)return-1;fe=Me.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(Me,_e,fe,Fe,rt);if(typeof _e=="number")return _e=_e&255,typeof Uint8Array.prototype.indexOf=="function"?rt?Uint8Array.prototype.indexOf.call(Me,_e,fe):Uint8Array.prototype.lastIndexOf.call(Me,_e,fe):E(Me,[_e],fe,Fe,rt);throw new TypeError("val must be string, number or Buffer")}function E(Me,_e,fe,Fe,rt){let st=1,Qe=Me.length,Lt=_e.length;if(Fe!==void 0&&(Fe=String(Fe).toLowerCase(),Fe==="ucs2"||Fe==="ucs-2"||Fe==="utf16le"||Fe==="utf-16le")){if(Me.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 qt;if(rt){let Zt=-1;for(qt=fe;qtQe&&(fe=Qe-Lt),qt=fe;qt>=0;qt--){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 g(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 y(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 f(Me,_e,fe){return _e===0&&fe===Me.length?q.fromByteArray(Me):q.fromByteArray(Me.slice(_e,fe))}function P(Me,_e,fe){fe=Math.min(Me.length,fe);let Fe=[],rt=_e;for(;rt239?4:st>223?3:st>191?2:1;if(rt+Lt<=fe){let kt,qt,Zt,Sr;switch(Lt){case 1:st<128&&(Qe=st);break;case 2:kt=Me[rt+1],(kt&192)===128&&(Sr=(st&31)<<6|kt&63,Sr>127&&(Qe=Sr));break;case 3:kt=Me[rt+1],qt=Me[rt+2],(kt&192)===128&&(qt&192)===128&&(Sr=(st&15)<<12|(kt&63)<<6|qt&63,Sr>2047&&(Sr<55296||Sr>57343)&&(Qe=Sr));break;case 4:kt=Me[rt+1],qt=Me[rt+2],Zt=Me[rt+3],(kt&192)===128&&(qt&192)===128&&(Zt&192)===128&&(Sr=(st&15)<<18|(kt&63)<<12|(qt&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(Me){let _e=Me.length;if(_e<=L)return String.fromCharCode.apply(String,Me);let fe="",Fe=0;for(;Fe<_e;)fe+=String.fromCharCode.apply(String,Me.slice(Fe,Fe+=L));return fe}function F(Me,_e,fe){let Fe="";fe=Math.min(Me.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(Me,_e,fe){if(Me%1!==0||Me<0)throw new RangeError("offset is not uint");if(Me+_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,ne(_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,ne(_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,ne(_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,ne(_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),v.read(this,_e,!0,23,4)},t.prototype.readFloatBE=function(_e,fe){return _e=_e>>>0,fe||N(_e,4,this.length),v.read(this,_e,!1,23,4)},t.prototype.readDoubleLE=function(_e,fe){return _e=_e>>>0,fe||N(_e,8,this.length),v.read(this,_e,!0,52,8)},t.prototype.readDoubleBE=function(_e,fe){return _e=_e>>>0,fe||N(_e,8,this.length),v.read(this,_e,!1,52,8)};function U(Me,_e,fe,Fe,rt,st){if(!t.isBuffer(Me))throw new TypeError('"buffer" argument must be a Buffer instance');if(_e>rt||_eMe.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(Me,_e,fe,Fe,rt){oe(_e,Fe,rt,Me,fe,7);let st=Number(_e&BigInt(4294967295));Me[fe++]=st,st=st>>8,Me[fe++]=st,st=st>>8,Me[fe++]=st,st=st>>8,Me[fe++]=st;let Qe=Number(_e>>BigInt(32)&BigInt(4294967295));return Me[fe++]=Qe,Qe=Qe>>8,Me[fe++]=Qe,Qe=Qe>>8,Me[fe++]=Qe,Qe=Qe>>8,Me[fe++]=Qe,fe}function Q(Me,_e,fe,Fe,rt){oe(_e,Fe,rt,Me,fe,7);let st=Number(_e&BigInt(4294967295));Me[fe+7]=st,st=st>>8,Me[fe+6]=st,st=st>>8,Me[fe+5]=st,st=st>>8,Me[fe+4]=st;let Qe=Number(_e>>BigInt(32)&BigInt(4294967295));return Me[fe+3]=Qe,Qe=Qe>>8,Me[fe+2]=Qe,Qe=Qe>>8,Me[fe+1]=Qe,Qe=Qe>>8,Me[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(Me,_e,fe,Fe,rt,st){if(fe+Fe>Me.length)throw new RangeError("Index out of range");if(fe<0)throw new RangeError("Index out of range")}function se(Me,_e,fe,Fe,rt){return _e=+_e,fe=fe>>>0,rt||ue(Me,_e,fe,4,34028234663852886e22,-34028234663852886e22),v.write(Me,_e,fe,Fe,23,4),fe+4}t.prototype.writeFloatLE=function(_e,fe,Fe){return se(this,_e,fe,!0,Fe)},t.prototype.writeFloatBE=function(_e,fe,Fe){return se(this,_e,fe,!1,Fe)};function he(Me,_e,fe,Fe,rt){return _e=+_e,fe=fe>>>0,rt||ue(Me,_e,fe,8,17976931348623157e292,-17976931348623157e292),v.write(Me,_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(Me){let _e="",fe=Me.length,Fe=Me[0]==="-"?1:0;for(;fe>=Fe+4;fe-=3)_e=`_${Me.slice(fe-3,fe)}${_e}`;return`${Me.slice(0,fe)}${_e}`}function X(Me,_e,fe){ne(_e,"offset"),(Me[_e]===void 0||Me[_e+fe]===void 0)&&j(_e,Me.length-(fe+1))}function oe(Me,_e,fe,Fe,rt,st){if(Me>fe||Me<_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 H.ERR_OUT_OF_RANGE("value",Lt,Me)}X(Fe,rt,st)}function ne(Me,_e){if(typeof Me!="number")throw new H.ERR_INVALID_ARG_TYPE(_e,"number",Me)}function j(Me,_e,fe){throw Math.floor(Me)!==Me?(ne(Me,fe),new H.ERR_OUT_OF_RANGE(fe||"offset","an integer",Me)):_e<0?new H.ERR_BUFFER_OUT_OF_BOUNDS:new H.ERR_OUT_OF_RANGE(fe||"offset",`>= ${fe?1:0} and <= ${_e}`,Me)}var ee=/[^+/0-9A-Za-z-_]/g;function re(Me){if(Me=Me.split("=")[0],Me=Me.trim().replace(ee,""),Me.length<2)return"";for(;Me.length%4!==0;)Me=Me+"=";return Me}function ce(Me,_e){_e=_e||1/0;let fe,Fe=Me.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(Me){let _e=[];for(let fe=0;fe>8,rt=fe%256,st.push(rt),st.push(Fe);return st}function ze(Me){return q.toByteArray(re(Me))}function Re(Me,_e,fe,Fe){let rt;for(rt=0;rt=_e.length||rt>=Me.length);++rt)_e[rt+fe]=Me[rt];return rt}function We(Me,_e){return Me instanceof _e||Me!=null&&Me.constructor!=null&&Me.constructor.name!=null&&Me.constructor.name===_e.name}function it(Me){return Me!==Me}var ot=function(){let Me="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]=Me[fe]+Me[rt]}return _e}();function tt(Me){return typeof BigInt>"u"?ut:Me}function ut(){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 i=Object.getOwnPropertyDescriptor(x,A);if(i.value!==e||i.enumerable!==!0)return!1}return!0}}}),H_=Ze({"node_modules/has-tostringtag/shams.js"(Z,q){"use strict";var v=p3();q.exports=function(){return v()&&!!Symbol.toStringTag}}}),zM=Ze({"node_modules/es-object-atoms/index.js"(Z,q){"use strict";q.exports=Object}}),f7=Ze({"node_modules/es-errors/index.js"(Z,q){"use strict";q.exports=Error}}),h7=Ze({"node_modules/es-errors/eval.js"(Z,q){"use strict";q.exports=EvalError}}),p7=Ze({"node_modules/es-errors/range.js"(Z,q){"use strict";q.exports=RangeError}}),d7=Ze({"node_modules/es-errors/ref.js"(Z,q){"use strict";q.exports=ReferenceError}}),FM=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}}),v7=Ze({"node_modules/es-errors/uri.js"(Z,q){"use strict";q.exports=URIError}}),m7=Ze({"node_modules/math-intrinsics/abs.js"(Z,q){"use strict";q.exports=Math.abs}}),g7=Ze({"node_modules/math-intrinsics/floor.js"(Z,q){"use strict";q.exports=Math.floor}}),y7=Ze({"node_modules/math-intrinsics/max.js"(Z,q){"use strict";q.exports=Math.max}}),_7=Ze({"node_modules/math-intrinsics/min.js"(Z,q){"use strict";q.exports=Math.min}}),x7=Ze({"node_modules/math-intrinsics/pow.js"(Z,q){"use strict";q.exports=Math.pow}}),b7=Ze({"node_modules/math-intrinsics/round.js"(Z,q){"use strict";q.exports=Math.round}}),w7=Ze({"node_modules/math-intrinsics/isNaN.js"(Z,q){"use strict";q.exports=Number.isNaN||function(x){return x!==x}}}),T7=Ze({"node_modules/math-intrinsics/sign.js"(Z,q){"use strict";var v=w7();q.exports=function(A){return v(A)||A===0?A:A<0?-1:1}}}),A7=Ze({"node_modules/gopd/gOPD.js"(Z,q){"use strict";q.exports=Object.getOwnPropertyDescriptor}}),r0=Ze({"node_modules/gopd/index.js"(Z,q){"use strict";var v=A7();if(v)try{v([],"length")}catch{v=null}q.exports=v}}),W_=Ze({"node_modules/es-define-property/index.js"(Z,q){"use strict";var v=Object.defineProperty||!1;if(v)try{v({},"a",{value:1})}catch{v=!1}q.exports=v}}),S7=Ze({"node_modules/has-symbols/index.js"(Z,q){"use strict";var v=typeof Symbol<"u"&&Symbol,x=p3();q.exports=function(){return typeof v!="function"||typeof Symbol!="function"||typeof v("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:x()}}}),OM=Ze({"node_modules/get-proto/Reflect.getPrototypeOf.js"(Z,q){"use strict";q.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null}}),BM=Ze({"node_modules/get-proto/Object.getPrototypeOf.js"(Z,q){"use strict";var v=zM();q.exports=v.getPrototypeOf||null}}),M7=Ze({"node_modules/function-bind/implementation.js"(Z,q){"use strict";var v="Function.prototype.bind called on incompatible ",x=Object.prototype.toString,A=Math.max,M="[object Function]",e=function(a,n){for(var o=[],s=0;s"u"||!b?v:b(Uint8Array),z={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?v:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?v:ArrayBuffer,"%ArrayIteratorPrototype%":g&&b?b([][Symbol.iterator]()):v,"%AsyncFromSyncIteratorPrototype%":v,"%AsyncFunction%":P,"%AsyncGenerator%":P,"%AsyncGeneratorFunction%":P,"%AsyncIteratorPrototype%":P,"%Atomics%":typeof Atomics>"u"?v:Atomics,"%BigInt%":typeof BigInt>"u"?v:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?v:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?v:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?v:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":A,"%eval%":eval,"%EvalError%":M,"%Float16Array%":typeof Float16Array>"u"?v:Float16Array,"%Float32Array%":typeof Float32Array>"u"?v:Float32Array,"%Float64Array%":typeof Float64Array>"u"?v:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?v:FinalizationRegistry,"%Function%":T,"%GeneratorFunction%":P,"%Int8Array%":typeof Int8Array>"u"?v:Int8Array,"%Int16Array%":typeof Int16Array>"u"?v:Int16Array,"%Int32Array%":typeof Int32Array>"u"?v:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":g&&b?b(b([][Symbol.iterator]())):v,"%JSON%":typeof JSON=="object"?JSON:v,"%Map%":typeof Map>"u"?v:Map,"%MapIteratorPrototype%":typeof Map>"u"||!g||!b?v:b(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":x,"%Object.getOwnPropertyDescriptor%":_,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?v:Promise,"%Proxy%":typeof Proxy>"u"?v:Proxy,"%RangeError%":e,"%ReferenceError%":t,"%Reflect%":typeof Reflect>"u"?v:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?v:Set,"%SetIteratorPrototype%":typeof Set>"u"||!g||!b?v:b(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?v:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":g&&b?b(""[Symbol.iterator]()):v,"%Symbol%":g?Symbol:v,"%SyntaxError%":r,"%ThrowTypeError%":E,"%TypedArray%":L,"%TypeError%":i,"%Uint8Array%":typeof Uint8Array>"u"?v:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?v:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?v:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?v:Uint32Array,"%URIError%":a,"%WeakMap%":typeof WeakMap>"u"?v:WeakMap,"%WeakRef%":typeof WeakRef>"u"?v:WeakRef,"%WeakSet%":typeof WeakSet>"u"?v:WeakSet,"%Function.prototype.call%":f,"%Function.prototype.apply%":y,"%Object.defineProperty%":w,"%Object.getPrototypeOf%":p,"%Math.abs%":n,"%Math.floor%":o,"%Math.max%":s,"%Math.min%":c,"%Math.pow%":h,"%Math.round%":m,"%Math.sign%":d,"%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 ne;if(oe==="%AsyncFunction%")ne=l("async function () {}");else if(oe==="%GeneratorFunction%")ne=l("function* () {}");else if(oe==="%AsyncGeneratorFunction%")ne=l("async function* () {}");else if(oe==="%AsyncGenerator%"){var j=X("%AsyncGeneratorFunction%");j&&(ne=j.prototype)}else if(oe==="%AsyncIteratorPrototype%"){var ee=X("%AsyncGenerator%");ee&&b&&(ne=b(ee.prototype))}return z[oe]=ne,ne},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=I7(),U=I.call(f,Array.prototype.concat),W=I.call(y,Array.prototype.splice),Q=I.call(f,String.prototype.replace),ue=I.call(f,String.prototype.slice),se=I.call(f,RegExp.prototype.exec),he=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,H=/\\(\\)?/g,$=function(oe){var ne=ue(oe,0,1),j=ue(oe,-1);if(ne==="%"&&j!=="%")throw new r("invalid intrinsic syntax, expected closing `%`");if(j==="%"&&ne!=="%")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,H,"$1"):ce||re}),ee},J=function(oe,ne){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"&&!ne)throw new i("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,ne){if(typeof oe!="string"||oe.length===0)throw new i("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof ne!="boolean")throw new i('"allowMissing" argument must be a boolean');if(se(/^%?[^%]*%?$/,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+"%",ne),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,We=!0;Re=j.length){var ut=_(be,it);We=!!ut,We&&"get"in ut&&!("originalValue"in ut.get)?be=ut.get:be=be[it]}else We=N(be,it),be=be[it];We&&!Ae&&(z[ce]=be)}}return be}}}),R7=Ze({"node_modules/define-data-property/index.js"(Z,q){"use strict";var v=W_(),x=FM(),A=m1(),M=r0();q.exports=function(t,r,i){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,n=arguments.length>4?arguments[4]:null,o=arguments.length>5?arguments[5]:null,s=arguments.length>6?arguments[6]:!1,c=!!M&&M(t,r);if(v)v(t,r,{configurable:o===null&&c?c.configurable:!o,enumerable:a===null&&c?c.enumerable:!a,value:i,writable:n===null&&c?c.writable:!n});else if(s||!a&&!n&&!o)t[r]=i;else throw new x("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}}}),UM=Ze({"node_modules/has-property-descriptors/index.js"(Z,q){"use strict";var v=W_(),x=function(){return!!v};x.hasArrayLengthDefineBug=function(){if(!v)return null;try{return v([],"length",{value:1}).length!==1}catch{return!0}},q.exports=x}}),D7=Ze({"node_modules/set-function-length/index.js"(Z,q){"use strict";var v=v3(),x=R7(),A=UM()(),M=r0(),e=m1(),t=v("%Math.floor%");q.exports=function(i,a){if(typeof i!="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 n=arguments.length>2&&!!arguments[2],o=!0,s=!0;if("length"in i&&M){var c=M(i,"length");c&&!c.configurable&&(o=!1),c&&!c.writable&&(s=!1)}return(o||s||!n)&&(A?x(i,"length",a,!0,!0):x(i,"length",a)),i}}}),X_=Ze({"node_modules/call-bind/index.js"(Z,q){"use strict";var v=g1(),x=v3(),A=D7(),M=m1(),e=x("%Function.prototype.apply%"),t=x("%Function.prototype.call%"),r=x("%Reflect.apply%",!0)||v.call(t,e),i=W_(),a=x("%Math.max%");q.exports=function(s){if(typeof s!="function")throw new M("a function is required");var c=r(v,t,arguments);return A(c,1+a(0,s.length-(arguments.length-1)),!0)};var n=function(){return r(v,e,arguments)};i?i(q.exports,"apply",{value:n}):q.exports.apply=n}}),y1=Ze({"node_modules/call-bind/callBound.js"(Z,q){"use strict";var v=v3(),x=X_(),A=x(v("String.prototype.indexOf"));q.exports=function(e,t){var r=v(e,!!t);return typeof r=="function"&&A(e,".prototype.")>-1?x(r):r}}}),z7=Ze({"node_modules/is-arguments/index.js"(Z,q){"use strict";var v=H_()(),x=y1(),A=x("Object.prototype.toString"),M=function(i){return v&&i&&typeof i=="object"&&Symbol.toStringTag in i?!1:A(i)==="[object Arguments]"},e=function(i){return M(i)?!0:i!==null&&typeof i=="object"&&typeof i.length=="number"&&i.length>=0&&A(i)!=="[object Array]"&&A(i.callee)==="[object Function]"},t=function(){return M(arguments)}();M.isLegacyArguments=e,q.exports=t?M:e}}),F7=Ze({"node_modules/is-generator-function/index.js"(Z,q){"use strict";var v=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 n=v.call(a);return n==="[object GeneratorFunction]"}if(!e)return!1;if(typeof r>"u"){var o=t();r=o?e(o):!1}return e(a)===r}}}),O7=Ze({"node_modules/is-callable/index.js"(Z,q){"use strict";var v=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=v.call(w);return e.test(S)}catch{return!1}},r=function(w){try{return t(w)?!1:(v.call(w),!0)}catch{return!1}},i=Object.prototype.toString,a="[object Object]",n="[object Function]",o="[object GeneratorFunction]",s="[object HTMLAllCollection]",c="[object HTML document.all class]",h="[object HTMLCollection]",m=typeof Symbol=="function"&&!!Symbol.toStringTag,d=!(0 in[,]),T=function(){return!1};typeof document=="object"&&(l=document.all,i.call(l)===i.call(document.all)&&(T=function(w){if((d||!w)&&(typeof w>"u"||typeof w=="object"))try{var S=i.call(w);return(S===s||S===c||S===h||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(m)return r(w);if(t(w))return!1;var S=i.call(w);return S!==n&&S!==o&&!/^\[object HTML/.test(S)?!1:r(w)}}}),jM=Ze({"node_modules/for-each/index.js"(Z,q){"use strict";var v=O7(),x=Object.prototype.toString,A=Object.prototype.hasOwnProperty,M=function(a,n,o){for(var s=0,c=a.length;s=3&&(s=o),x.call(a)==="[object Array]"?M(a,n,s):typeof a=="string"?e(a,n,s):t(a,n,s)};q.exports=r}}),VM=Ze({"node_modules/available-typed-arrays/index.js"(Z,q){"use strict";var v=["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(),n=M("String.prototype.slice"),o=Object.getPrototypeOf,s=M("Array.prototype.indexOf",!0)||function(T,l){for(var _=0;_-1?l:l!=="Object"?!1:m(T)}return e?h(T):null}}}),N7=Ze({"node_modules/is-typed-array/index.js"(Z,q){"use strict";var v=jM(),x=VM(),A=y1(),M=A("Object.prototype.toString"),e=H_()(),t=r0(),r=typeof globalThis>"u"?window:globalThis,i=x(),a=A("Array.prototype.indexOf",!0)||function(m,d){for(var T=0;T-1}return t?c(m):!1}}}),qM=Ze({"node_modules/util/support/types.js"(Z){"use strict";var q=z7(),v=F7(),x=B7(),A=N7();function M(Ae){return Ae.call.bind(Ae)}var e=typeof BigInt<"u",t=typeof Symbol<"u",r=M(Object.prototype.toString),i=M(Number.prototype.valueOf),a=M(String.prototype.valueOf),n=M(Boolean.prototype.valueOf);e&&(o=M(BigInt.prototype.valueOf));var o;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=v,Z.isTypedArray=A;function h(Ae){return typeof Promise<"u"&&Ae instanceof Promise||Ae!==null&&typeof Ae=="object"&&typeof Ae.then=="function"&&typeof Ae.catch=="function"}Z.isPromise=h;function m(Ae){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(Ae):A(Ae)||W(Ae)}Z.isArrayBufferView=m;function d(Ae){return x(Ae)==="Uint8Array"}Z.isUint8Array=d;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 g(Ae){return x(Ae)==="Float32Array"}Z.isFloat32Array=g;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 y(Ae){return r(Ae)==="[object Map]"}y.working=typeof Map<"u"&&y(new Map);function f(Ae){return typeof Map>"u"?!1:y.working?y(Ae):Ae instanceof Map}Z.isMap=f;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 se(Ae){return typeof Q>"u"?!1:(typeof ue.working>"u"&&(ue.working=ue(new Q)),ue.working?ue(Ae):Ae instanceof Q)}Z.isSharedArrayBuffer=se;function he(Ae){return r(Ae)==="[object AsyncFunction]"}Z.isAsyncFunction=he;function H(Ae){return r(Ae)==="[object Map Iterator]"}Z.isMapIterator=H;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,i)}Z.isNumberObject=oe;function ne(Ae){return c(Ae,a)}Z.isStringObject=ne;function j(Ae){return c(Ae,n)}Z.isBooleanObject=j;function ee(Ae){return e&&c(Ae,o)}Z.isBigIntObject=ee;function re(Ae){return t&&c(Ae,s)}Z.isSymbolObject=re;function ce(Ae){return oe(Ae)||ne(Ae)||j(Ae)||ee(Ae)||re(Ae)}Z.isBoxedPrimitive=ce;function be(Ae){return typeof Uint8Array<"u"&&(N(Ae)||se(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")}})})}}),GM=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"}}}),HM=Ze({"(disabled):node_modules/util/util.js"(Z){var q=Object.getOwnPropertyDescriptors||function(W){for(var Q=Object.keys(W),ue={},se=0;se=se)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 $}}),H=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]),d(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 i(U){var W={};return U.forEach(function(Q,ue){W[Q]=!0}),W}function a(U,W,Q){if(U.customInspect&&W&&y(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 se=n(U,W);if(se)return se;var he=Object.keys(W),H=i(he);if(U.showHidden&&(he=Object.getOwnPropertyNames(W)),u(W)&&(he.indexOf("message")>=0||he.indexOf("description")>=0))return o(W);if(he.length===0){if(y(W)){var $=W.name?": "+W.name:"";return U.stylize("[Function"+$+"]","special")}if(g(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 o(W)}var J="",X=!1,oe=["{","}"];if(m(W)&&(X=!0,oe=["[","]"]),y(W)){var ne=W.name?": "+W.name:"";J=" [Function"+ne+"]"}if(g(W)&&(J=" "+RegExp.prototype.toString.call(W)),p(W)&&(J=" "+Date.prototype.toUTCString.call(W)),u(W)&&(J=" "+o(W)),he.length===0&&(!X||W.length==0))return oe[0]+J+oe[1];if(Q<0)return g(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,H,he):j=he.map(function(ee){return c(U,W,Q,H,ee,X)}),U.seen.pop(),h(j,J,oe)}function n(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(d(W))return U.stylize(""+W,"boolean");if(T(W))return U.stylize("null","null")}function o(U){return"["+Error.prototype.toString.call(U)+"]"}function s(U,W,Q,ue,se){for(var he=[],H=0,$=W.length;H<$;++H)B(W,String(H))?he.push(c(U,W,Q,ue,String(H),!0)):he.push("");return se.forEach(function(J){J.match(/^\d+$/)||he.push(c(U,W,Q,ue,J,!0))}),he}function c(U,W,Q,ue,se,he){var H,$,J;if(J=Object.getOwnPropertyDescriptor(W,se)||{value:W[se]},J.get?J.set?$=U.stylize("[Getter/Setter]","special"):$=U.stylize("[Getter]","special"):J.set&&($=U.stylize("[Setter]","special")),B(ue,se)||(H="["+se+"]"),$||(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(H)){if(he&&se.match(/^\d+$/))return $;H=JSON.stringify(""+se),H.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(H=H.slice(1,-1),H=U.stylize(H,"name")):(H=H.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),H=U.stylize(H,"string"))}return H+": "+$}function h(U,W,Q){var ue=0,se=U.reduce(function(he,H){return ue++,H.indexOf(` `)>=0&&ue++,he+H.replace(/\u001b\[\d\d?m/g,"").length+1},0);return se>60?Q[0]+(W===""?"":W+` `)+" "+U.join(`, `)+" "+Q[1]:Q[0]+W+" "+U.join(", ")+" "+Q[1]}Z.types=qM();function m(U){return Array.isArray(U)}Z.isArray=m;function d(U){return typeof U=="boolean"}Z.isBoolean=d;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 g(U){return b(U)&&P(U)==="[object RegExp]"}Z.isRegExp=g,Z.types.isRegExp=g;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 y(U){return typeof U=="function"}Z.isFunction=y;function f(U){return U===null||typeof U=="boolean"||typeof U=="number"||typeof U=="string"||typeof U=="symbol"||typeof U>"u"}Z.isPrimitive=f,Z.isBuffer=GM();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,se,he=new Promise(function(J,X){ue=J,se=X}),H=[],$=0;$0?this.tail.next=d:this.head=d,this.tail=d,++this.length}},{key:"unshift",value:function(m){var d={data:m,next:this.head};this.length===0&&(this.tail=d),this.head=d,++this.length}},{key:"shift",value:function(){if(this.length!==0){var m=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,m}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(m){if(this.length===0)return"";for(var d=this.head,T=""+d.data;d=d.next;)T+=m+d.data;return T}},{key:"concat",value:function(m){if(this.length===0)return i.alloc(0);for(var d=i.allocUnsafe(m>>>0),T=this.head,l=0;T;)s(T.data,d,l),l+=T.data.length,T=T.next;return d}},{key:"consume",value:function(m,d){var T;return m_.length?_.length:m;if(w===_.length?l+=_:l+=_.slice(0,m),m-=w,m===0){w===_.length?(++T,d.next?this.head=d.next:this.head=this.tail=null):(this.head=d,d.data=_.slice(w));break}++T}return this.length-=T,l}},{key:"_getBuffer",value:function(m){var d=i.allocUnsafe(m),T=this.head,l=1;for(T.data.copy(d),m-=T.data.length;T=T.next;){var _=T.data,w=m>_.length?_.length:m;if(_.copy(d,d.length-m,0,w),m-=w,m===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,d}},{key:o,value:function(m,d){return n(this,x({},d,{depth:0,customInspect:!1}))}}]),c}()}}),WM=Ze({"node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/destroy.js"(Z,q){"use strict";function v(r,i){var a=this,n=this._readableState&&this._readableState.destroyed,o=this._writableState&&this._writableState.destroyed;return n||o?(i?i(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){!i&&s?a._writableState?a._writableState.errorEmitted?process.nextTick(A,a):(a._writableState.errorEmitted=!0,process.nextTick(x,a,s)):process.nextTick(x,a,s):i?(process.nextTick(A,a),i(s)):process.nextTick(A,a)}),this)}function x(r,i){e(r,i),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,i){r.emit("error",i)}function t(r,i){var a=r._readableState,n=r._writableState;a&&a.autoDestroy||n&&n.autoDestroy?r.destroy(i):r.emit("error",i)}q.exports={destroy:v,undestroy:M,errorOrDestroy:t}}}),a0=Ze({"node_modules/stream-browserify/node_modules/readable-stream/errors-browser.js"(Z,q){"use strict";function v(i,a){i.prototype=Object.create(a.prototype),i.prototype.constructor=i,i.__proto__=a}var x={};function A(i,a,n){n||(n=Error);function o(c,h,m){return typeof a=="string"?a:a(c,h,m)}var s=function(c){v(h,c);function h(m,d,T){return c.call(this,o(m,d,T))||this}return h}(n);s.prototype.name=n.name,s.prototype.code=i,x[i]=s}function M(i,a){if(Array.isArray(i)){var n=i.length;return i=i.map(function(o){return String(o)}),n>2?"one of ".concat(a," ").concat(i.slice(0,n-1).join(", "),", or ")+i[n-1]:n===2?"one of ".concat(a," ").concat(i[0]," or ").concat(i[1]):"of ".concat(a," ").concat(i[0])}else return"of ".concat(a," ").concat(String(i))}function e(i,a,n){return i.substr(!n||n<0?0:+n,a.length)===a}function t(i,a,n){return(n===void 0||n>i.length)&&(n=i.length),i.substring(n-a.length,n)===a}function r(i,a,n){return typeof n!="number"&&(n=0),n+a.length>i.length?!1:i.indexOf(a,n)!==-1}A("ERR_INVALID_OPT_VALUE",function(i,a){return'The value "'+a+'" is invalid for option "'+i+'"'},TypeError),A("ERR_INVALID_ARG_TYPE",function(i,a,n){var o;typeof a=="string"&&e(a,"not ")?(o="must not be",a=a.replace(/^not /,"")):o="must be";var s;if(t(i," argument"))s="The ".concat(i," ").concat(o," ").concat(M(a,"type"));else{var c=r(i,".")?"property":"argument";s='The "'.concat(i,'" ').concat(c," ").concat(o," ").concat(M(a,"type"))}return s+=". Received type ".concat(typeof n),s},TypeError),A("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),A("ERR_METHOD_NOT_IMPLEMENTED",function(i){return"The "+i+" method is not implemented"}),A("ERR_STREAM_PREMATURE_CLOSE","Premature close"),A("ERR_STREAM_DESTROYED",function(i){return"Cannot call "+i+" 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(i){return"Unknown encoding: "+i},TypeError),A("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),q.exports.codes=x}}),XM=Ze({"node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/state.js"(Z,q){"use strict";var v=a0().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 i=x(e,r,t);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var a=r?t:"highWaterMark";throw new v(a,i)}return Math.floor(i)}return M.objectMode?16:16*1024}q.exports={getHighWaterMark:A}}}),j7=Ze({"node_modules/util-deprecate/browser.js"(Z,q){q.exports=v;function v(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"}}}),ZM=Ze({"node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_writable.js"(Z,q){"use strict";q.exports=p;function v(H){var $=this;this.next=null,this.entry=null,this.finish=function(){he($,H)}}var x;p.WritableState=g;var A={deprecate:j7()},M=DM(),e=t0().Buffer,t=window.Uint8Array||function(){};function r(H){return e.from(H)}function i(H){return e.isBuffer(H)||H instanceof t}var a=WM(),n=XM(),o=n.getHighWaterMark,s=a0().codes,c=s.ERR_INVALID_ARG_TYPE,h=s.ERR_METHOD_NOT_IMPLEMENTED,m=s.ERR_MULTIPLE_CALLBACK,d=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 g(H,$,J){x=x||n0(),H=H||{},typeof J!="boolean"&&(J=$ instanceof x),this.objectMode=!!H.objectMode,J&&(this.objectMode=this.objectMode||!!H.writableObjectMode),this.highWaterMark=o(this,H,"writableHighWaterMark",J),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var X=H.decodeStrings===!1;this.decodeStrings=!X,this.defaultEncoding=H.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=H.emitClose!==!1,this.autoDestroy=!!H.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new v(this)}g.prototype.getBuffer=function(){for(var $=this.bufferedRequest,J=[];$;)J.push($),$=$.next;return J},function(){try{Object.defineProperty(g.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 g}})):b=function($){return $ instanceof this};function p(H){x=x||n0();var $=this instanceof x;if(!$&&!b.call(p,this))return new p(H);this._writableState=new g(H,this,$),this.writable=!0,H&&(typeof H.write=="function"&&(this._write=H.write),typeof H.writev=="function"&&(this._writev=H.writev),typeof H.destroy=="function"&&(this._destroy=H.destroy),typeof H.final=="function"&&(this._final=H.final)),M.call(this)}p.prototype.pipe=function(){S(this,new d)};function u(H,$){var J=new _;S(H,J),process.nextTick($,J)}function y(H,$,J,X){var oe;return J===null?oe=new l:typeof J!="string"&&!$.objectMode&&(oe=new c("chunk",["string","Buffer"],J)),oe?(S(H,oe),process.nextTick(X,oe),!1):!0}p.prototype.write=function(H,$,J){var X=this._writableState,oe=!1,ne=!X.objectMode&&i(H);return ne&&!e.isBuffer(H)&&(H=r(H)),typeof $=="function"&&(J=$,$=null),ne?$="buffer":$||($=X.defaultEncoding),typeof J!="function"&&(J=E),X.ending?u(this,J):(ne||y(this,X,H,J))&&(X.pendingcb++,oe=P(this,X,ne,H,$,J)),oe},p.prototype.cork=function(){this._writableState.corked++},p.prototype.uncork=function(){var H=this._writableState;H.corked&&(H.corked--,!H.writing&&!H.corked&&!H.bufferProcessing&&H.bufferedRequest&&N(this,H))},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 f(H,$,J){return!H.objectMode&&H.decodeStrings!==!1&&typeof $=="string"&&($=e.from($,J)),$}Object.defineProperty(p.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function P(H,$,J,X,oe,ne){if(!J){var j=f($,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:ne,next:null},ce?ce.next=$.lastBufferedRequest:$.bufferedRequest=$.lastBufferedRequest,$.bufferedRequestCount+=1}else L(H,$,!1,ee,X,oe,ne);return re}function L(H,$,J,X,oe,ne,j){$.writelen=X,$.writecb=j,$.writing=!0,$.sync=!0,$.destroyed?$.onwrite(new T("write")):J?H._writev(oe,$.onwrite):H._write(oe,ne,$.onwrite),$.sync=!1}function z(H,$,J,X,oe){--$.pendingcb,J?(process.nextTick(oe,X),process.nextTick(ue,H,$),H._writableState.errorEmitted=!0,S(H,X)):(oe(X),H._writableState.errorEmitted=!0,S(H,X),ue(H,$))}function F(H){H.writing=!1,H.writecb=null,H.length-=H.writelen,H.writelen=0}function B(H,$){var J=H._writableState,X=J.sync,oe=J.writecb;if(typeof oe!="function")throw new m;if(F(J),$)z(H,J,X,$,oe);else{var ne=U(J)||H.destroyed;!ne&&!J.corked&&!J.bufferProcessing&&J.bufferedRequest&&N(H,J),X?process.nextTick(O,H,J,ne,oe):O(H,J,ne,oe)}}function O(H,$,J,X){J||I(H,$),$.pendingcb--,X(),ue(H,$)}function I(H,$){$.length===0&&$.needDrain&&($.needDrain=!1,H.emit("drain"))}function N(H,$){$.bufferProcessing=!0;var J=$.bufferedRequest;if(H._writev&&J&&J.next){var X=$.bufferedRequestCount,oe=new Array(X),ne=$.corkedRequestsFree;ne.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(H,$,!0,$.length,oe,"",ne.finish),$.pendingcb++,$.lastBufferedRequest=null,ne.next?($.corkedRequestsFree=ne.next,ne.next=null):$.corkedRequestsFree=new v($),$.bufferedRequestCount=0}else{for(;J;){var re=J.chunk,ce=J.encoding,be=J.callback,Ae=$.objectMode?1:re.length;if(L(H,$,!1,Ae,re,ce,be),J=J.next,$.bufferedRequestCount--,$.writing)break}J===null&&($.lastBufferedRequest=null)}$.bufferedRequest=J,$.bufferProcessing=!1}p.prototype._write=function(H,$,J){J(new h("_write()"))},p.prototype._writev=null,p.prototype.end=function(H,$,J){var X=this._writableState;return typeof H=="function"?(J=H,H=null,$=null):typeof $=="function"&&(J=$,$=null),H!=null&&this.write(H,$),X.corked&&(X.corked=1,this.uncork()),X.ending||se(this,X,J),this},Object.defineProperty(p.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function U(H){return H.ending&&H.length===0&&H.bufferedRequest===null&&!H.finished&&!H.writing}function W(H,$){H._final(function(J){$.pendingcb--,J&&S(H,J),$.prefinished=!0,H.emit("prefinish"),ue(H,$)})}function Q(H,$){!$.prefinished&&!$.finalCalled&&(typeof H._final=="function"&&!$.destroyed?($.pendingcb++,$.finalCalled=!0,process.nextTick(W,H,$)):($.prefinished=!0,H.emit("prefinish")))}function ue(H,$){var J=U($);if(J&&(Q(H,$),$.pendingcb===0&&($.finished=!0,H.emit("finish"),$.autoDestroy))){var X=H._readableState;(!X||X.autoDestroy&&X.endEmitted)&&H.destroy()}return J}function se(H,$,J){$.ending=!0,ue(H,$),J&&($.finished?process.nextTick(J):H.once("finish",J)),$.ended=!0,H.writable=!1}function he(H,$,J){var X=H.entry;for(H.entry=null;X;){var oe=X.callback;$.pendingcb--,oe(J),X=X.next}$.corkedRequestsFree.next=H}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(H,$){$(H)}}}),n0=Ze({"node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_duplex.js"(Z,q){"use strict";var v=Object.keys||function(n){var o=[];for(var s in n)o.push(s);return o};q.exports=r;var x=KM(),A=ZM();for(Yv()(r,x),M=v(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 i(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 n(T){var l=T&&T.length?this.write(T):"";return this.lastNeed?l+"\uFFFD":l}function o(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 h(T){var l=T&&T.length?this.write(T):"";return this.lastNeed?l+this.lastChar.toString("base64",0,3-this.lastNeed):l}function m(T){return T.toString(this.encoding)}function d(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 v=a0().codes.ERR_STREAM_PREMATURE_CLOSE;function x(t){var r=!1;return function(){if(!r){r=!0;for(var i=arguments.length,a=new Array(i),n=0;n0)if(typeof ee!="string"&&!Ae.objectMode&&Object.getPrototypeOf(ee)!==e.prototype&&(ee=r(ee)),ce)Ae.endEmitted?g(j,new _):P(j,Ae,ee,!0);else if(Ae.ended)g(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))}y.prototype.read=function(j){n("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 n("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;n("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(n("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;n("emitReadable",ee.needReadable,ee.emittedReadable),ee.needReadable=!1,ee.emittedReadable||(n("emitReadable",ee.flowing),ee.emittedReadable=!0,process.nextTick(N,j))}function N(j){var ee=j._readableState;n("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&&ne(ce.pipes,j)!==-1)&&!it&&(n("false write response, pause",ce.awaitDrain),ce.awaitDrain++),re.pause())}function ut(Fe){n("onerror",Fe),fe(),j.removeListener("error",ut),A(j,"error")===0&&g(j,Fe)}p(j,"error",ut);function Me(){j.removeListener("finish",_e),fe()}j.once("close",Me);function _e(){n("onfinish"),j.removeListener("close",Me),fe()}j.once("finish",_e);function fe(){n("unpipe"),re.unpipe(j)}return j.emit("pipe",re),ce.flowing||(n("pipe resume"),re.resume()),j};function Q(j){return function(){var re=j._readableState;n("pipeOnDrain",re.awaitDrain),re.awaitDrain&&re.awaitDrain--,re.awaitDrain===0&&A(j,"data")&&(re.flowing=!0,$(j))}}y.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,n("on readable",ce.length,ce.reading),ce.length?I(this):ce.reading||process.nextTick(se,this)),re},y.prototype.addListener=y.prototype.on,y.prototype.removeListener=function(j,ee){var re=M.prototype.removeListener.call(this,j,ee);return j==="readable"&&process.nextTick(ue,this),re},y.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 se(j){n("readable nexttick read 0"),j.read(0)}y.prototype.resume=function(){var j=this._readableState;return j.flowing||(n("resume"),j.flowing=!j.readableListening,he(this,j)),j.paused=!1,this};function he(j,ee){ee.resumeScheduled||(ee.resumeScheduled=!0,process.nextTick(H,j,ee))}function H(j,ee){n("resume",ee.reading),ee.reading||j.read(0),ee.resumeScheduled=!1,j.emit("resume"),$(j),ee.flowing&&!ee.reading&&j.read(0)}y.prototype.pause=function(){return n("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(n("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function $(j){var ee=j._readableState;for(n("flow",ee.flowing);ee.flowing&&j.read()!==null;);}y.prototype.wrap=function(j){var ee=this,re=this._readableState,ce=!1;j.on("end",function(){if(n("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(n("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;n("endReadable",ee.endEmitted),ee.endEmitted||(ee.ended=!0,process.nextTick(oe,ee,j))}function oe(j,ee){if(n("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"&&(y.from=function(j,ee){return E===void 0&&(E=G7()),E(y,j,ee)});function ne(j,ee){for(var re=0,ce=j.length;re0;return i(_,S,E,function(g){T||(T=g),g&&l.forEach(a),!S&&(l.forEach(a),d(T))})});return h.reduce(n)}q.exports=s}}),X7=Ze({"node_modules/stream-browserify/index.js"(Z,q){q.exports=A;var v=Wg().EventEmitter,x=Yv();x(A,v),A.Readable=KM(),A.Writable=ZM(),A.Duplex=n0(),A.Transform=JM(),A.PassThrough=H7(),A.finished=m3(),A.pipeline=W7(),A.Stream=A;function A(){v.call(this)}A.prototype.pipe=function(M,e){var t=this;function r(h){M.writable&&M.write(h)===!1&&t.pause&&t.pause()}t.on("data",r);function i(){t.readable&&t.resume&&t.resume()}M.on("drain",i),!M._isStdio&&(!e||e.end!==!1)&&(t.on("end",n),t.on("close",o));var a=!1;function n(){a||(a=!0,M.end())}function o(){a||(a=!0,typeof M.destroy=="function"&&M.destroy())}function s(h){if(c(),v.listenerCount(this,"error")===0)throw h}t.on("error",s),M.on("error",s);function c(){t.removeListener("data",r),M.removeListener("drain",i),t.removeListener("end",n),t.removeListener("close",o),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={},se=0;se=se)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 $}}),H=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]),d(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 i(U){var W={};return U.forEach(function(Q,ue){W[Q]=!0}),W}function a(U,W,Q){if(U.customInspect&&W&&y(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 se=n(U,W);if(se)return se;var he=Object.keys(W),H=i(he);if(U.showHidden&&(he=Object.getOwnPropertyNames(W)),u(W)&&(he.indexOf("message")>=0||he.indexOf("description")>=0))return o(W);if(he.length===0){if(y(W)){var $=W.name?": "+W.name:"";return U.stylize("[Function"+$+"]","special")}if(g(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 o(W)}var J="",X=!1,oe=["{","}"];if(m(W)&&(X=!0,oe=["[","]"]),y(W)){var ne=W.name?": "+W.name:"";J=" [Function"+ne+"]"}if(g(W)&&(J=" "+RegExp.prototype.toString.call(W)),p(W)&&(J=" "+Date.prototype.toUTCString.call(W)),u(W)&&(J=" "+o(W)),he.length===0&&(!X||W.length==0))return oe[0]+J+oe[1];if(Q<0)return g(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,H,he):j=he.map(function(ee){return c(U,W,Q,H,ee,X)}),U.seen.pop(),h(j,J,oe)}function n(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(d(W))return U.stylize(""+W,"boolean");if(T(W))return U.stylize("null","null")}function o(U){return"["+Error.prototype.toString.call(U)+"]"}function s(U,W,Q,ue,se){for(var he=[],H=0,$=W.length;H<$;++H)B(W,String(H))?he.push(c(U,W,Q,ue,String(H),!0)):he.push("");return se.forEach(function(J){J.match(/^\d+$/)||he.push(c(U,W,Q,ue,J,!0))}),he}function c(U,W,Q,ue,se,he){var H,$,J;if(J=Object.getOwnPropertyDescriptor(W,se)||{value:W[se]},J.get?J.set?$=U.stylize("[Getter/Setter]","special"):$=U.stylize("[Getter]","special"):J.set&&($=U.stylize("[Setter]","special")),B(ue,se)||(H="["+se+"]"),$||(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(H)){if(he&&se.match(/^\d+$/))return $;H=JSON.stringify(""+se),H.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(H=H.slice(1,-1),H=U.stylize(H,"name")):(H=H.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),H=U.stylize(H,"string"))}return H+": "+$}function h(U,W,Q){var ue=0,se=U.reduce(function(he,H){return ue++,H.indexOf(` `)>=0&&ue++,he+H.replace(/\u001b\[\d\d?m/g,"").length+1},0);return se>60?Q[0]+(W===""?"":W+` `)+" "+U.join(`, `)+" "+Q[1]:Q[0]+W+" "+U.join(", ")+" "+Q[1]}Z.types=qM();function m(U){return Array.isArray(U)}Z.isArray=m;function d(U){return typeof U=="boolean"}Z.isBoolean=d;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 g(U){return b(U)&&P(U)==="[object RegExp]"}Z.isRegExp=g,Z.types.isRegExp=g;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 y(U){return typeof U=="function"}Z.isFunction=y;function f(U){return U===null||typeof U=="boolean"||typeof U=="number"||typeof U=="string"||typeof U=="symbol"||typeof U>"u"}Z.isPrimitive=f,Z.isBuffer=GM();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,se,he=new Promise(function(J,X){ue=J,se=X}),H=[],$=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 h={},m,d;function T(E,g,b){b||(b=Error);function p(y,f,P){return typeof g=="string"?g:g(y,f,P)}var u=function(y){r(P,y);var f=a(P);function P(L,z,F){var B;return t(this,P),B=f.call(this,p(L,z,F)),B.code=E,B}return A(P)}(b);h[E]=u}function l(E,g){if(Array.isArray(E)){var b=E.length;return E=E.map(function(p){return String(p)}),b>2?"one of ".concat(g," ").concat(E.slice(0,b-1).join(", "),", or ")+E[b-1]:b===2?"one of ".concat(g," ").concat(E[0]," or ").concat(E[1]):"of ".concat(g," ").concat(E[0])}else return"of ".concat(g," ").concat(String(E))}function _(E,g,b){return E.substr(!b||b<0?0:+b,g.length)===g}function w(E,g,b){return(b===void 0||b>E.length)&&(b=E.length),E.substring(b-g.length,b)===g}function S(E,g,b){return typeof b!="number"&&(b=0),b+g.length>E.length?!1:E.indexOf(g,b)!==-1}T("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),T("ERR_INVALID_ARG_TYPE",function(E,g,b){m===void 0&&(m=Y_()),m(typeof E=="string","'name' must be a string");var p;typeof g=="string"&&_(g,"not ")?(p="must not be",g=g.replace(/^not /,"")):p="must be";var u;if(w(E," argument"))u="The ".concat(E," ").concat(p," ").concat(l(g,"type"));else{var y=S(E,".")?"property":"argument";u='The "'.concat(E,'" ').concat(y," ").concat(p," ").concat(l(g,"type"))}return u+=". Received type ".concat(v(b)),u},TypeError),T("ERR_INVALID_ARG_VALUE",function(E,g){var b=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";d===void 0&&(d=_1());var p=d.inspect(g);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,g,b){var p;return b&&b.constructor&&b.constructor.name?p="instance of ".concat(b.constructor.name):p="type ".concat(v(b)),"Expected ".concat(E,' to be returned from the "').concat(g,'"')+" function but got ".concat(p,".")},TypeError),T("ERR_MISSING_ARGS",function(){for(var E=arguments.length,g=new Array(E),b=0;b0,"At least one arg needs to be specified");var p="The ",u=g.length;switch(g=g.map(function(y){return'"'.concat(y,'"')}),u){case 1:p+="".concat(g[0]," argument");break;case 2:p+="".concat(g[0]," and ").concat(g[1]," arguments");break;default:p+=g.slice(0,u-1).join(", "),p+=", and ".concat(g[u-1]," arguments");break}return"".concat(p," must be specified")},TypeError),q.exports.codes=h}}),Z7=Ze({"node_modules/assert/build/internal/assert/assertion_error.js"(Z,q){"use strict";function v(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 d(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=$M(),g=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="",y="",f="",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="",se=0,he="",H=!1,$=B(N),J=$.split(` `),X=B(U).split(` `),oe=0,ne="";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&&(ne=` `.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),H=!0),Q!==""&&(he=` `.concat(Q).concat(he),Q="");var ze=0,Re=L[W]+` `.concat(y,"+ actual").concat(P," ").concat(f,"- expected").concat(P),We=" ".concat(u,"...").concat(P," Lines skipped");for(oe=0;oe1&&oe>2&&(it>4?(ue+=` `.concat(u,"...").concat(P),H=!0):it>3&&(ue+=` `.concat(X[oe-2]),ze++),ue+=` `.concat(X[oe-1]),ze++),se=oe,Q+=` `.concat(f,"-").concat(P," ").concat(X[oe]),ze++;else if(X.length1&&oe>2&&(it>4?(ue+=` `.concat(u,"...").concat(P),H=!0):it>3&&(ue+=` `.concat(J[oe-2]),ze++),ue+=` `.concat(J[oe-1]),ze++),se=oe,ue+=` `.concat(y,"+").concat(P," ").concat(J[oe]),ze++;else{var ot=X[oe],tt=J[oe],ut=tt!==ot&&(!b(tt,",")||tt.slice(0,-1)!==ot);ut&&b(ot,",")&&ot.slice(0,-1)===tt&&(ut=!1,tt+=","),ut?(it>1&&oe>2&&(it>4?(ue+=` `.concat(u,"...").concat(P),H=!0):it>3&&(ue+=` `.concat(J[oe-2]),ze++),ue+=` `.concat(J[oe-1]),ze++),se=oe,ue+=` `.concat(y,"+").concat(P," ").concat(tt),Q+=` `.concat(f,"-").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?se=W.call(this,"".concat(ne," ").concat(j[0])):se=W.call(this,"".concat(ne,` `).concat(j.join(` `),` `))}else{var ee=B(J),re="",ce=L[H];H==="notDeepEqual"||H==="notEqual"?(ee="".concat(L[H],` `).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),"...")),H==="deepEqual"||H==="equal"?ee="".concat(ce,` `).concat(ee,` should equal `):re=" ".concat(H," ").concat(re)),se=W.call(this,"".concat(ee).concat(re))}return Error.stackTraceLimit=oe,se.generatedMessage=!he,Object.defineProperty(s(se),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),se.code="ERR_ASSERTION",se.actual=J,se.expected=X,se.operator=H,Error.captureStackTrace&&Error.captureStackTrace(s(se),$),se.stack,se.name="AssertionError",o(se)}return t(Q,[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:U,value:function(se,he){return S(this,x(x({},he),{},{customInspect:!1,depth:0}))}}]),Q}(c(Error),S.custom);q.exports=I}}),QM=Ze({"node_modules/object-keys/isArguments.js"(Z,q){"use strict";var v=Object.prototype.toString;q.exports=function(A){var M=v.call(A),e=M==="[object Arguments]";return e||(e=M!=="[object Array]"&&A!==null&&typeof A=="object"&&typeof A.length=="number"&&A.length>=0&&v.call(A.callee)==="[object Function]"),e}}}),Y7=Ze({"node_modules/object-keys/implementation.js"(Z,q){"use strict";var v;Object.keys||(x=Object.prototype.hasOwnProperty,A=Object.prototype.toString,M=QM(),e=Object.prototype.propertyIsEnumerable,t=!e.call({toString:null},"toString"),r=e.call(function(){},"prototype"),i=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],a=function(c){var h=c.constructor;return h&&h.prototype===c},n={$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},o=function(){if(typeof window>"u")return!1;for(var c in window)try{if(!n["$"+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"||!o)return a(c);try{return a(c)}catch{return!1}},v=function(h){var m=h!==null&&typeof h=="object",d=A.call(h)==="[object Function]",T=M(h),l=m&&A.call(h)==="[object String]",_=[];if(!m&&!d&&!T)throw new TypeError("Object.keys called on a non-object");var w=r&&d;if(l&&h.length>0&&!x.call(h,0))for(var S=0;S0)for(var E=0;E2?arguments[2]:{},h=v(s);x&&(h=M.call(h,Object.getOwnPropertySymbols(s)));for(var m=0;mMe.length)&&(_e=Me.length);for(var fe=0,Fe=new Array(_e);fe<_e;fe++)Fe[fe]=Me[fe];return Fe}function e(Me,_e){var fe=Me==null?null:typeof Symbol<"u"&&Me[Symbol.iterator]||Me["@@iterator"];if(fe!=null){var Fe,rt,st,Qe,Lt=[],kt=!0,qt=!1;try{if(st=(fe=fe.call(Me)).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){qt=!0,rt=Zt}finally{try{if(!kt&&fe.return!=null&&(Qe=fe.return(),Object(Qe)!==Qe))return}finally{if(qt)throw rt}}return Lt}}function t(Me){if(Array.isArray(Me))return Me}function r(Me){"@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(Me)}var i=/a/g.flags!==void 0,a=function(_e){var fe=[];return _e.forEach(function(Fe){return fe.push(Fe)}),fe},n=function(_e){var fe=[];return _e.forEach(function(Fe,rt){return fe.push([rt,Fe])}),fe},o=Object.is?Object.is:Q7(),s=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols:function(){return[]},c=Number.isNaN?Number.isNaN:t9();function h(Me){return Me.call.bind(Me)}var m=h(Object.prototype.hasOwnProperty),d=h(Object.prototype.propertyIsEnumerable),T=h(Object.prototype.toString),l=_1().types,_=l.isAnyArrayBuffer,w=l.isArrayBufferView,S=l.isDate,E=l.isMap,g=l.isRegExp,b=l.isSet,p=l.isNativeError,u=l.isBoxedPrimitive,y=l.isNumberObject,f=l.isStringObject,P=l.isBooleanObject,L=l.isBigIntObject,z=l.isSymbolObject,F=l.isFloat32Array,B=l.isFloat64Array;function O(Me){if(Me.length===0||Me.length>10)return!0;for(var _e=0;_e57)return!0}return Me.length===10&&Me>=Math.pow(2,32)}function I(Me){return Object.keys(Me).filter(O).concat(s(Me).filter(Object.prototype.propertyIsEnumerable.bind(Me)))}function N(Me,_e){if(Me===_e)return 0;for(var fe=Me.length,Fe=_e.length,rt=0,st=Math.min(fe,Fe);rt1?X-1:0),ne=1;ne1?X-1:0),ne=1;ne1?X-1:0),ne=1;ne1?X-1:0),ne=1;ne0)return t(n);if(s==="number"&&isNaN(n)===!1)return o.long?i(n):r(n);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(n))};function t(n){if(n=String(n),!(n.length>100)){var o=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(n);if(o){var s=parseFloat(o[1]),c=(o[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*v;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}}}function r(n){return n>=M?Math.round(n/M)+"d":n>=A?Math.round(n/A)+"h":n>=x?Math.round(n/x)+"m":n>=v?Math.round(n/v)+"s":n+"ms"}function i(n){return a(n,M,"day")||a(n,A,"hour")||a(n,x,"minute")||a(n,v,"second")||n+" ms"}function a(n,o,s){if(!(n=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}Z.formatters.j=function(r){try{return JSON.stringify(r)}catch(i){return"[UnexpectedJSONParseError]: "+i.message}};function x(r){var i=this.useColors;if(r[0]=(i?"%c":"")+this.namespace+(i?" %c":" ")+r[0]+(i?"%c ":" ")+"+"+Z.humanize(this.diff),!!i){var a="color: "+this.color;r.splice(1,0,a,"color: inherit");var n=0,o=0;r[0].replace(/%[a-zA-Z%]/g,function(s){s!=="%%"&&(n++,s==="%c"&&(o=n))}),r.splice(o,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{}}}}),o9=Ze({"node_modules/stream-parser/index.js"(Z,q){var v=Y_(),x=i9()("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=n,_&&(l._passthrough=o),_?l._transform=c:l._write=s}function i(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,_){v(!this._parserCallback,'there is already a "callback" set!'),v(isFinite(l)&&l>0,'can only buffer a finite number of bytes > 0, got "'+l+'"'),this._parserInit||i(this),x("buffering %o bytes",l),this._parserBytesLeft=l,this._parserCallback=_,this._parserState=M}function n(l,_){v(!this._parserCallback,'there is already a "callback" set!'),v(l>0,'can only skip > 0 bytes, got "'+l+'"'),this._parserInit||i(this),x("skipping %o bytes",l),this._parserBytesLeft=l,this._parserCallback=_,this._parserState=e}function o(l,_){v(!this._parserCallback,'There is already a "callback" set!'),v(l>0,'can only pass through > 0 bytes, got "'+l+'"'),this._parserInit||i(this),x("passing through %o bytes",l),this._parserBytesLeft=l,this._parserCallback=_,this._parserState=t}function s(l,_,w){this._parserInit||i(this),x("write(%o bytes)",l.length),typeof _=="function"&&(w=_),d(this,l,null,w)}function c(l,_,w){this._parserInit||i(this),x("transform(%o bytes)",l.length),typeof _!="function"&&(_=this._parserOutput),d(this,l,_,w)}function h(l,_,w,S){return l._parserBytesLeft<=0?S(new Error("got data but not currently parsing anything")):_.length<=l._parserBytesLeft?function(){return m(l,_,w,S)}:function(){var E=_.slice(0,l._parserBytesLeft);return m(l,E,w,function(g){if(g)return S(g);if(_.length>E.length)return function(){return h(l,_.slice(E.length),w,S)}})}}function m(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 g=[];_&&g.push(_),w&&g.push(w);var b=E.length>g.length;b&&g.push(T(S));var p=E.apply(l,g);if(!b||S===p)return S}}else return S}var d=T(h);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=X7().Transform,v=o9();function x(){q.call(this,{readableObjectMode:!0})}x.prototype=Object.create(q.prototype),x.prototype.constructor=x,v(x.prototype),Z.ParserStream=x,Z.sliceEq=function(M,e,t){for(var r=e,i=0;i>4&15,h=o[4]&15,m=o[5]>>4&15,d=v(o,6),T=8,l=0;ld.width||m.width===d.width&&m.height>d.height?m:d}),c=o.reduce(function(m,d){return m.height>d.height||m.height===d.height&&m.width>d.width?m:d}),h;return s.width>c.height||s.width===c.height&&s.height>c.width?h=s:h=c,h}q.exports.readSizeFromMeta=function(o){var s={sizes:[],transforms:[],item_inf:{},item_loc:{}};if(a(o,s),!!s.sizes.length){var c=n(s.sizes),h=1;s.transforms.forEach(function(d){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(d.type==="imir"&&(d.value===0?h=l[h]:(h=l[h],h=T[h],h=T[h])),d.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 v("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 v("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 i=0;ithis.input.length)throw v("unexpected EOF","EBADDATA");for(var d=[],T=h,l=0;l0&&(this.ifds_to_read.push({id:a,offset:d[0]}),m=!0);var w={is_big_endian:this.big_endian,ifd:M,tag:a,format:n,count:o,entry_offset:e+this.start,data_length:c,data_offset:h+this.start,value:d,is_subifd_link:m};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}}}}),l9=Ze({"node_modules/probe-image-size/lib/parse_sync/avif.js"(Z,q){"use strict";var v=ac().str2arr,x=ac().sliceEq,A=ac().readUInt32BE,M=s9(),e=y3(),t=v("ftyp");q.exports=function(r){if(x(r,4,t)){var i=M.unbox(r,0);if(i){var a=M.getMimeType(i.data);if(a){for(var n,o=i.end;;){var s=M.unbox(r,o);if(!s)break;if(o=s.end,s.boxtype==="mdat")return;if(s.boxtype==="meta"){n=s.data;break}}if(n){var c=M.readSizeFromMeta(n);if(c){var h={width:c.width,height:c.height,type:a.type,mime:a.mime,wUnits:"px",hUnits:"px"};if(c.variants.length>1&&(h.variants=c.variants),c.orientation&&(h.orientation=c.orientation),c.exif_location&&c.exif_location.offset+c.exif_location.length<=r.length){var m=A(r,c.exif_location.offset),d=r.slice(c.exif_location.offset+m+4,c.exif_location.offset+c.exif_location.length),T=e.get_orientation(d);T>0&&(h.orientation=T)}return h}}}}}}}}),u9=Ze({"node_modules/probe-image-size/lib/parse_sync/bmp.js"(Z,q){"use strict";var v=ac().str2arr,x=ac().sliceEq,A=ac().readUInt16LE,M=v("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"}}}}),c9=Ze({"node_modules/probe-image-size/lib/parse_sync/gif.js"(Z,q){"use strict";var v=ac().str2arr,x=ac().sliceEq,A=ac().readUInt16LE,M=v("GIF87a"),e=v("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"}}}}),f9=Ze({"node_modules/probe-image-size/lib/parse_sync/ico.js"(Z,q){"use strict";var v=ac().readUInt16LE,x=0,A=1,M=16;q.exports=function(e){var t=v(e,0),r=v(e,2),i=v(e,4);if(!(t!==x||r!==A||!i)){for(var a=[],n={width:0,height:0},o=0;on.width||c>n.height)&&(n=h)}return{width:n.width,height:n.height,variants:a,type:"ico",mime:"image/x-icon",wUnits:"px",hUnits:"px"}}}}}),h9=Ze({"node_modules/probe-image-size/lib/parse_sync/jpeg.js"(Z,q){"use strict";var v=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 i=t[r++],a;i===255;)i=t[r++];if(208<=i&&i<=217||i===1)a=0;else if(192<=i&&i<=254){if(t.length-r<2)return;a=v(t,r)-2,r+=2}else return;if(i===217||i===218)return;var n;if(i===225&&a>=10&&A(t,r,e)&&(n=M.get_orientation(t.slice(r+6,r+a))),a>=5&&192<=i&&i<=207&&i!==196&&i!==200&&i!==204){if(t.length-r0&&(o.orientation=n),o}r+=a}}}}),p9=Ze({"node_modules/probe-image-size/lib/parse_sync/png.js"(Z,q){"use strict";var v=ac().str2arr,x=ac().sliceEq,A=ac().readUInt32BE,M=v(`\x89PNG\r  `),e=v("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"}}}}),d9=Ze({"node_modules/probe-image-size/lib/parse_sync/psd.js"(Z,q){"use strict";var v=ac().str2arr,x=ac().sliceEq,A=ac().readUInt32BE,M=v("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"}}}}),v9=Ze({"node_modules/probe-image-size/lib/parse_sync/svg.js"(Z,q){"use strict";function v(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,h=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='([^%]+?)'/,i=/\bview[bB]ox="(.+?)"|\bview[bB]ox='(.+?)'/,a=/in$|mm$|cm$|pt$|pc$|px$|em$|ex$/;function n(s){var c=s.match(t),h=s.match(r),m=s.match(i);return{width:c&&(c[1]||c[2]),height:h&&(h[1]||h[2]),viewbox:m&&(m[1]||m[2])}}function o(s){return a.test(s)?s.match(a)[0]:"px"}q.exports=function(s){if(A(s)){for(var c="",h=0;h>14&16383)+1,type:"webp",mime:"image/webp",wUnits:"px",hUnits:"px"}}}function n(o,s){return{width:(o[s+6]<<16|o[s+5]<<8|o[s+4])+1,height:(o[s+9]<o.length)){for(;s+8=10?c=c||i(o,s+8):d==="VP8L"&&T>=9?c=c||a(o,s+8):d==="VP8X"&&T>=10?c=c||n(o,s+8):d==="EXIF"&&(h=e.get_orientation(o.slice(s+8,s+8+T)),s=1/0),s+=8+T}if(c)return h>0&&(c.orientation=h),c}}}}}),y9=Ze({"node_modules/probe-image-size/lib/parsers_sync.js"(Z,q){"use strict";q.exports={avif:l9(),bmp:u9(),gif:c9(),ico:f9(),jpeg:h9(),png:p9(),psd:d9(),svg:v9(),tiff:m9(),webp:g9()}}}),_9=Ze({"node_modules/probe-image-size/sync.js"(Z,q){"use strict";var v=y9();function x(A){for(var M=Object.keys(v),e=0;e0;)P=c.c2p(E+B*u),B--;for(B=0;z===void 0&&B0;)F=h.c2p(g+B*y),B--;if(PH[0];if($||J){var X=f+I/2,oe=z+N/2;se+="transform:"+A(X+"px",oe+"px")+"scale("+($?-1:1)+","+(J?-1:1)+")"+A(-X+"px",-oe+"px")+";"}}ue.attr("style",se);var ne=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:f,y:z})});a._promises.push(ne)})}}}),T9=Ze({"src/traces/image/style.js"(Z,q){"use strict";var v=Oi();q.exports=function(A){v.select(A).selectAll(".im image").style("opacity",function(M){return M[0].trace.opacity})}}}),A9=Ze({"src/traces/image/hover.js"(Z,q){"use strict";var v=ef(),x=ca(),A=x.isArrayOrTypedArray,M=v1();q.exports=function(t,r,i){var a=t.cd[0],n=a.trace,o=t.xa,s=t.ya;if(!(v.inbox(r-a.x0,r-(a.x0+a.w*n.dx),0)>0||v.inbox(i-a.y0,i-(a.y0+a.h*n.dy),0)>0)){var c=Math.floor((r-a.x0)/n.dx),h=Math.floor(Math.abs(i-a.y0)/n.dy),m;if(n._hasZ?m=a.z[h][c]:n._hasSource&&(m=n._canvas.el.getContext("2d",{willReadFrequently:!0}).getImageData(c,h,1,1).data),!!m){var d=a.hi||n.hoverinfo,T;if(d){var l=d.split("+");l.indexOf("all")!==-1&&(l=["color"]),l.indexOf("color")!==-1&&(T=!0)}var _=M.colormodel[n.colormodel],w=_.colormodel||n.colormodel,S=w.length,E=n._scaler(m),g=_.suffix,b=[];(n.hovertemplate||T)&&(b.push("["+[E[0]+g[0],E[1]+g[1],E[2]+g[2]].join(", ")),S===4&&b.push(", "+E[3]+g[3]),b.push("]"),b=b.join(""),t.extraText=w.toUpperCase()+": "+b);var p;A(n.hovertext)&&A(n.hovertext[h])?p=n.hovertext[h][c]:A(n.text)&&A(n.text[h])&&(p=n.text[h][c]);var u=s.c2p(a.y0+(h+.5)*n.dy),y=a.x0+(c+.5)*n.dx,f=a.y0+(h+.5)*n.dy,P="["+m.slice(0,n.colormodel.length).join(", ")+"]";return[x.extendFlat(t,{index:[h,c],x0:o.c2p(a.x0+c*n.dx),x1:o.c2p(a.x0+(c+1)*n.dx),y0:u,y1:u,color:E,xVal:y,xLabelVal:y,yVal:f,yLabelVal:f,zLabelVal:P,text:p,hovertemplateLabels:{zLabel:P,colorLabel:b,"color[0]Label":E[0]+g[0],"color[1]Label":E[1]+g[1],"color[2]Label":E[2]+g[2],"color[3]Label":E[3]+g[3]}})]}}}}}),S9=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}}}),M9=Ze({"src/traces/image/index.js"(Z,q){"use strict";q.exports={attributes:RM(),supplyDefaults:l7(),calc:b9(),plot:w9(),style:T9(),hoverPoints:A9(),eventData:S9(),moduleType:"trace",name:"image",basePlotModule:Zf(),categories:["cartesian","svg","2dMap","noSortingByValue"],animatable:!1,meta:{}}}}),E9=Ze({"lib/image.js"(Z,q){"use strict";q.exports=M9()}}),i0=Ze({"src/traces/pie/attributes.js"(Z,q){"use strict";var v=eu(),x=bc().attributes,A=tc(),M=oh(),e=Cs().hovertemplateAttrs,t=Cs().texttemplateAttrs,r=rs().extendFlat,i=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:i,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({},v.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"}}}}),o0=Ze({"src/traces/pie/defaults.js"(Z,q){"use strict";var v=is(),x=ca(),A=i0(),M=bc().defaults,e=gd().handleText,t=ca().coercePattern;function r(n,o){var s=x.isArrayOrTypedArray(n),c=x.isArrayOrTypedArray(o),h=Math.min(s?n.length:1/0,c?o.length:1/0);if(isFinite(h)||(h=0),h&&c){for(var m,d=0;d0){m=!0;break}}m||(h=0)}return{hasLabels:s,hasValues:c,len:h}}function i(n,o,s,c,h){var m=c("marker.line.width");m&&c("marker.line.color",h?void 0:s.paper_bgcolor);var d=c("marker.colors");t(c,"marker.pattern",d),n.marker&&!o.marker.pattern.fgcolor&&(o.marker.pattern.fgcolor=n.marker.colors),o.marker.pattern.bgcolor||(o.marker.pattern.bgcolor=s.paper_bgcolor)}function a(n,o,s,c){function h(f,P){return x.coerce(n,o,A,f,P)}var m=h("labels"),d=h("values"),T=r(m,d),l=T.len;if(o._hasLabels=T.hasLabels,o._hasValues=T.hasValues,!o._hasLabels&&o._hasValues&&(h("label0"),h("dlabel")),!l){o.visible=!1;return}o._length=l,i(n,o,c,h,!0),h("scalegroup");var _=h("text"),w=h("texttemplate"),S;if(w||(S=h("textinfo",x.isArrayOrTypedArray(_)?"text+percent":"percent")),h("hovertext"),h("hovertemplate"),w||S&&S!=="none"){var E=h("textposition");e(n,o,c,h,E,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1});var g=Array.isArray(E)||E==="auto",b=g||E==="outside";b&&h("automargin"),(E==="inside"||E==="auto"||Array.isArray(E))&&h("insidetextorientation")}else S==="none"&&h("textposition","none");M(o,c,h);var p=h("hole"),u=h("title.text");if(u){var y=h("title.position",p?"middle center":"top center");!p&&y==="middle center"&&(o.title.position="top center"),x.coerceFont(h,"title.font",c.font)}h("sort"),h("direction"),h("rotation"),h("pull")}q.exports={handleLabelsAndValues:r,handleMarkerDefaults:i,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"}}}}),C9=Ze({"src/traces/pie/layout_defaults.js"(Z,q){"use strict";var v=ca(),x=_3();q.exports=function(M,e){function t(r,i){return v.coerce(M,e,x,r,i)}t("hiddenlabels"),t("piecolorway",e.colorway),t("extendpiecolors")}}}),x1=Ze({"src/traces/pie/calc.js"(Z,q){"use strict";var v=is(),x=Ch(),A=Yi(),M={};function e(a,n){var o=[],s=a._fullLayout,c=s.hiddenlabels||[],h=n.labels,m=n.marker.colors||[],d=n.values,T=n._length,l=n._hasValues&&T,_,w;if(n.dlabel)for(h=new Array(T),_=0;_=0});var P=n.type==="funnelarea"?b:n.sort;return P&&o.sort(function(L,z){return z.v-L.v}),o[0]&&(o[0].vTotal=g),o}function t(a){return function(o,s){return!o||(o=x(o),!o.isValid())?!1:(o=A.addOpacity(o,o.getAlpha()),a[s]||(a[s]=o),o)}}function r(a,n){var o=(n||{}).type;o||(o="pie");var s=a._fullLayout,c=a.calcdata,h=s[o+"colorway"],m=s["_"+o+"colormap"];s["extend"+o+"colors"]&&(h=i(h,M));for(var d=0,T=0;T0&&(rt+=kt*fe.pxmid[0],st+=kt*fe.pxmid[1])}fe.cxFinal=rt,fe.cyFinal=st;function qt(bt,Be,Ke,Ue){var Ee=Ue*(Be[0]-bt[0]),Ve=Ue*(Be[1]-bt[1]);return"a"+Ue*ce.r+","+Ue*ce.r+" 0 "+fe.largeArc+(Ke?" 1 ":" 0 ")+Ee+","+Ve}var Zt=be.hole;if(fe.v===ce.vTotal){var Sr="M"+(rt+fe.px0[0])+","+(st+fe.px0[1])+qt(fe.px0,fe.pxmid,!0,1)+qt(fe.pxmid,fe.px0,!0,1)+"Z";Zt?Lt.attr("d","M"+(rt+Zt*fe.px0[0])+","+(st+Zt*fe.px0[1])+qt(fe.px0,fe.pxmid,!1,Zt)+qt(fe.pxmid,fe.px0,!1,Zt)+"Z"+Sr):Lt.attr("d",Sr)}else{var xr=qt(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])+qt(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=h.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(v.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=g(Ke,fe,ce),wr==="auto"&&Ue.scale<1){var Ee=t.ensureUniformFontSize($,be.outsidetextfont);bt.call(e.font,Ee),Ke=e.bBox(bt.node()),Ue=z(Ke,fe)}var Ve=Ue.textPosAngle,Ce=Ve===void 0?fe.pxmid:se(ce.r,Ve);if(Ue.targetX=rt+Ce[0]*Ue.rCenter+(Ue.x||0),Ue.targetY=st+Ce[1]*Ue.rCenter+(Ue.y||0),H(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,o(be.type,Ue,oe),ee[Fe].transform=Ue,t.setTransormAndDisplay(bt,Ue)})});var We=v.select(this).selectAll("g.titletext").data(be.title.text?[0]:[]);if(We.enter().append("g").classed("titletext",!0),We.exit().remove(),We.each(function(){var fe=t.ensureSingle(v.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,ne),fe.attr("transform",i(rt.x,rt.y)+r(Math.min(1,rt.scale))+i(rt.tx,rt.ty))}),Re&&U(ze,be),l(Ae,be),Re&&be.automargin){var it=e.bBox(re.node()),ot=be.domain,tt=ne.w*(ot.x[1]-ot.x[0]),ut=ne.h*(ot.y[1]-ot.y[0]),Me=(.5*tt-ce.r)/ne.w,_e=(.5*ut-ce.r)/ne.h;x.autoMargin($,"pie."+be.uid+".automargin",{xl:ot.x[0]-Me,xr:ot.x[1]+Me,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=v.select(this);ee.attr("dy")&&ee.attr("dy",ee.attr("dy"))})},0)}function l($,J){$.each(function(X){var oe=v.select(this);if(!X.labelExtraX&&!X.labelExtraY){oe.select("path.textline").remove();return}var ne=oe.select("g.slicetext text");X.transform.targetX+=X.labelExtraX,X.transform.targetY+=X.labelExtraY,t.setTransormAndDisplay(ne,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],ne=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:[h.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,We=ne+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=h.castOption(Ae.hovertext||Ae.text,ce.pts),ze&&ze.indexOf("text")!==-1){var ut=ce.text;t.isValidTextValue(ut)&&tt.push(ut)}ce.value=ce.v,ce.valueLabel=h.formatPieValue(ce.v,ot),ze&&ze.indexOf("value")!==-1&&tt.push(ce.valueLabel),ce.percent=ce.v/oe.vTotal,ce.percentLabel=h.formatPiePercent(ce.percent,ot),ze&&ze.indexOf("percent")!==-1&&tt.push(ce.percentLabel);var Me=Ae.hoverlabel,_e=Me.font,fe=[];A.loneHover({trace:ee,x0:We-Re*oe.r,x1:We+Re*oe.r,y:it,_x0:re?ne+ce.TL[0]:We-Re*oe.r,_x1:re?ne+ce.TR[0]:We+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:h.castOption(Me.bgcolor,ce.pts)||ce.color,borderColor:h.castOption(Me.bordercolor,ce.pts),fontFamily:h.castOption(_e.family,ce.pts),fontSize:h.castOption(_e.size,ce.pts),fontColor:h.castOption(_e.color,ce.pts),nameLength:h.castOption(Me.namelength,ce.pts),textAlign:h.castOption(Me.align,ce.pts),hovertemplate:h.castOption(Ae.hovertemplate,ce.pts),hovertemplateLabels:ce,eventData:[m(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:[m(ce,Ae)],event:v.event})}}),$.on("mouseout",function(ce){var be=J._fullLayout,Ae=J._fullData[ee.index],ze=v.select(this).datum();ee._hasHoverEvent&&(ce.originalEvent=v.event,J.emit("plotly_unhover",{points:[m(ze,Ae)],event:v.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=[m(ce,Ae)],A.click(J,v.event))})}function w($,J,X){var oe=h.castOption($.outsidetextfont.color,J.pts)||h.castOption($.textfont.color,J.pts)||X.color,ne=h.castOption($.outsidetextfont.family,J.pts)||h.castOption($.textfont.family,J.pts)||X.family,j=h.castOption($.outsidetextfont.size,J.pts)||h.castOption($.textfont.size,J.pts)||X.size,ee=h.castOption($.outsidetextfont.weight,J.pts)||h.castOption($.textfont.weight,J.pts)||X.weight,re=h.castOption($.outsidetextfont.style,J.pts)||h.castOption($.textfont.style,J.pts)||X.style,ce=h.castOption($.outsidetextfont.variant,J.pts)||h.castOption($.textfont.variant,J.pts)||X.variant,be=h.castOption($.outsidetextfont.textcase,J.pts)||h.castOption($.textfont.textcase,J.pts)||X.textcase,Ae=h.castOption($.outsidetextfont.lineposition,J.pts)||h.castOption($.textfont.lineposition,J.pts)||X.lineposition,ze=h.castOption($.outsidetextfont.shadow,J.pts)||h.castOption($.textfont.shadow,J.pts)||X.shadow;return{color:oe,family:ne,size:j,weight:ee,style:re,variant:ce,textcase:be,lineposition:Ae,shadow:ze}}function S($,J,X){var oe=h.castOption($.insidetextfont.color,J.pts);!oe&&$._input.textfont&&(oe=h.castOption($._input.textfont.color,J.pts));var ne=h.castOption($.insidetextfont.family,J.pts)||h.castOption($.textfont.family,J.pts)||X.family,j=h.castOption($.insidetextfont.size,J.pts)||h.castOption($.textfont.size,J.pts)||X.size,ee=h.castOption($.insidetextfont.weight,J.pts)||h.castOption($.textfont.weight,J.pts)||X.weight,re=h.castOption($.insidetextfont.style,J.pts)||h.castOption($.textfont.style,J.pts)||X.style,ce=h.castOption($.insidetextfont.variant,J.pts)||h.castOption($.textfont.variant,J.pts)||X.variant,be=h.castOption($.insidetextfont.textcase,J.pts)||h.castOption($.textfont.textcase,J.pts)||X.textcase,Ae=h.castOption($.insidetextfont.lineposition,J.pts)||h.castOption($.textfont.lineposition,J.pts)||X.lineposition,ze=h.castOption($.insidetextfont.shadow,J.pts)||h.castOption($.textfont.shadow,J.pts)||X.shadow;return{color:oe||M.contrast(J.color),family:ne,size:j,weight:ee,style:re,variant:ce,textcase:be,lineposition:Ae,shadow:ze}}function E($,J){for(var X,oe,ne=0;ne<$.length;ne++)if(X=$[ne][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 g($,J,X){var oe=X.r||J.rpx1,ne=J.rInscribed,j=J.startangle===J.stopangle;if(j)return{rCenter:1-ne,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",We=Ae==="radial",it=Ae==="auto",ot=[],tt;if(!it){var ut=function(Qe,Lt){if(b(J,Qe)){var kt=Math.abs(Qe-J.startangle),qt=Math.abs(Qe-J.stopangle),Zt=kt=-4;Me-=2)ut(Math.PI*Me,"tan");for(Me=4;Me>=-4;Me-=2)ut(Math.PI*(Me+1),"tan")}if(ze||We){for(Me=4;Me>=-4;Me-=2)ut(Math.PI*(Me+1.5),"rad");for(Me=4;Me>=-4;Me-=2)ut(Math.PI*(Me+.5),"rad")}}if(re||it||ze){var _e=Math.sqrt($.width*$.width+$.height*$.height);if(tt={scale:ne*oe*2/_e,rCenter:1-ne,rotate:0},tt.textPosAngle=(J.startangle+J.stopangle)/2,tt.scale>=1)return tt;ot.push(tt)}(it||We)&&(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,ne,j=$.trace,ee={x:$.cx,y:$.cy},re={tx:0,ty:0};re.ty+=j.title.font.size,ne=N(j),j.title.position.indexOf("top")!==-1?(ee.y-=(1+ne)*$.r,re.ty-=$.titleBox.height):j.title.position.indexOf("bottom")!==-1&&(ee.y+=(1+ne)*$.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+ne)*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+ne)*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,ne,j,ee,re,ce,be,Ae,ze,Re,We,it;function ot(_e,fe){return _e.pxmid[1]-fe.pxmid[1]}function tt(_e,fe){return fe.pxmid[1]-_e.pxmid[1]}function ut(_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,qt,Zt,Sr,xr,jr;if(Lt*ce>0&&(_e.labelExtraY=Lt),!!t.isArrayOrTypedArray(J.pull))for(qt=0;qt=(h.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(qt-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(ne=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(ne),Ae=$[1-oe][X],ze=Ae.concat(be),We=[],Re=0;Re1?(be=X.r,Ae=be/ne.aspectratio):(Ae=X.r,be=Ae*ne.aspectratio),be*=(1+ne.baseratio)/2,ce=be*Ae}ee=Math.min(ee,ce/X.vTotal)}for(oe=0;oe<$.length;oe++)if(X=$[oe][0],ne=X.trace,ne.scalegroup===re){var ze=ee*X.vTotal;ne.type==="funnelarea"&&(ze/=(1+ne.baseratio)/2,ze/=ne.aspectratio),X.r=Math.sqrt(ze)}}}function ue($){var J=$[0],X=J.r,oe=J.trace,ne=h.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;ne+=j*$[ce].v,j*=-1,ee="px1",re="px0"}for(Ae=se(X,ne),ce=0;ce<$.length;ce++)be=$[ce],!be.hidden&&(be[ee]=Ae,be.startangle=ne,ne+=j*be.v/2,be.pxmid=se(X,ne),be.midangle=ne,ne+=j*be.v/2,Ae=se(X,ne),be.stopangle=ne,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 se($,J){return[$*Math.sin(J),-$*Math.cos(J)]}function he($,J,X){var oe=$._fullLayout,ne=X.trace,j=ne.texttemplate,ee=ne.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"),We=oe.separators,it;if(it=be?[J.label]:[],Ae){var ot=h.getFirstFilled(ne.text,J.pts);d(ot)&&it.push(ot)}ze&&it.push(h.formatPieValue(J.v,We)),Re&&it.push(h.formatPiePercent(J.v/X.vTotal,We)),J.text=it.join("
")}function tt(fe){return{label:fe.label,value:fe.v,valueLabel:h.formatPieValue(fe.v,oe.separators),percent:fe.v/X.vTotal,percentLabel:h.formatPiePercent(fe.v/X.vTotal,oe.separators),color:fe.color,text:fe.text,customdata:t.castOption(ne,fe.i,"customdata")}}if(j){var ut=t.castOption(ne,J.i,"texttemplate");if(!ut)J.text="";else{var Me=tt(J),_e=h.getFirstFilled(ne.text,J.pts);(d(_e)||_e==="")&&(Me.text=_e),J.text=t.texttemplateString(ut,Me,$._fullLayout._d3locale,Me,ne._meta||{})}}}function H($,J){var X=$.rotate*Math.PI/180,oe=Math.cos(X),ne=Math.sin(X),j=(J.left+J.right)/2,ee=(J.top+J.bottom)/2;$.textX=j*oe-ee*ne,$.textY=j*ne+ee*oe,$.noCenter=!0}q.exports={plot:T,formatSliceLabel:he,transformInsideText:g,determineInsideTextFont:S,positionTitleOutside:B,prerenderTitles:E,layoutAreas:W,attachFxHandlers:_,computeTransform:H}}}),L9=Ze({"src/traces/pie/style.js"(Z,q){"use strict";var v=Oi(),x=n1(),A=wp().resizeText;q.exports=function(e){var t=e._fullLayout._pielayer.selectAll(".trace");A(e,t,"pie"),t.each(function(r){var i=r[0],a=i.trace,n=v.select(this);n.style({opacity:a.opacity}),n.selectAll("path.surface").each(function(o){v.select(this).call(x,o,a,e)})})}}}),P9=Ze({"src/traces/pie/base_plot.js"(Z){"use strict";var q=xc();Z.name="pie",Z.plot=function(v,x,A,M){q.plotBasePlot(Z.name,v,x,A,M)},Z.clean=function(v,x,A,M){q.cleanBasePlot(Z.name,v,x,A,M)}}}),I9=Ze({"src/traces/pie/index.js"(Z,q){"use strict";q.exports={attributes:i0(),supplyDefaults:o0().supplyDefaults,supplyLayoutDefaults:C9(),layoutAttributes:_3(),calc:x1().calc,crossTraceCalc:x1().crossTraceCalc,plot:x3().plot,style:L9(),styleOne:n1(),moduleType:"trace",name:"pie",basePlotModule:P9(),categories:["pie-like","pie","showLegend"],meta:{}}}}),R9=Ze({"lib/pie.js"(Z,q){"use strict";q.exports=I9()}}),D9=Ze({"src/traces/sunburst/base_plot.js"(Z){"use strict";var q=xc();Z.name="sunburst",Z.plot=function(v,x,A,M){q.plotBasePlot(Z.name,v,x,A,M)},Z.clean=function(v,x,A,M){q.cleanBasePlot(Z.name,v,x,A,M)}}}),nE=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 v=eu(),x=Cs().hovertemplateAttrs,A=Cs().texttemplateAttrs,M=Mu(),e=bc().attributes,t=i0(),r=nE(),i=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:i({colors:{valType:"data_array",editType:"calc"},line:{color:i({},t.marker.line.color,{dflt:null}),width:i({},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:i({},v.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:i({},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"})}}}),iE=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"}}}}),z9=Ze({"src/traces/sunburst/defaults.js"(Z,q){"use strict";var v=ca(),x=K_(),A=bc().defaults,M=gd().handleText,e=o0().handleMarkerDefaults,t=rc(),r=t.hasColorscale,i=t.handleDefaults;q.exports=function(n,o,s,c){function h(S,E){return v.coerce(n,o,x,S,E)}var m=h("labels"),d=h("parents");if(!m||!m.length||!d||!d.length){o.visible=!1;return}var T=h("values");T&&T.length?h("branchvalues"):h("count"),h("level"),h("maxdepth"),e(n,o,c,h);var l=o._hasColorscale=r(n,"marker","colors")||(n.marker||{}).coloraxis;l&&i(n,o,c,h,{prefix:"marker.",cLetter:"c"}),h("leaf.opacity",l?1:.7);var _=h("text");h("texttemplate"),o.texttemplate||h("textinfo",v.isArrayOrTypedArray(_)?"text+label":"label"),h("hovertext"),h("hovertemplate");var w="auto";M(n,o,c,h,w,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),h("insidetextorientation"),h("sort"),h("rotation"),h("root.color"),A(o,c,h),o._length=null}}}),F9=Ze({"src/traces/sunburst/layout_defaults.js"(Z,q){"use strict";var v=ca(),x=iE();q.exports=function(M,e){function t(r,i){return v.coerce(M,e,x,r,i)}t("sunburstcolorway",e.colorway),t("extendsunburstcolors")}}}),J_=Ze({"node_modules/d3-hierarchy/dist/d3-hierarchy.js"(Z,q){(function(v,x){typeof Z=="object"&&typeof q<"u"?x(Z):(v=v||self,x(v.d3=v.d3||{}))})(Z,function(v){"use strict";function x(Ue,Ee){return Ue.parent===Ee.parent?1:2}function A(Ue){return Ue.reduce(M,0)/Ue.length}function M(Ue,Ee){return Ue+Ee.x}function e(Ue){return 1+Ue.reduce(t,0)}function t(Ue,Ee){return Math.max(Ue,Ee.y)}function r(Ue){for(var Ee;Ee=Ue.children;)Ue=Ee[0];return Ue}function i(Ue){for(var Ee;Ee=Ue.children;)Ue=Ee[Ee.length-1];return Ue}function a(){var Ue=x,Ee=1,Ve=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=i(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)*Ee,Qt.y=(Pe.y-Qt.y)*Ve}:function(Qt){Qt.x=(Qt.x-Gt)/(rr-Gt)*Ee,Qt.y=(1-(Pe.y?Qt.y/Pe.y:1))*Ve})}return Te.separation=function(Pe){return arguments.length?(Ue=Pe,Te):Ue},Te.size=function(Pe){return arguments.length?(Ce=!1,Ee=+Pe[0],Ve=+Pe[1],Te):Ce?null:[Ee,Ve]},Te.nodeSize=function(Pe){return arguments.length?(Ce=!0,Ee=+Pe[0],Ve=+Pe[1],Te):Ce?[Ee,Ve]:null},Te}function n(Ue){var Ee=0,Ve=Ue.children,Ce=Ve&&Ve.length;if(!Ce)Ee=1;else for(;--Ce>=0;)Ee+=Ve[Ce].value;Ue.value=Ee}function o(){return this.eachAfter(n)}function s(Ue){var Ee=this,Ve,Ce=[Ee],Te,Pe,at;do for(Ve=Ce.reverse(),Ce=[];Ee=Ve.pop();)if(Ue(Ee),Te=Ee.children,Te)for(Pe=0,at=Te.length;Pe=0;--Te)Ve.push(Ce[Te]);return this}function h(Ue){for(var Ee=this,Ve=[Ee],Ce=[],Te,Pe,at;Ee=Ve.pop();)if(Ce.push(Ee),Te=Ee.children,Te)for(Pe=0,at=Te.length;Pe=0;)Ve+=Ce[Te].value;Ee.value=Ve})}function d(Ue){return this.eachBefore(function(Ee){Ee.children&&Ee.children.sort(Ue)})}function T(Ue){for(var Ee=this,Ve=l(Ee,Ue),Ce=[Ee];Ee!==Ve;)Ee=Ee.parent,Ce.push(Ee);for(var Te=Ce.length;Ue!==Ve;)Ce.splice(Te,0,Ue),Ue=Ue.parent;return Ce}function l(Ue,Ee){if(Ue===Ee)return Ue;var Ve=Ue.ancestors(),Ce=Ee.ancestors(),Te=null;for(Ue=Ve.pop(),Ee=Ce.pop();Ue===Ee;)Te=Ue,Ue=Ve.pop(),Ee=Ce.pop();return Te}function _(){for(var Ue=this,Ee=[Ue];Ue=Ue.parent;)Ee.push(Ue);return Ee}function w(){var Ue=[];return this.each(function(Ee){Ue.push(Ee)}),Ue}function S(){var Ue=[];return this.eachBefore(function(Ee){Ee.children||Ue.push(Ee)}),Ue}function E(){var Ue=this,Ee=[];return Ue.each(function(Ve){Ve!==Ue&&Ee.push({source:Ve.parent,target:Ve})}),Ee}function g(Ue,Ee){var Ve=new f(Ue),Ce=+Ue.value&&(Ve.value=Ue.value),Te,Pe=[Ve],at,yt,Tt,Ot;for(Ee==null&&(Ee=p);Te=Pe.pop();)if(Ce&&(Te.value=+Te.data.value),(yt=Ee(Te.data))&&(Ot=yt.length))for(Te.children=new Array(Ot),Tt=Ot-1;Tt>=0;--Tt)Pe.push(at=Te.children[Tt]=new f(yt[Tt])),at.parent=Te,at.depth=Te.depth+1;return Ve.eachBefore(y)}function b(){return g(this).eachBefore(u)}function p(Ue){return Ue.children}function u(Ue){Ue.data=Ue.data.data}function y(Ue){var Ee=0;do Ue.height=Ee;while((Ue=Ue.parent)&&Ue.height<++Ee)}function f(Ue){this.data=Ue,this.depth=this.height=0,this.parent=null}f.prototype=g.prototype={constructor:f,count:o,each:s,eachAfter:h,eachBefore:c,sum:m,sort:d,path:T,ancestors:_,descendants:w,leaves:S,links:E,copy:b};var P=Array.prototype.slice;function L(Ue){for(var Ee=Ue.length,Ve,Ce;Ee;)Ce=Math.random()*Ee--|0,Ve=Ue[Ee],Ue[Ee]=Ue[Ce],Ue[Ce]=Ve;return Ue}function z(Ue){for(var Ee=0,Ve=(Ue=L(P.call(Ue))).length,Ce=[],Te,Pe;Ee0&&Ve*Ve>Ce*Ce+Te*Te}function I(Ue,Ee){for(var Ve=0;VeTt?(Te=(Ot+Tt-Pe)/(2*Ot),yt=Math.sqrt(Math.max(0,Tt/Ot-Te*Te)),Ve.x=Ue.x-Te*Ce-yt*at,Ve.y=Ue.y-Te*at+yt*Ce):(Te=(Ot+Pe-Tt)/(2*Ot),yt=Math.sqrt(Math.max(0,Pe/Ot-Te*Te)),Ve.x=Ee.x+Te*Ce-yt*at,Ve.y=Ee.y+Te*at+yt*Ce)):(Ve.x=Ee.x+Ve.r,Ve.y=Ee.y)}function se(Ue,Ee){var Ve=Ue.r+Ee.r-1e-6,Ce=Ee.x-Ue.x,Te=Ee.y-Ue.y;return Ve>0&&Ve*Ve>Ce*Ce+Te*Te}function he(Ue){var Ee=Ue._,Ve=Ue.next._,Ce=Ee.r+Ve.r,Te=(Ee.x*Ve.r+Ve.x*Ee.r)/Ce,Pe=(Ee.y*Ve.r+Ve.y*Ee.r)/Ce;return Te*Te+Pe*Pe}function H(Ue){this._=Ue,this.next=null,this.previous=null}function $(Ue){if(!(Te=Ue.length))return 0;var Ee,Ve,Ce,Te,Pe,at,yt,Tt,Ot,Gt,rr;if(Ee=Ue[0],Ee.x=0,Ee.y=0,!(Te>1))return Ee.r;if(Ve=Ue[1],Ee.x=-Ve.r,Ve.x=Ee.r,Ve.y=0,!(Te>2))return Ee.r+Ve.r;ue(Ve,Ee,Ce=Ue[2]),Ee=new H(Ee),Ve=new H(Ve),Ce=new H(Ce),Ee.next=Ce.previous=Ve,Ve.next=Ee.previous=Ce,Ce.next=Ve.previous=Ee;e:for(yt=3;yt0)throw new Error("cycle");return yt}return Ve.id=function(Ce){return arguments.length?(Ue=oe(Ce),Ve):Ue},Ve.parentId=function(Ce){return arguments.length?(Ee=oe(Ce),Ve):Ee},Ve}function fe(Ue,Ee){return Ue.parent===Ee.parent?1:2}function Fe(Ue){var Ee=Ue.children;return Ee?Ee[0]:Ue.t}function rt(Ue){var Ee=Ue.children;return Ee?Ee[Ee.length-1]:Ue.t}function st(Ue,Ee,Ve){var Ce=Ve/(Ee.i-Ue.i);Ee.c-=Ce,Ee.s+=Ve,Ue.c+=Ce,Ee.z+=Ve,Ee.m+=Ve}function Qe(Ue){for(var Ee=0,Ve=0,Ce=Ue.children,Te=Ce.length,Pe;--Te>=0;)Pe=Ce[Te],Pe.z+=Ee,Pe.m+=Ee,Ee+=Pe.s+(Ve+=Pe.c)}function Lt(Ue,Ee,Ve){return Ue.a.parent===Ee.parent?Ue.a:Ve}function kt(Ue,Ee){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=Ee}kt.prototype=Object.create(f.prototype);function qt(Ue){for(var Ee=new kt(Ue,0),Ve,Ce=[Ee],Te,Pe,at,yt;Ve=Ce.pop();)if(Pe=Ve._.children)for(Ve.children=new Array(yt=Pe.length),at=yt-1;at>=0;--at)Ce.push(Te=Ve.children[at]=new kt(Pe[at],at)),Te.parent=Ve;return(Ee.parent=new kt(null,0)).children=[Ee],Ee}function Zt(){var Ue=fe,Ee=1,Ve=1,Ce=null;function Te(Ot){var Gt=qt(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(Qa){Qa.xQt.x&&(Qt=Qa),Qa.depth>Tr.depth&&(Tr=Qa)});var la=rr===Qt?1:Ue(rr,Qt)/2,Ua=la-rr.x,Ba=Ee/(Qt.x+la+Ua),Ra=Ve/(Tr.depth||1);Ot.eachBefore(function(Qa){Qa.x=(Qa.x+Ua)*Ba,Qa.y=Qa.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,Qa=la.m,za=Ua.m,en;la=rt(la),Qt=Fe(Qt),la&&Qt;)Ua=Fe(Ua),Tr=rt(Tr),Tr.a=Ot,en=la.z+Qa-Qt.z-Ba+Ue(la._,Qt._),en>0&&(st(Lt(la,Ot,rr),Ot,en),Ba+=en,Ra+=en),Qa+=la.m,Ba+=Qt.m,za+=Ua.m,Ra+=Tr.m;la&&!rt(Tr)&&(Tr.t=la,Tr.m+=Qa-Ra),Qt&&!Fe(Ua)&&(Ua.t=Qt,Ua.m+=Ba-za,rr=Ot)}return rr}function Tt(Ot){Ot.x*=Ee,Ot.y=Ot.depth*Ve}return Te.separation=function(Ot){return arguments.length?(Ue=Ot,Te):Ue},Te.size=function(Ot){return arguments.length?(Ce=!1,Ee=+Ot[0],Ve=+Ot[1],Te):Ce?null:[Ee,Ve]},Te.nodeSize=function(Ot){return arguments.length?(Ce=!0,Ee=+Ot[0],Ve=+Ot[1],Te):Ce?[Ee,Ve]:null},Te}function Sr(Ue,Ee,Ve,Ce,Te){for(var Pe=Ue.children,at,yt=-1,Tt=Pe.length,Ot=Ue.value&&(Te-Ve)/Ue.value;++ytQa&&(Qa=Ot),Jt=Ba*Ba*kn,za=Math.max(Qa/Jt,Jt/Ra),za>en){Ba-=Ot;break}en=za}at.push(Tt={value:Ba,dice:Tr1?Ce:1)},Ve}(xr);function Ir(){var Ue=wr,Ee=!1,Ve=1,Ce=1,Te=[0],Pe=ne,at=ne,yt=ne,Tt=ne,Ot=ne;function Gt(Qt){return Qt.x0=Qt.y0=0,Qt.x1=Ve,Qt.y1=Ce,Qt.eachBefore(rr),Te=[0],Ee&&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 Qa=Pe[rr];Qa.x0=la,Qa.y0=Ua,Qa.x1=Ba,Qa.y1=Ra;return}for(var za=Ot[rr],en=Tr/2+za,kn=rr+1,Jt=Qt-1;kn>>1;Ot[Nt]Ra-Ua){var Pr=(la*Wt+Ba*Kt)/Tr;Gt(rr,kn,Kt,la,Ua,Pr,Ra),Gt(kn,Qt,Wt,Pr,Ua,Ba,Ra)}else{var ta=(Ua*Wt+Ra*Kt)/Tr;Gt(rr,kn,Kt,la,Ua,Ba,ta),Gt(kn,Qt,Wt,la,ta,Ba,Ra)}}}function Be(Ue,Ee,Ve,Ce,Te){(Ue.depth&1?Sr:Re)(Ue,Ee,Ve,Ce,Te)}var Ke=function Ue(Ee){function Ve(Ce,Te,Pe,at,yt){if((Tt=Ce._squarify)&&Tt.ratio===Ee)for(var Tt,Ot,Gt,rr,Qt=-1,Tr,la=Tt.length,Ua=Ce.value;++Qt1?Ce:1)},Ve}(xr);v.cluster=a,v.hierarchy=g,v.pack=re,v.packEnclose=z,v.packSiblings=J,v.partition=We,v.stratify=_e,v.tree=Zt,v.treemap=Ir,v.treemapBinary=bt,v.treemapDice=Re,v.treemapResquarify=Ke,v.treemapSlice=Sr,v.treemapSliceDice=Be,v.treemapSquarify=wr,Object.defineProperty(v,"__esModule",{value:!0})})}}),$_=Ze({"src/traces/sunburst/calc.js"(Z){"use strict";var q=J_(),v=is(),x=ca(),A=rc().makeColorScaleFuncFromTrace,M=x1().makePullColorFn,e=x1().generateExtendedColors,t=rc().calc,r=Vs().ALMOST_EQUAL,i={},a={},n={};Z.calc=function(s,c){var h=s._fullLayout,m=c.ids,d=x.isArrayOrTypedArray(m),T=c.labels,l=c.parents,_=c.values,w=x.isArrayOrTypedArray(_),S=[],E={},g={},b=function(J,X){E[J]?E[J].push(X):E[J]=[X],g[X]=1},p=function(J){return J||typeof J=="number"},u=function(J){return!w||v(_[J])&&_[J]>=0},y,f,P;d?(y=Math.min(m.length,l.length),f=function(J){return p(m[J])&&u(J)},P=function(J){return String(m[J])}):(y=Math.min(T.length,l.length),f=function(J){return p(T[J])&&u(J)},P=function(J){return String(T[J])}),w&&(y=Math.min(y,_.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):v===8?Q_(q>>24&255,q>>16&255,q>>8&255,(q&255)/255):v===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=vE.exec(Z))?new Xh(q[1],q[2],q[3],1):(q=mE.exec(Z))?new Xh(q[1]*255/100,q[2]*255/100,q[3]*255/100,1):(q=gE.exec(Z))?Q_(q[1],q[2],q[3],q[4]):(q=yE.exec(Z))?Q_(q[1]*255/100,q[2]*255/100,q[3]*255/100,q[4]):(q=_E.exec(Z))?fE(q[1],q[2]/100,q[3]/100,1):(q=xE.exec(Z))?fE(q[1],q[2]/100,q[3]/100,q[4]):S3.hasOwnProperty(Z)?lE(S3[Z]):Z==="transparent"?new Xh(NaN,NaN,NaN,0):null}function lE(Z){return new Xh(Z>>16&255,Z>>8&255,Z&255,1)}function Q_(Z,q,v,x){return x<=0&&(Z=q=v=NaN),new Xh(Z,q,v,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,v,x){return arguments.length===1?w3(Z):new Xh(Z,q,v,x??1)}function Xh(Z,q,v,x){this.r=+Z,this.g=+q,this.b=+v,this.opacity=+x}function uE(){return`#${og(this.r)}${og(this.g)}${og(this.b)}`}function N9(){return`#${og(this.r)}${og(this.g)}${og(this.b)}${og((isNaN(this.opacity)?1:this.opacity)*255)}`}function cE(){let Z=tx(this.opacity);return`${Z===1?"rgb(":"rgba("}${ig(this.r)}, ${ig(this.g)}, ${ig(this.b)}${Z===1?")":`, ${Z})`}`}function tx(Z){return isNaN(Z)?1:Math.max(0,Math.min(1,Z))}function ig(Z){return Math.max(0,Math.min(255,Math.round(Z)||0))}function og(Z){return Z=ig(Z),(Z<16?"0":"")+Z.toString(16)}function fE(Z,q,v,x){return x<=0?Z=q=v=NaN:v<=0||v>=1?Z=q=NaN:q<=0&&(Z=NaN),new Ud(Z,q,v,x)}function hE(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,v=Z.g/255,x=Z.b/255,A=Math.min(q,v,x),M=Math.max(q,v,x),e=NaN,t=M-A,r=(M+A)/2;return t?(q===M?e=(v-x)/t+(v0&&r<1?0:e,new Ud(e,t,r,Z.opacity)}function T3(Z,q,v,x){return arguments.length===1?hE(Z):new Ud(Z,q,v,x??1)}function Ud(Z,q,v,x){this.h=+Z,this.s=+q,this.l=+v,this.opacity=+x}function pE(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,v){return(Z<60?q+(v-q)*Z/60:Z<180?v:Z<240?q+(v-q)*(240-Z)/60:q)*255}var Jv,sg,lg,l0,jd,dE,vE,mE,gE,yE,_E,xE,S3,M3=mo({"node_modules/d3-color/src/color.js"(){b3(),Jv=.7,sg=1/Jv,lg="\\s*([+-]?\\d+)\\s*",l0="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",jd="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",dE=/^#([0-9a-f]{3,8})$/,vE=new RegExp(`^rgb\\(${lg},${lg},${lg}\\)$`),mE=new RegExp(`^rgb\\(${jd},${jd},${jd}\\)$`),gE=new RegExp(`^rgba\\(${lg},${lg},${lg},${l0}\\)$`),yE=new RegExp(`^rgba\\(${jd},${jd},${jd},${l0}\\)$`),_E=new RegExp(`^hsl\\(${l0},${jd},${jd}\\)$`),xE=new RegExp(`^hsla\\(${l0},${jd},${jd},${l0}\\)$`),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},s0(Kv,w1,{copy(Z){return Object.assign(new this.constructor,this,Z)},displayable(){return this.rgb().displayable()},hex:oE,formatHex:oE,formatHex8:O9,formatHsl:B9,formatRgb:sE,toString:sE}),s0(Xh,ex,b1(Kv,{brighter(Z){return Z=Z==null?sg:Math.pow(sg,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(ig(this.r),ig(this.g),ig(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:uE,formatHex:uE,formatHex8:N9,formatRgb:cE,toString:cE})),s0(Ud,T3,b1(Kv,{brighter(Z){return Z=Z==null?sg:Math.pow(sg,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,v=this.l,x=v+(v<.5?v:1-v)*q,A=2*v-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(pE(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("}${pE(this.h)}, ${rx(this.s)*100}%, ${rx(this.l)*100}%${Z===1?")":`, ${Z})`}`}}))}}),E3,C3,bE=mo({"node_modules/d3-color/src/math.js"(){E3=Math.PI/180,C3=180/Math.PI}});function wE(Z){if(Z instanceof rv)return new rv(Z.l,Z.a,Z.b,Z.opacity);if(Z instanceof Mv)return TE(Z);Z instanceof Xh||(Z=w3(Z));var q=R3(Z.r),v=R3(Z.g),x=R3(Z.b),A=L3((.2225045*q+.7168786*v+.0606169*x)/F3),M,e;return q===v&&v===x?M=e=A:(M=L3((.4360747*q+.3850649*v+.1430804*x)/z3),e=L3((.0139322*q+.0971045*v+.7141733*x)/O3)),new rv(116*A-16,500*(M-A),200*(A-e),Z.opacity)}function k3(Z,q,v,x){return arguments.length===1?wE(Z):new rv(Z,q,v,x??1)}function rv(Z,q,v,x){this.l=+Z,this.a=+q,this.b=+v,this.opacity=+x}function L3(Z){return Z>AE?Math.pow(Z,.3333333333333333):Z/N3+B3}function P3(Z){return Z>ug?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 U9(Z){if(Z instanceof Mv)return new Mv(Z.h,Z.c,Z.l,Z.opacity);if(Z instanceof rv||(Z=wE(Z)),Z.a===0&&Z.b===0)return new Mv(NaN,0=1?(v=1,q-1):Math.floor(v*q),A=Z[x],M=Z[x+1],e=x>0?Z[x-1]:2*A-M,t=x()=>Z}});function LE(Z,q){return function(v){return Z+v*q}}function G9(Z,q,v){return Z=Math.pow(Z,v),q=Math.pow(q,v)-Z,v=1/v,function(x){return Math.pow(Z+x*q,v)}}function ix(Z,q){var v=q-Z;return v?LE(Z,v>180||v<-180?v-360*Math.round(v/360):v):S1(isNaN(Z)?q:Z)}function H9(Z){return(Z=+Z)==1?Zh:function(q,v){return v-q?G9(q,v,Z):S1(isNaN(q)?v:q)}}function Zh(Z,q){var v=q-Z;return v?LE(Z,v):S1(isNaN(Z)?q:Z)}var f0=mo({"node_modules/d3-interpolate/src/color.js"(){kE()}});function PE(Z){return function(q){var v=q.length,x=new Array(v),A=new Array(v),M=new Array(v),e,t;for(e=0;ev&&(M=q.slice(v,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)})),v=ux.lastIndex;return v180?a+=360:a-i>180&&(i+=360),o.push({i:n.push(A(n)+"rotate(",null,x)-2,x:av(i,a)})):a&&n.push(A(n)+"rotate("+a+x)}function t(i,a,n,o){i!==a?o.push({i:n.push(A(n)+"skewX(",null,x)-2,x:av(i,a)}):a&&n.push(A(n)+"skewX("+a+x)}function r(i,a,n,o,s,c){if(i!==n||a!==o){var h=s.push(A(s)+"scale(",null,",",null,")");c.push({i:h-4,x:av(i,n)},{i:h-2,x:av(a,o)})}else(n!==1||o!==1)&&s.push(A(s)+"scale("+n+","+o+")")}return function(i,a){var n=[],o=[];return i=Z(i),a=Z(a),M(i.translateX,i.translateY,a.translateX,a.translateY,n,o),e(i.rotate,a.rotate,n,o),t(i.skewX,a.skewX,n,o),r(i.scaleX,i.scaleY,a.scaleX,a.scaleY,n,o),i=a=null,function(s){for(var c=-1,h=o.length,m;++ccx,interpolateArray:()=>W9,interpolateBasis:()=>ME,interpolateBasisClosed:()=>EE,interpolateCubehelix:()=>n5,interpolateCubehelixLong:()=>i5,interpolateDate:()=>BE,interpolateDiscrete:()=>Y9,interpolateHcl:()=>t5,interpolateHclLong:()=>r5,interpolateHsl:()=>$E,interpolateHslLong:()=>QE,interpolateHue:()=>J9,interpolateLab:()=>cN,interpolateNumber:()=>av,interpolateNumberArray:()=>W3,interpolateObject:()=>UE,interpolateRgb:()=>ox,interpolateRgbBasis:()=>IE,interpolateRgbBasisClosed:()=>RE,interpolateRound:()=>Q9,interpolateString:()=>VE,interpolateTransformCss:()=>WE,interpolateTransformSvg:()=>XE,interpolateZoom:()=>KE,piecewise:()=>dN,quantize:()=>mN});var h0=mo({"node_modules/d3-interpolate/src/index.js"(){fx(),OE(),H3(),CE(),NE(),K9(),$9(),sx(),X3(),jE(),eN(),qE(),iN(),lN(),DE(),uN(),fN(),hN(),pN(),vN(),gN()}}),Y3=Ze({"src/traces/sunburst/fill_one.js"(Z,q){"use strict";var v=as(),x=Yi();q.exports=function(M,e,t,r,i){var a=e.data.data,n=a.i,o=i||a.color;if(n>=0){e.i=a.i;var s=t.marker;s.pattern?(!s.colors||!s.pattern.shape)&&(s.color=o,e.color=o):(s.color=o,e.color=o),v.pointStyle(M,t,r,e)}else x.fill(M,o)}}}),o5=Ze({"src/traces/sunburst/style.js"(Z,q){"use strict";var v=Oi(),x=Yi(),A=ca(),M=wp().resizeText,e=Y3();function t(i){var a=i._fullLayout._sunburstlayer.selectAll(".trace");M(i,a,"sunburst"),a.each(function(n){var o=v.select(this),s=n[0],c=s.trace;o.style("opacity",c.opacity),o.selectAll("path.surface").each(function(h){v.select(this).call(r,h,c,i)})})}function r(i,a,n,o){var s=a.data.data,c=!a.children,h=s.i,m=A.castOption(n,h,"marker.line.color")||x.defaultLine,d=A.castOption(n,h,"marker.line.width")||0;i.call(e,a,n,o).style("stroke-width",d).call(x.stroke,m).style("opacity",c?n.leaf.opacity:null)}q.exports={style:t,styleOne:r}}}),$v=Ze({"src/traces/sunburst/helpers.js"(Z){"use strict";var q=ca(),v=Yi(),x=Kd(),A=eg();Z.findEntryWithLevel=function(r,i){var a;return i&&r.eachAfter(function(n){if(Z.getPtId(n)===i)return a=n.copy()}),a||r},Z.findEntryWithChild=function(r,i){var a;return r.eachAfter(function(n){for(var o=n.children||[],s=0;s0)},Z.getMaxDepth=function(r){return r.maxdepth>=0?r.maxdepth:1/0},Z.isHeader=function(r,i){return!(Z.isLeaf(r)||r.depth===i._maxDepth-1)};function t(r){return r.data.data.pid}Z.getParent=function(r,i){return Z.findEntryWithLevel(r,t(i))},Z.listPath=function(r,i){var a=r.parent;if(!a)return[];var n=i?[a.data[i]]:[a];return Z.listPath(a,i).concat(n)},Z.getPath=function(r){return Z.listPath(r,"label").join("/")+"/"},Z.formatValue=A.formatPieValue,Z.formatPercent=function(r,i){var a=q.formatPercent(r,0);return a==="0%"&&(a=A.formatPiePercent(r,i)),a}}}),dx=Ze({"src/traces/sunburst/fx.js"(Z,q){"use strict";var v=Oi(),x=oo(),A=Qp().appendArrayPointValue,M=ef(),e=ca(),t=Qy(),r=$v(),i=eg(),a=i.formatPieValue;q.exports=function(s,c,h,m,d){var T=m[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=h._fullLayout;if(!(h._dragging||u.hovermode===!1)){var y=h._fullData[l.index],f=p.data.data,P=f.i,L=r.isHierarchyRoot(p),z=r.getParent(_,p),F=r.getValue(p),B=function(ee){return e.castOption(y,P,ee)},O=B("hovertemplate"),I=M.castHoverinfo(y,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={},se=[],he=[],H=function(ee){return se.indexOf(ee)!==-1};I&&(se=I==="all"?y._module.attributes.hoverinfo.flags:I.split("+")),ue.label=f.label,H("label")&&ue.label&&he.push(ue.label),f.hasOwnProperty("v")&&(ue.value=f.v,ue.valueLabel=a(ue.value,N),H("value")&&he.push(ue.valueLabel)),ue.currentPath=p.currentPath=r.getPath(p.data),H("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),H("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),H("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(_),H("percent root")&&!L&&($=r.formatPercent(ue.percentRoot,N)+" of "+ue.root,X()),ue.text=B("hovertext")||B("text"),H("text")&&($=ue.text,e.isValidTextValue($)&&he.push($)),U=[n(p,y,d.eventDataKeys)];var oe={trace:y,y:Q,_x0:p._x0,_x1:p._x1,_y0:p._y0,_y1:p._y1,text:he.join("
"),name:O||H("name")?y.name:void 0,color:B("hoverlabel.bgcolor")||f.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 ne=[];M.loneHover(oe,{container:u._hoverlayer.node(),outerContainer:u._paper.node(),gd:h,inOut_bbox:ne}),U[0].bbox=ne[0],l._hasHoverLabel=!0}if(S){var j=s.select("path.surface");d.styleOne(j,p,y,h,{hovered:!0})}l._hasHoverEvent=!0,h.emit("plotly_hover",{points:U||[n(p,y,d.eventDataKeys)],event:v.event})}},g=function(p){var u=h._fullLayout,y=h._fullData[l.index],f=v.select(this).datum();if(l._hasHoverEvent&&(p.originalEvent=v.event,h.emit("plotly_unhover",{points:[n(f,y,d.eventDataKeys)],event:v.event}),l._hasHoverEvent=!1),l._hasHoverLabel&&(M.loneUnhover(u._hoverlayer.node()),l._hasHoverLabel=!1),S){var P=s.select("path.surface");d.styleOne(P,f,y,h,{hovered:!1})}},b=function(p){var u=h._fullLayout,y=h._fullData[l.index],f=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:[n(p,y,d.eventDataKeys)],event:v.event};f||(F.nextLevel=z);var B=t.triggerHandler(h,"plotly_"+l.type+"click",F);if(B!==!1&&u.hovermode&&(h._hoverdata=[n(p,y,d.eventDataKeys)],M.click(h,v.event)),!f&&B!==!1&&!h._dragging&&!h._transitioning){x.call("_storeDirectGUIEdit",y,u._tracePreGUI[y.uid],{level:y.level});var O={data:[{level:z}],traces:[l.index]},I={frame:{redraw:!1,duration:d.transitionTime},transition:{duration:d.transitionTime,easing:d.transitionEasing},mode:"immediate",fromcurrent:!0};M.loneUnhover(u._hoverlayer.node()),x.call("animate",h,O,I)}};s.on("mouseover",E),s.on("mouseout",g),s.on("click",b)};function n(o,s,c){for(var h=o.data.data,m={curveNumber:s.index,pointNumber:h.i,data:s._input,fullData:s},d=0;dst.x1?2*Math.PI:0)+ee;Qe=fe.rpx1We?2*Math.PI:0)+ee;rt={x0:Qe,x1:Qe}}else rt={rpx0:se,rpx1:se},M.extendFlat(rt,_e(fe));else rt={rpx0:0,rpx1:0};else rt={x0:ee,x1:ee};return x(rt,st)}function Me(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(We){var Qe=fe.x1>We?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),qt=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=qt(bt),Ue=Zt(bt),Ee=Ir(bt),Ve=be(Be,(Ke+Ue)/2),Ce=Lt(bt),Te={pxmid:Ve,rpx1:Be,transform:{textPosAngle:Ce,rCenter:Ee,x:st.x,y:st.y}};return r(B.type,st,f),{transform:{targetX:ze(Te),targetY:Re(Te),scale:Sr(bt),rotate:xr(bt),rCenter:Ee}}}}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,qt=x(rt.x0,rt.x1);st.x0=qt(Lt/kt),st.x1=qt(Lt/kt)}else st.x0=st.x1=0;return st}}function _(g){return v.partition().size([2*Math.PI,g.height+1])(g)}Z.formatSliceLabel=function(g,b,p,u,y){var f=p.texttemplate,P=p.textinfo;if(!f&&(!P||P==="none"))return"";var L=y.separators,z=u[0],F=g.data.data,B=z.hierarchy,O=T.isHierarchyRoot(g),I=T.getParent(B,g),N=T.getValue(g);if(!f){var U=P.split("+"),W=function(ne){return U.indexOf(ne)!==-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(g.data));var se=0;W("percent parent")&&se++,W("percent entry")&&se++,W("percent root")&&se++;var he=se>1;if(se){var H,$=function(ne){ue=T.formatPercent(H,L),he&&(ue+=" of "+ne),Q.push(ue)};W("percent parent")&&!O&&(H=N/T.getValue(I),$("parent")),W("percent entry")&&(H=N/T.getValue(b),$("entry")),W("percent root")&&(H=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(g.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,y._d3locale,X,p._meta||{})};function w(g){return g.rpx0===0&&M.isFullCircle([g.x0,g.x1])?1:Math.max(0,Math.min(1/(1+1/Math.sin(g.halfangle)),g.ring/2))}function S(g){return E(g.rpx1,g.transform.textPosAngle)}function E(g,b){return[g*Math.sin(b),-g*Math.cos(b)]}}}),yN=Ze({"src/traces/sunburst/index.js"(Z,q){"use strict";q.exports={moduleType:"trace",name:"sunburst",basePlotModule:D9(),categories:[],animatable:!0,attributes:K_(),layoutAttributes:iE(),supplyDefaults:z9(),supplyLayoutDefaults:F9(),calc:$_().calc,crossTraceCalc:$_().crossTraceCalc,plot:K3().plot,style:o5().style,colorbar:hp(),meta:{}}}}),_N=Ze({"lib/sunburst.js"(Z,q){"use strict";q.exports=yN()}}),xN=Ze({"src/traces/treemap/base_plot.js"(Z){"use strict";var q=xc();Z.name="treemap",Z.plot=function(v,x,A,M){q.plotBasePlot(Z.name,v,x,A,M)},Z.clean=function(v,x,A,M){q.cleanBasePlot(Z.name,v,x,A,M)}}}),p0=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 v=Cs().hovertemplateAttrs,x=Cs().texttemplateAttrs,A=Mu(),M=bc().attributes,e=i0(),t=K_(),r=p0(),i=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:i({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:i({},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:v({},{keys:r.eventDataKeys}),textfont:e.textfont,insidetextfont:e.insidetextfont,outsidetextfont:i({},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"})}}}),s5=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"}}}}),bN=Ze({"src/traces/treemap/defaults.js"(Z,q){"use strict";var v=ca(),x=J3(),A=Yi(),M=bc().defaults,e=gd().handleText,t=Qg().TEXTPAD,r=o0().handleMarkerDefaults,i=rc(),a=i.hasColorscale,n=i.handleDefaults;q.exports=function(s,c,h,m){function d(y,f){return v.coerce(s,c,x,y,f)}var T=d("labels"),l=d("parents");if(!T||!T.length||!l||!l.length){c.visible=!1;return}var _=d("values");_&&_.length?d("branchvalues"):d("count"),d("level"),d("maxdepth");var w=d("tiling.packing");w==="squarify"&&d("tiling.squarifyratio"),d("tiling.flip"),d("tiling.pad");var S=d("text");d("texttemplate"),c.texttemplate||d("textinfo",v.isArrayOrTypedArray(S)?"text+label":"label"),d("hovertext"),d("hovertemplate");var E=d("pathbar.visible"),g="auto";e(s,c,m,d,g,{hasPathbar:E,moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),d("textposition");var b=c.textposition.indexOf("bottom")!==-1;r(s,c,m,d);var p=c._hasColorscale=a(s,"marker","colors")||(s.marker||{}).coloraxis;p?n(s,c,m,d,{prefix:"marker.",cLetter:"c"}):d("marker.depthfade",!(c.marker.colors||[]).length);var u=c.textfont.size*2;d("marker.pad.t",b?u/4:u),d("marker.pad.l",u/4),d("marker.pad.r",u/4),d("marker.pad.b",b?u:u/4),d("marker.cornerradius"),c._hovered={marker:{line:{width:2,color:A.contrast(m.paper_bgcolor)}}},E&&(d("pathbar.thickness",c.pathbar.textfont.size+2*t),d("pathbar.side"),d("pathbar.edgeshape")),d("sort"),d("root.color"),M(c,m,d),c._length=null}}}),wN=Ze({"src/traces/treemap/layout_defaults.js"(Z,q){"use strict";var v=ca(),x=s5();q.exports=function(M,e){function t(r,i){return v.coerce(M,e,x,r,i)}t("treemapcolorway",e.colorway),t("extendtreemapcolors")}}}),l5=Ze({"src/traces/treemap/calc.js"(Z){"use strict";var q=$_();Z.calc=function(v,x){return q.calc(v,x)},Z.crossTraceCalc=function(v){return q._runCrossTraceCalc("treemap",v)}}}),u5=Ze({"src/traces/treemap/flip_tree.js"(Z,q){"use strict";q.exports=function v(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"),H=x.ensureSingle(he,"text","",function(J){J.attr("data-notex",1)}),$=x.ensureUniformFontSize(s,i.determineTextFont(B,Q,z.font,{onPathbar:!0}));H.text(Q._text||" ").classed("slicetext",!0).attr("text-anchor","start").call(A.font,$).call(M.convertToTspans,s),Q.textBB=A.bBox(H.node()),Q.transform=g(Q,{fontSize:$.size,onPathbar:!0}),Q.transform.fontSize=$.size,p?H.transition().attrTween("transform",function(J){var X=f(J,n,P,[l,_]);return function(oe){return b(X(oe))}}):H.attr("transform",b(Q))})}}}),AN=Ze({"src/traces/treemap/plot_one.js"(Z,q){"use strict";var v=Oi(),x=(h0(),ih(fg)).interpolate,A=$v(),M=ca(),e=Qg().TEXTPAD,t=e0(),r=t.toMoveInsideBar,i=wp(),a=i.recordMinTextSize,n=p0(),o=TN();function s(c){return A.isHierarchyRoot(c)?"":A.getPtId(c)}q.exports=function(h,m,d,T,l){var _=h._fullLayout,w=m[0],S=w.trace,E=S.type,g=E==="icicle",b=w.hierarchy,p=A.findEntryWithLevel(b,S.level),u=v.select(d),y=u.selectAll("g.pathbar"),f=u.selectAll("g.slice");if(!p){y.remove(),f.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,se={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},Ee=function(Ce){return Ce-Be<=Ir.y0},Ve=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:Ee(wr.y0-Be)?0:Ve(wr.y0-Be)?bt[1]:wr.y0,y1:Ee(wr.y1+Be)?0:Ve(wr.y1+Be)?bt[1]:wr.y1}},H=null,$={},J={},X=null,oe=function(wr,Ir){return Ir?$[s(wr)]:J[s(wr)]},ne=function(wr,Ir,bt,Be){if(Ir)return $[s(b)]||se;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 We(wr,Ir){return wr+","+Ir}var it=ze(0),ot=function(wr){wr.x=Math.max(it,wr.x)},tt=S.pathbar.edgeshape,ut=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,Ee={},Ve={};Ee.x=Ir,Ve.x=bt,Ee.y=Ve.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,Ee.x-=Ue/2,Ve.x-=Ue/2):tt==="\\"?(Ce.x-=Ue,Te.x-=Ue,Ee.x-=Ue/2,Ve.x-=Ue/2):tt==="<"&&(Ee.x-=Ue,Ve.x-=Ue),ot(Ce),ot(at),ot(Ee),ot(Te),ot(Pe),ot(Ve),"M"+We(Ce.x,Ce.y)+"L"+We(Te.x,Te.y)+"L"+We(Ve.x,Ve.y)+"L"+We(Pe.x,Pe.y)+"L"+We(at.x,at.y)+"L"+We(Ee.x,Ee.y)+"Z"},Me=S[g?"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,Ee=Ke-Be;if(!Ue||!Ee)return"";var Ve=S.marker.cornerradius||0,Ce=Math.min(Ve,Ue/2,Ee/2);Ce&&wr.data&&wr.data.data&&wr.data.data.label&&(fe&&(Ce=Math.min(Ce,Me.t)),Fe&&(Ce=Math.min(Ce,Me.l)),rt&&(Ce=Math.min(Ce,Me.r)),st&&(Ce=Math.min(Ce,Me.b)));var Te=function(Pe,at){return Ce?"a"+We(Ce,Ce)+" 0 0 1 "+We(Pe,at):""};return"M"+We(Ir,Be+Ce)+Te(Ce,-Ce)+"L"+We(bt-Ce,Be)+Te(Ce,Ce)+"L"+We(bt,Ke-Ce)+Te(-Ce,Ce)+"L"+We(Ir+Ce,Ke)+Te(-Ce,-Ce)+"Z"},Lt=function(wr,Ir){var bt=wr.x0,Be=wr.x1,Ke=wr.y0,Ue=wr.y1,Ee=wr.textBB,Ve=fe||Ir.isHeader&&!st,Ce=Ve?"start":st?"end":"middle",Te=_e("right"),Pe=_e("left")||Ir.onPathbar,at=Pe?-1:Te?1:0;if(Ir.isHeader){if(bt+=(g?Me:Me.l)-e,Be-=(g?Me:Me.r)-e,bt>=Be){var yt=(bt+Be)/2;bt=yt,Be=yt}var Tt;st?(Tt=Ue-(g?Me:Me.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(),se=1/0,he=-1/0;ue.forEach(function(oe){var ne=oe.depth;ne>=O._maxDepth?(oe.x0=oe.x1=(oe.x0+oe.x1)/2,oe.y0=oe.y1=(oe.y0+oe.y1)/2):(se=Math.min(se,ne),he=Math.max(he,ne))}),d=d.data(ue,i.getPtId),O._maxVisibleLayers=isFinite(he)?he-se+1:0,d.enter().append("g").classed("slice",!0),u(d,o,L,[l,_],E),d.order();var H=null;if(p&&P){var $=i.getPtId(P);d.each(function(oe){H===null&&i.getPtId(oe)===$&&(H={x0:oe.x0,x1:oe.x1,y0:oe.y0,y1:oe.y1})})}var J=function(){return H||{x0:0,x1:l,y0:0,y1:_}},X=d;return p&&(X=X.transition().each("end",function(){var oe=v.select(this);i.setSliceCursor(oe,c,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})})),X.each(function(oe){var ne=i.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=v.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 We=y(Re,o,J(),[l,_]);return function(it){return E(We(it))}}):ee.attr("d",E),j.call(a,m,c,h,{styleOne:t,eventDataKeys:r.eventDataKeys,transitionTime:r.CLICK_TRANSITION_TIME,transitionEasing:r.CLICK_TRANSITION_EASING}).call(i.setSliceCursor,c,{isTransitioning:c._transitioning}),ee.call(t,oe,O,c,{hovered:!1}),oe.x0===oe.x1||oe.y0===oe.y1?oe._text="":ne?oe._text=W?"":i.getPtLabel(oe)||"":oe._text=n(oe,m,O,h,F)||"";var re=x.ensureSingle(j,"g","slicetext"),ce=x.ensureSingle(re,"text","",function(Re){Re.attr("data-notex",1)}),be=x.ensureUniformFontSize(c,i.determineTextFont(O,oe,F.font)),Ae=oe._text||" ",ze=ne&&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=g(oe,{fontSize:be.size,isHeader:ne}),oe.transform.fontSize=be.size,p?ce.transition().attrTween("transform",function(Re){var We=f(Re,o,J(),[l,_]);return function(it){return b(We(it))}}):ce.attr("transform",b(oe))}),H}}}),MN=Ze({"src/traces/treemap/plot.js"(Z,q){"use strict";var v=f5(),x=SN();q.exports=function(M,e,t,r){return v(M,e,t,r,{type:"treemap",drawDescendants:x})}}}),EN=Ze({"src/traces/treemap/index.js"(Z,q){"use strict";q.exports={moduleType:"trace",name:"treemap",basePlotModule:xN(),categories:[],animatable:!0,attributes:J3(),layoutAttributes:s5(),supplyDefaults:bN(),supplyLayoutDefaults:wN(),calc:l5().calc,crossTraceCalc:l5().crossTraceCalc,plot:MN(),style:$3().style,colorbar:hp(),meta:{}}}}),CN=Ze({"lib/treemap.js"(Z,q){"use strict";q.exports=EN()}}),kN=Ze({"src/traces/icicle/base_plot.js"(Z){"use strict";var q=xc();Z.name="icicle",Z.plot=function(v,x,A,M){q.plotBasePlot(Z.name,v,x,A,M)},Z.clean=function(v,x,A,M){q.cleanBasePlot(Z.name,v,x,A,M)}}}),h5=Ze({"src/traces/icicle/attributes.js"(Z,q){"use strict";var v=Cs().hovertemplateAttrs,x=Cs().texttemplateAttrs,A=Mu(),M=bc().attributes,e=i0(),t=K_(),r=J3(),i=p0(),a=rs().extendFlat,n=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:n,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:i.eventDataKeys.concat(["label","value"])}),hovertext:e.hovertext,hoverinfo:t.hoverinfo,hovertemplate:v({},{keys:i.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"})}}}),p5=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"}}}}),LN=Ze({"src/traces/icicle/defaults.js"(Z,q){"use strict";var v=ca(),x=h5(),A=Yi(),M=bc().defaults,e=gd().handleText,t=Qg().TEXTPAD,r=o0().handleMarkerDefaults,i=rc(),a=i.hasColorscale,n=i.handleDefaults;q.exports=function(s,c,h,m){function d(b,p){return v.coerce(s,c,x,b,p)}var T=d("labels"),l=d("parents");if(!T||!T.length||!l||!l.length){c.visible=!1;return}var _=d("values");_&&_.length?d("branchvalues"):d("count"),d("level"),d("maxdepth"),d("tiling.orientation"),d("tiling.flip"),d("tiling.pad");var w=d("text");d("texttemplate"),c.texttemplate||d("textinfo",v.isArrayOrTypedArray(w)?"text+label":"label"),d("hovertext"),d("hovertemplate");var S=d("pathbar.visible"),E="auto";e(s,c,m,d,E,{hasPathbar:S,moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),d("textposition"),r(s,c,m,d);var g=c._hasColorscale=a(s,"marker","colors")||(s.marker||{}).coloraxis;g&&n(s,c,m,d,{prefix:"marker.",cLetter:"c"}),d("leaf.opacity",g?1:.7),c._hovered={marker:{line:{width:2,color:A.contrast(m.paper_bgcolor)}}},S&&(d("pathbar.thickness",c.pathbar.textfont.size+2*t),d("pathbar.side"),d("pathbar.edgeshape")),d("sort"),d("root.color"),M(c,m,d),c._length=null}}}),PN=Ze({"src/traces/icicle/layout_defaults.js"(Z,q){"use strict";var v=ca(),x=p5();q.exports=function(M,e){function t(r,i){return v.coerce(M,e,x,r,i)}t("iciclecolorway",e.colorway),t("extendiciclecolors")}}}),d5=Ze({"src/traces/icicle/calc.js"(Z){"use strict";var q=$_();Z.calc=function(v,x){return q.calc(v,x)},Z.crossTraceCalc=function(v){return q._runCrossTraceCalc("icicle",v)}}}),IN=Ze({"src/traces/icicle/partition.js"(Z,q){"use strict";var v=J_(),x=u5();q.exports=function(M,e,t){var r=t.flipX,i=t.flipY,a=t.orientation==="h",n=t.maxDepth,o=e[0],s=e[1];n&&(o=(M.height+1)*e[0]/Math.min(M.height+1,n),s=(M.height+1)*e[1]/Math.min(M.height+1,n));var c=v.partition().padding(t.pad.inner).size(a?[e[1],o]:[e[0],s])(M);return(a||r||i)&&x(c,e,{swapXY:a,flipX:r,flipY:i}),c}}}),v5=Ze({"src/traces/icicle/style.js"(Z,q){"use strict";var v=Oi(),x=Yi(),A=ca(),M=wp().resizeText,e=Y3();function t(i){var a=i._fullLayout._iciclelayer.selectAll(".trace");M(i,a,"icicle"),a.each(function(n){var o=v.select(this),s=n[0],c=s.trace;o.style("opacity",c.opacity),o.selectAll("path.surface").each(function(h){v.select(this).call(r,h,c,i)})})}function r(i,a,n,o){var s=a.data.data,c=!a.children,h=s.i,m=A.castOption(n,h,"marker.line.color")||x.defaultLine,d=A.castOption(n,h,"marker.line.width")||0;i.call(e,a,n,o).style("stroke-width",d).call(x.stroke,m).style("opacity",c?n.leaf.opacity:null)}q.exports={style:t,styleOne:r}}}),RN=Ze({"src/traces/icicle/draw_descendants.js"(Z,q){"use strict";var v=Oi(),x=ca(),A=as(),M=fu(),e=IN(),t=v5().styleOne,r=p0(),i=$v(),a=dx(),n=K3().formatSliceLabel,o=!1;q.exports=function(c,h,m,d,T){var l=T.width,_=T.height,w=T.viewX,S=T.viewY,E=T.pathSlice,g=T.toMoveInsideSlice,b=T.strTransform,p=T.hasTransition,u=T.handleSlicesExit,y=T.makeUpdateSliceInterpolator,f=T.makeUpdateTextInterpolator,P=T.prevEntry,L={},z=c._context.staticPlot,F=c._fullLayout,B=h[0],O=B.trace,I=O.textposition.indexOf("left")!==-1,N=O.textposition.indexOf("right")!==-1,U=O.textposition.indexOf("bottom")!==-1,W=e(m,[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,se=-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),se=Math.max(se,oe))}),d=d.data(Q,i.getPtId),O._maxVisibleLayers=isFinite(se)?se-ue+1:0,d.enter().append("g").classed("slice",!0),u(d,o,L,[l,_],E),d.order();var he=null;if(p&&P){var H=i.getPtId(P);d.each(function(X){he===null&&i.getPtId(X)===H&&(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=d;return p&&(J=J.transition().each("end",function(){var X=v.select(this);i.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=v.select(this),ne=x.ensureSingle(oe,"path","surface",function(ce){ce.style("pointer-events",z?"none":"all")});p?ne.transition().attrTween("d",function(ce){var be=y(ce,o,$(),[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))}}):ne.attr("d",E),oe.call(a,m,c,h,{styleOne:t,eventDataKeys:r.eventDataKeys,transitionTime:r.CLICK_TRANSITION_TIME,transitionEasing:r.CLICK_TRANSITION_EASING}).call(i.setSliceCursor,c,{isTransitioning:c._transitioning}),ne.call(t,X,O,c,{hovered:!1}),X.x0===X.x1||X.y0===X.y1?X._text="":X._text=n(X,m,O,h,F)||"";var j=x.ensureSingle(oe,"g","slicetext"),ee=x.ensureSingle(j,"text","",function(ce){ce.attr("data-notex",1)}),re=x.ensureUniformFontSize(c,i.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=g(X,{fontSize:re.size}),X.transform.fontSize=re.size,p?ee.transition().attrTween("transform",function(ce){var be=f(ce,o,$(),[l,_]);return function(Ae){return b(be(Ae))}}):ee.attr("transform",b(X))}),he}}}),DN=Ze({"src/traces/icicle/plot.js"(Z,q){"use strict";var v=f5(),x=RN();q.exports=function(M,e,t,r){return v(M,e,t,r,{type:"icicle",drawDescendants:x})}}}),zN=Ze({"src/traces/icicle/index.js"(Z,q){"use strict";q.exports={moduleType:"trace",name:"icicle",basePlotModule:kN(),categories:[],animatable:!0,attributes:h5(),layoutAttributes:p5(),supplyDefaults:LN(),supplyLayoutDefaults:PN(),calc:d5().calc,crossTraceCalc:d5().crossTraceCalc,plot:DN(),style:v5().style,colorbar:hp(),meta:{}}}}),FN=Ze({"lib/icicle.js"(Z,q){"use strict";q.exports=zN()}}),ON=Ze({"src/traces/funnelarea/base_plot.js"(Z){"use strict";var q=xc();Z.name="funnelarea",Z.plot=function(v,x,A,M){q.plotBasePlot(Z.name,v,x,A,M)},Z.clean=function(v,x,A,M){q.cleanBasePlot(Z.name,v,x,A,M)}}}),m5=Ze({"src/traces/funnelarea/attributes.js"(Z,q){"use strict";var v=i0(),x=eu(),A=bc().attributes,M=Cs().hovertemplateAttrs,e=Cs().texttemplateAttrs,t=rs().extendFlat;q.exports={labels:v.labels,label0:v.label0,dlabel:v.dlabel,values:v.values,marker:{colors:v.marker.colors,line:{color:t({},v.marker.line.color,{dflt:null}),width:t({},v.marker.line.width,{dflt:1}),editType:"calc"},pattern:v.marker.pattern,editType:"calc"},text:v.text,hovertext:v.hovertext,scalegroup:t({},v.scalegroup,{}),textinfo:t({},v.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({},v.textposition,{values:["inside","none"],dflt:"inside"}),textfont:v.textfont,insidetextfont:v.insidetextfont,title:{text:v.title.text,font:v.title.font,position:t({},v.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"}}}}),g5=Ze({"src/traces/funnelarea/layout_attributes.js"(Z,q){"use strict";var v=_3().hiddenlabels;q.exports={hiddenlabels:v,funnelareacolorway:{valType:"colorlist",editType:"calc"},extendfunnelareacolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),BN=Ze({"src/traces/funnelarea/defaults.js"(Z,q){"use strict";var v=ca(),x=m5(),A=bc().defaults,M=gd().handleText,e=o0().handleLabelsAndValues,t=o0().handleMarkerDefaults;q.exports=function(i,a,n,o){function s(E,g){return v.coerce(i,a,x,E,g)}var c=s("labels"),h=s("values"),m=e(c,h),d=m.len;if(a._hasLabels=m.hasLabels,a._hasValues=m.hasValues,!a._hasLabels&&a._hasValues&&(s("label0"),s("dlabel")),!d){a.visible=!1;return}a._length=d,t(i,a,o,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(i,a,o,s,w,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1})}else _==="none"&&s("textposition","none");A(a,o,s);var S=s("title.text");S&&(s("title.position"),v.coerceFont(s,"title.font",o.font)),s("aspectratio"),s("baseratio")}}}),NN=Ze({"src/traces/funnelarea/layout_defaults.js"(Z,q){"use strict";var v=ca(),x=g5();q.exports=function(M,e){function t(r,i){return v.coerce(M,e,x,r,i)}t("hiddenlabels"),t("funnelareacolorway",e.colorway),t("extendfunnelareacolors")}}}),y5=Ze({"src/traces/funnelarea/calc.js"(Z,q){"use strict";var v=x1();function x(M,e){return v.calc(M,e)}function A(M){v.crossTraceCalc(M,{type:"funnelarea"})}q.exports={calc:x,crossTraceCalc:A}}}),UN=Ze({"src/traces/funnelarea/plot.js"(Z,q){"use strict";var v=Oi(),x=as(),A=ca(),M=A.strScale,e=A.strTranslate,t=fu(),r=e0(),i=r.toMoveInsideBar,a=wp(),n=a.recordMinTextSize,o=a.clearMinTextSize,s=eg(),c=x3(),h=c.attachFxHandlers,m=c.determineInsideTextFont,d=c.layoutAreas,T=c.prerenderTitles,l=c.positionTitleOutside,_=c.formatSliceLabel;q.exports=function(b,p){var u=b._context.staticPlot,y=b._fullLayout;o("funnelarea",y),T(p,b),d(p,y._size),A.makeTraceGroups(y._funnelarealayer,p,"trace").each(function(f){var P=v.select(this),L=f[0],z=L.trace;E(f),P.each(function(){var F=v.select(this).selectAll("g.slice").data(f);F.enter().append("g").classed("slice",!0),F.exit().remove(),F.each(function(O,I){if(O.hidden){v.select(this).selectAll("path,g").remove();return}O.pointNumber=O.i,O.curveNumber=z.index;var N=L.cx,U=L.cy,W=v.select(this),Q=W.selectAll("path.surface").data([O]);Q.enter().append("path").classed("surface",!0).style({"pointer-events":u?"none":"all"}),W.call(h,b,f);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 se=s.castOption(z.textposition,O.pts),he=W.selectAll("g.slicetext").data(O.text&&se!=="none"?[0]:[]);he.enter().append("g").classed("slicetext",!0),he.exit().remove(),he.each(function(){var H=A.ensureSingle(v.select(this),"text","",function(re){re.attr("data-notex",1)}),$=A.ensureUniformFontSize(b,m(z,O,y.font));H.text(O.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(x.font,$).call(t.convertToTspans,b);var J=x.bBox(H.node()),X,oe,ne,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,ne=Math.min(O.TR[0],O.BR[0])+N,X=i(oe,ne,j,ee,J,{isHorizontal:!0,constrained:!0,angle:0,anchor:"middle"}),X.fontSize=$.size,n(z.type,X,y),f[I].transform=X,A.setTransormAndDisplay(H,X)})});var B=v.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(v.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,y._size);O.attr("transform",e(N.x,N.y)+M(Math.min(1,N.scale))+e(N.tx,N.ty))})})})};function w(g,b){var p=b[0]-g[0],u=b[1]-g[1];return"l"+p+","+u}function S(g,b){return[.5*(g[0]+b[0]),.5*(g[1]+b[1])]}function E(g){if(!g.length)return;var b=g[0],p=b.trace,u=p.aspectratio,y=p.baseratio;y>.999&&(y=.999);var f=Math.pow(y,2),P=b.vTotal,L=P*f/(1-f),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=g.length-1;U>-1;U--)if(W=g[U],!W.hidden){var Q=W.v/z;F+=Q,N.push(O())}var ue=1/0,se=-1/0;for(U=0;U-1;U--)if(W=g[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=ne,W.pxmid=S(W.TR,W.BR),oe=W.TL,ne=W.TR}}}}),jN=Ze({"src/traces/funnelarea/style.js"(Z,q){"use strict";var v=Oi(),x=n1(),A=wp().resizeText;q.exports=function(e){var t=e._fullLayout._funnelarealayer.selectAll(".trace");A(e,t,"funnelarea"),t.each(function(r){var i=r[0],a=i.trace,n=v.select(this);n.style({opacity:a.opacity}),n.selectAll("path.surface").each(function(o){v.select(this).call(x,o,a,e)})})}}}),VN=Ze({"src/traces/funnelarea/index.js"(Z,q){"use strict";q.exports={moduleType:"trace",name:"funnelarea",basePlotModule:ON(),categories:["pie-like","funnelarea","showLegend"],attributes:m5(),layoutAttributes:g5(),supplyDefaults:BN(),supplyLayoutDefaults:NN(),calc:y5().calc,crossTraceCalc:y5().crossTraceCalc,plot:UN(),style:jN(),styleOne:n1(),meta:{}}}}),qN=Ze({"lib/funnelarea.js"(Z,q){"use strict";q.exports=VN()}}),Yh=Ze({"stackgl_modules/index.js"(Z,q){(function(){var v={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 i;function a(Ce,Te){if(!(Ce instanceof Te))throw new TypeError("Cannot call a class as a function")}function n(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,f.prototype),Te}function f(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)}f.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 f.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 f.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))}f.from=function(Ce,Te,Pe){return P(Ce,Te,Pe)},Object.setPrototypeOf(f.prototype,Uint8Array.prototype),Object.setPrototypeOf(f,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?y(Ce):Te!==void 0?typeof Pe=="string"?y(Ce).fill(Te,Pe):y(Ce).fill(Te):y(Ce)}f.alloc=function(Ce,Te,Pe){return z(Ce,Te,Pe)};function F(Ce){return L(Ce),y(Ce<0?0:W(Ce)|0)}f.allocUnsafe=function(Ce){return F(Ce)},f.allocUnsafeSlow=function(Ce){return F(Ce)};function B(Ce,Te){if((typeof Te!="string"||Te==="")&&(Te="utf8"),!f.isEncoding(Te))throw new TypeError("Unknown encoding: "+Te);var Pe=ue(Ce,Te)|0,at=y(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=y(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),f.alloc(+Ce)}f.isBuffer=function(Te){return Te!=null&&Te._isBuffer===!0&&Te!==f.prototype},f.compare=function(Te,Pe){if(Be(Te,Uint8Array)&&(Te=f.from(Te,Te.offset,Te.byteLength)),Be(Pe,Uint8Array)&&(Pe=f.from(Pe,Pe.offset,Pe.byteLength)),!f.isBuffer(Te)||!f.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?(f.isBuffer(Ot)||(Ot=f.from(Ot)),Ot.copy(yt,Tt)):Uint8Array.prototype.set.call(yt,Ot,Tt);else if(f.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(f.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}}f.byteLength=ue;function se(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 We(this,Te,Pe);default:if(at)throw new TypeError("Unknown encoding: "+Ce);Ce=(Ce+"").toLowerCase(),at=!0}}f.prototype._isBuffer=!0;function he(Ce,Te,Pe){var at=Ce[Te];Ce[Te]=Ce[Pe],Ce[Pe]=at}f.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&&(f.prototype[b]=f.prototype.inspect),f.prototype.compare=function(Te,Pe,at,yt,Tt){if(Be(Te,Uint8Array)&&(Te=f.from(Te,Te.offset,Te.byteLength)),!f.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=f.from(Te,at)),f.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 ne(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}},f.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")}f.prototype.readUintLE=f.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},f.prototype.readUint8=f.prototype.readUInt8=function(Te,Pe){return Te=Te>>>0,Pe||it(Te,1,this.length),this[Te]},f.prototype.readUint16LE=f.prototype.readUInt16LE=function(Te,Pe){return Te=Te>>>0,Pe||it(Te,2,this.length),this[Te]|this[Te+1]<<8},f.prototype.readUint16BE=f.prototype.readUInt16BE=function(Te,Pe){return Te=Te>>>0,Pe||it(Te,2,this.length),this[Te]<<8|this[Te+1]},f.prototype.readUint32LE=f.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},f.prototype.readUint32BE=f.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])},f.prototype.readBigUInt64LE=Ee(function(Te){Te=Te>>>0,kt(Te,"offset");var Pe=this[Te],at=this[Te+7];(Pe===void 0||at===void 0)&&qt(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)&&qt(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},f.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},f.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]},f.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},f.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},f.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},f.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]},f.prototype.readBigInt64LE=Ee(function(Te){Te=Te>>>0,kt(Te,"offset");var Pe=this[Te],at=this[Te+7];(Pe===void 0||at===void 0)&&qt(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)&&qt(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),g.read(this,Te,!0,23,4)},f.prototype.readFloatBE=function(Te,Pe){return Te=Te>>>0,Pe||it(Te,4,this.length),g.read(this,Te,!1,23,4)},f.prototype.readDoubleLE=function(Te,Pe){return Te=Te>>>0,Pe||it(Te,8,this.length),g.read(this,Te,!0,52,8)},f.prototype.readDoubleBE=function(Te,Pe){return Te=Te>>>0,Pe||it(Te,8,this.length),g.read(this,Te,!1,52,8)};function ot(Ce,Te,Pe,at,yt,Tt){if(!f.isBuffer(Ce))throw new TypeError('"buffer" argument must be a Buffer instance');if(Te>yt||TeCe.length)throw new RangeError("Index out of range")}f.prototype.writeUintLE=f.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},f.prototype.writeUint8=f.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},f.prototype.writeUint16LE=f.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},f.prototype.writeUint16BE=f.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},f.prototype.writeUint32LE=f.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},f.prototype.writeUint32BE=f.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 ut(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}f.prototype.writeBigUInt64LE=Ee(function(Te){var Pe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return tt(this,Te,Pe,BigInt(0),BigInt("0xffffffffffffffff"))}),f.prototype.writeBigUInt64BE=Ee(function(Te){var Pe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return ut(this,Te,Pe,BigInt(0),BigInt("0xffffffffffffffff"))}),f.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},f.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},f.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},f.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},f.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},f.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},f.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},f.prototype.writeBigInt64LE=Ee(function(Te){var Pe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return tt(this,Te,Pe,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),f.prototype.writeBigInt64BE=Ee(function(Te){var Pe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return ut(this,Te,Pe,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Me(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||Me(Ce,Te,Pe,4,34028234663852886e22,-34028234663852886e22),g.write(Ce,Te,Pe,at,23,4),Pe+4}f.prototype.writeFloatLE=function(Te,Pe,at){return _e(this,Te,Pe,!0,at)},f.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||Me(Ce,Te,Pe,8,17976931348623157e292,-17976931348623157e292),g.write(Ce,Te,Pe,at,52,8),Pe+8}f.prototype.writeDoubleLE=function(Te,Pe,at){return fe(this,Te,Pe,!0,at)},f.prototype.writeDoubleBE=function(Te,Pe,at){return fe(this,Te,Pe,!1,at)},f.prototype.copy=function(Te,Pe,at,yt){if(!f.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)&&qt(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 qt(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 Ee(Ce){return typeof BigInt>"u"?Ve:Ce}function Ve(){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/,i=/android|ipad|playbook|silk/i;function a(n){n||(n={});var o=n.ua;if(!o&&typeof navigator<"u"&&(o=navigator.userAgent),o&&o.headers&&typeof o.headers["user-agent"]=="string"&&(o=o.headers["user-agent"]),typeof o!="string")return!1;var s=t.test(o)&&!r.test(o)||!!n.tablet&&i.test(o);return!s&&n.tablet&&n.featureDetect&&navigator&&navigator.maxTouchPoints>1&&o.indexOf("Macintosh")!==-1&&o.indexOf("Safari")!==-1&&(s=!0),s}},6296:function(e,t,r){"use strict";e.exports=c;var i=r(7261),a=r(9977),n=r(1811);function o(h,m){this._controllerNames=Object.keys(h),this._controllerList=this._controllerNames.map(function(d){return h[d]}),this._mode=m,this._active=h[m],this._active||(this._mode="turntable",this._active=h.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=o.prototype;s.flush=function(h){for(var m=this._controllerList,d=0;d"u"?r(1538):WeakMap,a=r(2762),n=r(8116),o=new i;function s(c){var h=o.get(c),m=h&&(h._triangleBuffer.handle||h._triangleBuffer.buffer);if(!m||!c.isBuffer(m)){var d=a(c,new Float32Array([-1,-1,-1,4,4,-1]));h=n(c,[{buffer:d,type:c.FLOAT,size:2}]),h._triangleBuffer=d,o.set(c,h)}h.bind(),c.drawArrays(c.TRIANGLES,0,3),h.unbind()}e.exports=s},1085:function(e,t,r){var i=r(1371);e.exports=a;function a(n,o,s){o=typeof o=="number"?o:1,s=s||": ";var c=n.split(/\r?\n/),h=String(c.length+o-1).length;return c.map(function(m,d){var T=d+o,l=String(T).length,_=i(T,h-l);return _+s+m}).join(` `)}},3952:function(e,t,r){"use strict";e.exports=n;var i=r(3250);function a(o,s){for(var c=new Array(s+1),h=0;h0)throw new Error("Invalid string. Length must be a multiple of 4");var E=w.indexOf("=");E===-1&&(E=S);var g=E===S?0:4-E%4;return[E,g]}function h(w){var S=c(w),E=S[0],g=S[1];return(E+g)*3/4-g}function m(w,S,E){return(S+E)*3/4-E}function d(w){var S,E=c(w),g=E[0],b=E[1],p=new a(m(w,g,b)),u=0,y=b>0?g-4:g,f;for(f=0;f>16&255,p[u++]=S>>8&255,p[u++]=S&255;return b===2&&(S=i[w.charCodeAt(f)]<<2|i[w.charCodeAt(f+1)]>>4,p[u++]=S&255),b===1&&(S=i[w.charCodeAt(f)]<<10|i[w.charCodeAt(f+1)]<<4|i[w.charCodeAt(f+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 g,b=[],p=S;py?y:u+p));return g===1?(S=w[E-1],b.push(r[S>>2]+r[S<<4&63]+"==")):g===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 i=r(869);e.exports=a;function a(n,o){return i(n[0].mul(o[1]).add(o[0].mul(n[1])),n[1].mul(o[1]))}},1318:function(e){"use strict";e.exports=t;function t(r,i){return r[0].mul(i[1]).cmp(i[0].mul(r[1]))}},8697:function(e,t,r){"use strict";var i=r(869);e.exports=a;function a(n,o){return i(n[0].mul(o[1]),n[1].mul(o[0]))}},7842:function(e,t,r){"use strict";var i=r(6330),a=r(1533),n=r(2651),o=r(6768),s=r(869),c=r(8697);e.exports=h;function h(m,d){if(i(m))return d?c(m,h(d)):[m[0].clone(),m[1].clone()];var T=0,l,_;if(a(m))l=m.clone();else if(typeof m=="string")l=o(m);else{if(m===0)return[n(0),n(1)];if(m===Math.floor(m))l=n(m);else{for(;m!==Math.floor(m);)m=m*Math.pow(2,256),T-=256;l=n(m)}}if(i(d))l.mul(d[1]),_=d[0].clone();else if(a(d))_=d.clone();else if(typeof d=="string")_=o(d);else if(!d)_=n(1);else if(d===Math.floor(d))_=n(d);else{for(;d!==Math.floor(d);)d=d*Math.pow(2,256),T+=256;_=n(d)}return T>0?l=l.ushln(T):T<0&&(_=_.ushln(-T)),s(l,_)}},6330:function(e,t,r){"use strict";var i=r(1533);e.exports=a;function a(n){return Array.isArray(n)&&n.length===2&&i(n[0])&&i(n[1])}},5716:function(e,t,r){"use strict";var i=r(6859);e.exports=a;function a(n){return n.cmp(new i(0))}},1369:function(e,t,r){"use strict";var i=r(5716);e.exports=a;function a(n){var o=n.length,s=n.words,c=0;if(o===1)c=s[0];else if(o===2)c=s[0]+s[1]*67108864;else for(var h=0;h20?52:c+32}},1533:function(e,t,r){"use strict";var i=r(6859);e.exports=a;function a(n){return n&&typeof n=="object"&&!!n.words}},2651:function(e,t,r){"use strict";var i=r(6859),a=r(2361);e.exports=n;function n(o){var s=a.exponent(o);return s<52?new i(o):new i(o*Math.pow(2,52-s)).ushln(s-52)}},869:function(e,t,r){"use strict";var i=r(2651),a=r(5716);e.exports=n;function n(o,s){var c=a(o),h=a(s);if(c===0)return[i(0),i(1)];if(h===0)return[i(0),i(0)];h<0&&(o=o.neg(),s=s.neg());var m=o.gcd(s);return m.cmpn(1)?[o.div(m),s.div(m)]:[o,s]}},6768:function(e,t,r){"use strict";var i=r(6859);e.exports=a;function a(n){return new i(n)}},6504:function(e,t,r){"use strict";var i=r(869);e.exports=a;function a(n,o){return i(n[0].mul(o[0]),n[1].mul(o[1]))}},7721:function(e,t,r){"use strict";var i=r(5716);e.exports=a;function a(n){return i(n[0])*i(n[1])}},5572:function(e,t,r){"use strict";var i=r(869);e.exports=a;function a(n,o){return i(n[0].mul(o[1]).sub(n[1].mul(o[0])),n[1].mul(o[1]))}},946:function(e,t,r){"use strict";var i=r(1369),a=r(4025);e.exports=n;function n(o){var s=o[0],c=o[1];if(s.cmpn(0)===0)return 0;var h=s.abs().divmod(c.abs()),m=h.div,d=i(m),T=h.mod,l=s.negative!==c.negative?-1:1;if(T.cmpn(0)===0)return l*d;if(d){var _=a(d)+4,w=i(T.ushln(_).divRound(c));return l*(d+w*Math.pow(2,-_))}else{var S=c.bitLength()-T.bitLength()+53,w=i(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,h,m,d){for(var T=d+1;m<=d;){var l=m+d>>>1,_=s[l],w=h!==void 0?h(_,c):_-c;w>=0?(T=l,d=l-1):m=l+1}return T}function r(s,c,h,m,d){for(var T=d+1;m<=d;){var l=m+d>>>1,_=s[l],w=h!==void 0?h(_,c):_-c;w>0?(T=l,d=l-1):m=l+1}return T}function i(s,c,h,m,d){for(var T=m-1;m<=d;){var l=m+d>>>1,_=s[l],w=h!==void 0?h(_,c):_-c;w<0?(T=l,m=l+1):d=l-1}return T}function a(s,c,h,m,d){for(var T=m-1;m<=d;){var l=m+d>>>1,_=s[l],w=h!==void 0?h(_,c):_-c;w<=0?(T=l,m=l+1):d=l-1}return T}function n(s,c,h,m,d){for(;m<=d;){var T=m+d>>>1,l=s[T],_=h!==void 0?h(l,c):l-c;if(_===0)return T;_<=0?m=T+1:d=T-1}return-1}function o(s,c,h,m,d,T){return typeof h=="function"?T(s,c,h,m===void 0?0:m|0,d===void 0?s.length-1:d|0):T(s,c,void 0,h===void 0?0:h|0,m===void 0?s.length-1:m|0)}e.exports={ge:function(s,c,h,m,d){return o(s,c,h,m,d,t)},gt:function(s,c,h,m,d){return o(s,c,h,m,d,r)},lt:function(s,c,h,m,d){return o(s,c,h,m,d,i)},le:function(s,c,h,m,d){return o(s,c,h,m,d,a)},eq:function(s,c,h,m,d){return o(s,c,h,m,d,n)}}},8828:function(e,t){"use strict";"use restrict";var r=32;t.INT_BITS=r,t.INT_MAX=2147483647,t.INT_MIN=-1<0)-(n<0)},t.abs=function(n){var o=n>>r-1;return(n^o)-o},t.min=function(n,o){return o^(n^o)&-(n65535)<<4,n>>>=o,s=(n>255)<<3,n>>>=s,o|=s,s=(n>15)<<2,n>>>=s,o|=s,s=(n>3)<<1,n>>>=s,o|=s,o|n>>1},t.log10=function(n){return n>=1e9?9:n>=1e8?8:n>=1e7?7:n>=1e6?6:n>=1e5?5:n>=1e4?4:n>=1e3?3:n>=100?2:n>=10?1:0},t.popCount=function(n){return n=n-(n>>>1&1431655765),n=(n&858993459)+(n>>>2&858993459),(n+(n>>>4)&252645135)*16843009>>>24};function i(n){var o=32;return n&=-n,n&&o--,n&65535&&(o-=16),n&16711935&&(o-=8),n&252645135&&(o-=4),n&858993459&&(o-=2),n&1431655765&&(o-=1),o}t.countTrailingZeros=i,t.nextPow2=function(n){return n+=n===0,--n,n|=n>>>1,n|=n>>>2,n|=n>>>4,n|=n>>>8,n|=n>>>16,n+1},t.prevPow2=function(n){return n|=n>>>1,n|=n>>>2,n|=n>>>4,n|=n>>>8,n|=n>>>16,n-(n>>>1)},t.parity=function(n){return n^=n>>>16,n^=n>>>8,n^=n>>>4,n&=15,27030>>>n&1};var a=new Array(256);(function(n){for(var o=0;o<256;++o){var s=o,c=o,h=7;for(s>>>=1;s;s>>>=1)c<<=1,c|=s&1,--h;n[o]=c<>>8&255]<<16|a[n>>>16&255]<<8|a[n>>>24&255]},t.interleave2=function(n,o){return n&=65535,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,o&=65535,o=(o|o<<8)&16711935,o=(o|o<<4)&252645135,o=(o|o<<2)&858993459,o=(o|o<<1)&1431655765,n|o<<1},t.deinterleave2=function(n,o){return n=n>>>o&1431655765,n=(n|n>>>1)&858993459,n=(n|n>>>2)&252645135,n=(n|n>>>4)&16711935,n=(n|n>>>16)&65535,n<<16>>16},t.interleave3=function(n,o,s){return n&=1023,n=(n|n<<16)&4278190335,n=(n|n<<8)&251719695,n=(n|n<<4)&3272356035,n=(n|n<<2)&1227133513,o&=1023,o=(o|o<<16)&4278190335,o=(o|o<<8)&251719695,o=(o|o<<4)&3272356035,o=(o|o<<2)&1227133513,n|=o<<1,s&=1023,s=(s|s<<16)&4278190335,s=(s|s<<8)&251719695,s=(s|s<<4)&3272356035,s=(s|s<<2)&1227133513,n|s<<2},t.deinterleave3=function(n,o){return n=n>>>o&1227133513,n=(n|n>>>2)&3272356035,n=(n|n>>>4)&251719695,n=(n|n>>>8)&4278190335,n=(n|n>>>16)&1023,n<<22>>22},t.nextCombination=function(n){var o=n|n-1;return o+1|(~o&-~o)-1>>>i(n)+1}},6859:function(e,t,r){e=r.nmd(e),function(i,a){"use strict";function n(O,I){if(!O)throw new Error(I||"Assertion failed")}function o(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 i=="object"?i.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),n(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-se&67108863,se+=24,se>=26&&(se-=26,Q++);else if(U==="le")for(W=0,Q=0;W>>26-se&67108863,se+=24,se>=26&&(se-=26,Q++);return this.strip()};function h(O,I){var N=O.charCodeAt(I);return N>=65&&N<=70?N-55:N>=97&&N<=102?N-87:N-48&15}function m(O,I,N){var U=h(O,N);return N-1>=I&&(U|=h(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)se=m(I,N,W)<=18?(Q-=18,ue+=1,this.words[ue]|=se>>>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]|=se>>>26):Q+=8}this.strip()};function d(O,I,N,U){for(var W=0,Q=Math.min(O.length,N),ue=I;ue=49?W+=se-49+10:se>=17?W+=se-17+10:W+=se}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,se=ue%W,he=Math.min(ue,ue-se)+U,H=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 H=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[H-X.length]+X+U}for(this.isZero()&&(U="0"+U);U.length%N!==0;)U="0"+U;return this.negative!==0&&(U="-"+U),U}n(!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&&n(!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 n(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);n(W<=Q,"byte array longer than desired length"),n(Q>0,"Requested array length <= 0"),this.strip();var ue=N==="le",se=new I(Q),he,H,$=this.clone();if(ue){for(H=0;!$.isZero();H++)he=$.andln(255),$.iushrn(8),se[H]=he;for(;H=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){n(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){n(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,se=0;se>26,this.words[se]=N&67108863;for(;ue!==0&&se>26,this.words[se]=N&67108863;if(ue===0&&se>>26,J=he&67108863,X=Math.min(H,I.length-1),oe=Math.max(0,H-O.length+1);oe<=X;oe++){var ne=H-oe|0;W=O.words[ne]|0,Q=I.words[oe]|0,ue=W*Q+J,$+=ue/67108864|0,J=ue&67108863}N.words[H]=J|0,he=$|0}return he!==0?N.words[H]=he|0:N.length--,N.strip()}var E=function(I,N,U){var W=I.words,Q=N.words,ue=U.words,se=0,he,H,$,J=W[0]|0,X=J&8191,oe=J>>>13,ne=W[1]|0,j=ne&8191,ee=ne>>>13,re=W[2]|0,ce=re&8191,be=re>>>13,Ae=W[3]|0,ze=Ae&8191,Re=Ae>>>13,We=W[4]|0,it=We&8191,ot=We>>>13,tt=W[5]|0,ut=tt&8191,Me=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,qt=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,Ee=Ue&8191,Ve=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,Qa=Q[8]|0,za=Qa&8191,en=Qa>>>13,kn=Q[9]|0,Jt=kn&8191,Nt=kn>>>13;U.negative=I.negative^N.negative,U.length=19,he=Math.imul(X,wr),H=Math.imul(X,Ir),H=H+Math.imul(oe,wr)|0,$=Math.imul(oe,Ir);var Kt=(se+he|0)+((H&8191)<<13)|0;se=($+(H>>>13)|0)+(Kt>>>26)|0,Kt&=67108863,he=Math.imul(j,wr),H=Math.imul(j,Ir),H=H+Math.imul(ee,wr)|0,$=Math.imul(ee,Ir),he=he+Math.imul(X,Be)|0,H=H+Math.imul(X,Ke)|0,H=H+Math.imul(oe,Be)|0,$=$+Math.imul(oe,Ke)|0;var Wt=(se+he|0)+((H&8191)<<13)|0;se=($+(H>>>13)|0)+(Wt>>>26)|0,Wt&=67108863,he=Math.imul(ce,wr),H=Math.imul(ce,Ir),H=H+Math.imul(be,wr)|0,$=Math.imul(be,Ir),he=he+Math.imul(j,Be)|0,H=H+Math.imul(j,Ke)|0,H=H+Math.imul(ee,Be)|0,$=$+Math.imul(ee,Ke)|0,he=he+Math.imul(X,Ee)|0,H=H+Math.imul(X,Ve)|0,H=H+Math.imul(oe,Ee)|0,$=$+Math.imul(oe,Ve)|0;var Pr=(se+he|0)+((H&8191)<<13)|0;se=($+(H>>>13)|0)+(Pr>>>26)|0,Pr&=67108863,he=Math.imul(ze,wr),H=Math.imul(ze,Ir),H=H+Math.imul(Re,wr)|0,$=Math.imul(Re,Ir),he=he+Math.imul(ce,Be)|0,H=H+Math.imul(ce,Ke)|0,H=H+Math.imul(be,Be)|0,$=$+Math.imul(be,Ke)|0,he=he+Math.imul(j,Ee)|0,H=H+Math.imul(j,Ve)|0,H=H+Math.imul(ee,Ee)|0,$=$+Math.imul(ee,Ve)|0,he=he+Math.imul(X,Te)|0,H=H+Math.imul(X,Pe)|0,H=H+Math.imul(oe,Te)|0,$=$+Math.imul(oe,Pe)|0;var ta=(se+he|0)+((H&8191)<<13)|0;se=($+(H>>>13)|0)+(ta>>>26)|0,ta&=67108863,he=Math.imul(it,wr),H=Math.imul(it,Ir),H=H+Math.imul(ot,wr)|0,$=Math.imul(ot,Ir),he=he+Math.imul(ze,Be)|0,H=H+Math.imul(ze,Ke)|0,H=H+Math.imul(Re,Be)|0,$=$+Math.imul(Re,Ke)|0,he=he+Math.imul(ce,Ee)|0,H=H+Math.imul(ce,Ve)|0,H=H+Math.imul(be,Ee)|0,$=$+Math.imul(be,Ve)|0,he=he+Math.imul(j,Te)|0,H=H+Math.imul(j,Pe)|0,H=H+Math.imul(ee,Te)|0,$=$+Math.imul(ee,Pe)|0,he=he+Math.imul(X,yt)|0,H=H+Math.imul(X,Tt)|0,H=H+Math.imul(oe,yt)|0,$=$+Math.imul(oe,Tt)|0;var ma=(se+he|0)+((H&8191)<<13)|0;se=($+(H>>>13)|0)+(ma>>>26)|0,ma&=67108863,he=Math.imul(ut,wr),H=Math.imul(ut,Ir),H=H+Math.imul(Me,wr)|0,$=Math.imul(Me,Ir),he=he+Math.imul(it,Be)|0,H=H+Math.imul(it,Ke)|0,H=H+Math.imul(ot,Be)|0,$=$+Math.imul(ot,Ke)|0,he=he+Math.imul(ze,Ee)|0,H=H+Math.imul(ze,Ve)|0,H=H+Math.imul(Re,Ee)|0,$=$+Math.imul(Re,Ve)|0,he=he+Math.imul(ce,Te)|0,H=H+Math.imul(ce,Pe)|0,H=H+Math.imul(be,Te)|0,$=$+Math.imul(be,Pe)|0,he=he+Math.imul(j,yt)|0,H=H+Math.imul(j,Tt)|0,H=H+Math.imul(ee,yt)|0,$=$+Math.imul(ee,Tt)|0,he=he+Math.imul(X,Gt)|0,H=H+Math.imul(X,rr)|0,H=H+Math.imul(oe,Gt)|0,$=$+Math.imul(oe,rr)|0;var ra=(se+he|0)+((H&8191)<<13)|0;se=($+(H>>>13)|0)+(ra>>>26)|0,ra&=67108863,he=Math.imul(fe,wr),H=Math.imul(fe,Ir),H=H+Math.imul(Fe,wr)|0,$=Math.imul(Fe,Ir),he=he+Math.imul(ut,Be)|0,H=H+Math.imul(ut,Ke)|0,H=H+Math.imul(Me,Be)|0,$=$+Math.imul(Me,Ke)|0,he=he+Math.imul(it,Ee)|0,H=H+Math.imul(it,Ve)|0,H=H+Math.imul(ot,Ee)|0,$=$+Math.imul(ot,Ve)|0,he=he+Math.imul(ze,Te)|0,H=H+Math.imul(ze,Pe)|0,H=H+Math.imul(Re,Te)|0,$=$+Math.imul(Re,Pe)|0,he=he+Math.imul(ce,yt)|0,H=H+Math.imul(ce,Tt)|0,H=H+Math.imul(be,yt)|0,$=$+Math.imul(be,Tt)|0,he=he+Math.imul(j,Gt)|0,H=H+Math.imul(j,rr)|0,H=H+Math.imul(ee,Gt)|0,$=$+Math.imul(ee,rr)|0,he=he+Math.imul(X,Tr)|0,H=H+Math.imul(X,la)|0,H=H+Math.imul(oe,Tr)|0,$=$+Math.imul(oe,la)|0;var Ia=(se+he|0)+((H&8191)<<13)|0;se=($+(H>>>13)|0)+(Ia>>>26)|0,Ia&=67108863,he=Math.imul(st,wr),H=Math.imul(st,Ir),H=H+Math.imul(Qe,wr)|0,$=Math.imul(Qe,Ir),he=he+Math.imul(fe,Be)|0,H=H+Math.imul(fe,Ke)|0,H=H+Math.imul(Fe,Be)|0,$=$+Math.imul(Fe,Ke)|0,he=he+Math.imul(ut,Ee)|0,H=H+Math.imul(ut,Ve)|0,H=H+Math.imul(Me,Ee)|0,$=$+Math.imul(Me,Ve)|0,he=he+Math.imul(it,Te)|0,H=H+Math.imul(it,Pe)|0,H=H+Math.imul(ot,Te)|0,$=$+Math.imul(ot,Pe)|0,he=he+Math.imul(ze,yt)|0,H=H+Math.imul(ze,Tt)|0,H=H+Math.imul(Re,yt)|0,$=$+Math.imul(Re,Tt)|0,he=he+Math.imul(ce,Gt)|0,H=H+Math.imul(ce,rr)|0,H=H+Math.imul(be,Gt)|0,$=$+Math.imul(be,rr)|0,he=he+Math.imul(j,Tr)|0,H=H+Math.imul(j,la)|0,H=H+Math.imul(ee,Tr)|0,$=$+Math.imul(ee,la)|0,he=he+Math.imul(X,Ba)|0,H=H+Math.imul(X,Ra)|0,H=H+Math.imul(oe,Ba)|0,$=$+Math.imul(oe,Ra)|0;var Ha=(se+he|0)+((H&8191)<<13)|0;se=($+(H>>>13)|0)+(Ha>>>26)|0,Ha&=67108863,he=Math.imul(kt,wr),H=Math.imul(kt,Ir),H=H+Math.imul(qt,wr)|0,$=Math.imul(qt,Ir),he=he+Math.imul(st,Be)|0,H=H+Math.imul(st,Ke)|0,H=H+Math.imul(Qe,Be)|0,$=$+Math.imul(Qe,Ke)|0,he=he+Math.imul(fe,Ee)|0,H=H+Math.imul(fe,Ve)|0,H=H+Math.imul(Fe,Ee)|0,$=$+Math.imul(Fe,Ve)|0,he=he+Math.imul(ut,Te)|0,H=H+Math.imul(ut,Pe)|0,H=H+Math.imul(Me,Te)|0,$=$+Math.imul(Me,Pe)|0,he=he+Math.imul(it,yt)|0,H=H+Math.imul(it,Tt)|0,H=H+Math.imul(ot,yt)|0,$=$+Math.imul(ot,Tt)|0,he=he+Math.imul(ze,Gt)|0,H=H+Math.imul(ze,rr)|0,H=H+Math.imul(Re,Gt)|0,$=$+Math.imul(Re,rr)|0,he=he+Math.imul(ce,Tr)|0,H=H+Math.imul(ce,la)|0,H=H+Math.imul(be,Tr)|0,$=$+Math.imul(be,la)|0,he=he+Math.imul(j,Ba)|0,H=H+Math.imul(j,Ra)|0,H=H+Math.imul(ee,Ba)|0,$=$+Math.imul(ee,Ra)|0,he=he+Math.imul(X,za)|0,H=H+Math.imul(X,en)|0,H=H+Math.imul(oe,za)|0,$=$+Math.imul(oe,en)|0;var rn=(se+he|0)+((H&8191)<<13)|0;se=($+(H>>>13)|0)+(rn>>>26)|0,rn&=67108863,he=Math.imul(Sr,wr),H=Math.imul(Sr,Ir),H=H+Math.imul(xr,wr)|0,$=Math.imul(xr,Ir),he=he+Math.imul(kt,Be)|0,H=H+Math.imul(kt,Ke)|0,H=H+Math.imul(qt,Be)|0,$=$+Math.imul(qt,Ke)|0,he=he+Math.imul(st,Ee)|0,H=H+Math.imul(st,Ve)|0,H=H+Math.imul(Qe,Ee)|0,$=$+Math.imul(Qe,Ve)|0,he=he+Math.imul(fe,Te)|0,H=H+Math.imul(fe,Pe)|0,H=H+Math.imul(Fe,Te)|0,$=$+Math.imul(Fe,Pe)|0,he=he+Math.imul(ut,yt)|0,H=H+Math.imul(ut,Tt)|0,H=H+Math.imul(Me,yt)|0,$=$+Math.imul(Me,Tt)|0,he=he+Math.imul(it,Gt)|0,H=H+Math.imul(it,rr)|0,H=H+Math.imul(ot,Gt)|0,$=$+Math.imul(ot,rr)|0,he=he+Math.imul(ze,Tr)|0,H=H+Math.imul(ze,la)|0,H=H+Math.imul(Re,Tr)|0,$=$+Math.imul(Re,la)|0,he=he+Math.imul(ce,Ba)|0,H=H+Math.imul(ce,Ra)|0,H=H+Math.imul(be,Ba)|0,$=$+Math.imul(be,Ra)|0,he=he+Math.imul(j,za)|0,H=H+Math.imul(j,en)|0,H=H+Math.imul(ee,za)|0,$=$+Math.imul(ee,en)|0,he=he+Math.imul(X,Jt)|0,H=H+Math.imul(X,Nt)|0,H=H+Math.imul(oe,Jt)|0,$=$+Math.imul(oe,Nt)|0;var nn=(se+he|0)+((H&8191)<<13)|0;se=($+(H>>>13)|0)+(nn>>>26)|0,nn&=67108863,he=Math.imul(Sr,Be),H=Math.imul(Sr,Ke),H=H+Math.imul(xr,Be)|0,$=Math.imul(xr,Ke),he=he+Math.imul(kt,Ee)|0,H=H+Math.imul(kt,Ve)|0,H=H+Math.imul(qt,Ee)|0,$=$+Math.imul(qt,Ve)|0,he=he+Math.imul(st,Te)|0,H=H+Math.imul(st,Pe)|0,H=H+Math.imul(Qe,Te)|0,$=$+Math.imul(Qe,Pe)|0,he=he+Math.imul(fe,yt)|0,H=H+Math.imul(fe,Tt)|0,H=H+Math.imul(Fe,yt)|0,$=$+Math.imul(Fe,Tt)|0,he=he+Math.imul(ut,Gt)|0,H=H+Math.imul(ut,rr)|0,H=H+Math.imul(Me,Gt)|0,$=$+Math.imul(Me,rr)|0,he=he+Math.imul(it,Tr)|0,H=H+Math.imul(it,la)|0,H=H+Math.imul(ot,Tr)|0,$=$+Math.imul(ot,la)|0,he=he+Math.imul(ze,Ba)|0,H=H+Math.imul(ze,Ra)|0,H=H+Math.imul(Re,Ba)|0,$=$+Math.imul(Re,Ra)|0,he=he+Math.imul(ce,za)|0,H=H+Math.imul(ce,en)|0,H=H+Math.imul(be,za)|0,$=$+Math.imul(be,en)|0,he=he+Math.imul(j,Jt)|0,H=H+Math.imul(j,Nt)|0,H=H+Math.imul(ee,Jt)|0,$=$+Math.imul(ee,Nt)|0;var yn=(se+he|0)+((H&8191)<<13)|0;se=($+(H>>>13)|0)+(yn>>>26)|0,yn&=67108863,he=Math.imul(Sr,Ee),H=Math.imul(Sr,Ve),H=H+Math.imul(xr,Ee)|0,$=Math.imul(xr,Ve),he=he+Math.imul(kt,Te)|0,H=H+Math.imul(kt,Pe)|0,H=H+Math.imul(qt,Te)|0,$=$+Math.imul(qt,Pe)|0,he=he+Math.imul(st,yt)|0,H=H+Math.imul(st,Tt)|0,H=H+Math.imul(Qe,yt)|0,$=$+Math.imul(Qe,Tt)|0,he=he+Math.imul(fe,Gt)|0,H=H+Math.imul(fe,rr)|0,H=H+Math.imul(Fe,Gt)|0,$=$+Math.imul(Fe,rr)|0,he=he+Math.imul(ut,Tr)|0,H=H+Math.imul(ut,la)|0,H=H+Math.imul(Me,Tr)|0,$=$+Math.imul(Me,la)|0,he=he+Math.imul(it,Ba)|0,H=H+Math.imul(it,Ra)|0,H=H+Math.imul(ot,Ba)|0,$=$+Math.imul(ot,Ra)|0,he=he+Math.imul(ze,za)|0,H=H+Math.imul(ze,en)|0,H=H+Math.imul(Re,za)|0,$=$+Math.imul(Re,en)|0,he=he+Math.imul(ce,Jt)|0,H=H+Math.imul(ce,Nt)|0,H=H+Math.imul(be,Jt)|0,$=$+Math.imul(be,Nt)|0;var xt=(se+he|0)+((H&8191)<<13)|0;se=($+(H>>>13)|0)+(xt>>>26)|0,xt&=67108863,he=Math.imul(Sr,Te),H=Math.imul(Sr,Pe),H=H+Math.imul(xr,Te)|0,$=Math.imul(xr,Pe),he=he+Math.imul(kt,yt)|0,H=H+Math.imul(kt,Tt)|0,H=H+Math.imul(qt,yt)|0,$=$+Math.imul(qt,Tt)|0,he=he+Math.imul(st,Gt)|0,H=H+Math.imul(st,rr)|0,H=H+Math.imul(Qe,Gt)|0,$=$+Math.imul(Qe,rr)|0,he=he+Math.imul(fe,Tr)|0,H=H+Math.imul(fe,la)|0,H=H+Math.imul(Fe,Tr)|0,$=$+Math.imul(Fe,la)|0,he=he+Math.imul(ut,Ba)|0,H=H+Math.imul(ut,Ra)|0,H=H+Math.imul(Me,Ba)|0,$=$+Math.imul(Me,Ra)|0,he=he+Math.imul(it,za)|0,H=H+Math.imul(it,en)|0,H=H+Math.imul(ot,za)|0,$=$+Math.imul(ot,en)|0,he=he+Math.imul(ze,Jt)|0,H=H+Math.imul(ze,Nt)|0,H=H+Math.imul(Re,Jt)|0,$=$+Math.imul(Re,Nt)|0;var ct=(se+he|0)+((H&8191)<<13)|0;se=($+(H>>>13)|0)+(ct>>>26)|0,ct&=67108863,he=Math.imul(Sr,yt),H=Math.imul(Sr,Tt),H=H+Math.imul(xr,yt)|0,$=Math.imul(xr,Tt),he=he+Math.imul(kt,Gt)|0,H=H+Math.imul(kt,rr)|0,H=H+Math.imul(qt,Gt)|0,$=$+Math.imul(qt,rr)|0,he=he+Math.imul(st,Tr)|0,H=H+Math.imul(st,la)|0,H=H+Math.imul(Qe,Tr)|0,$=$+Math.imul(Qe,la)|0,he=he+Math.imul(fe,Ba)|0,H=H+Math.imul(fe,Ra)|0,H=H+Math.imul(Fe,Ba)|0,$=$+Math.imul(Fe,Ra)|0,he=he+Math.imul(ut,za)|0,H=H+Math.imul(ut,en)|0,H=H+Math.imul(Me,za)|0,$=$+Math.imul(Me,en)|0,he=he+Math.imul(it,Jt)|0,H=H+Math.imul(it,Nt)|0,H=H+Math.imul(ot,Jt)|0,$=$+Math.imul(ot,Nt)|0;var Nr=(se+he|0)+((H&8191)<<13)|0;se=($+(H>>>13)|0)+(Nr>>>26)|0,Nr&=67108863,he=Math.imul(Sr,Gt),H=Math.imul(Sr,rr),H=H+Math.imul(xr,Gt)|0,$=Math.imul(xr,rr),he=he+Math.imul(kt,Tr)|0,H=H+Math.imul(kt,la)|0,H=H+Math.imul(qt,Tr)|0,$=$+Math.imul(qt,la)|0,he=he+Math.imul(st,Ba)|0,H=H+Math.imul(st,Ra)|0,H=H+Math.imul(Qe,Ba)|0,$=$+Math.imul(Qe,Ra)|0,he=he+Math.imul(fe,za)|0,H=H+Math.imul(fe,en)|0,H=H+Math.imul(Fe,za)|0,$=$+Math.imul(Fe,en)|0,he=he+Math.imul(ut,Jt)|0,H=H+Math.imul(ut,Nt)|0,H=H+Math.imul(Me,Jt)|0,$=$+Math.imul(Me,Nt)|0;var Or=(se+he|0)+((H&8191)<<13)|0;se=($+(H>>>13)|0)+(Or>>>26)|0,Or&=67108863,he=Math.imul(Sr,Tr),H=Math.imul(Sr,la),H=H+Math.imul(xr,Tr)|0,$=Math.imul(xr,la),he=he+Math.imul(kt,Ba)|0,H=H+Math.imul(kt,Ra)|0,H=H+Math.imul(qt,Ba)|0,$=$+Math.imul(qt,Ra)|0,he=he+Math.imul(st,za)|0,H=H+Math.imul(st,en)|0,H=H+Math.imul(Qe,za)|0,$=$+Math.imul(Qe,en)|0,he=he+Math.imul(fe,Jt)|0,H=H+Math.imul(fe,Nt)|0,H=H+Math.imul(Fe,Jt)|0,$=$+Math.imul(Fe,Nt)|0;var Rr=(se+he|0)+((H&8191)<<13)|0;se=($+(H>>>13)|0)+(Rr>>>26)|0,Rr&=67108863,he=Math.imul(Sr,Ba),H=Math.imul(Sr,Ra),H=H+Math.imul(xr,Ba)|0,$=Math.imul(xr,Ra),he=he+Math.imul(kt,za)|0,H=H+Math.imul(kt,en)|0,H=H+Math.imul(qt,za)|0,$=$+Math.imul(qt,en)|0,he=he+Math.imul(st,Jt)|0,H=H+Math.imul(st,Nt)|0,H=H+Math.imul(Qe,Jt)|0,$=$+Math.imul(Qe,Nt)|0;var Lr=(se+he|0)+((H&8191)<<13)|0;se=($+(H>>>13)|0)+(Lr>>>26)|0,Lr&=67108863,he=Math.imul(Sr,za),H=Math.imul(Sr,en),H=H+Math.imul(xr,za)|0,$=Math.imul(xr,en),he=he+Math.imul(kt,Jt)|0,H=H+Math.imul(kt,Nt)|0,H=H+Math.imul(qt,Jt)|0,$=$+Math.imul(qt,Nt)|0;var Gr=(se+he|0)+((H&8191)<<13)|0;se=($+(H>>>13)|0)+(Gr>>>26)|0,Gr&=67108863,he=Math.imul(Sr,Jt),H=Math.imul(Sr,Nt),H=H+Math.imul(xr,Jt)|0,$=Math.imul(xr,Nt);var Kr=(se+he|0)+((H&8191)<<13)|0;return se=($+(H>>>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]=rn,ue[9]=nn,ue[10]=yn,ue[11]=xt,ue[12]=ct,ue[13]=Nr,ue[14]=Or,ue[15]=Rr,ue[16]=Lr,ue[17]=Gr,ue[18]=Kr,se!==0&&(ue[19]=se,U.length++),U};Math.imul||(E=S);function g(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]=se,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=g(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 se=0;se>>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),se=67108863^67108863>>>Q<ue)for(this.length-=ue,H=0;H=0&&($!==0||H>=W);H--){var J=this.words[H]|0;this.words[H]=$<<26-Q|J>>>Q,$=J&se}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 n(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){n(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(n(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(n(typeof I=="number"),n(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(se===0)return this.strip();for(n(se===-1),se=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,se=this._countBits(ue);U=26-se,U!==0&&(Q=Q.ushln(U),W.iushln(U),ue=Q.words[Q.length-1]|0);var he=W.length-Q.length,H;if(N!=="mod"){H=new s(null),H.length=he+1,H.words=new Array(H.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);H&&(H.words[X]=oe)}return H&&H.strip(),W.strip(),N!=="div"&&U!==0&&W.iushrn(U),{div:H||null,mod:W}},s.prototype.divmod=function(I,N,U){if(n(!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){n(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){n(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){n(I.negative===0),n(!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),se=new s(1),he=0;N.isEven()&&U.isEven();)N.iushrn(1),U.iushrn(1),++he;for(var H=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(H),Q.isub($)),W.iushrn(1),Q.iushrn(1);for(var oe=0,ne=1;!(U.words[0]&ne)&&oe<26;++oe,ne<<=1);if(oe>0)for(U.iushrn(oe);oe-- >0;)(ue.isOdd()||se.isOdd())&&(ue.iadd(H),se.isub($)),ue.iushrn(1),se.iushrn(1);N.cmp(U)>=0?(N.isub(U),W.isub(ue),Q.isub(se)):(U.isub(N),ue.isub(W),se.isub(Q))}return{a:ue,b:se,gcd:U.iushln(he)}},s.prototype._invmp=function(I){n(I.negative===0),n(!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 se=0,he=1;!(N.words[0]&he)&&se<26;++se,he<<=1);if(se>0)for(N.iushrn(se);se-- >0;)W.isOdd()&&W.iadd(ue),W.iushrn(1);for(var H=0,$=1;!(U.words[0]&$)&&H<26;++H,$<<=1);if(H>0)for(U.iushrn(H);H-- >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){n(typeof I=="number");var N=I%26,U=(I-N)/26,W=1<>>26,se&=67108863,this.words[ue]=se}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),n(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 n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),I.convertTo(this)._forceRed(I)},s.prototype.fromRed=function(){return n(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 n(!this.red,"Already a number in reduction context"),this._forceRed(I)},s.prototype.redAdd=function(I){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,I)},s.prototype.redIAdd=function(I){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,I)},s.prototype.redSub=function(I){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,I)},s.prototype.redISub=function(I){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,I)},s.prototype.redShl=function(I){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,I)},s.prototype.redMul=function(I){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,I),this.red.mul(this,I)},s.prototype.redIMul=function(I){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,I),this.red.imul(this,I)},s.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(I){return n(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 y(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()}y.prototype._tmp=function(){var I=new s(null);return I.words=new Array(Math.ceil(this.n/13)),I},y.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},y.prototype.split=function(I,N){I.iushrn(this.n,0,N)},y.prototype.imulK=function(I){return I.imul(this.k)};function f(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}o(f,y),f.prototype.split=function(I,N){for(var U=4194303,W=Math.min(I.length,9),Q=0;Q>>22,ue=se}ue>>>=22,I.words[Q-10]=ue,ue===0&&I.length>10?I.length-=10:I.length-=9},f.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 f;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 n(O.gtn(1),"modulus must be greater than 1"),this.m=O,this.prime=null}F.prototype._verify1=function(I){n(I.negative===0,"red works only with positives"),n(I.red,"red works only with red numbers")},F.prototype._verify2=function(I,N){n((I.negative|N.negative)===0,"red works only with positives"),n(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(n(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);n(!W.isZero());var ue=new s(1).toRed(this),se=ue.redNeg(),he=this.m.subn(1).iushrn(1),H=this.m.bitLength();for(H=new s(2*H*H).toRed(this);this.pow(H,he).cmp(se)!==0;)H.redIAdd(se);for(var $=this.pow(H,W),J=this.pow(I,W.addn(1).iushrn(1)),X=this.pow(I,W),oe=Q;X.cmp(ue)!==0;){for(var ne=X,j=0;ne.cmp(ue)!==0;j++)ne=ne.redSqr();n(j=0;Q--){for(var $=N.words[Q],J=H-1;J>=0;J--){var X=$>>J&1;if(ue!==W[0]&&(ue=this.sqr(ue)),X===0&&se===0){he=0;continue}se<<=1,se|=X,he++,!(he!==U&&(Q!==0||J!==0))&&(ue=this.mul(ue,W[se]),he=0,se=0)}H=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)}o(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 i,a,n,o=r.length,s=0;for(i=0;i>>1;if(!(p<=0)){var u,y=i.mallocDouble(2*p*g),f=i.mallocInt32(g);if(g=s(_,p,y,f),g>0){if(p===1&&E)a.init(g),u=a.sweepComplete(p,S,0,g,y,f,0,g,y,f);else{var P=i.mallocDouble(2*p*b),L=i.mallocInt32(b);b=s(w,p,P,L),b>0&&(a.init(g+b),p===1?u=a.sweepBipartite(p,S,0,g,y,f,0,b,P,L):u=n(p,S,E,g,y,f,b,P,L),i.free(P),i.free(L))}i.free(y),i.free(f)}return u}}}var h;function m(_,w){h.push([_,w])}function d(_){return h=[],c(_,_,m,!0),h}function T(_,w){return h=[],c(_,w,m,!1),h}function l(_,w,S){switch(arguments.length){case 1:return d(_);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 n(c,h,m,d,T,l,_,w,S,E,g){for(var b=2*c,p=d,u=b*d;pS-w?n(c,h,m,d,T,l,_,w,S,E,g):o(c,h,m,d,T,l,_,w,S,E,g)}return s}function i(){function n(m,d,T,l,_,w,S,E,g,b,p){for(var u=2*m,y=l,f=u*l;y<_;++y,f+=u){var P=w[d+f],L=w[d+f+m],z=S[y];e:for(var F=E,B=u*E;Fb-g?l?n(m,d,T,_,w,S,E,g,b,p,u):o(m,d,T,_,w,S,E,g,b,p,u):l?s(m,d,T,_,w,S,E,g,b,p,u):c(m,d,T,_,w,S,E,g,b,p,u)}return h}function a(n){return n?r():i()}t.partial=a(!1),t.full=a(!0)},7150:function(e,t,r){"use strict";e.exports=O;var i=r(1888),a=r(8828),n=r(2455),o=n.partial,s=n.full,c=r(855),h=r(3545),m=r(8105),d=128,T=1<<22,l=1<<22,_=m("!(lo>=p0)&&!(p1>=hi)"),w=m("lo===p0"),S=m("lo0;){$-=1;var oe=$*p,ne=f[oe],j=f[oe+1],ee=f[oe+2],re=f[oe+3],ce=f[oe+4],be=f[oe+5],Ae=$*u,ze=P[Ae],Re=P[Ae+1],We=be&1,it=!!(be&16),ot=Q,tt=ue,ut=he,Me=H;if(We&&(ot=he,tt=H,ut=Q,Me=ue),!(be&2&&(ee=S(I,ne,j,ee,ot,tt,Re),j>=ee))&&!(be&4&&(j=E(I,ne,j,ee,ot,tt,ze),j>=ee))){var _e=ee-j,fe=ce-re;if(it){if(I*_e*(_e+fe)m&&T[b+h]>E;--g,b-=_){for(var p=b,u=b+_,y=0;y<_;++y,++p,++u){var f=T[p];T[p]=T[u],T[u]=f}var P=l[g];l[g]=l[g-1],l[g-1]=P}}function s(c,h,m,d,T,l){if(d<=m+1)return m;for(var _=m,w=d,S=d+m>>>1,E=2*c,g=S,b=T[E*S+h];_=P?(g=f,b=P):y>=z?(g=u,b=y):(g=L,b=z):P>=z?(g=f,b=P):z>=y?(g=u,b=y):(g=L,b=z);for(var O=E*(w-1),I=E*g,F=0;F=p0)&&!(p1>=hi)":h};function r(m){return t[m]}function i(m,d,T,l,_,w,S){for(var E=2*m,g=E*T,b=g,p=T,u=d,y=m+d,f=T;l>f;++f,g+=E){var P=_[g+u];if(P===S)if(p===f)p+=1,b+=E;else{for(var L=0;E>L;++L){var z=_[g+L];_[g+L]=_[b],_[b++]=z}var F=w[f];w[f]=w[p],w[p++]=F}}return p}function a(m,d,T,l,_,w,S){for(var E=2*m,g=E*T,b=g,p=T,u=d,y=m+d,f=T;l>f;++f,g+=E){var P=_[g+u];if(PL;++L){var z=_[g+L];_[g+L]=_[b],_[b++]=z}var F=w[f];w[f]=w[p],w[p++]=F}}return p}function n(m,d,T,l,_,w,S){for(var E=2*m,g=E*T,b=g,p=T,u=d,y=m+d,f=T;l>f;++f,g+=E){var P=_[g+y];if(P<=S)if(p===f)p+=1,b+=E;else{for(var L=0;E>L;++L){var z=_[g+L];_[g+L]=_[b],_[b++]=z}var F=w[f];w[f]=w[p],w[p++]=F}}return p}function o(m,d,T,l,_,w,S){for(var E=2*m,g=E*T,b=g,p=T,u=d,y=m+d,f=T;l>f;++f,g+=E){var P=_[g+y];if(P<=S)if(p===f)p+=1,b+=E;else{for(var L=0;E>L;++L){var z=_[g+L];_[g+L]=_[b],_[b++]=z}var F=w[f];w[f]=w[p],w[p++]=F}}return p}function s(m,d,T,l,_,w,S){for(var E=2*m,g=E*T,b=g,p=T,u=d,y=m+d,f=T;l>f;++f,g+=E){var P=_[g+u],L=_[g+y];if(P<=S&&S<=L)if(p===f)p+=1,b+=E;else{for(var z=0;E>z;++z){var F=_[g+z];_[g+z]=_[b],_[b++]=F}var B=w[f];w[f]=w[p],w[p++]=B}}return p}function c(m,d,T,l,_,w,S){for(var E=2*m,g=E*T,b=g,p=T,u=d,y=m+d,f=T;l>f;++f,g+=E){var P=_[g+u],L=_[g+y];if(Pz;++z){var F=_[g+z];_[g+z]=_[b],_[b++]=F}var B=w[f];w[f]=w[p],w[p++]=B}}return p}function h(m,d,T,l,_,w,S,E){for(var g=2*m,b=g*T,p=b,u=T,y=d,f=m+d,P=T;l>P;++P,b+=g){var L=_[b+y],z=_[b+f];if(!(L>=S)&&!(E>=z))if(u===P)u+=1,p+=g;else{for(var F=0;g>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(d,T){T<=4*t?i(0,T-1,d):m(0,T-1,d)}function i(d,T,l){for(var _=2*(d+1),w=d+1;w<=T;++w){for(var S=l[_++],E=l[_++],g=w,b=_-2;g-- >d;){var p=l[b-2],u=l[b-1];if(pl[T+1]:!0}function h(d,T,l,_){d*=2;var w=_[d];return w>1,g=E-_,b=E+_,p=w,u=g,y=E,f=b,P=S,L=d+1,z=T-1,F=0;c(p,u,l)&&(F=p,p=u,u=F),c(f,P,l)&&(F=f,f=P,P=F),c(p,y,l)&&(F=p,p=y,y=F),c(u,y,l)&&(F=u,u=y,y=F),c(p,f,l)&&(F=p,p=f,f=F),c(y,f,l)&&(F=y,y=f,f=F),c(u,P,l)&&(F=u,u=P,P=F),c(u,y,l)&&(F=u,u=y,y=F),c(f,P,l)&&(F=f,f=P,P=F);for(var B=l[2*u],O=l[2*u+1],I=l[2*f],N=l[2*f+1],U=2*p,W=2*y,Q=2*P,ue=2*w,se=2*E,he=2*S,H=0;H<2;++H){var $=l[U+H],J=l[W+H],X=l[Q+H];l[ue+H]=$,l[se+H]=J,l[he+H]=X}n(g,d,l),n(b,T,l);for(var oe=L;oe<=z;++oe)if(h(oe,B,O,l))oe!==L&&a(oe,L,l),++L;else if(!h(oe,I,N,l))for(;;)if(h(z,I,N,l)){h(z,B,O,l)?(o(oe,L,z,l),++L,--z):(a(oe,z,l),--z);break}else{if(--z>>1;n(_,J);for(var X=0,oe=0,se=0;se=o)ne=ne-o|0,S(m,d,oe--,ne);else if(ne>=0)S(c,h,X--,ne);else if(ne<=-o){ne=-ne-o|0;for(var j=0;j>>1;n(_,J);for(var X=0,oe=0,ne=0,se=0;se>1===_[2*se+3]>>1&&(ee=2,se+=1),j<0){for(var re=-(j>>1)-1,ce=0;ce>1)-1;ee===0?S(c,h,X--,re):ee===1?S(m,d,oe--,re):ee===2&&S(T,l,ne--,re)}}}function p(y,f,P,L,z,F,B,O,I,N,U,W){var Q=0,ue=2*y,se=f,he=f+y,H=1,$=1;L?$=o:H=o;for(var J=z;J>>1;n(_,j);for(var ee=0,J=0;J=o?(ce=!L,X-=o):(ce=!!L,X-=1),ce)E(c,h,ee++,X);else{var be=W[X],Ae=ue*X,ze=U[Ae+f+1],Re=U[Ae+f+1+y];e:for(var We=0;We>>1;n(_,X);for(var oe=0,he=0;he=o)c[oe++]=H-o;else{H-=1;var j=U[H],ee=Q*H,re=N[ee+f+1],ce=N[ee+f+1+y];e:for(var be=0;be=0;--be)if(c[be]===H){for(var We=be+1;We0;){for(var w=h.pop(),T=h.pop(),S=-1,E=-1,l=d[T],b=1;b=0||(c.flip(T,w),n(s,c,h,S,T,E),n(s,c,h,T,E,S),n(s,c,h,E,w,S),n(s,c,h,w,S,E))}}},5023:function(e,t,r){"use strict";var i=r(2478);e.exports=h;function a(m,d,T,l,_,w,S){this.cells=m,this.neighbor=d,this.flags=l,this.constraint=T,this.active=_,this.next=w,this.boundary=S}var n=a.prototype;function o(m,d){return m[0]-d[0]||m[1]-d[1]||m[2]-d[2]}n.locate=function(){var m=[0,0,0];return function(d,T,l){var _=d,w=T,S=l;return T0||S.length>0;){for(;w.length>0;){var u=w.pop();if(E[u]!==-_){E[u]=_;for(var y=g[u],f=0;f<3;++f){var P=p[3*u+f];P>=0&&E[P]===0&&(b[3*u+f]?S.push(P):(w.push(P),E[P]=_))}}}var L=S;S=w,w=L,S.length=0,_=-_}var z=c(g,E,d);return T?z.concat(l.boundary):z}},8902:function(e,t,r){"use strict";var i=r(2478),a=r(3250)[3],n=0,o=1,s=2;e.exports=S;function c(E,g,b,p,u){this.a=E,this.b=g,this.idx=b,this.lowerIds=p,this.upperIds=u}function h(E,g,b,p){this.a=E,this.b=g,this.type=b,this.idx=p}function m(E,g){var b=E.a[0]-g.a[0]||E.a[1]-g.a[1]||E.type-g.type;return b||E.type!==n&&(b=a(E.a,E.b,g.b),b)?b:E.idx-g.idx}function d(E,g){return a(E.a,E.b,g)}function T(E,g,b,p,u){for(var y=i.lt(g,p,d),f=i.gt(g,p,d),P=y;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,g){var b;return E.a[0]L[0]&&u.push(new h(L,P,s,y),new h(P,L,o,y))}u.sort(m);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=[],y=0,O=u.length;y=0}}(),n.removeTriangle=function(c,h,m){var d=this.stars;o(d[c],h,m),o(d[h],m,c),o(d[m],c,h)},n.addTriangle=function(c,h,m){var d=this.stars;d[c].push(h,m),d[h].push(m,c),d[m].push(c,h)},n.opposite=function(c,h){for(var m=this.stars[h],d=1,T=m.length;d=0;--I){var $=B[I];N=$[0];var J=z[N],X=J[0],oe=J[1],ne=L[X],j=L[oe];if((ne[0]-j[0]||ne[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 g(L,z,F){for(var B=z.length,O=new i(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(h.alpha)?h.alpha.length!==2?g=[1,1]:g=h.alpha.slice():typeof h.alpha=="number"?g=[h.alpha,h.alpha]:g=[1,1],m=_.map(function(P){return Math.round(P.index*E)}),g[0]=Math.min(Math.max(g[0],0),1),g[1]=Math.min(Math.max(g[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]=g[0]+(g[1]-g[0])*z),F}),u=[];for(b=0;b=0}function h(m,d,T,l){var _=i(d,T,l);if(_===0){var w=a(i(m,d,T)),S=a(i(m,d,l));if(w===S){if(w===0){var E=c(m,d,T),g=c(m,d,l);return E===g?0:E?1:-1}return 0}else{if(S===0)return w>0||c(m,d,l)?-1:1;if(w===0)return S>0||c(m,d,T)?1:-1}return a(S-w)}var b=i(m,d,T);if(b>0)return _>0&&i(m,d,l)>0?1:-1;if(b<0)return _>0||i(m,d,l)>0?1:-1;var p=i(m,d,l);return p>0||c(m,d,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=i;var t=Math.min;function r(a,n){return a-n}function i(a,n){var o=a.length,s=a.length-n.length;if(s)return s;switch(o){case 0:return 0;case 1:return a[0]-n[0];case 2:return a[0]+a[1]-n[0]-n[1]||t(a[0],a[1])-t(n[0],n[1]);case 3:var c=a[0]+a[1],h=n[0]+n[1];if(s=c+a[2]-(h+n[2]),s)return s;var m=t(a[0],a[1]),d=t(n[0],n[1]);return t(m,a[2])-t(d,n[2])||t(m+a[2],c)-t(d+n[2],h);case 4:var T=a[0],l=a[1],_=a[2],w=a[3],S=n[0],E=n[1],g=n[2],b=n[3];return T+l+_+w-(S+E+g+b)||t(T,l,_,w)-t(S,E,g,b,S)||t(T+l,T+_,T+w,l+_,l+w,_+w)-t(S+E,S+g,S+b,E+g,E+b,g+b)||t(T+l+_,T+l+w,T+_+w,l+_+w)-t(S+E+g,S+E+b,S+g+b,E+g+b);default:for(var p=a.slice().sort(r),u=n.slice().sort(r),y=0;yr[a][0]&&(a=n);return ia?[[a],[i]]:[[i]]}},4750:function(e,t,r){"use strict";e.exports=a;var i=r(3090);function a(n){var o=i(n),s=o.length;if(s<=2)return[];for(var c=new Array(s),h=o[s-1],m=0;m=h[S]&&(w+=1);l[_]=w}}return c}function s(c,h){try{return i(c,!0)}catch{var m=a(c);if(m.length<=h)return[];var d=n(c,m),T=i(d,!0);return o(T,m)}}},4769:function(e){"use strict";function t(i,a,n,o,s,c){var h=6*s*s-6*s,m=3*s*s-4*s+1,d=-6*s*s+6*s,T=3*s*s-2*s;if(i.length){c||(c=new Array(i.length));for(var l=i.length-1;l>=0;--l)c[l]=h*i[l]+m*a[l]+d*n[l]+T*o[l];return c}return h*i+m*a+d*n[l]+T*o}function r(i,a,n,o,s,c){var h=s-1,m=s*s,d=h*h,T=(1+2*s)*d,l=s*d,_=m*(3-2*s),w=m*h;if(i.length){c||(c=new Array(i.length));for(var S=i.length-1;S>=0;--S)c[S]=T*i[S]+l*a[S]+_*n[S]+w*o[S];return c}return T*i+l*a+_*n+w*o}e.exports=r,e.exports.derivative=t},7642:function(e,t,r){"use strict";var i=r(8954),a=r(1682);e.exports=c;function n(h,m){this.point=h,this.index=m}function o(h,m){for(var d=h.point,T=m.point,l=d.length,_=0;_=2)return!1;F[O]=I}return!0}):z=z.filter(function(F){for(var B=0;B<=T;++B){var O=y[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,n,o){var s=a[o]|0;if(s<=0)return[];var c=new Array(s),h;if(o===a.length-1)for(h=0;h"u"&&(n=0),typeof a){case"number":if(a>0)return r(a|0,n);break;case"object":if(typeof a.length=="number")return t(a,n,0);break}return[]}e.exports=i},3134:function(e,t,r){"use strict";e.exports=a;var i=r(1682);function a(n,o){var s=n.length;if(typeof o!="number"){o=0;for(var c=0;c=T-1)for(var b=w.length-1,u=m-d[T-1],p=0;p=T-1)for(var g=w.length-1,b=m-d[T-1],p=0;p=0;--T)if(m[--d])return!1;return!0},s.jump=function(m){var d=this.lastT(),T=this.dimension;if(!(m0;--p)l.push(n(E[p-1],g[p-1],arguments[p])),_.push(0)}},s.push=function(m){var d=this.lastT(),T=this.dimension;if(!(m1e-6?1/S:0;this._time.push(m);for(var u=T;u>0;--u){var y=n(g[u-1],b[u-1],arguments[u]);l.push(y),_.push((y-l[w++])*p)}}},s.set=function(m){var d=this.dimension;if(!(m0;--E)T.push(n(w[E-1],S[E-1],arguments[E])),l.push(0)}},s.move=function(m){var d=this.lastT(),T=this.dimension;if(!(m<=d||arguments.length!==T+1)){var l=this._state,_=this._velocity,w=l.length-this.dimension,S=this.bounds,E=S[0],g=S[1],b=m-d,p=b>1e-6?1/b:0;this._time.push(m);for(var u=T;u>0;--u){var y=arguments[u];l.push(n(E[u-1],g[u-1],l[w++]+y)),_.push(y*p)}}},s.idle=function(m){var d=this.lastT();if(!(m=0;--p)l.push(n(E[p],g[p],l[w]+b*_[w])),_.push(0),w+=1}};function c(m){for(var d=new Array(m),T=0;T=0;--L){var u=y[L];f[L]<=0?y[L]=new i(u._color,u.key,u.value,y[L+1],u.right,u._count+1):y[L]=new i(u._color,u.key,u.value,u.left,y[L+1],u._count+1)}for(var L=y.length-1;L>1;--L){var z=y[L-1],u=y[L];if(z._color===r||u._color===r)break;var F=y[L-2];if(F.left===z)if(z.left===u){var B=F.right;if(B&&B._color===t)z._color=r,F.right=n(r,B),F._color=t,L-=1;else{if(F._color=t,F.left=z.right,z._color=r,z.right=F,y[L-2]=z,y[L-1]=u,o(F),o(z),L>=3){var O=y[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=n(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,y[L-2]=u,y[L-1]=z,o(F),o(z),o(u),L>=3){var O=y[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=n(r,B),F._color=t,L-=1;else{if(F._color=t,F.right=z.left,z._color=r,z.left=F,y[L-2]=z,y[L-1]=u,o(F),o(z),L>=3){var O=y[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=n(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,y[L-2]=u,y[L-1]=z,o(F),o(z),o(u),L>=3){var O=y[L-3];O.right===F?O.right=u:O.left=u}break}}}return y[0]._color=r,new s(p,y[0])};function h(g,b){if(b.left){var p=h(g,b.left);if(p)return p}var p=g(b.key,b.value);if(p)return p;if(b.right)return h(g,b.right)}function m(g,b,p,u){var y=b(g,u.key);if(y<=0){if(u.left){var f=m(g,b,p,u.left);if(f)return f}var f=p(u.key,u.value);if(f)return f}if(u.right)return m(g,b,p,u.right)}function d(g,b,p,u,y){var f=p(g,y.key),P=p(b,y.key),L;if(f<=0&&(y.left&&(L=d(g,b,p,u,y.left),L)||P>0&&(L=u(y.key,y.value),L)))return L;if(P>0&&y.right)return d(g,b,p,u,y.right)}c.forEach=function(b,p,u){if(this.root)switch(arguments.length){case 1:return h(b,this.root);case 2:return m(p,this._compare,b,this.root);case 3:return this._compare(p,u)>=0?void 0:d(p,u,this._compare,b,this.root)}},Object.defineProperty(c,"begin",{get:function(){for(var g=[],b=this.root;b;)g.push(b),b=b.left;return new T(this,g)}}),Object.defineProperty(c,"end",{get:function(){for(var g=[],b=this.root;b;)g.push(b),b=b.right;return new T(this,g)}}),c.at=function(g){if(g<0)return new T(this,[]);for(var b=this.root,p=[];;){if(p.push(b),b.left){if(g=b.right._count)break;b=b.right}else break}return new T(this,[])},c.ge=function(g){for(var b=this._compare,p=this.root,u=[],y=0;p;){var f=b(g,p.key);u.push(p),f<=0&&(y=u.length),f<=0?p=p.left:p=p.right}return u.length=y,new T(this,u)},c.gt=function(g){for(var b=this._compare,p=this.root,u=[],y=0;p;){var f=b(g,p.key);u.push(p),f<0&&(y=u.length),f<0?p=p.left:p=p.right}return u.length=y,new T(this,u)},c.lt=function(g){for(var b=this._compare,p=this.root,u=[],y=0;p;){var f=b(g,p.key);u.push(p),f>0&&(y=u.length),f<=0?p=p.left:p=p.right}return u.length=y,new T(this,u)},c.le=function(g){for(var b=this._compare,p=this.root,u=[],y=0;p;){var f=b(g,p.key);u.push(p),f>=0&&(y=u.length),f<0?p=p.left:p=p.right}return u.length=y,new T(this,u)},c.find=function(g){for(var b=this._compare,p=this.root,u=[];p;){var y=b(g,p.key);if(u.push(p),y===0)return new T(this,u);y<=0?p=p.left:p=p.right}return new T(this,[])},c.remove=function(g){var b=this.find(g);return b?b.remove():this},c.get=function(g){for(var b=this._compare,p=this.root;p;){var u=b(g,p.key);if(u===0)return p.value;u<=0?p=p.left:p=p.right}};function T(g,b){this.tree=g,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 _(g,b){g.key=b.key,g.value=b.value,g.left=b.left,g.right=b.right,g._color=b._color,g._count=b._count}function w(g){for(var b,p,u,y,f=g.length-1;f>=0;--f){if(b=g[f],f===0){b._color=r;return}if(p=g[f-1],p.left===b){if(u=p.right,u.right&&u.right._color===t){if(u=p.right=a(u),y=u.right=a(u.right),p.right=u.left,u.left=p,u.right=y,u._color=p._color,b._color=r,p._color=r,y._color=r,o(p),o(u),f>1){var P=g[f-2];P.left===p?P.left=u:P.right=u}g[f-1]=u;return}else if(u.left&&u.left._color===t){if(u=p.right=a(u),y=u.left=a(u.left),p.right=y.left,u.left=y.right,y.left=p,y.right=u,y._color=p._color,p._color=r,u._color=r,b._color=r,o(p),o(u),o(y),f>1){var P=g[f-2];P.left===p?P.left=y:P.right=y}g[f-1]=y;return}if(u._color===r)if(p._color===t){p._color=r,p.right=n(t,u);return}else{p.right=n(t,u);continue}else{if(u=a(u),p.right=u.left,u.left=p,u._color=p._color,p._color=t,o(p),o(u),f>1){var P=g[f-2];P.left===p?P.left=u:P.right=u}g[f-1]=u,g[f]=p,f+11){var P=g[f-2];P.right===p?P.right=u:P.left=u}g[f-1]=u;return}else if(u.right&&u.right._color===t){if(u=p.left=a(u),y=u.right=a(u.right),p.left=y.right,u.right=y.left,y.right=p,y.left=u,y._color=p._color,p._color=r,u._color=r,b._color=r,o(p),o(u),o(y),f>1){var P=g[f-2];P.right===p?P.right=y:P.left=y}g[f-1]=y;return}if(u._color===r)if(p._color===t){p._color=r,p.left=n(t,u);return}else{p.left=n(t,u);continue}else{if(u=a(u),p.left=u.right,u.right=p,u._color=p._color,p._color=t,o(p),o(u),f>1){var P=g[f-2];P.right===p?P.right=u:P.left=u}g[f-1]=u,g[f]=p,f+1=0;--u){var p=g[u];p.left===g[u+1]?b[u]=new i(p._color,p.key,p.value,b[u+1],p.right,p._count):b[u]=new i(p._color,p.key,p.value,p.left,b[u+1],p._count)}if(p=b[b.length-1],p.left&&p.right){var y=b.length;for(p=p.left;p.right;)b.push(p),p=p.right;var f=b[y-1];b.push(new i(p._color,f.key,f.value,p.left,p.right,p._count)),b[y-1].key=p.key,b[y-1].value=p.value;for(var u=b.length-2;u>=y;--u)p=b[u],b[u]=new i(p._color,p.key,p.value,p.left,b[u+1],p._count);b[y-1].left=b[y]}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 g=0,b=this._stack;if(b.length===0){var p=this.tree.root;return p?p._count:0}else b[b.length-1].left&&(g=b[b.length-1].left._count);for(var u=b.length-2;u>=0;--u)b[u+1]===b[u].right&&(++g,b[u].left&&(g+=b[u].left._count));return g},enumerable:!0}),l.next=function(){var g=this._stack;if(g.length!==0){var b=g[g.length-1];if(b.right)for(b=b.right;b;)g.push(b),b=b.left;else for(g.pop();g.length>0&&g[g.length-1].right===b;)b=g[g.length-1],g.pop()}},Object.defineProperty(l,"hasNext",{get:function(){var g=this._stack;if(g.length===0)return!1;if(g[g.length-1].right)return!0;for(var b=g.length-1;b>0;--b)if(g[b-1].left===g[b])return!0;return!1}}),l.update=function(g){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 i(u._color,u.key,g,u.left,u.right,u._count);for(var y=b.length-2;y>=0;--y)u=b[y],u.left===b[y+1]?p[y]=new i(u._color,u.key,u.value,p[y+1],u.right,u._count):p[y]=new i(u._color,u.key,u.value,u.left,p[y+1],u._count);return new s(this.tree._compare,p[0])},l.prev=function(){var g=this._stack;if(g.length!==0){var b=g[g.length-1];if(b.left)for(b=b.left;b;)g.push(b),b=b.right;else for(g.pop();g.length>0&&g[g.length-1].left===b;)b=g[g.length-1],g.pop()}},Object.defineProperty(l,"hasPrev",{get:function(){var g=this._stack;if(g.length===0)return!1;if(g[g.length-1].left)return!0;for(var b=g.length-1;b>0;--b)if(g[b-1].right===g[b])return!0;return!1}});function S(g,b){return gb?1:0}function E(g){return new s(g||S,null)}},3837:function(e,t,r){"use strict";e.exports=L;var i=r(4935),a=r(501),n=r(5304),o=r(6429),s=r(6444),c=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),h=ArrayBuffer,m=DataView;function d(z){return h.isView(z)&&!(z instanceof m)}function T(z){return Array.isArray(z)||d(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=n(z)}var w=_.prototype;w.update=function(z){z=z||{};function F(X,oe,ne){if(ne in z){var j=z[ne],ee=this[ne],re;(X?T(j)&&T(j[0]):T(j))?this[ne]=re=[oe(j[0]),oe(j[1]),oe(j[2])]:this[ne]=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,se=0;se<2;++se)for(var he=0;he<3;++he)ue[se][he]!==this.bounds[se][he]&&(Q=!0),this.bounds[se][he]=ue[se][he];if("ticks"in z){U=z.ticks,W=!0,this.autoTicks=!1;for(var se=0;se<3;++se)this.tickSpacing[se]=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 se=0;se<3;++se)U[se].sort(function(oe,ne){return oe.x-ne.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 H=I("labels");I("labelFont")&&(H=!0),I("labelFontStyle")&&(H=!0),I("labelFontWeight")&&(H=!0),I("labelFontVariant")&&(H=!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&&(H||W)&&this._text.update(this.bounds,this.labels,$,this.ticks,J):this._text=i(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 g(z,F,B,O,I){for(var N=z.primalOffset,U=z.primalMinor,W=z.mirrorOffset,Q=z.mirrorMinor,ue=O[F],se=0;se<3;++se)if(F!==se){var he=N,H=W,$=U,J=Q;ue&1<0?($[se]=-1,J[se]=0):($[se]=0,J[se]=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,y=[0,0,0],f=[0,0,0],P=[0,0,0];w.draw=function(z){z=z||p;for(var ne=this.gl,F=z.model||c,B=z.view||c,O=z.projection||c,I=this.bounds,N=z._ortho||!1,U=o(F,B,O,I,N),W=U.cubeEdges,Q=U.axis,ue=B[12],se=B[13],he=B[14],H=B[15],$=N?2:1,J=$*this.pixelRatio*(O[3]*ue+O[7]*se+O[11]*he+O[15]*H)/ne.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)g(E[X],X,this.bounds,W,Q);for(var ne=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(y,oe[X].primalMinor),ze=l(f,oe[X].mirrorMinor),Re=this.lineTickLength,re=0;re<3;++re){var We=J/F[5*re];Ae[re]*=Re[re]*We,ze[re]*=Re[re]*We}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,ut;function Me(Qe){ut=[0,0,0],ut[Qe]=1}function _e(Qe,Lt,kt){var qt=(Qe+1)%3,Zt=(Qe+2)%3,Sr=Lt[qt],xr=Lt[Zt],jr=kt[qt],wr=kt[Zt];if(Sr>0&&wr>0){Me(qt);return}else if(Sr>0&&wr<0){Me(qt);return}else if(Sr<0&&wr>0){Me(qt);return}else if(Sr<0&&wr<0){Me(qt);return}else if(xr>0&&jr>0){Me(Zt);return}else if(xr>0&&jr<0){Me(Zt);return}else if(xr<0&&jr>0){Me(Zt);return}else if(xr<0&&jr<0){Me(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]),ut=[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,ut,it)}if(this.labelEnable[X]){tt=0,ut=[0,0,0],this.labels[X].length>4&&(Me(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],ut,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 i=r(2762),a=r(8116),n=r(1879).bg;function o(h,m,d,T){this.gl=h,this.buffer=m,this.vao=d,this.shader=T}var s=o.prototype;s.draw=function(h,m,d,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:h,view:m,projection:d,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(h){for(var m=[],d=[],T=0,l=0;l<3;++l)for(var _=(l+1)%3,w=(l+2)%3,S=[0,0,0],E=[0,0,0],g=-1;g<=1;g+=2){d.push(T,T+2,T+1,T+1,T+2,T+3),S[l]=g,E[l]=g;for(var b=-1;b<=1;b+=2){S[_]=b;for(var p=-1;p<=1;p+=2)S[w]=p,m.push(S[0],S[1],S[2],E[0],E[1],E[2]),T+=1}var u=_;_=w,w=u}var y=i(h,new Float32Array(m)),f=i(h,new Uint16Array(d),h.ELEMENT_ARRAY_BUFFER),P=a(h,[{buffer:y,type:h.FLOAT,size:3,offset:0,stride:24},{buffer:y,type:h.FLOAT,size:3,offset:12,stride:24}],f),L=n(h);return L.attributes.position.location=0,L.attributes.normal.location=1,new o(h,y,P,L)}},6429:function(e,t,r){"use strict";e.exports=g;var i=r(8828),a=r(6760),n=r(5202),o=r(3250),s=new Array(16),c=new Array(8),h=new Array(8),m=new Array(3),d=[0,0,0];(function(){for(var b=0;b<8;++b)c[b]=[1,1,1,1],h[b]=[1,1,1]})();function T(b,p,u){for(var y=0;y<4;++y){b[y]=u[12+y];for(var f=0;f<3;++f)b[y]+=p[f]*u[4*f+y]}}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<h[L][1])&&(oe=L);for(var ne=-1,L=0;L<3;++L){var j=oe^1<h[ee][0]&&(ee=j)}}var re=w;re[0]=re[1]=re[2]=0,re[i.log2(ne^oe)]=oe&ne,re[i.log2(oe^ee)]=oeⅇvar ce=ee^7;ce===B||ce===X?(ce=ne^7,re[i.log2(ee^ce)]=ce&ee):re[i.log2(ne^ce)]=ce≠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=i([`precision highp float; #define GLSLIFY 1 uniform vec4 color; void main() { gl_FragColor = color; }`]);t.Q=function(d){return a(d,s,c,null,[{name:"position",type:"vec3"}])};var h=i([`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); } `]),m=i([`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(d){return a(d,h,m,null,[{name:"position",type:"vec3"},{name:"normal",type:"vec3"}])}},4935:function(e,t,r){"use strict";e.exports=_;var i=r(2762),a=r(8116),n=r(4359),o=r(1879).Q,s=window||process.global||{},c=s.__TEXT_CACHE||{};s.__TEXT_CACHE={};var h=3;function m(w,S,E,g){this.gl=w,this.shader=S,this.buffer=E,this.vao=g,this.tickOffset=this.tickCount=this.labelOffset=this.labelCount=null}var d=m.prototype,T=[0,0];d.bind=function(w,S,E,g){this.vao.bind(),this.shader.bind();var b=this.shader.uniforms;b.model=w,b.view=S,b.projection=E,b.pixelScale=g,T[0]=this.gl.drawingBufferWidth,T[1]=this.gl.drawingBufferHeight,this.shader.uniforms.resolution=T},d.unbind=function(){this.vao.unbind()},d.update=function(w,S,E,g,b){var p=[];function u(N,U,W,Q,ue,se){var he=[W.style,W.weight,W.variant,W.family].join("_"),H=c[he];H||(H=c[he]={});var $=H[U];$||($=H[U]=l(U,{triangles:!0,font:W.family,fontStyle:W.style,fontWeight:W.weight,fontVariant:W.variant,textAlign:"center",textBaseline:"middle",lineSpacing:ue,styletags:se}));for(var J=(Q||12)/12,X=$.positions,oe=$.cells,ne=0,j=oe.length;ne=0;--re){var ce=X[ee[re]];p.push(J*ce[0],-J*ce[1],N)}}for(var y=[0,0,0],f=[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/h|0,u(.5*(w[0][B]+w[1][B]),S[B],E[B],12,z,F),L[B]=(p.length/h|0)-P[B],y[B]=p.length/h|0;for(var O=0;O=0&&(h=s.length-c-1);var m=Math.pow(10,h),d=Math.round(n*o*m),T=d+"";if(T.indexOf("e")>=0)return T;var l=d/m,_=d%m;d<0?(l=-Math.ceil(l)|0,_=-_|0):(l=Math.floor(l)|0,_=_|0);var w=""+l;if(d<0&&(w="-"+w),h){for(var S=""+_;S.length=n[0][c];--d)h.push({x:d*o[c],text:r(o[c],d)});s.push(h)}return s}function a(n,o){for(var s=0;s<3;++s){if(n[s].length!==o[s].length)return!1;for(var c=0;cw)throw new Error("gl-buffer: If resizing buffer, must not specify offset");return l.bufferSubData(_,g,E),w}function m(l,_){for(var w=i.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(o.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&&d(l.shape,l.stride))l.offset===0&&l.data.length===l.shape[0]?this.length=h(this.gl,this.type,this.length,this.usage,l.data,_):this.length=h(this.gl,this.type,this.length,this.usage,l.data.subarray(l.offset,l.shape[0]),_);else{var E=i.malloc(l.size,w),g=n(E,l.shape);a.assign(g,l),_<0?this.length=h(this.gl,this.type,this.length,this.usage,E,_):this.length=h(this.gl,this.type,this.length,this.usage,E.subarray(0,l.size),_),i.free(E)}}else if(Array.isArray(l)){var b;this.type===this.gl.ELEMENT_ARRAY_BUFFER?b=m(l,"uint16"):b=m(l,"float32"),_<0?this.length=h(this.gl,this.type,this.length,this.usage,b,_):this.length=h(this.gl,this.type,this.length,this.usage,b.subarray(0,l.length),_),i.free(b)}else if(typeof l=="object"&&typeof l.length=="number")this.length=h(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(),g=new s(l,w,E,0,S);return g.update(_),g}e.exports=T},6405:function(e,t,r){"use strict";var i=r(2931);e.exports=function(n,o){var s=n.positions,c=n.vectors,h={positions:[],vertexIntensity:[],vertexIntensityBounds:n.vertexIntensityBounds,vectors:[],cells:[],coneOffset:n.coneOffset,colormap:n.colormap};if(n.positions.length===0)return o&&(o[0]=[0,0,0],o[1]=[0,0,0]),h;for(var m=0,d=1/0,T=-1/0,l=1/0,_=-1/0,w=1/0,S=-1/0,E=null,g=null,b=[],p=1/0,u=!1,y=n.coneSizemode==="raw",f=0;fm&&(m=i.length(L)),f&&!y){var z=2*i.distance(E,P)/(i.length(g)+i.length(L));z?(p=Math.min(p,z),u=!1):u=!0}u||(E=P,g=L),b.push(L)}var F=[d,l,w],B=[T,_,S];o&&(o[0]=F,o[1]=B),m===0&&(m=1);var O=1/m;isFinite(p)||(p=1),h.vectorScale=p;var I=n.coneSize||(y?1:.5);n.absoluteConeSize&&(I=n.absoluteConeSize*O),h.coneScale=I;for(var f=0,N=0;f=1},l.isTransparent=function(){return this.opacity<1},l.pickSlots=1,l.setPickBase=function(b){this.pickId=b};function _(b){for(var p=m({colormap:b,nshades:256,format:"rgba"}),u=new Uint8Array(256*4),y=0;y<256;++y){for(var f=p[y],P=0;P<3;++P)u[4*y+P]=f[P];u[4*y+3]=f[3]*255}return h(u,[256,256,4],[4,0,1])}function w(b){for(var p=b.length,u=new Array(p),y=0;y0){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||d,y=b.view||d,f=b.projection||d,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(y),this._projection=[].slice.call(f),this._resolution=[p.drawingBufferWidth,p.drawingBufferHeight];var z={model:u,view:y,projection:f,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],y=this.positions[u[1]].slice(0,3),f={position:y,dataCoordinate:y,index:Math.floor(u[1]/48)};return this.traceType==="cone"?f.index=Math.floor(u[1]/48):this.traceType==="streamtube"&&(f.intensity=this.intensity[u[1]],f.velocity=this.vectors[u[1]].slice(0,3),f.divergence=this.vectors[u[1]][3],f.index=p),f},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=i(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=i(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 g(b,p,u){var y=u.shaders;arguments.length===1&&(p=b,b=p.gl);var f=S(b,y),P=E(b,y),L=o(b,h(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=n(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,f,P,z,F,I,B,O,N,u.traceType||"cone");return U.update(p),U}e.exports=g},614:function(e,t,r){var i=r(3236),a=i([`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; } `]),n=i([`#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; } `]),o=i([`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=i([`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:n,attributes:[{name:"position",type:"vec4"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"vector",type:"vec3"}]},t.pickShader={vertex:o,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 i=r(737);e.exports=function(n){return i[n]}},9165:function(e,t,r){"use strict";e.exports=T;var i=r(2762),a=r(8116),n=r(3436),o=[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||o,E=w.projection=l.projection||o;w.model=l.model||o,w.clipBounds=this.clipBounds,w.opacity=this.opacity;var g=S[12],b=S[13],p=S[14],u=S[15],y=l._ortho||!1,f=y?2:1,P=f*this.pixelRatio*(E[3]*g+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 h(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 m=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 g=(S+_)%3,b=[0,0,0];b[g]=E,w.push(b)}l[_]=w}return l}();function d(l,_,w,S){for(var E=m[S],g=0;g0){var z=y.slice();z[p]+=P[1][p],E.push(y[0],y[1],y[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),h(this.bounds,z),b+=2+d(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=i(_),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=n(_);E.attributes.position.location=0,E.attributes.color.location=1,E.attributes.offset.location=2;var g=new s(_,w,S,E);return g.update(l),g}},3436:function(e,t,r){"use strict";var i=r(3236),a=r(9405),n=i([`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; }`]),o=i([`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,n,o,null,[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"offset",type:"vec3"}])}},2260:function(e,t,r){"use strict";var i=r(7766);e.exports=b;var a=null,n,o,s,c;function h(p){var u=p.getParameter(p.FRAMEBUFFER_BINDING),y=p.getParameter(p.RENDERBUFFER_BINDING),f=p.getParameter(p.TEXTURE_BINDING_2D);return[u,y,f]}function m(p,u){p.bindFramebuffer(p.FRAMEBUFFER,u[0]),p.bindRenderbuffer(p.RENDERBUFFER,u[1]),p.bindTexture(p.TEXTURE_2D,u[2])}function d(p,u){var y=p.getParameter(u.MAX_COLOR_ATTACHMENTS_WEBGL);a=new Array(y+1);for(var f=0;f<=y;++f){for(var P=new Array(y),L=0;L1&&F.drawBuffersWEBGL(a[z]);var U=y.getExtension("WEBGL_depth_texture");U?B?p.depth=l(y,P,L,U.UNSIGNED_INT_24_8_WEBGL,y.DEPTH_STENCIL,y.DEPTH_STENCIL_ATTACHMENT):O&&(p.depth=l(y,P,L,y.UNSIGNED_SHORT,y.DEPTH_COMPONENT,y.DEPTH_ATTACHMENT)):O&&B?p._depth_rb=_(y,P,L,y.DEPTH_STENCIL,y.DEPTH_STENCIL_ATTACHMENT):O?p._depth_rb=_(y,P,L,y.DEPTH_COMPONENT16,y.DEPTH_ATTACHMENT):B&&(p._depth_rb=_(y,P,L,y.STENCIL_INDEX,y.STENCIL_ATTACHMENT));var W=y.checkFramebufferStatus(y.FRAMEBUFFER);if(W!==y.FRAMEBUFFER_COMPLETE){p._destroyed=!0,y.bindFramebuffer(y.FRAMEBUFFER,null),y.deleteFramebuffer(p.handle),p.handle=null,p.depth&&(p.depth.dispose(),p.depth=null),p._depth_rb&&(y.deleteRenderbuffer(p._depth_rb),p._depth_rb=null);for(var N=0;NP||y<0||y>P)throw new Error("gl-fbo: Can't resize FBO, invalid dimensions");p._shape[0]=u,p._shape[1]=y;for(var L=h(f),z=0;zL||y<0||y>L)throw new Error("gl-fbo: Parameters are too large for FBO");f=f||{};var z=1;if("color"in f){if(z=Math.max(f.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(f.float&&z>0){if(!B)throw new Error("gl-fbo: Context does not support floating point textures");F=p.FLOAT}else f.preferFloat&&z>0&&B&&(F=p.FLOAT);var O=!0;"depth"in f&&(O=!!f.depth);var I=!1;return"stencil"in f&&(I=!!f.stencil),new S(p,u,y,F,z,O,I,P)}},2992:function(e,t,r){var i=r(3387).sprintf,a=r(5171),n=r(1848),o=r(1085);e.exports=s;function s(c,h,m){"use strict";var d=n(h)||"of unknown name (see npm glsl-shader-name)",T="unknown type";m!==void 0&&(T=m===a.FRAGMENT_SHADER?"fragment":"vertex");for(var l=i(`Error compiling %s shader %s: `,T,d),_=i("%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=i([`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(h){return a(h,n,o,null,c)},t.createPickShader=function(h){return a(h,n,s,null,c)}},5714:function(e,t,r){"use strict";e.exports=p;var i=r(2762),a=r(8116),n=r(7766),o=new Uint8Array(4),s=new Float32Array(o.buffer);function c(u,y,f,P){return o[0]=P,o[1]=f,o[2]=y,o[3]=u,s[0]}var h=r(2478),m=r(9618),d=r(7319),T=d.createShader,l=d.createPickShader,_=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function w(u,y){for(var f=0,P=0;P<3;++P){var L=u[P]-y[P];f+=L*L}return Math.sqrt(f)}function S(u){for(var y=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],f=0;f<3;++f)y[0][f]=Math.max(u[0][f],y[0][f]),y[1][f]=Math.min(u[1][f],y[1][f]);return y}function E(u,y,f,P){this.arcLength=u,this.position=y,this.index=f,this.dataCoordinate=P}function g(u,y,f,P,L,z){this.gl=u,this.shader=y,this.pickShader=f,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=g.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 y=this.gl,f=this.shader,P=this.vao;f.bind(),f.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:[y.drawingBufferWidth,y.drawingBufferHeight],pixelRatio:this.pixelRatio},P.bind(),P.draw(y.TRIANGLE_STRIP,this.vertexCount),P.unbind()}},b.drawPick=function(u){if(this.vertexCount){var y=this.gl,f=this.pickShader,P=this.vao;f.bind(),f.uniforms={model:u.model||_,view:u.view||_,projection:u.projection||_,pickId:this.pickId,clipBounds:S(this.clipBounds),screenShape:[y.drawingBufferWidth,y.drawingBufferHeight],pixelRatio:this.pixelRatio},P.bind(),P.draw(y.TRIANGLE_STRIP,this.vertexCount),P.unbind()}},b.update=function(u){var y,f;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(y=1;y0){for(var he=0;he<24;++he)L.push(L[L.length-12]);O+=2,Q=!0}continue e}I[0][f]=Math.min(I[0][f],ue[f],se[f]),I[1][f]=Math.max(I[1][f],ue[f],se[f])}var H,$;Array.isArray(U[0])?(H=U.length>y-1?U[y-1]:U.length>0?U[U.length-1]:[0,0,0,1],$=U.length>y?U[y]:U.length>0?U[U.length-1]:[0,0,0,1]):H=$=U,H.length===3&&(H=[H[0],H[1],H[2],1]),$.length===3&&($=[$[0],$[1],$[2],1]),!this.hasAlpha&&H[3]<1&&(this.hasAlpha=!0);var J;Array.isArray(W)?J=W.length>y-1?W[y-1]:W.length>0?W[W.length-1]:[0,0,0,1]:J=W;var X=B;if(B+=w(ue,se),Q){for(f=0;f<2;++f)L.push(ue[0],ue[1],ue[2],se[0],se[1],se[2],X,J,H[0],H[1],H[2],H[3]);O+=2,Q=!1}L.push(ue[0],ue[1],ue[2],se[0],se[1],se[2],X,J,H[0],H[1],H[2],H[3],ue[0],ue[1],ue[2],se[0],se[1],se[2],X,-J,H[0],H[1],H[2],H[3],se[0],se[1],se[2],ue[0],ue[1],ue[2],B,-J,$[0],$[1],$[2],$[3],se[0],se[1],se[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,ne=oe.slice();for(ne.unshift(0),y=1;y1.0001)return null;f+=y[E]}return Math.abs(f-1)>.001?null:[g,c(m,y),y]}},840:function(e,t,r){var i=r(3236),a=i([`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; } `]),n=i([`#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; } `]),o=i([`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=i([`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=i([`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; }`]),h=i([`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; }`]),m=i([`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; }`]),d=i([`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=i([`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=i([`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))); }`]),_=i([`precision highp float; #define GLSLIFY 1 uniform vec3 contourColor; void main() { gl_FragColor = vec4(contourColor, 1.0); } `]);t.meshShader={vertex:a,fragment:n,attributes:[{name:"position",type:"vec3"},{name:"normal",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},t.wireShader={vertex:o,fragment:s,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},t.pointShader={vertex:c,fragment:h,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"pointSize",type:"float"}]},t.pickShader={vertex:m,fragment:d,attributes:[{name:"position",type:"vec3"},{name:"id",type:"vec4"}]},t.pointPickShader={vertex:T,fragment:d,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 i=1e-6,a=1e-6,n=r(9405),o=r(2762),s=r(8116),c=r(7766),h=r(8406),m=r(6760),d=r(7608),T=r(9618),l=r(6729),_=r(7765),w=r(1888),S=r(840),E=r(7626),g=S.meshShader,b=S.wireShader,p=S.pointShader,u=S.pickShader,y=S.pointPickShader,f=S.contourShader,P=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function L(he,H,$,J,X,oe,ne,j,ee,re,ce,be,Ae,ze,Re,We,it,ot,tt,ut,Me,_e,fe,Fe,rt,st,Qe){this.gl=he,this.pixelRatio=1,this.cells=[],this.positions=[],this.intensity=[],this.texture=H,this.dirty=!0,this.triShader=$,this.lineShader=J,this.pointShader=X,this.pickShader=oe,this.pointPickShader=ne,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=We,this.edgeVAO=tt,this.edgeCount=0,this.pointPositions=ut,this.pointColors=_e,this.pointUVs=fe,this.pointSizes=Fe,this.pointIds=Me,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,H){if(!H||!H.length)return 1;for(var $=0;$he&&$>0){var J=(H[$][0]-he)/(H[$][0]-H[$-1][0]);return H[$][1]*(1-J)+J*H[$-1][1]}}return 1}function B(he,H){for(var $=l({colormap:he,nshades:256,format:"rgba"}),J=new Uint8Array(256*4),X=0;X<256;++X){for(var oe=$[X],ne=0;ne<3;++ne)J[4*X+ne]=oe[ne];H?J[4*X+3]=255*F(X/255,H):J[4*X+3]=255*oe[3]}return T(J,[256,256,4],[4,0,1])}function O(he){for(var H=he.length,$=new Array(H),J=0;J0){var Ae=this.triShader;Ae.bind(),Ae.uniforms=j,this.triangleVAO.bind(),H.drawArrays(H.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(),H.lineWidth(this.lineWidth*this.pixelRatio),H.drawArrays(H.LINES,0,this.edgeCount*2),this.edgeVAO.unbind()}if(this.pointCount>0){var Ae=this.pointShader;Ae.bind(),Ae.uniforms=j,this.pointVAO.bind(),H.drawArrays(H.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(),H.drawArrays(H.LINES,0,this.contourCount),this.contourVAO.unbind()}},z.drawPick=function(he){he=he||{};for(var H=this.gl,$=he.model||P,J=he.view||P,X=he.projection||P,oe=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],ne=0;ne<3;++ne)oe[0][ne]=Math.max(oe[0][ne],this.clipBounds[0][ne]),oe[1][ne]=Math.min(oe[1][ne],this.clipBounds[1][ne]);this._model=[].slice.call($),this._view=[].slice.call(J),this._projection=[].slice.call(X),this._resolution=[H.drawingBufferWidth,H.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(),H.drawArrays(H.TRIANGLES,0,this.triangleCount*3),this.triangleVAO.unbind()),this.edgeCount>0&&(this.edgeVAO.bind(),H.lineWidth(this.lineWidth*this.pixelRatio),H.drawArrays(H.LINES,0,this.edgeCount*2),this.edgeVAO.unbind()),this.pointCount>0){var ee=this.pointPickShader;ee.bind(),ee.uniforms=j,this.pointVAO.bind(),H.drawArrays(H.POINTS,0,this.pointCount),this.pointVAO.unbind()}},z.pick=function(he){if(!he||he.id!==this.pickId)return null;for(var H=he.value[0]+256*he.value[1]+65536*he.value[2],$=this.cells[H],J=this.positions,X=new Array($.length),oe=0;oe<$.length;++oe)X[oe]=J[$[oe]];var ne=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:[ne,j],index:H,cell:$,cellId:H,intensity:this.intensity[H],dataCoordinate:be}}var Ae=E(X,[ne*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:H,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 H=n(he,g.vertex,g.fragment);return H.attributes.position.location=0,H.attributes.color.location=2,H.attributes.uv.location=3,H.attributes.normal.location=4,H}function N(he){var H=n(he,b.vertex,b.fragment);return H.attributes.position.location=0,H.attributes.color.location=2,H.attributes.uv.location=3,H}function U(he){var H=n(he,p.vertex,p.fragment);return H.attributes.position.location=0,H.attributes.color.location=2,H.attributes.uv.location=3,H.attributes.pointSize.location=4,H}function W(he){var H=n(he,u.vertex,u.fragment);return H.attributes.position.location=0,H.attributes.id.location=1,H}function Q(he){var H=n(he,y.vertex,y.fragment);return H.attributes.position.location=0,H.attributes.id.location=1,H.attributes.pointSize.location=4,H}function ue(he){var H=n(he,f.vertex,f.fragment);return H.attributes.position.location=0,H}function se(he,H){arguments.length===1&&(H=he,he=H.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),ne=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=o(he),be=o(he),Ae=o(he),ze=o(he),Re=o(he),We=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=o(he),ot=o(he),tt=o(he),ut=o(he),Me=s(he,[{buffer:it,type:he.FLOAT,size:3},{buffer:ut,type:he.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:ot,type:he.FLOAT,size:4},{buffer:tt,type:he.FLOAT,size:2}]),_e=o(he),fe=o(he),Fe=o(he),rt=o(he),st=o(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=o(he),kt=s(he,[{buffer:Lt,type:he.FLOAT,size:3}]),qt=new L(he,re,J,X,oe,ne,j,ee,ce,Re,be,Ae,ze,We,it,ut,ot,tt,Me,_e,st,fe,Fe,rt,Qe,Lt,kt);return qt.update(H),qt}e.exports=se},4437:function(e,t,r){"use strict";e.exports=h;var i=r(3025),a=r(6296),n=r(351),o=r(8512),s=r(24),c=r(7520);function h(m,d){m=m||document.body,d=d||{};var T=[.01,1/0];"distanceLimits"in d&&(T[0]=d.distanceLimits[0],T[1]=d.distanceLimits[1]),"zoomMin"in d&&(T[0]=d.zoomMin),"zoomMax"in d&&(T[1]=d.zoomMax);var l=a({center:d.center||[0,0,0],up:d.up||[0,1,0],eye:d.eye||[0,0,10],mode:d.mode||"orbit",distanceLimits:T}),_=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],w=0,S=m.clientWidth,E=m.clientHeight,g={keyBindingMode:"rotate",enableWheel:!0,view:l,element:m,delay:d.delay||16,rotateSpeed:d.rotateSpeed||1,zoomSpeed:d.zoomSpeed||1,translateSpeed:d.translateSpeed||1,flipX:!!d.flipX,flipY:!!d.flipY,modes:l.modes,_ortho:d._ortho||d.projection&&d.projection.type==="orthographic"||!1,tick:function(){var b=i(),p=this.delay,u=b-2*p;l.idle(b-p),l.recalcMatrix(u),l.flush(b-(100+p*2));for(var y=!0,f=l.computedMatrix,P=0;P<16;++P)y=y&&_[P]===f[P],_[P]=f[P];var L=m.clientWidth===S&&m.clientHeight===E;return S=m.clientWidth,E=m.clientHeight,y?!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(g,{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(),y=l.computedCenter.slice();if(l.setMode(b),b==="turntable"){var f=i();l._active.lookAt(f,u,y,p),l._active.lookAt(f+500,u,y,[0,0,1]),l._active.flush(f)}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}}),m.addEventListener("contextmenu",function(b){return b.preventDefault(),!1}),g._lastX=-1,g._lastY=-1,g._lastMods={shift:!1,control:!1,alt:!1,meta:!1},g.enableMouseListeners=function(){g.mouseListener=n(m,b),m.addEventListener("touchstart",function(p){var u=s(p.changedTouches[0],m);b(0,u[0],u[1],g._lastMods),b(1,u[0],u[1],g._lastMods)},c?{passive:!0}:!1),m.addEventListener("touchmove",function(p){var u=s(p.changedTouches[0],m);b(1,u[0],u[1],g._lastMods),p.preventDefault()},c?{passive:!1}:!1),m.addEventListener("touchend",function(p){b(0,g._lastX,g._lastY,g._lastMods)},c?{passive:!0}:!1);function b(p,u,y,f){var P=g.keyBindingMode;if(P!==!1){var L=P==="rotate",z=P==="pan",F=P==="zoom",B=!!f.control,O=!!f.alt,I=!!f.shift,N=!!(p&1),U=!!(p&2),W=!!(p&4),Q=1/m.clientHeight,ue=Q*(u-g._lastX),se=Q*(y-g._lastY),he=g.flipX?1:-1,H=g.flipY?1:-1,$=Math.PI*g.rotateSpeed,J=i();if(g._lastX!==-1&&g._lastY!==-1&&((L&&N&&!B&&!O&&!I||N&&!B&&!O&&I)&&l.rotate(J,he*$*ue,-H*$*se,0),(z&&N&&!B&&!O&&!I||U||N&&B&&!O&&!I)&&l.pan(J,-g.translateSpeed*ue*w,g.translateSpeed*se*w,0),F&&N&&!B&&!O&&!I||W||N&&!B&&O&&!I)){var X=-g.zoomSpeed*se/window.innerHeight*(J-l.lastT())*100;l.pan(J,0,0,w*(Math.exp(X)-1))}return g._lastX=u,g._lastY=y,g._lastMods=f,!0}}g.wheelListener=o(m,function(p,u){if(g.keyBindingMode!==!1&&g.enableWheel){var y=g.flipX?1:-1,f=g.flipY?1:-1,P=i();if(Math.abs(p)>Math.abs(u))l.rotate(P,0,0,-p*y*Math.PI*g.rotateSpeed/window.innerWidth);else if(!g._ortho){var L=-g.zoomSpeed*f*u/window.innerHeight*(P-l.lastT())/20;l.pan(P,0,0,w*(Math.exp(L)-1))}}},!0)},g.enableMouseListeners(),g}},799:function(e,t,r){var i=r(3236),a=r(9405),n=i([`precision mediump float; #define GLSLIFY 1 attribute vec2 position; varying vec2 uv; void main() { uv = position; gl_Position = vec4(position, 0, 1); }`]),o=i([`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,n,o,null,[{name:"position",type:"vec2"}])}},4100:function(e,t,r){"use strict";var i=r(4437),a=r(3837),n=r(5445),o=r(4449),s=r(3589),c=r(2260),h=r(7169),m=r(351),d=r(4772),T=r(4040),l=r(799),_=r(9216)({tablet:!0,featureDetect:!0});e.exports={createScene:b,createCamera:i};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,y){var f=null;try{f=u.getContext("webgl",y),f||(f=u.getContext("experimental-webgl",y))}catch{return null}return f}function E(u){var y=Math.round(Math.log(Math.abs(u))/Math.log(10));if(y<0){var f=Math.round(Math.pow(10,-y));return Math.ceil(u*f)/f}else if(y>0){var f=Math.round(Math.pow(10,y));return Math.ceil(u/f)*f}return Math.ceil(u)}function g(u){return typeof u=="boolean"?u:!0}function b(u){u=u||{},u.camera=u.camera||{};var y=u.canvas;if(!y)if(y=document.createElement("canvas"),u.container){var f=u.container;f.appendChild(y)}else document.body.appendChild(y);var P=u.gl;if(P||(u.glOptions&&(_=!!u.glOptions.preserveDrawingBuffer),P=S(y,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=o(P,W),ue=[],se=[],he=[],H=[],$=!0,ne=!0,J=new Array(16),X=new Array(16),oe={view:null,projection:J,model:X,_ortho:!1},ne=!0,j=[P.drawingBufferWidth,P.drawingBufferHeight],ee=u.cameraObject||i(y,I),re={gl:P,contextLost:!1,pixelRatio:u.pixelRatio||1,canvas:y,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:g(u.autoResize),autoBounds:g(u.autoBounds),autoScale:!!u.autoScale,autoCenter:g(u.autoCenter),clipToBounds:g(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(ut){this.aspect[0]=ut.x,this.aspect[1]=ut.y,this.aspect[2]=ut.z,ne=!0},setBounds:function(ut,Me){this.bounds[0][ut]=Me.min,this.bounds[1][ut]=Me.max},setClearColor:function(ut){this.clearColor=ut},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 ut=y.parentNode,Me=1,_e=1;ut&&ut!==document.body?(Me=ut.clientWidth,_e=ut.clientHeight):(Me=window.innerWidth,_e=window.innerHeight);var fe=Math.ceil(Me*re.pixelRatio)|0,Fe=Math.ceil(_e*re.pixelRatio)|0;if(fe!==y.width||Fe!==y.height){y.width=fe,y.height=Fe;var rt=y.style;rt.position=rt.position||"absolute",rt.left="0px",rt.top="0px",rt.width=Me+"px",rt.height=_e+"px",$=!0}}}re.autoResize&&be(),window.addEventListener("resize",be);function Ae(){for(var ut=ue.length,Me=H.length,_e=0;_e0&&he[Me-1]===0;)he.pop(),H.pop().dispose()}re.update=function(ut){re._stopped||(ut=ut||{},$=!0,ne=!0)},re.add=function(ut){re._stopped||(ut.axes=U,ue.push(ut),se.push(-1),$=!0,ne=!0,Ae())},re.remove=function(ut){if(!re._stopped){var Me=ue.indexOf(ut);Me<0||(ue.splice(Me,1),se.pop(),$=!0,ne=!0,Ae())}},re.dispose=function(){if(!re._stopped&&(re._stopped=!0,window.removeEventListener("resize",be),y.removeEventListener("webglcontextlost",ze),re.mouseListener.enabled=!1,!re.contextLost)){U.dispose(),Q.dispose();for(var ut=0;utz.distance)continue;for(var kt=0;kt1e-6?(_=Math.acos(w),S=Math.sin(_),E=Math.sin((1-n)*_)/S,g=Math.sin(n*_)/S):(E=1-n,g=n),r[0]=E*o+g*m,r[1]=E*s+g*d,r[2]=E*c+g*T,r[3]=E*h+g*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 i=r(4359);e.exports=n;var a={};function n(o,s,c){var h=[s.style,s.weight,s.variant,s.family].join("_"),m=a[h];if(m||(m=a[h]={}),o in m)return m[o];var d={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}};d.triangles=!0;var T=i(o,d);d.triangles=!1;var l=i(o,d),_,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; } }`]),o=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; } `]),h=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); }`]),m=[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"glyph",type:"vec2"},{name:"id",type:"vec4"}],d={vertex:n,fragment:c,attributes:m},T={vertex:o,fragment:c,attributes:m},l={vertex:s,fragment:c,attributes:m},_={vertex:n,fragment:h,attributes:m},w={vertex:o,fragment:h,attributes:m},S={vertex:s,fragment:h,attributes:m};function E(g,b){var p=i(g,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(g){return E(g,d)},t.createOrtho=function(g){return E(g,T)},t.createProject=function(g){return E(g,l)},t.createPickPerspective=function(g){return E(g,_)},t.createPickOrtho=function(g){return E(g,w)},t.createPickProject=function(g){return E(g,S)}},8418:function(e,t,r){"use strict";var i=r(5219),a=r(2762),n=r(8116),o=r(1888),s=r(6760),c=r(1283),h=r(9366),m=r(5964),d=[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 ne=X[0],j=X[1],ee=X[2],re=X[3];return X[0]=oe[0]*ne+oe[4]*j+oe[8]*ee+oe[12]*re,X[1]=oe[1]*ne+oe[5]*j+oe[9]*ee+oe[13]*re,X[2]=oe[2]*ne+oe[6]*j+oe[10]*ee+oe[14]*re,X[3]=oe[3]*ne+oe[7]*j+oe[11]*ee+oe[15]*re,X}function E(X,oe,ne,j){return S(j,j,ne),S(j,j,oe),S(j,j,X)}function g(X,oe){this.index=X,this.dataCoordinate=this.position=oe}function b(X){return X===!0||X>1?1:X}function p(X,oe,ne,j,ee,re,ce,be,Ae,ze,Re,We){this.gl=X,this.pixelRatio=1,this.shader=oe,this.orthoShader=ne,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=We,this.points=[],this._selectResult=new g(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 y=[0,0],f=[0,0,0],P=[0,0,0],L=[0,0,0,1],z=[0,0,0,1],F=d.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,ne,j){return X[0]=oe[0],X[1]=oe[1],X[2]=oe[2],X[ne]=j,X}function W(X){for(var oe=O,ne=0;ne<2;++ne)for(var j=0;j<3;++j)oe[ne][j]=Math.max(Math.min(X[ne][j],1e8),-1e8);return oe}function Q(X,oe,ne,j){var ee=oe.axesProject,re=oe.gl,ce=X.uniforms,be=ne.model||d,Ae=ne.view||d,ze=ne.projection||d,Re=oe.axesBounds,We=W(oe.clipBounds),it;oe.axes&&oe.axes.lastCubeProps?it=oe.axes.lastCubeProps.axis:it=[1,1,1],y[0]=2/re.drawingBufferWidth,y[1]=2/re.drawingBufferHeight,X.bind(),ce.view=Ae,ce.projection=ze,ce.screenSize=y,ce.highlightId=oe.highlightId,ce.highlightScale=oe.highlightScale,ce.clipBounds=We,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,ut=0;ut<16;++ut)tt[ut]=0;for(var ut=0;ut<4;++ut)tt[5*ut]=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 Me=(ot+1)%3,_e=(ot+2)%3,fe=I(f),Fe=I(P);fe[Me]=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=Me;Me=_e,_e=Lt}rt[0]<0&&(fe[Me]=-1),st[1]>0&&(Fe[_e]=-1);for(var kt=0,qt=0,ut=0;ut<4;++ut)kt+=Math.pow(be[4*Me+ut],2),qt+=Math.pow(be[4*_e+ut],2);fe[Me]/=Math.sqrt(kt),Fe[_e]/=Math.sqrt(qt),ce.axes[0]=fe,ce.axes[1]=Fe,ce.fragClipBounds[0]=U(B,We[0],ot,-1e8),ce.fragClipBounds[1]=U(B,We[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],se=[1e8,1e8,1e8],he=[ue,se];function H(X,oe,ne,j,ee,re,ce){var be=ne.gl;if((re===ne.projectHasAlpha||ce)&&Q(oe,ne,j,ee),re===ne.hasAlpha||ce){X.bind();var Ae=X.uniforms;Ae.model=j.model||d,Ae.view=j.view||d,Ae.projection=j.projection||d,y[0]=2/be.drawingBufferWidth,y[1]=2/be.drawingBufferHeight,Ae.screenSize=y,Ae.highlightId=ne.highlightId,Ae.highlightScale=ne.highlightScale,Ae.fragClipBounds=he,Ae.clipBounds=ne.axes.bounds,Ae.opacity=ne.opacity,Ae.pickGroup=ne.pickId/255,Ae.pixelRatio=ee,ne.vao.bind(),ne.vao.draw(be.TRIANGLES,ne.vertexCount),ne.lineWidth>0&&(be.lineWidth(ne.lineWidth*ee),ne.vao.draw(be.LINES,ne.lineVertexCount,ne.vertexCount)),ne.vao.unbind()}}u.draw=function(X){var oe=this.useOrtho?this.orthoShader:this.shader;H(oe,this.projectShader,this,X,this.pixelRatio,!1,!1)},u.drawTransparent=function(X){var oe=this.useOrtho?this.orthoShader:this.shader;H(oe,this.projectShader,this,X,this.pixelRatio,!0,!1)},u.drawPick=function(X){var oe=this.useOrtho?this.pickOrthoShader:this.pickPerspectiveShader;H(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 ne=this.points[oe],j=this._selectResult;j.index=oe;for(var ee=0;ee<3;++ee)j.position[ee]=j.dataCoordinate[ee]=ne[ee];return j},u.highlight=function(X){if(!X)this.highlightId=[1,1,1,1];else{var oe=X.index,ne=oe&255,j=oe>>8&255,ee=oe>>16&255;this.highlightId=[ne/255,j/255,ee/255,0]}};function $(X,oe,ne,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]),Ee=w(ut)&&w(ut[0]);e:for(var j=0;j0?1-qt[0][0]:Tt<0?1+qt[1][0]:1,Ot*=Ot>0?1-qt[0][1]:Ot<0?1+qt[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(o(_*l*4)),S=0;S<_*l*4;++S)w[S]=255}return T}}}),m.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))},m.end=function(){var T=this.gl;T&&(T.bindFramebuffer(T.FRAMEBUFFER,null),this._readTimeout||clearTimeout(this._readTimeout),this._readTimeout=setTimeout(this._readCallback,1))},m.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,g=Math.min(Math.max(l-_,0),w[1])|0,b=Math.min(Math.max(l+_,0),w[1])|0;if(E<=S||b<=g)return null;var p=[E-S,b-g],u=n(this.buffer,[p[0],p[1],4],[4,w[0]*4,1],4*(S+w[0]*g)),y=s(u.hi(p[0],p[1],1),_,_),f=y[0],P=y[1];if(f<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(){g.program=o.program(b,g._vref,g._fref,L,z);for(var ue=0;ue=0){var u=b.charCodeAt(b.length-1)-48;if(u<2||u>4)throw new i("","Invalid data type for attribute "+g+": "+b);s(m,d,p[0],l,u,_,g)}else if(b.indexOf("mat")>=0){var u=b.charCodeAt(b.length-1)-48;if(u<2||u>4)throw new i("","Invalid data type for attribute "+g+": "+b);c(m,d,p,l,u,_,g)}else throw new i("","Unknown data type for attribute "+g+": "+b);break}}return _}},3327:function(e,t,r){"use strict";var i=r(216),a=r(8866);e.exports=s;function n(c){return function(){return c}}function o(c,h){for(var m=new Array(c),d=0;d4)throw new a("","Invalid data type");switch(U.charAt(0)){case"b":case"i":c["uniform"+W+"iv"](d[z],F);break;case"v":c["uniform"+W+"fv"](d[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"](d[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 y in p){var f=p[y],P=b;parseInt(y)+""===y?P+="["+y+"]":P+="."+y,typeof f=="object"?u.push.apply(u,_(P,f)):u.push([P,f])}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"?o(u,!1):o(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 o(u*u,0)}else throw new a("","Unknown uniform data type for "+name+": "+b)}}function S(b,p,u){if(typeof u=="object"){var y=E(u);Object.defineProperty(b,p,{get:n(y),set:l(u),enumerable:!0,configurable:!1})}else d[u]?Object.defineProperty(b,p,{get:T(u),set:l(u),enumerable:!0,configurable:!1}):b[p]=w(m[u].type)}function E(b){var p;if(Array.isArray(b)){p=new Array(b.length);for(var u=0;u1){m[0]in c||(c[m[0]]=[]),c=c[m[0]];for(var d=1;d1)for(var _=0;_"u"?r(606):WeakMap,o=new n,s=0;function c(S,E,g,b,p,u,y){this.id=S,this.src=E,this.type=g,this.shader=b,this.count=u,this.programs=[],this.cache=y}c.prototype.dispose=function(){if(--this.count===0){for(var S=this.cache,E=S.gl,g=this.programs,b=0,p=g.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; } `]),n=i([`#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; } `]),o=i([`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=i([`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:n,attributes:[{name:"position",type:"vec4"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"vector",type:"vec4"}]},t.pickShader={vertex:o,fragment:s,attributes:[{name:"position",type:"vec4"},{name:"id",type:"vec4"},{name:"vector",type:"vec4"}]}},7815:function(e,t,r){"use strict";var i=r(2931),a=r(9970),n=["xyz","xzy","yxz","yzx","zxy","zyx"],o=function(S,E,g,b){for(var p=S.points,u=S.velocities,y=S.divergences,f=[],P=[],L=[],z=[],F=[],B=[],O=0,I=0,N=a.create(),U=a.create(),W=8,Q=0;Q0)for(var H=0;HE)return b-1}return b},h=function(S,E,g){return Sg?g:S},m=function(S,E,g){var b=E.vectors,p=E.meshgrid,u=S[0],y=S[1],f=S[2],P=p[0].length,L=p[1].length,z=p[2].length,F=c(p[0],u),B=c(p[1],y),O=c(p[2],f),I=F+1,N=B+1,U=O+1;if(F=h(F,0,P-1),I=h(I,0,P-1),B=h(B,0,L-1),N=h(N,0,L-1),O=h(O,0,z-1),U=h(U,0,z-1),F<0||B<0||O<0||I>P-1||N>L-1||U>z-1)return i.create();var W=p[0][F],Q=p[0][I],ue=p[1][B],se=p[1][N],he=p[2][O],H=p[2][U],$=(u-W)/(Q-W),J=(y-ue)/(se-ue),X=(f-he)/(H-he);isFinite($)||($=.5),isFinite(J)||(J=.5),isFinite(X)||(X=.5);var oe,ne,j,ee,re,ce;switch(g.reversedX&&(F=P-1-F,I=P-1-I),g.reversedY&&(B=L-1-B,N=L-1-N),g.reversedZ&&(O=z-1-O,U=z-1-U),g.filled){case 5:re=O,ce=U,j=B*z,ee=N*z,oe=F*z*L,ne=I*z*L;break;case 4:re=O,ce=U,oe=F*z,ne=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,ne=I*L*z;break;case 2:j=B,ee=N,oe=F*L,ne=I*L,re=O*L*P,ce=U*L*P;break;case 1:oe=F,ne=I,re=O*P,ce=U*P,j=B*P*z,ee=N*P*z;break;default:oe=F,ne=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],We=b[ne+j+re],it=b[ne+j+ce],ot=b[ne+ee+re],tt=b[ne+ee+ce],ut=i.create(),Me=i.create(),_e=i.create(),fe=i.create();i.lerp(ut,be,We,$),i.lerp(Me,Ae,it,$),i.lerp(_e,ze,ot,$),i.lerp(fe,Re,tt,$);var Fe=i.create(),rt=i.create();i.lerp(Fe,ut,_e,J),i.lerp(rt,Me,fe,J);var st=i.create();return i.lerp(st,Fe,rt,X),st},d=function(S,E){var g=E[0],b=E[1],p=E[2];return S[0]=g<0?-g:g,S[1]=b<0?-b:b,S[2]=p<0?-p:p,S},T=function(S){var E=1/0;S.sort(function(u,y){return u-y});for(var g=S.length,b=1;bI||ttN||utU)},Q=i.distance(E[0],E[1]),ue=10*Q/b,se=ue*ue,he=1,H=0,$=g.length;$>1&&(he=l(g));for(var J=0;J<$;J++){var X=i.create();i.copy(X,g[J]);var oe=[X],ne=[],j=P(X),ee=X;ne.push(j);var re=[],ce=L(X,j),be=i.length(ce);isFinite(be)&&be>H&&(H=be),re.push(be),z.push({points:oe,velocities:ne,divergences:re});for(var Ae=0;Aese&&i.scale(ze,ze,ue/Math.sqrt(Re)),i.add(ze,ze,X),j=P(ze),i.squaredDistance(ee,ze)-se>-1e-4*se){oe.push(ze),ee=ze,ne.push(j);var ce=L(ze,j),be=i.length(ce);isFinite(be)&&be>H&&(H=be),re.push(be)}X=ze}}var We=s(z,S.colormap,H,he);return u?We.tubeScale=u:(H===0&&(H=1),We.tubeScale=p*.5*he/H),We};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 i=r(9405),a=r(3236),n=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); } `]),o=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(h){var m=i(h,n,o,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return m.attributes.uv.location=0,m.attributes.f.location=1,m.attributes.normal.location=2,m},t.createPickShader=function(h){var m=i(h,n,c,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return m.attributes.uv.location=0,m.attributes.f.location=1,m.attributes.normal.location=2,m},t.createContourShader=function(h){var m=i(h,s,o,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return m.attributes.uv.location=0,m.attributes.f.location=1,m},t.createPickContourShader=function(h){var m=i(h,s,c,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return m.attributes.uv.location=0,m.attributes.f.location=1,m}},9499:function(e,t,r){"use strict";e.exports=oe;var i=r(8828),a=r(2762),n=r(8116),o=r(7766),s=r(1888),c=r(6729),h=r(5298),m=r(9994),d=r(9618),T=r(3711),l=r(6760),_=r(7608),w=r(2478),S=r(6199),E=r(990),g=E.createShader,b=E.createContourShader,p=E.createPickShader,u=E.createPickContourShader,y=4*10,f=[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 ne=0;ne<3;++ne){var j=L[ne],ee=(ne+1)%3,re=(ne+2)%3;j[ee+0]=1,j[re+3]=1,j[ne+6]=1}})();function z(ne,j,ee,re,ce){this.position=ne,this.index=j,this.uv=ee,this.level=re,this.dataCoordinate=ce}var F=256;function B(ne,j,ee,re,ce,be,Ae,ze,Re,We,it,ot,tt,ut,Me){this.gl=ne,this.shape=j,this.bounds=ee,this.objectOffset=Me,this.intensityBounds=[],this._shader=re,this._pickShader=ce,this._coordinateBuffer=be,this._vao=Ae,this._colorMap=ze,this._contourShader=Re,this._contourPickShader=We,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=ut,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=[d(s.mallocFloat(1024),[0,0]),d(s.mallocFloat(1024),[0,0]),d(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(ne,j){var ee=!1,re=m([c({colormap:ne,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 h.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(ne){this.pickId=ne};function I(ne,j){if(!j||!j.length)return 1;for(var ee=0;eene&&ee>0){var re=(j[ee][0]-ne)/(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:[f.slice(),f.slice(),f.slice()],clipBounds:[[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]]]};function W(ne,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,ne.model,Re);var We=U.clipBounds[ee];for(ce=0;ce<2;++ce)for(re=0;re<3;++re)We[ce][re]=ne.clipBounds[ce][re];We[0][ee]=-1e8,We[1][ee]=1e8}return U.showSurface=Ae,U.showContour=ze,U}var Q={model:f,view:f,projection:f,inverseModel:f.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=f.slice(),se=[1,0,0,0,1,0,0,0,1];function he(ne,j){ne=ne||{};var ee=this.gl;ee.disable(ee.CULL_FACE),this._colorMap.bind(0);var re=Q;re.model=ne.model||f,re.view=ne.view||f,re.projection=ne.projection||f,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=se,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 We=ze[12+ce];for(Ae=0;Ae<3;++Ae)We+=ze[4*Ae+ce]*this.lightPosition[Ae];re.lightPosition[ce]=We/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]*(ne.value[1]+(ne.value[2]&15)/16)/255,ze=Math.floor(Ae),Re=Ae-ze;ce+=1,ze+=1;var We=ee.position;We[0]=We[1]=We[2]=0;for(var it=0;it<2;++it)for(var ot=it?be:1-be,tt=0;tt<2;++tt)for(var ut=tt?Re:1-Re,Me=ce+it,_e=ze+tt,fe=ot*ut,Fe=0;Fe<3;++Fe)We[Fe]+=this._field[Fe].get(Me,_e)*fe;for(var rt=this._pickResult.level,st=0;st<3;++st)if(rt[st]=w.le(this.contourLevels[st],We[st]),rt[st]<0)this.contourLevels[st].length>0&&(rt[st]=0);else if(rt[st]Math.abs(Lt-We[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(ne,j){var ee=j.shape.slice(),re=ne.shape.slice();h.assign(ne.lo(1,1).hi(ee[0],ee[1]),j),h.assign(ne.lo(1).hi(ee[0],1),j.hi(ee[0],1)),h.assign(ne.lo(1,re[1]-1).hi(ee[0],1),j.lo(0,ee[1]-1).hi(ee[0],1)),h.assign(ne.lo(0,1).hi(1,ee[1]),j.hi(1)),h.assign(ne.lo(re[0]-1,1).hi(1,ee[1]),j.lo(ee[0]-1)),ne.set(0,0,j.get(0,0)),ne.set(0,re[1]-1,j.get(0,ee[1]-1)),ne.set(re[0]-1,0,j.get(ee[0]-1,0)),ne.set(re[0]-1,re[1]-1,j.get(ee[0]-1,ee[1]-1))};function $(ne,j){return Array.isArray(ne)?[j(ne[0]),j(ne[1]),j(ne[2])]:[j(ne),j(ne),j(ne)]}function J(ne){return Array.isArray(ne)?ne.length===3?[ne[0],ne[1],ne[2],1]:[ne[0],ne[1],ne[2],ne[3]]:[0,0,0,1]}function X(ne){if(Array.isArray(ne)){if(Array.isArray(ne))return[J(ne[0]),J(ne[1]),J(ne[2])];var j=J(ne);return[j.slice(),j.slice(),j.slice()]}}O.update=function(ne){ne=ne||{},this.objectOffset=ne.objectOffset||this.objectOffset,this.dirty=!0,"contourWidth"in ne&&(this.contourWidth=$(ne.contourWidth,Number)),"showContour"in ne&&(this.showContour=$(ne.showContour,Boolean)),"showSurface"in ne&&(this.showSurface=!!ne.showSurface),"contourTint"in ne&&(this.contourTint=$(ne.contourTint,Boolean)),"contourColor"in ne&&(this.contourColor=X(ne.contourColor)),"contourProject"in ne&&(this.contourProject=$(ne.contourProject,function(yn){return $(yn,Boolean)})),"surfaceProject"in ne&&(this.surfaceProject=ne.surfaceProject),"dynamicColor"in ne&&(this.dynamicColor=X(ne.dynamicColor)),"dynamicTint"in ne&&(this.dynamicTint=$(ne.dynamicTint,Number)),"dynamicWidth"in ne&&(this.dynamicWidth=$(ne.dynamicWidth,Number)),"opacity"in ne&&(this.opacity=ne.opacity),"opacityscale"in ne&&(this.opacityscale=ne.opacityscale),"colorBounds"in ne&&(this.colorBounds=ne.colorBounds),"vertexColor"in ne&&(this.vertexColor=ne.vertexColor?1:0),"colormap"in ne&&this._colorMap.setPixels(this.genColormap(ne.colormap,this.opacityscale));var j=ne.field||ne.coords&&ne.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 ne||"coords"in ne){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(i.nextPow2(re))),this._field[2]=d(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]=d(this._field[be].data,[ce[0]+2,ce[1]+2]);if(ne.coords){var Ae=ne.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(ne.ticks){var Re=ne.ticks;if(!Array.isArray(Re)||Re.length!==2)throw new Error("gl-surface: invalid ticks");for(be=0;be<2;++be){var We=Re[be];if((Array.isArray(We)||We.length)&&(We=d(We)),We.shape[0]!==ce[be])throw new Error("gl-surface: invalid tick length");var it=d(We.data,ce);it.stride[be]=We.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]=d(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 rn=0;rn<5;++rn)rr.pop();Ue-=1}continue e}}}Ua.push(Ue)}this._contourOffsets[Qt]=la,this._contourCounts[Qt]=Ua}var nn=s.mallocFloat(rr.length);for(be=0;bez||P<0||P>z)throw new Error("gl-texture2d: Invalid texture size");return y._shape=[f,P],y.bind(),L.texImage2D(L.TEXTURE_2D,0,y.format,f,P,0,y.format,y.type,null),y._mipLevels=[0],y}function l(y,f,P,L,z,F){this.gl=y,this.handle=f,this.format=z,this.type=F,this._shape=[P,L],this._mipLevels=[0],this._magFilter=y.NEAREST,this._minFilter=y.NEAREST,this._wrapS=y.CLAMP_TO_EDGE,this._wrapT=y.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(y){this.bind();var f=this.gl;if(this.type===f.FLOAT&&o.indexOf(y)>=0&&(f.getExtension("OES_texture_float_linear")||(y=f.NEAREST)),s.indexOf(y)<0)throw new Error("gl-texture2d: Unknown filter mode "+y);return f.texParameteri(f.TEXTURE_2D,f.TEXTURE_MIN_FILTER,y),this._minFilter=y}},magFilter:{get:function(){return this._magFilter},set:function(y){this.bind();var f=this.gl;if(this.type===f.FLOAT&&o.indexOf(y)>=0&&(f.getExtension("OES_texture_float_linear")||(y=f.NEAREST)),s.indexOf(y)<0)throw new Error("gl-texture2d: Unknown filter mode "+y);return f.texParameteri(f.TEXTURE_2D,f.TEXTURE_MAG_FILTER,y),this._magFilter=y}},mipSamples:{get:function(){return this._anisoSamples},set:function(y){var f=this._anisoSamples;if(this._anisoSamples=Math.max(y,1)|0,f!==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(y){if(this.bind(),c.indexOf(y)<0)throw new Error("gl-texture2d: Unknown wrap mode "+y);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,y),this._wrapS=y}},wrapT:{get:function(){return this._wrapT},set:function(y){if(this.bind(),c.indexOf(y)<0)throw new Error("gl-texture2d: Unknown wrap mode "+y);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,y),this._wrapT=y}},wrap:{get:function(){return this._wrapVector},set:function(y){if(Array.isArray(y)||(y=[y,y]),y.length!==2)throw new Error("gl-texture2d: Must specify wrap mode for rows and columns");for(var f=0;f<2;++f)if(c.indexOf(y[f])<0)throw new Error("gl-texture2d: Unknown wrap mode "+y);this._wrapS=y[0],this._wrapT=y[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),y}},shape:{get:function(){return this._shapeVector},set:function(y){if(!Array.isArray(y))y=[y|0,y|0];else if(y.length!==2)throw new Error("gl-texture2d: Invalid texture shape");return T(this,y[0]|0,y[1]|0),[y[0]|0,y[1]|0]}},width:{get:function(){return this._shape[0]},set:function(y){return y=y|0,T(this,y,this._shape[1]),y}},height:{get:function(){return this._shape[1]},set:function(y){return y=y|0,T(this,this._shape[0],y),y}}}),_.bind=function(y){var f=this.gl;return y!==void 0&&f.activeTexture(f.TEXTURE0+(y|0)),f.bindTexture(f.TEXTURE_2D,this.handle),y!==void 0?y|0:f.getParameter(f.ACTIVE_TEXTURE)-f.TEXTURE0},_.dispose=function(){this.gl.deleteTexture(this.handle)},_.generateMipmap=function(){this.bind(),this.gl.generateMipmap(this.gl.TEXTURE_2D);for(var y=Math.min(this._shape[0],this._shape[1]),f=0;y>0;++f,y>>>=1)this._mipLevels.indexOf(f)<0&&this._mipLevels.push(f)},_.setPixels=function(y,f,P,L){var z=this.gl;this.bind(),Array.isArray(f)?(L=P,P=f[1]|0,f=f[0]|0):(f=f||0,P=P||0),L=L||0;var F=m(y)?y:y.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,f,P,this.format,this.type,F)}else if(y.shape&&y.stride&&y.data){if(y.shape.length<2||f+y.shape[1]>this._shape[1]>>>L||P+y.shape[0]>this._shape[0]>>>L||f<0||P<0)throw new Error("gl-texture2d: Texture dimensions are out of bounds");S(z,f,P,L,this.format,this.type,this._mipLevels,y)}else throw new Error("gl-texture2d: Unsupported data type")};function w(y,f){return y.length===3?f[2]===1&&f[1]===y[0]*y[2]&&f[0]===y[2]:f[0]===1&&f[1]===y[0]}function S(y,f,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=y.FLOAT:I==="float64"?(U=y.FLOAT,Q=!1,I="float32"):I==="uint8"?U=y.UNSIGNED_BYTE:(U=y.UNSIGNED_BYTE,Q=!1,I="uint8");var ue=1;if(N.length===2)W=y.LUMINANCE,N=[N[0],N[1],1],O=i(O.data,N,[O.stride[0],O.stride[1],1],O.offset);else if(N.length===3){if(N[2]===1)W=y.ALPHA;else if(N[2]===2)W=y.LUMINANCE_ALPHA;else if(N[2]===3)W=y.RGB;else if(N[2]===4)W=y.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===y.LUMINANCE||W===y.ALPHA)&&(z===y.LUMINANCE||z===y.ALPHA)&&(W=z),W!==z)throw new Error("gl-texture2d: Incompatible texture format for setPixels");var se=O.size,he=B.indexOf(L)<0;if(he&&B.push(L),U===F&&Q)O.offset===0&&O.data.length===se?he?y.texImage2D(y.TEXTURE_2D,L,z,N[0],N[1],0,z,F,O.data):y.texSubImage2D(y.TEXTURE_2D,L,f,P,N[0],N[1],z,F,O.data):he?y.texImage2D(y.TEXTURE_2D,L,z,N[0],N[1],0,z,F,O.data.subarray(O.offset,O.offset+se)):y.texSubImage2D(y.TEXTURE_2D,L,f,P,N[0],N[1],z,F,O.data.subarray(O.offset,O.offset+se));else{var H;F===y.FLOAT?H=n.mallocFloat32(se):H=n.mallocUint8(se);var $=i(H,N,[N[2],N[2]*N[0],1]);U===y.FLOAT&&F===y.UNSIGNED_BYTE?d($,O):a.assign($,O),he?y.texImage2D(y.TEXTURE_2D,L,z,N[0],N[1],0,z,F,H.subarray(0,se)):y.texSubImage2D(y.TEXTURE_2D,L,f,P,N[0],N[1],z,F,H.subarray(0,se)),F===y.FLOAT?n.freeFloat32(H):n.freeUint8(H)}}function E(y){var f=y.createTexture();return y.bindTexture(y.TEXTURE_2D,f),y.texParameteri(y.TEXTURE_2D,y.TEXTURE_MIN_FILTER,y.NEAREST),y.texParameteri(y.TEXTURE_2D,y.TEXTURE_MAG_FILTER,y.NEAREST),y.texParameteri(y.TEXTURE_2D,y.TEXTURE_WRAP_S,y.CLAMP_TO_EDGE),y.texParameteri(y.TEXTURE_2D,y.TEXTURE_WRAP_T,y.CLAMP_TO_EDGE),f}function g(y,f,P,L,z){var F=y.getParameter(y.MAX_TEXTURE_SIZE);if(f<0||f>F||P<0||P>F)throw new Error("gl-texture2d: Invalid texture shape");if(z===y.FLOAT&&!y.getExtension("OES_texture_float"))throw new Error("gl-texture2d: Floating point textures not supported on this platform");var B=E(y);return y.texImage2D(y.TEXTURE_2D,0,L,f,P,0,L,z,null),new l(y,B,f,P,L,z)}function b(y,f,P,L,z,F){var B=E(y);return y.texImage2D(y.TEXTURE_2D,0,z,z,F,f),new l(y,B,P,L,z,F)}function p(y,f){var P=f.dtype,L=f.shape.slice(),z=y.getParameter(y.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,f.stride.slice()),B=0;P==="float32"?B=y.FLOAT:P==="float64"?(B=y.FLOAT,F=!1,P="float32"):P==="uint8"?B=y.UNSIGNED_BYTE:(B=y.UNSIGNED_BYTE,F=!1,P="uint8");var O=0;if(L.length===2)O=y.LUMINANCE,L=[L[0],L[1],1],f=i(f.data,L,[f.stride[0],f.stride[1],1],f.offset);else if(L.length===3)if(L[2]===1)O=y.ALPHA;else if(L[2]===2)O=y.LUMINANCE_ALPHA;else if(L[2]===3)O=y.RGB;else if(L[2]===4)O=y.RGBA;else throw new Error("gl-texture2d: Invalid shape for pixel coords");else throw new Error("gl-texture2d: Invalid shape for texture");B===y.FLOAT&&!y.getExtension("OES_texture_float")&&(B=y.UNSIGNED_BYTE,F=!1);var I,N,U=f.size;if(F)f.offset===0&&f.data.length===U?I=f.data:I=f.data.subarray(f.offset,f.offset+U);else{var W=[L[2],L[2]*L[0],1];N=n.malloc(U,P);var Q=i(N,L,W,0);(P==="float32"||P==="float64")&&B===y.UNSIGNED_BYTE?d(Q,f):a.assign(Q,f),I=N.subarray(0,U)}var ue=E(y);return y.texImage2D(y.TEXTURE_2D,0,O,L[0],L[1],0,O,B,I),F||n.free(N),new l(y,ue,L[0],L[1],O,B)}function u(y){if(arguments.length<=1)throw new Error("gl-texture2d: Missing arguments for texture2d constructor");if(o||h(y),typeof arguments[1]=="number")return g(y,arguments[1],arguments[2],arguments[3]||y.RGBA,arguments[4]||y.UNSIGNED_BYTE);if(Array.isArray(arguments[1]))return g(y,arguments[1][0]|0,arguments[1][1]|0,arguments[2]||y.RGBA,arguments[3]||y.UNSIGNED_BYTE);if(typeof arguments[1]=="object"){var f=arguments[1],P=m(f)?f:f.raw;if(P)return b(y,P,f.width|0,f.height|0,arguments[2]||y.RGBA,arguments[3]||y.UNSIGNED_BYTE);if(f.shape&&f.data&&f.stride)return p(y,f)}throw new Error("gl-texture2d: Invalid arguments for texture2d constructor")}},1433:function(e){"use strict";function t(r,i,a){i?i.bind():r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,null);var n=r.getParameter(r.MAX_VERTEX_ATTRIBS)|0;if(a){if(a.length>n)throw new Error("gl-vao: Too many vertex attributes");for(var o=0;o1?0:Math.acos(d)}},9226:function(e){e.exports=t;function t(r,i){return r[0]=Math.ceil(i[0]),r[1]=Math.ceil(i[1]),r[2]=Math.ceil(i[2]),r}},3126:function(e){e.exports=t;function t(r){var i=new Float32Array(3);return i[0]=r[0],i[1]=r[1],i[2]=r[2],i}},3990:function(e){e.exports=t;function t(r,i){return r[0]=i[0],r[1]=i[1],r[2]=i[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,i,a){var n=i[0],o=i[1],s=i[2],c=a[0],h=a[1],m=a[2];return r[0]=o*m-s*h,r[1]=s*c-n*m,r[2]=n*h-o*c,r}},5455:function(e,t,r){e.exports=r(7056)},7056:function(e){e.exports=t;function t(r,i){var a=i[0]-r[0],n=i[1]-r[1],o=i[2]-r[2];return Math.sqrt(a*a+n*n+o*o)}},4008:function(e,t,r){e.exports=r(6690)},6690:function(e){e.exports=t;function t(r,i,a){return r[0]=i[0]/a[0],r[1]=i[1]/a[1],r[2]=i[2]/a[2],r}},244:function(e){e.exports=t;function t(r,i){return r[0]*i[0]+r[1]*i[1]+r[2]*i[2]}},2613:function(e){e.exports=1e-6},9922:function(e,t,r){e.exports=a;var i=r(2613);function a(n,o){var s=n[0],c=n[1],h=n[2],m=o[0],d=o[1],T=o[2];return Math.abs(s-m)<=i*Math.max(1,Math.abs(s),Math.abs(m))&&Math.abs(c-d)<=i*Math.max(1,Math.abs(c),Math.abs(d))&&Math.abs(h-T)<=i*Math.max(1,Math.abs(h),Math.abs(T))}},9265:function(e){e.exports=t;function t(r,i){return r[0]===i[0]&&r[1]===i[1]&&r[2]===i[2]}},2681:function(e){e.exports=t;function t(r,i){return r[0]=Math.floor(i[0]),r[1]=Math.floor(i[1]),r[2]=Math.floor(i[2]),r}},5137:function(e,t,r){e.exports=a;var i=r(1091)();function a(n,o,s,c,h,m){var d,T;for(o||(o=3),s||(s=0),c?T=Math.min(c*o+s,n.length):T=n.length,d=s;d0&&(s=1/Math.sqrt(s),r[0]=i[0]*s,r[1]=i[1]*s,r[2]=i[2]*s),r}},7636:function(e){e.exports=t;function t(r,i){i=i||1;var a=Math.random()*2*Math.PI,n=Math.random()*2-1,o=Math.sqrt(1-n*n)*i;return r[0]=Math.cos(a)*o,r[1]=Math.sin(a)*o,r[2]=n*i,r}},6894:function(e){e.exports=t;function t(r,i,a,n){var o=a[1],s=a[2],c=i[1]-o,h=i[2]-s,m=Math.sin(n),d=Math.cos(n);return r[0]=i[0],r[1]=o+c*d-h*m,r[2]=s+c*m+h*d,r}},109:function(e){e.exports=t;function t(r,i,a,n){var o=a[0],s=a[2],c=i[0]-o,h=i[2]-s,m=Math.sin(n),d=Math.cos(n);return r[0]=o+h*m+c*d,r[1]=i[1],r[2]=s+h*d-c*m,r}},8692:function(e){e.exports=t;function t(r,i,a,n){var o=a[0],s=a[1],c=i[0]-o,h=i[1]-s,m=Math.sin(n),d=Math.cos(n);return r[0]=o+c*d-h*m,r[1]=s+c*m+h*d,r[2]=i[2],r}},2447:function(e){e.exports=t;function t(r,i){return r[0]=Math.round(i[0]),r[1]=Math.round(i[1]),r[2]=Math.round(i[2]),r}},6621:function(e){e.exports=t;function t(r,i,a){return r[0]=i[0]*a,r[1]=i[1]*a,r[2]=i[2]*a,r}},8489:function(e){e.exports=t;function t(r,i,a,n){return r[0]=i[0]+a[0]*n,r[1]=i[1]+a[1]*n,r[2]=i[2]+a[2]*n,r}},1463:function(e){e.exports=t;function t(r,i,a,n){return r[0]=i,r[1]=a,r[2]=n,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,i){var a=i[0]-r[0],n=i[1]-r[1],o=i[2]-r[2];return a*a+n*n+o*o}},3066:function(e){e.exports=t;function t(r){var i=r[0],a=r[1],n=r[2];return i*i+a*a+n*n}},2229:function(e,t,r){e.exports=r(6843)},6843:function(e){e.exports=t;function t(r,i,a){return r[0]=i[0]-a[0],r[1]=i[1]-a[1],r[2]=i[2]-a[2],r}},492:function(e){e.exports=t;function t(r,i,a){var n=i[0],o=i[1],s=i[2];return r[0]=n*a[0]+o*a[3]+s*a[6],r[1]=n*a[1]+o*a[4]+s*a[7],r[2]=n*a[2]+o*a[5]+s*a[8],r}},5673:function(e){e.exports=t;function t(r,i,a){var n=i[0],o=i[1],s=i[2],c=a[3]*n+a[7]*o+a[11]*s+a[15];return c=c||1,r[0]=(a[0]*n+a[4]*o+a[8]*s+a[12])/c,r[1]=(a[1]*n+a[5]*o+a[9]*s+a[13])/c,r[2]=(a[2]*n+a[6]*o+a[10]*s+a[14])/c,r}},264:function(e){e.exports=t;function t(r,i,a){var n=i[0],o=i[1],s=i[2],c=a[0],h=a[1],m=a[2],d=a[3],T=d*n+h*s-m*o,l=d*o+m*n-c*s,_=d*s+c*o-h*n,w=-c*n-h*o-m*s;return r[0]=T*d+w*-c+l*-m-_*-h,r[1]=l*d+w*-h+_*-c-T*-m,r[2]=_*d+w*-m+T*-h-l*-c,r}},4361:function(e){e.exports=t;function t(r,i,a){return r[0]=i[0]+a[0],r[1]=i[1]+a[1],r[2]=i[2]+a[2],r[3]=i[3]+a[3],r}},2335:function(e){e.exports=t;function t(r){var i=new Float32Array(4);return i[0]=r[0],i[1]=r[1],i[2]=r[2],i[3]=r[3],i}},2933:function(e){e.exports=t;function t(r,i){return r[0]=i[0],r[1]=i[1],r[2]=i[2],r[3]=i[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,i){var a=i[0]-r[0],n=i[1]-r[1],o=i[2]-r[2],s=i[3]-r[3];return Math.sqrt(a*a+n*n+o*o+s*s)}},1373:function(e){e.exports=t;function t(r,i,a){return r[0]=i[0]/a[0],r[1]=i[1]/a[1],r[2]=i[2]/a[2],r[3]=i[3]/a[3],r}},3750:function(e){e.exports=t;function t(r,i){return r[0]*i[0]+r[1]*i[1]+r[2]*i[2]+r[3]*i[3]}},3390:function(e){e.exports=t;function t(r,i,a,n){var o=new Float32Array(4);return o[0]=r,o[1]=i,o[2]=a,o[3]=n,o}},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,i){return r[0]=1/i[0],r[1]=1/i[1],r[2]=1/i[2],r[3]=1/i[3],r}},6808:function(e){e.exports=t;function t(r){var i=r[0],a=r[1],n=r[2],o=r[3];return Math.sqrt(i*i+a*a+n*n+o*o)}},2573:function(e){e.exports=t;function t(r,i,a,n){var o=i[0],s=i[1],c=i[2],h=i[3];return r[0]=o+n*(a[0]-o),r[1]=s+n*(a[1]-s),r[2]=c+n*(a[2]-c),r[3]=h+n*(a[3]-h),r}},160:function(e){e.exports=t;function t(r,i,a){return r[0]=Math.max(i[0],a[0]),r[1]=Math.max(i[1],a[1]),r[2]=Math.max(i[2],a[2]),r[3]=Math.max(i[3],a[3]),r}},2334:function(e){e.exports=t;function t(r,i,a){return r[0]=Math.min(i[0],a[0]),r[1]=Math.min(i[1],a[1]),r[2]=Math.min(i[2],a[2]),r[3]=Math.min(i[3],a[3]),r}},3576:function(e){e.exports=t;function t(r,i,a){return r[0]=i[0]*a[0],r[1]=i[1]*a[1],r[2]=i[2]*a[2],r[3]=i[3]*a[3],r}},1498:function(e){e.exports=t;function t(r,i){return r[0]=-i[0],r[1]=-i[1],r[2]=-i[2],r[3]=-i[3],r}},5177:function(e){e.exports=t;function t(r,i){var a=i[0],n=i[1],o=i[2],s=i[3],c=a*a+n*n+o*o+s*s;return c>0&&(c=1/Math.sqrt(c),r[0]=a*c,r[1]=n*c,r[2]=o*c,r[3]=s*c),r}},9131:function(e,t,r){var i=r(5177),a=r(9288);e.exports=n;function n(o,s){return s=s||1,o[0]=Math.random(),o[1]=Math.random(),o[2]=Math.random(),o[3]=Math.random(),i(o,o),a(o,o,s),o}},9288:function(e){e.exports=t;function t(r,i,a){return r[0]=i[0]*a,r[1]=i[1]*a,r[2]=i[2]*a,r[3]=i[3]*a,r}},4844:function(e){e.exports=t;function t(r,i,a,n){return r[0]=i[0]+a[0]*n,r[1]=i[1]+a[1]*n,r[2]=i[2]+a[2]*n,r[3]=i[3]+a[3]*n,r}},4578:function(e){e.exports=t;function t(r,i,a,n,o){return r[0]=i,r[1]=a,r[2]=n,r[3]=o,r}},7960:function(e){e.exports=t;function t(r,i){var a=i[0]-r[0],n=i[1]-r[1],o=i[2]-r[2],s=i[3]-r[3];return a*a+n*n+o*o+s*s}},483:function(e){e.exports=t;function t(r){var i=r[0],a=r[1],n=r[2],o=r[3];return i*i+a*a+n*n+o*o}},6860:function(e){e.exports=t;function t(r,i,a){return r[0]=i[0]-a[0],r[1]=i[1]-a[1],r[2]=i[2]-a[2],r[3]=i[3]-a[3],r}},5352:function(e){e.exports=t;function t(r,i,a){var n=i[0],o=i[1],s=i[2],c=i[3];return r[0]=a[0]*n+a[4]*o+a[8]*s+a[12]*c,r[1]=a[1]*n+a[5]*o+a[9]*s+a[13]*c,r[2]=a[2]*n+a[6]*o+a[10]*s+a[14]*c,r[3]=a[3]*n+a[7]*o+a[11]*s+a[15]*c,r}},4041:function(e){e.exports=t;function t(r,i,a){var n=i[0],o=i[1],s=i[2],c=a[0],h=a[1],m=a[2],d=a[3],T=d*n+h*s-m*o,l=d*o+m*n-c*s,_=d*s+c*o-h*n,w=-c*n-h*o-m*s;return r[0]=T*d+w*-c+l*-m-_*-h,r[1]=l*d+w*-h+_*-c-T*-m,r[2]=_*d+w*-m+T*-h-l*-c,r[3]=i[3],r}},1848:function(e,t,r){var i=r(4905),a=r(6468);e.exports=n;function n(o){for(var s=Array.isArray(o)?o:i(o),c=0;c0)continue;st=fe.slice(0,1).join("")}return ee(st),se+=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 ut(){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 Me(){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=g:ne[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 i=r(6852);i=i.slice().filter(function(a){return!/^(gl\_|texture)/.test(a)}),e.exports=i.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 i=r(620);e.exports=i.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 i=r(5874);e.exports=a;function a(n,o){var s=i(o),c=[];return c=c.concat(s(n)),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),i=[],a=0;a>1,T=-7,l=a?o-1:0,_=a?-1:1,w=r[i+l];for(l+=_,s=w&(1<<-T)-1,w>>=-T,T+=h;T>0;s=s*256+r[i+l],l+=_,T-=8);for(c=s&(1<<-T)-1,s>>=-T,T+=n;T>0;c=c*256+r[i+l],l+=_,T-=8);if(s===0)s=1-d;else{if(s===m)return c?NaN:(w?-1:1)*(1/0);c=c+Math.pow(2,n),s=s-d}return(w?-1:1)*c*Math.pow(2,s-n)},t.write=function(r,i,a,n,o,s){var c,h,m,d=s*8-o-1,T=(1<>1,_=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,w=n?0:s-1,S=n?1:-1,E=i<0||i===0&&1/i<0?1:0;for(i=Math.abs(i),isNaN(i)||i===1/0?(h=isNaN(i)?1:0,c=T):(c=Math.floor(Math.log(i)/Math.LN2),i*(m=Math.pow(2,-c))<1&&(c--,m*=2),c+l>=1?i+=_/m:i+=_*Math.pow(2,1-l),i*m>=2&&(c++,m/=2),c+l>=T?(h=0,c=T):c+l>=1?(h=(i*m-1)*Math.pow(2,o),c=c+l):(h=i*Math.pow(2,l-1)*Math.pow(2,o),c=0));o>=8;r[a+w]=h&255,w+=S,h/=256,o-=8);for(c=c<0;r[a+w]=c&255,w+=S,c/=256,d-=8);r[a+w-S]|=E*128}},8954:function(e,t,r){"use strict";e.exports=l;var i=r(3250),a=r(6803).Fw;function n(_,w,S){this.vertices=_,this.adjacent=w,this.boundary=S,this.lastVisited=-1}n.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 o(_,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 h(_){var w=i[_+1];return w||(w=i),c(w)}var m=[];function d(_,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 g=m[_];g||(g=m[_]=h(_)),this.orient=g}var T=d.prototype;T.handleBoundaryDegeneracy=function(_,w){var S=this.dimension,E=this.vertices.length-1,g=this.tuple,b=this.vertices,p=[_];for(_.lastVisited=-E;p.length>0;){_=p.pop();for(var u=_.adjacent,y=0;y<=S;++y){var f=u[y];if(!(!f.boundary||f.lastVisited<=-E)){for(var P=f.vertices,L=0;L<=S;++L){var z=P[L];z<0?g[L]=w:g[L]=b[z]}var F=this.orient();if(F>0)return f;f.lastVisited=-E,F===0&&p.push(f)}}}return null},T.walk=function(_,w){var S=this.vertices.length-1,E=this.dimension,g=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 y=u.vertices,f=u.adjacent,P=0;P<=E;++P)b[P]=g[y[P]];u.lastVisited=S;for(var P=0;P<=E;++P){var L=f[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,g=this.vertices,b=this.tuple,p=this.interior,u=this.simplices,y=[w];w.lastVisited=S,w.vertices[w.vertices.indexOf(-1)]=S,w.boundary=!1,p.push(w);for(var f=[];y.length>0;){var w=y.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]=g[O[N]];var U=this.orient();if(U>0){O[I]=S,B.boundary=!1,p.push(B),y.push(B),B.lastVisited=S;continue}else B.lastVisited=-S}var W=B.adjacent,Q=P.slice(),ue=L.slice(),se=new n(Q,ue,!0);u.push(se);var he=W.indexOf(w);if(!(he<0)){W[he]=se,ue[z]=B,Q[F]=-1,ue[F]=w,L[F]=se,se.flip();for(var N=0;N<=E;++N){var H=Q[N];if(!(H<0||H===S)){for(var $=new Array(E-1),J=0,X=0;X<=E;++X){var oe=Q[X];oe<0||X===N||($[J++]=oe)}f.push(new o($,se,N))}}}}}}}f.sort(s);for(var F=0;F+1=0?p[y++]=u[P]:f=P&1;if(f===(_&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 g=_.slice(0,E+1),b=i.apply(void 0,g);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 y=new n(p,new Array(E+1),!1),f=y.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 n(L,new Array(E+1),!0);f[u]=B,P[u]=B}P[E+1]=y;for(var u=0;u<=E;++u)for(var L=f[u].vertices,O=f[u].adjacent,z=0;z<=E;++z){var I=L[z];if(I<0){O[z]=y;continue}for(var N=0;N<=E;++N)f[N].vertices.indexOf(I)<0&&(O[z]=f[N])}for(var U=new d(E,g,P),W=!!w,u=E+1;u3*(P+1)?d(this,f):this.left.insert(f):this.left=b([f]);else if(f[0]>this.mid)this.right?4*(this.right.count+1)>3*(P+1)?d(this,f):this.right.insert(f):this.right=b([f]);else{var L=i.ge(this.leftPoints,f,E),z=i.ge(this.rightPoints,f,g);this.leftPoints.splice(L,0,f),this.rightPoints.splice(z,0,f)}},c.remove=function(f){var P=this.count-this.leftPoints;if(f[1]3*(P-1))return T(this,f);var z=this.left.remove(f);return z===o?(this.left=null,this.count-=1,n):(z===n&&(this.count-=1),z)}else if(f[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,f);var z=this.right.remove(f);return z===o?(this.right=null,this.count-=1,n):(z===n&&(this.count-=1),z)}else{if(this.count===1)return this.leftPoints[0]===f?o:a;if(this.leftPoints.length===1&&this.leftPoints[0]===f){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}h(this,O),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?h(this,this.left):h(this,this.right);return n}for(var I=i.ge(this.leftPoints,f,E);I=0&&f[z][1]>=P;--z){var F=L(f[z]);if(F)return F}}function w(f,P){for(var L=0;Lthis.mid){if(this.right){var L=this.right.queryPoint(f,P);if(L)return L}return _(this.rightPoints,f,P)}else return w(this.leftPoints,P)},c.queryInterval=function(f,P,L){if(fthis.mid&&this.right){var z=this.right.queryInterval(f,P,L);if(z)return z}return Pthis.mid?_(this.rightPoints,f,L):w(this.leftPoints,L)};function S(f,P){return f-P}function E(f,P){var L=f[0]-P[0];return L||f[1]-P[1]}function g(f,P){var L=f[1]-P[1];return L||f[0]-P[0]}function b(f){if(f.length===0)return null;for(var P=[],L=0;L>1],F=[],B=[],O=[],L=0;L13)&&i!==32&&i!==133&&i!==160&&i!==5760&&i!==6158&&(i<8192||i>8205)&&i!==8232&&i!==8233&&i!==8239&&i!==8287&&i!==8288&&i!==12288&&i!==65279)return!1;return!0}},395:function(e){function t(r,i,a){return r*(1-a)+i*a}e.exports=t},2652:function(e,t,r){var i=r(4335),a=r(6864),n=r(1903),o=r(9921),s=r(7608),c=r(5665),h={length:r(1387),normalize:r(3536),dot:r(244),cross:r(5911)},m=a(),d=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,y,f,P){if(p||(p=[0,0,0]),u||(u=[0,0,0]),y||(y=[0,0,0]),f||(f=[0,0,0,1]),P||(P=[0,0,0,1]),!i(m,b)||(n(d,m),d[3]=0,d[7]=0,d[11]=0,d[15]=1,Math.abs(o(d)<1e-8)))return!1;var L=m[3],z=m[7],F=m[11],B=m[12],O=m[13],I=m[14],N=m[15];if(L!==0||z!==0||F!==0){T[0]=L,T[1]=z,T[2]=F,T[3]=N;var U=s(d,d);if(!U)return!1;c(d,d),w(f,T,d)}else f[0]=f[1]=f[2]=0,f[3]=1;if(p[0]=B,p[1]=O,p[2]=I,S(l,m),u[0]=h.length(l[0]),h.normalize(l[0],l[0]),y[0]=h.dot(l[0],l[1]),E(l[1],l[1],l[0],1,-y[0]),u[1]=h.length(l[1]),h.normalize(l[1],l[1]),y[0]/=u[1],y[1]=h.dot(l[0],l[2]),E(l[2],l[2],l[0],1,-y[1]),y[2]=h.dot(l[1],l[2]),E(l[2],l[2],l[1],1,-y[2]),u[2]=h.length(l[2]),h.normalize(l[2],l[2]),y[1]/=u[2],y[2]/=u[2],h.cross(_,l[1],l[2]),h.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(g,b,p){var u=b[0],y=b[1],f=b[2],P=b[3];return g[0]=p[0]*u+p[4]*y+p[8]*f+p[12]*P,g[1]=p[1]*u+p[5]*y+p[9]*f+p[13]*P,g[2]=p[2]*u+p[6]*y+p[10]*f+p[14]*P,g[3]=p[3]*u+p[7]*y+p[11]*f+p[15]*P,g}function S(g,b){g[0][0]=b[0],g[0][1]=b[1],g[0][2]=b[2],g[1][0]=b[4],g[1][1]=b[5],g[1][2]=b[6],g[2][0]=b[8],g[2][1]=b[9],g[2][2]=b[10]}function E(g,b,p,u,y){g[0]=b[0]*u+p[0]*y,g[1]=b[1]*u+p[1]*y,g[2]=b[2]*u+p[2]*y}},4335:function(e){e.exports=function(r,i){var a=i[15];if(a===0)return!1;for(var n=1/a,o=0;o<16;o++)r[o]=i[o]*n;return!0}},7442:function(e,t,r){var i=r(6658),a=r(7182),n=r(2652),o=r(9921),s=r(8648),c=T(),h=T(),m=T();e.exports=d;function d(w,S,E,g){if(o(S)===0||o(E)===0)return!1;var b=n(S,c.translate,c.scale,c.skew,c.perspective,c.quaternion),p=n(E,h.translate,h.scale,h.skew,h.perspective,h.quaternion);return!b||!p?!1:(i(m.translate,c.translate,h.translate,g),i(m.skew,c.skew,h.skew,g),i(m.scale,c.scale,h.scale,g),i(m.perspective,c.perspective,h.perspective,g),s(m.quaternion,c.quaternion,h.quaternion,g),a(w,m.translate,m.scale,m.skew,m.perspective,m.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 i={identity:r(7894),translate:r(7656),multiply:r(6760),create:r(6864),scale:r(2504),fromRotationTranslation:r(6743)},a=i.create(),n=i.create();e.exports=function(s,c,h,m,d,T){return i.identity(s),i.fromRotationTranslation(s,T,c),s[3]=d[0],s[7]=d[1],s[11]=d[2],s[15]=d[3],i.identity(n),m[2]!==0&&(n[9]=m[2],i.multiply(s,s,n)),m[1]!==0&&(n[9]=0,n[8]=m[1],i.multiply(s,s,n)),m[0]!==0&&(n[8]=0,n[4]=m[0],i.multiply(s,s,n)),i.scale(s,s,h),s}},1811:function(e,t,r){"use strict";var i=r(2478),a=r(7442),n=r(7608),o=r(5567),s=r(2408),c=r(7089),h=r(6582),m=r(7656),d=r(2504),T=r(3536),l=[0,0,0];e.exports=E;function _(g){this._components=g.slice(),this._time=[0],this.prevMatrix=g.slice(),this.nextMatrix=g.slice(),this.computedMatrix=g.slice(),this.computedInverse=g.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(g){var b=this._time,p=i.le(b,g),u=this.computedMatrix;if(!(p<0)){var y=this._components;if(p===b.length-1)for(var f=16*p,P=0;P<16;++P)u[P]=y[f++];else{for(var L=b[p+1]-b[p],f=16*p,z=this.prevMatrix,F=!0,P=0;P<16;++P)z[P]=y[f++];for(var B=this.nextMatrix,P=0;P<16;++P)B[P]=y[f++],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,(g-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;n(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(g){if(!(g1&&i(n[h[l-2]],n[h[l-1]],T)<=0;)l-=1,h.pop();for(h.push(d),l=m.length;l>1&&i(n[m[l-2]],n[m[l-1]],T)>=0;)l-=1,m.pop();m.push(d)}for(var _=new Array(m.length+h.length-2),w=0,s=0,S=h.length;s0;--E)_[w++]=m[E];return _}},351:function(e,t,r){"use strict";e.exports=a;var i=r(4687);function a(n,o){o||(o=n,n=window);var s=0,c=0,h=0,m={shift:!1,alt:!1,control:!1,meta:!1},d=!1;function T(f){var P=!1;return"altKey"in f&&(P=P||f.altKey!==m.alt,m.alt=!!f.altKey),"shiftKey"in f&&(P=P||f.shiftKey!==m.shift,m.shift=!!f.shiftKey),"ctrlKey"in f&&(P=P||f.ctrlKey!==m.control,m.control=!!f.ctrlKey),"metaKey"in f&&(P=P||f.metaKey!==m.meta,m.meta=!!f.metaKey),P}function l(f,P){var L=i.x(P),z=i.y(P);"buttons"in P&&(f=P.buttons|0),(f!==s||L!==c||z!==h||T(P))&&(s=f|0,c=L||0,h=z||0,o&&o(s,c,h,m))}function _(f){l(0,f)}function w(){(s||c||h||m.shift||m.alt||m.meta||m.control)&&(c=h=0,s=0,m.shift=m.alt=m.control=m.meta=!1,o&&o(0,0,0,m))}function S(f){T(f)&&o&&o(s,c,h,m)}function E(f){i.buttons(f)===0?l(0,f):l(s,f)}function g(f){l(s|i.buttons(f),f)}function b(f){l(s&~i.buttons(f),f)}function p(){d||(d=!0,n.addEventListener("mousemove",E),n.addEventListener("mousedown",g),n.addEventListener("mouseup",b),n.addEventListener("mouseleave",_),n.addEventListener("mouseenter",_),n.addEventListener("mouseout",_),n.addEventListener("mouseover",_),n.addEventListener("blur",w),n.addEventListener("keyup",S),n.addEventListener("keydown",S),n.addEventListener("keypress",S),n!==window&&(window.addEventListener("blur",w),window.addEventListener("keyup",S),window.addEventListener("keydown",S),window.addEventListener("keypress",S)))}function u(){d&&(d=!1,n.removeEventListener("mousemove",E),n.removeEventListener("mousedown",g),n.removeEventListener("mouseup",b),n.removeEventListener("mouseleave",_),n.removeEventListener("mouseenter",_),n.removeEventListener("mouseout",_),n.removeEventListener("mouseover",_),n.removeEventListener("blur",w),n.removeEventListener("keyup",S),n.removeEventListener("keydown",S),n.removeEventListener("keypress",S),n!==window&&(window.removeEventListener("blur",w),window.removeEventListener("keyup",S),window.removeEventListener("keydown",S),window.removeEventListener("keypress",S)))}p();var y={element:n};return Object.defineProperties(y,{enabled:{get:function(){return d},set:function(f){f?p():u()},enumerable:!0},buttons:{get:function(){return s},enumerable:!0},x:{get:function(){return c},enumerable:!0},y:{get:function(){return h},enumerable:!0},mods:{get:function(){return m},enumerable:!0}}),y}},24:function(e){var t={left:0,top:0};e.exports=r;function r(a,n,o){n=n||a.currentTarget||a.srcElement,Array.isArray(o)||(o=[0,0]);var s=a.clientX||0,c=a.clientY||0,h=i(n);return o[0]=s-h.left,o[1]=c-h.top,o}function i(a){return a===window||a===document||a===document.body?t:a.getBoundingClientRect()}},4687:function(e,t){"use strict";function r(o){if(typeof o=="object"){if("buttons"in o)return o.buttons;if("which"in o){var s=o.which;if(s===2)return 4;if(s===3)return 2;if(s>0)return 1<=0)return 1<0){if(ue=1,H[J++]=m(p[P],w,S,E),P+=U,g>0)for(Q=1,L=p[P],X=H[J]=m(L,w,S,E),j=H[J+oe],ce=H[J+ee],ze=H[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]=se++),J+=1,P+=U,Q=2;Q0)for(Q=1,L=p[P],X=H[J]=m(L,w,S,E),j=H[J+oe],ce=H[J+ee],ze=H[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]=se++,ze!==ce&&h($[J+ee],Re,O,N,ce,ze,w,S,E)),J+=1,P+=U,Q=2;Q0){if(Q=1,H[J++]=m(p[P],w,S,E),P+=U,b>0)for(ue=1,L=p[P],X=H[J]=m(L,w,S,E),ce=H[J+ee],j=H[J+oe],ze=H[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]=se++),J+=1,P+=U,ue=2;ue0)for(ue=1,L=p[P],X=H[J]=m(L,w,S,E),ce=H[J+ee],j=H[J+oe],ze=H[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]=se++,ze!==ce&&h($[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(m),_=0;_=0?l[_]=!0:l[_]=!1;return n(s.vertex,s.cell,s.phase,d,h,l)}},6199:function(e,t,r){"use strict";var i=r(1338),a={zero:function(E,g,b,p){var u=E[0],y=b[0];p|=0;var f=0,P=y;for(f=0;f2&&f[1]>2&&p(y.pick(-1,-1).lo(1,1).hi(f[0]-2,f[1]-2),u.pick(-1,-1,0).lo(1,1).hi(f[0]-2,f[1]-2),u.pick(-1,-1,1).lo(1,1).hi(f[0]-2,f[1]-2)),f[1]>2&&(b(y.pick(0,-1).lo(1).hi(f[1]-2),u.pick(0,-1,1).lo(1).hi(f[1]-2)),g(u.pick(0,-1,0).lo(1).hi(f[1]-2))),f[1]>2&&(b(y.pick(f[0]-1,-1).lo(1).hi(f[1]-2),u.pick(f[0]-1,-1,1).lo(1).hi(f[1]-2)),g(u.pick(f[0]-1,-1,0).lo(1).hi(f[1]-2))),f[0]>2&&(b(y.pick(-1,0).lo(1).hi(f[0]-2),u.pick(-1,0,0).lo(1).hi(f[0]-2)),g(u.pick(-1,0,1).lo(1).hi(f[0]-2))),f[0]>2&&(b(y.pick(-1,f[1]-1).lo(1).hi(f[0]-2),u.pick(-1,f[1]-1,0).lo(1).hi(f[0]-2)),g(u.pick(-1,f[1]-1,1).lo(1).hi(f[0]-2))),u.set(0,0,0,0),u.set(0,0,1,0),u.set(f[0]-1,0,0,0),u.set(f[0]-1,0,1,0),u.set(0,f[1]-1,0,0),u.set(0,f[1]-1,1,0),u.set(f[0]-1,f[1]-1,0,0),u.set(f[0]-1,f[1]-1,1,0),u}}function S(E){var g=E.join(),f=m[g];if(f)return f;for(var b=E.length,p=[T,l],u=1;u<=b;++u)p.push(_(u));var y=w,f=y.apply(void 0,p);return m[g]=f,f}e.exports=function(g,b,p){if(Array.isArray(p)||(typeof p=="string"?p=i(b.dimension,p):p=i(b.dimension,"clamp")),b.size===0)return g;if(b.dimension===0)return g.set(0),g;var u=S(p);return u(g,b)}},4317:function(e){"use strict";function t(o,s){var c=Math.floor(s),h=s-c,m=0<=c&&c0;){O<64?(g=O,O=0):(g=64,O-=64);for(var I=m[1]|0;I>0;){I<64?(b=I,I=0):(b=64,I-=64),l=F+O*u+I*y,S=B+O*P+I*L;var N=0,U=0,W=0,Q=f,ue=u-p*f,se=y-g*u,he=z,H=P-p*z,$=L-g*P;for(W=0;W0;){L<64?(g=L,L=0):(g=64,L-=64);for(var z=m[0]|0;z>0;){z<64?(E=z,z=0):(E=64,z-=64),l=f+L*p+z*b,S=P+L*y+z*u;var F=0,B=0,O=p,I=b-g*p,N=y,U=u-g*y;for(B=0;B0;){B<64?(b=B,B=0):(b=64,B-=64);for(var O=m[0]|0;O>0;){O<64?(E=O,O=0):(E=64,O-=64);for(var I=m[1]|0;I>0;){I<64?(g=I,I=0):(g=64,I-=64),l=z+B*y+O*p+I*u,S=F+B*L+O*f+I*P;var N=0,U=0,W=0,Q=y,ue=p-b*y,se=u-E*p,he=L,H=f-b*L,$=P-E*f;for(W=0;W_;){N=0,U=F-g;t:for(O=0;OQ)break t;U+=f,N+=P}for(N=F,U=F-g,O=0;O>1,I=O-z,N=O+z,U=F,W=I,Q=O,ue=N,se=B,he=w+1,H=S-1,$=!0,J,X,oe,ne,j,ee,re,ce,be,Ae=0,ze=0,Re=0,We,it,ot,tt,ut,Me,_e,fe,Fe,rt,st,Qe,Lt,kt,qt,Zt,Sr=y,xr=T(Sr),jr=T(Sr);it=b*U,ot=b*W,Zt=g;e:for(We=0;We0){X=U,U=W,W=X;break e}if(Re<0)break e;Zt+=P}it=b*ue,ot=b*se,Zt=g;e:for(We=0;We0){X=ue,ue=se,se=X;break e}if(Re<0)break e;Zt+=P}it=b*U,ot=b*Q,Zt=g;e:for(We=0;We0){X=U,U=Q,Q=X;break e}if(Re<0)break e;Zt+=P}it=b*W,ot=b*Q,Zt=g;e:for(We=0;We0){X=W,W=Q,Q=X;break e}if(Re<0)break e;Zt+=P}it=b*U,ot=b*ue,Zt=g;e:for(We=0;We0){X=U,U=ue,ue=X;break e}if(Re<0)break e;Zt+=P}it=b*Q,ot=b*ue,Zt=g;e:for(We=0;We0){X=Q,Q=ue,ue=X;break e}if(Re<0)break e;Zt+=P}it=b*W,ot=b*se,Zt=g;e:for(We=0;We0){X=W,W=se,se=X;break e}if(Re<0)break e;Zt+=P}it=b*W,ot=b*Q,Zt=g;e:for(We=0;We0){X=W,W=Q,Q=X;break e}if(Re<0)break e;Zt+=P}it=b*ue,ot=b*se,Zt=g;e:for(We=0;We0){X=ue,ue=se,se=X;break e}if(Re<0)break e;Zt+=P}for(it=b*U,ot=b*W,tt=b*Q,ut=b*ue,Me=b*se,_e=b*F,fe=b*O,Fe=b*B,qt=0,Zt=g,We=0;We0)H--;else if(Re<0){for(it=b*ee,ot=b*he,tt=b*H,Zt=g,We=0;We0)for(;;){re=g+H*b,qt=0;e:for(We=0;We0){if(--HB){e:for(;;){for(re=g+he*b,qt=0,Zt=g,We=0;We1&&_?S(l,_[0],_[1]):S(l)}var h={"uint32,1,0":function(d,T){return function(l){var _=l.data,w=l.offset|0,S=l.shape,E=l.stride,g=E[0]|0,b=S[0]|0,p=E[1]|0,u=S[1]|0,y=p,f=p,P=1;b<=32?d(0,b-1,_,w,g,p,b,u,y,f,P):T(0,b-1,_,w,g,p,b,u,y,f,P)}}};function m(d,T){var l=[T,d].join(","),_=h[l],w=o(d,T),S=c(d,T,w);return _(w,S)}e.exports=m},446:function(e,t,r){"use strict";var i=r(7640),a={};function n(o){var s=o.order,c=o.dtype,h=[s,c],m=h.join(":"),d=a[m];return d||(a[m]=d=i(s,c)),d(o),o}e.exports=n},9618:function(e,t,r){var i=r(7163),a=typeof Float64Array<"u";function n(T,l){return T[0]-l[0]}function o(){var T=this.stride,l=new Array(T.length),_;for(_=0;_=0&&(p=g|0,b+=y*p,u-=p),new w(this.data,u,y,b)},S.step=function(g){var b=this.shape[0],p=this.stride[0],u=this.offset,y=0,f=Math.ceil;return typeof g=="number"&&(y=g|0,y<0?(u+=p*(b-1),b=f(-b/y)):b=f(b/y),p*=y),new w(this.data,b,p,u)},S.transpose=function(g){g=g===void 0?0:g|0;var b=this.shape,p=this.stride;return new w(this.data,b[g],p[g],this.offset)},S.pick=function(g){var b=[],p=[],u=this.offset;typeof g=="number"&&g>=0?u=u+this.stride[0]*g|0:(b.push(this.shape[0]),p.push(this.stride[0]));var y=l[b.length+1];return y(this.data,b,p,u)},function(g,b,p,u){return new w(g,b[0],p[0],u)}},2:function(T,l,_){function w(E,g,b,p,u,y){this.data=E,this.shape=[g,b],this.stride=[p,u],this.offset=y|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(g,b,p){return T==="generic"?this.data.set(this.offset+this.stride[0]*g+this.stride[1]*b,p):this.data[this.offset+this.stride[0]*g+this.stride[1]*b]=p},S.get=function(g,b){return T==="generic"?this.data.get(this.offset+this.stride[0]*g+this.stride[1]*b):this.data[this.offset+this.stride[0]*g+this.stride[1]*b]},S.index=function(g,b){return this.offset+this.stride[0]*g+this.stride[1]*b},S.hi=function(g,b){return new w(this.data,typeof g!="number"||g<0?this.shape[0]:g|0,typeof b!="number"||b<0?this.shape[1]:b|0,this.stride[0],this.stride[1],this.offset)},S.lo=function(g,b){var p=this.offset,u=0,y=this.shape[0],f=this.shape[1],P=this.stride[0],L=this.stride[1];return typeof g=="number"&&g>=0&&(u=g|0,p+=P*u,y-=u),typeof b=="number"&&b>=0&&(u=b|0,p+=L*u,f-=u),new w(this.data,y,f,P,L,p)},S.step=function(g,b){var p=this.shape[0],u=this.shape[1],y=this.stride[0],f=this.stride[1],P=this.offset,L=0,z=Math.ceil;return typeof g=="number"&&(L=g|0,L<0?(P+=y*(p-1),p=z(-p/L)):p=z(p/L),y*=L),typeof b=="number"&&(L=b|0,L<0?(P+=f*(u-1),u=z(-u/L)):u=z(u/L),f*=L),new w(this.data,p,u,y,f,P)},S.transpose=function(g,b){g=g===void 0?0:g|0,b=b===void 0?1:b|0;var p=this.shape,u=this.stride;return new w(this.data,p[g],p[b],u[g],u[b],this.offset)},S.pick=function(g,b){var p=[],u=[],y=this.offset;typeof g=="number"&&g>=0?y=y+this.stride[0]*g|0:(p.push(this.shape[0]),u.push(this.stride[0])),typeof b=="number"&&b>=0?y=y+this.stride[1]*b|0:(p.push(this.shape[1]),u.push(this.stride[1]));var f=l[p.length+1];return f(this.data,p,u,y)},function(g,b,p,u){return new w(g,b[0],b[1],p[0],p[1],u)}},3:function(T,l,_){function w(E,g,b,p,u,y,f,P){this.data=E,this.shape=[g,b,p],this.stride=[u,y,f],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 g=Math.abs(this.stride[0]),b=Math.abs(this.stride[1]),p=Math.abs(this.stride[2]);return g>b?b>p?[2,1,0]:g>p?[1,2,0]:[1,0,2]:g>p?[2,0,1]:p>b?[0,1,2]:[0,2,1]}}),S.set=function(g,b,p,u){return T==="generic"?this.data.set(this.offset+this.stride[0]*g+this.stride[1]*b+this.stride[2]*p,u):this.data[this.offset+this.stride[0]*g+this.stride[1]*b+this.stride[2]*p]=u},S.get=function(g,b,p){return T==="generic"?this.data.get(this.offset+this.stride[0]*g+this.stride[1]*b+this.stride[2]*p):this.data[this.offset+this.stride[0]*g+this.stride[1]*b+this.stride[2]*p]},S.index=function(g,b,p){return this.offset+this.stride[0]*g+this.stride[1]*b+this.stride[2]*p},S.hi=function(g,b,p){return new w(this.data,typeof g!="number"||g<0?this.shape[0]:g|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(g,b,p){var u=this.offset,y=0,f=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 g=="number"&&g>=0&&(y=g|0,u+=z*y,f-=y),typeof b=="number"&&b>=0&&(y=b|0,u+=F*y,P-=y),typeof p=="number"&&p>=0&&(y=p|0,u+=B*y,L-=y),new w(this.data,f,P,L,z,F,B,u)},S.step=function(g,b,p){var u=this.shape[0],y=this.shape[1],f=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 g=="number"&&(B=g|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*(y-1),y=O(-y/B)):y=O(y/B),L*=B),typeof p=="number"&&(B=p|0,B<0?(F+=z*(f-1),f=O(-f/B)):f=O(f/B),z*=B),new w(this.data,u,y,f,P,L,z,F)},S.transpose=function(g,b,p){g=g===void 0?0:g|0,b=b===void 0?1:b|0,p=p===void 0?2:p|0;var u=this.shape,y=this.stride;return new w(this.data,u[g],u[b],u[p],y[g],y[b],y[p],this.offset)},S.pick=function(g,b,p){var u=[],y=[],f=this.offset;typeof g=="number"&&g>=0?f=f+this.stride[0]*g|0:(u.push(this.shape[0]),y.push(this.stride[0])),typeof b=="number"&&b>=0?f=f+this.stride[1]*b|0:(u.push(this.shape[1]),y.push(this.stride[1])),typeof p=="number"&&p>=0?f=f+this.stride[2]*p|0:(u.push(this.shape[2]),y.push(this.stride[2]));var P=l[u.length+1];return P(this.data,u,y,f)},function(g,b,p,u){return new w(g,b[0],b[1],b[2],p[0],p[1],p[2],u)}},4:function(T,l,_){function w(E,g,b,p,u,y,f,P,L,z){this.data=E,this.shape=[g,b,p,u],this.stride=[y,f,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(g,b,p,u,y){return T==="generic"?this.data.set(this.offset+this.stride[0]*g+this.stride[1]*b+this.stride[2]*p+this.stride[3]*u,y):this.data[this.offset+this.stride[0]*g+this.stride[1]*b+this.stride[2]*p+this.stride[3]*u]=y},S.get=function(g,b,p,u){return T==="generic"?this.data.get(this.offset+this.stride[0]*g+this.stride[1]*b+this.stride[2]*p+this.stride[3]*u):this.data[this.offset+this.stride[0]*g+this.stride[1]*b+this.stride[2]*p+this.stride[3]*u]},S.index=function(g,b,p,u){return this.offset+this.stride[0]*g+this.stride[1]*b+this.stride[2]*p+this.stride[3]*u},S.hi=function(g,b,p,u){return new w(this.data,typeof g!="number"||g<0?this.shape[0]:g|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(g,b,p,u){var y=this.offset,f=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 g=="number"&&g>=0&&(f=g|0,y+=B*f,P-=f),typeof b=="number"&&b>=0&&(f=b|0,y+=O*f,L-=f),typeof p=="number"&&p>=0&&(f=p|0,y+=I*f,z-=f),typeof u=="number"&&u>=0&&(f=u|0,y+=N*f,F-=f),new w(this.data,P,L,z,F,B,O,I,N,y)},S.step=function(g,b,p,u){var y=this.shape[0],f=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 g=="number"&&(N=g|0,N<0?(I+=z*(y-1),y=U(-y/N)):y=U(y/N),z*=N),typeof b=="number"&&(N=b|0,N<0?(I+=F*(f-1),f=U(-f/N)):f=U(f/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,y,f,P,L,z,F,B,O,I)},S.transpose=function(g,b,p,u){g=g===void 0?0:g|0,b=b===void 0?1:b|0,p=p===void 0?2:p|0,u=u===void 0?3:u|0;var y=this.shape,f=this.stride;return new w(this.data,y[g],y[b],y[p],y[u],f[g],f[b],f[p],f[u],this.offset)},S.pick=function(g,b,p,u){var y=[],f=[],P=this.offset;typeof g=="number"&&g>=0?P=P+this.stride[0]*g|0:(y.push(this.shape[0]),f.push(this.stride[0])),typeof b=="number"&&b>=0?P=P+this.stride[1]*b|0:(y.push(this.shape[1]),f.push(this.stride[1])),typeof p=="number"&&p>=0?P=P+this.stride[2]*p|0:(y.push(this.shape[2]),f.push(this.stride[2])),typeof u=="number"&&u>=0?P=P+this.stride[3]*u|0:(y.push(this.shape[3]),f.push(this.stride[3]));var L=l[y.length+1];return L(this.data,y,f,P)},function(g,b,p,u){return new w(g,b[0],b[1],b[2],b[3],p[0],p[1],p[2],p[3],u)}},5:function(l,_,w){function S(g,b,p,u,y,f,P,L,z,F,B,O){this.data=g,this.shape=[b,p,u,y,f],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,y,f,P){return l==="generic"?this.data.set(this.offset+this.stride[0]*b+this.stride[1]*p+this.stride[2]*u+this.stride[3]*y+this.stride[4]*f,P):this.data[this.offset+this.stride[0]*b+this.stride[1]*p+this.stride[2]*u+this.stride[3]*y+this.stride[4]*f]=P},E.get=function(b,p,u,y,f){return l==="generic"?this.data.get(this.offset+this.stride[0]*b+this.stride[1]*p+this.stride[2]*u+this.stride[3]*y+this.stride[4]*f):this.data[this.offset+this.stride[0]*b+this.stride[1]*p+this.stride[2]*u+this.stride[3]*y+this.stride[4]*f]},E.index=function(b,p,u,y,f){return this.offset+this.stride[0]*b+this.stride[1]*p+this.stride[2]*u+this.stride[3]*y+this.stride[4]*f},E.hi=function(b,p,u,y,f){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 y!="number"||y<0?this.shape[3]:y|0,typeof f!="number"||f<0?this.shape[4]:f|0,this.stride[0],this.stride[1],this.stride[2],this.stride[3],this.stride[4],this.offset)},E.lo=function(b,p,u,y,f){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 y=="number"&&y>=0&&(L=y|0,P+=Q*L,O-=L),typeof f=="number"&&f>=0&&(L=f|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,y,f){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,se=Math.ceil;return typeof b=="number"&&(ue=b|0,ue<0?(Q+=O*(P-1),P=se(-P/ue)):P=se(P/ue),O*=ue),typeof p=="number"&&(ue=p|0,ue<0?(Q+=I*(L-1),L=se(-L/ue)):L=se(L/ue),I*=ue),typeof u=="number"&&(ue=u|0,ue<0?(Q+=N*(z-1),z=se(-z/ue)):z=se(z/ue),N*=ue),typeof y=="number"&&(ue=y|0,ue<0?(Q+=U*(F-1),F=se(-F/ue)):F=se(F/ue),U*=ue),typeof f=="number"&&(ue=f|0,ue<0?(Q+=W*(B-1),B=se(-B/ue)):B=se(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,y,f){b=b===void 0?0:b|0,p=p===void 0?1:p|0,u=u===void 0?2:u|0,y=y===void 0?3:y|0,f=f===void 0?4:f|0;var P=this.shape,L=this.stride;return new S(this.data,P[b],P[p],P[u],P[y],P[f],L[b],L[p],L[u],L[y],L[f],this.offset)},E.pick=function(b,p,u,y,f){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 y=="number"&&y>=0?z=z+this.stride[3]*y|0:(P.push(this.shape[3]),L.push(this.stride[3])),typeof f=="number"&&f>=0?z=z+this.stride[4]*f|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,y){return new S(b,p[0],p[1],p[2],p[3],p[4],u[0],u[1],u[2],u[3],u[4],y)}}};function c(T,l){var _=l===-1?"T":String(l),w=s[_];return l===-1?w(T):l===0?w(T,m[T][0]):w(T,m[T],o)}function h(T){if(i(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 m={generic:[],buffer:[],array:[],float32:[],float64:[],int8:[],int16:[],int32:[],uint8_clamped:[],uint8:[],uint16:[],uint32:[],bigint64:[],biguint64:[]};function d(T,l,_,w){if(T===void 0){var u=m.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,g=1;E>=0;--E)_[E]=g,g*=l[E]}if(w===void 0){w=0;for(var E=0;E>>0;e.exports=o;function o(s,c){if(isNaN(s)||isNaN(c))return NaN;if(s===c)return s;if(s===0)return c<0?-a:a;var h=i.hi(s),m=i.lo(s);return c>s==s>0?m===n?(h+=1,m=0):m+=1:m===0?(m=n,h-=1):m-=1,i.pack(m,h)}},8406:function(e,t){var r=1e-6,i=1e-6;t.vertexNormals=function(a,n,o){for(var s=n.length,c=new Array(s),h=o===void 0?r:o,m=0;mh)for(var P=c[l],L=1/Math.sqrt(p*y),f=0;f<3;++f){var z=(f+1)%3,F=(f+2)%3;P[f]+=L*(u[z]*b[F]-u[F]*b[z])}}for(var m=0;mh)for(var L=1/Math.sqrt(B),f=0;f<3;++f)P[f]*=L;else for(var f=0;f<3;++f)P[f]=0}return c},t.faceNormals=function(a,n,o){for(var s=a.length,c=new Array(s),h=o===void 0?i:o,m=0;mh?E=1/Math.sqrt(E):E=0;for(var l=0;l<3;++l)S[l]*=E;c[m]=S}return c}},4081:function(e){"use strict";e.exports=t;function t(r,i,a,n,o,s,c,h,m,d){var T=i+s+d;if(l>0){var l=Math.sqrt(T+1);r[0]=.5*(c-m)/l,r[1]=.5*(h-n)/l,r[2]=.5*(a-s)/l,r[3]=.5*l}else{var _=Math.max(i,s,d),l=Math.sqrt(2*_-T+1);i>=_?(r[0]=.5*l,r[1]=.5*(o+a)/l,r[2]=.5*(h+n)/l,r[3]=.5*(c-m)/l):s>=_?(r[0]=.5*(a+o)/l,r[1]=.5*l,r[2]=.5*(m+c)/l,r[3]=.5*(h-n)/l):(r[0]=.5*(n+h)/l,r[1]=.5*(c+m)/l,r[2]=.5*l,r[3]=.5*(a-o)/l)}return r}},9977:function(e,t,r){"use strict";e.exports=l;var i=r(9215),a=r(6582),n=r(7399),o=r(7608),s=r(4081);function c(_,w,S){return Math.sqrt(Math.pow(_,2)+Math.pow(w,2)+Math.pow(S,2))}function h(_,w,S,E){return Math.sqrt(Math.pow(_,2)+Math.pow(w,2)+Math.pow(S,2)+Math.pow(E,2))}function m(_,w){var S=w[0],E=w[1],g=w[2],b=w[3],p=h(S,E,g,b);p>1e-6?(_[0]=S/p,_[1]=E/p,_[2]=g/p,_[3]=b/p):(_[0]=_[1]=_[2]=0,_[3]=1)}function d(_,w,S){this.radius=i([S]),this.center=i(w),this.rotation=i(_),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=d.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;m(w,w);var S=this.computedMatrix;n(S,w);var E=this.computedCenter,g=this.computedEye,b=this.computedUp,p=Math.exp(this.computedRadius[0]);g[0]=E[0]+p*S[2],g[1]=E[1]+p*S[6],g[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 y=0,f=0;f<3;++f)y+=S[u+4*f]*g[f];S[12+u]=-y}},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 g=this.computedMatrix,b=g[1],p=g[5],u=g[9],y=c(b,p,u);b/=y,p/=y,u/=y;var f=g[0],P=g[4],L=g[8],z=f*b+P*p+L*u;f-=b*z,P-=p*z,L-=u*z;var F=c(f,P,L);f/=F,P/=F,L/=F;var B=g[2],O=g[6],I=g[10],N=B*b+O*p+I*u,U=B*f+O*P+I*L;B-=N*b+U*f,O-=N*p+U*P,I-=N*u+U*L;var W=c(B,O,I);B/=W,O/=W,I/=W;var Q=f*w+b*S,ue=P*w+p*S,se=L*w+u*S;this.center.move(_,Q,ue,se);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 g=this.computedMatrix,b=g[0],p=g[4],u=g[8],y=g[1],f=g[5],P=g[9],L=g[2],z=g[6],F=g[10],B=w*b+S*y,O=w*p+S*f,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=h(N,U,W,Q);ue>1e-6?(N/=ue,U/=ue,W/=ue,Q/=ue):(N=U=W=0,Q=1);var se=this.computedRotation,he=se[0],H=se[1],$=se[2],J=se[3],X=he*Q+J*N+H*W-$*U,oe=H*Q+J*U+$*N-he*W,ne=$*Q+J*W+he*U-H*N,j=J*Q-he*N-H*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-ne*U,oe=oe*Q+j*U+ne*N-X*W,ne=ne*Q+j*W+X*U-oe*N,j=j*Q-X*N-oe*U-ne*W}var re=h(X,oe,ne,j);re>1e-6?(X/=re,oe/=re,ne/=re,j/=re):(X=oe=ne=0,j=1),this.rotation.set(_,X,oe,ne,j)},T.lookAt=function(_,w,S,E){this.recalcMatrix(_),S=S||this.computedCenter,w=w||this.computedEye,E=E||this.computedUp;var g=this.computedMatrix;a(g,w,S,E);var b=this.computedRotation;s(b,g[0],g[1],g[2],g[4],g[5],g[6],g[8],g[9],g[10]),m(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]),m(S,S),this.rotation.set(_,S[0],S[1],S[2],S[3]);var E=this.computedMatrix;o(E,w);var g=E[15];if(Math.abs(g)>1e-6){var b=E[12]/g,p=E[13]/g,u=E[14]/g;this.recalcMatrix(_);var y=Math.exp(this.computedRadius[0]);this.center.set(_,b-E[2]*y,p-E[6]*y,u-E[10]*y),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 g=_.distance;g&&g>0&&this.radius.set(w,Math.log(g)),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),m(S,S);var g=new d(S,w,Math.log(E));return g.setDistanceLimits(_.zoomMin,_.zoomMax),("eye"in _||"up"in _)&&g.lookAt(0,_.eye,_.center,_.up),g}},1371:function(e,t,r){"use strict";var i=r(3233);e.exports=function(n,o,s){return s=typeof s<"u"?s+"":" ",i(s,o)+n}},3202:function(e){e.exports=function(r,i){i||(i=[0,""]),r=String(r);var a=parseFloat(r,10);return i[0]=a,i[1]=r.match(/[\d.\-\+]*\s*(.*)/)[1]||"",i}},3088:function(e,t,r){"use strict";e.exports=a;var i=r(3140);function a(n,o){for(var s=o.length|0,c=n.length,h=[new Array(s),new Array(s)],m=0;m0){P=h[F][y][0],z=F;break}L=P[z^1];for(var B=0;B<2;++B)for(var O=h[B][y],I=0;I0&&(P=N,L=U,z=B)}return f||P&&l(P,z),L}function w(u,y){var f=h[y][u][0],P=[u];l(f,y);for(var L=f[y^1],z=y;;){for(;L!==u;)P.push(L),L=_(P[P.length-2],L,!1);if(h[0][u].length+h[1][u].length===0)break;var F=P[P.length-1],B=u,O=P[1],I=_(F,B,!0);if(i(o[F],o[B],o[O],o[I])<0)break;P.push(u),L=_(F,B)}return P}function S(u,y){return y[1]===y[y.length-1]}for(var m=0;m0;){var b=h[0][m].length,p=w(m,E);S(g,p)?g.push.apply(g,p):(g.length>0&&T.push(g),g=p)}g.length>0&&T.push(g)}return T}},5609:function(e,t,r){"use strict";e.exports=a;var i=r(3134);function a(n,o){for(var s=i(n,o.length),c=new Array(o.length),h=new Array(o.length),m=[],d=0;d0;){var l=m.pop();c[l]=!1;for(var _=s[l],d=0;d<_.length;++d){var w=_[d];--h[w]===0&&m.push(w)}}for(var S=new Array(o.length),E=[],d=0;d0}b=b.filter(p);for(var u=b.length,y=new Array(u),f=new Array(u),g=0;g0;){var re=ne.pop(),ce=ue[re];c(ce,function(We,it){return We-it});var be=ce.length,Ae=j[re],ze;if(Ae===0){var O=b[re];ze=[O]}for(var g=0;g=0)&&(j[Re]=Ae^1,ne.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 i=r(3250)[3],a=r(4209),n=r(3352),o=r(2478);function s(){return!0}function c(w){return function(S,E){var g=w[S];return g?!!g.queryPoint(E,s):!1}}function h(w){for(var S={},E=0;E0&&S[g]===E[0])b=w[g-1];else return 1;for(var p=1;b;){var u=b.key,y=i(E,u[0],u[1]);if(u[0][0]0)p=-1,b=b.right;else return 0;else if(y>0)b=b.left;else if(y<0)p=1,b=b.right;else return 0}return p}}function d(w){return 1}function T(w){return function(E){return w(E[0],E[1])?0:1}}function l(w,S){return function(g){return w(g[0],g[1])?0:S(g)}}function _(w){for(var S=w.length,E=[],g=[],b=0,p=0;p=d?(u=1,f=d+2*_+S):(u=-_/d,f=_*u+S)):(u=0,w>=0?(y=0,f=S):-w>=l?(y=1,f=l+2*w+S):(y=-w/l,f=w*y+S));else if(y<0)y=0,_>=0?(u=0,f=S):-_>=d?(u=1,f=d+2*_+S):(u=-_/d,f=_*u+S);else{var P=1/p;u*=P,y*=P,f=u*(d*u+T*y+2*_)+y*(T*u+l*y+2*w)+S}else{var L,z,F,B;u<0?(L=T+_,z=l+w,z>L?(F=z-L,B=d-2*T+l,F>=B?(u=1,y=0,f=d+2*_+S):(u=F/B,y=1-u,f=u*(d*u+T*y+2*_)+y*(T*u+l*y+2*w)+S)):(u=0,z<=0?(y=1,f=l+2*w+S):w>=0?(y=0,f=S):(y=-w/l,f=w*y+S))):y<0?(L=T+w,z=d+_,z>L?(F=z-L,B=d-2*T+l,F>=B?(y=1,u=0,f=l+2*w+S):(y=F/B,u=1-y,f=u*(d*u+T*y+2*_)+y*(T*u+l*y+2*w)+S)):(y=0,z<=0?(u=1,f=d+2*_+S):_>=0?(u=0,f=S):(u=-_/d,f=_*u+S))):(F=l+w-T-_,F<=0?(u=0,y=1,f=l+2*w+S):(B=d-2*T+l,F>=B?(u=1,y=0,f=d+2*_+S):(u=F/B,y=1-u,f=u*(d*u+T*y+2*_)+y*(T*u+l*y+2*w)+S)))}for(var O=1-u-y,m=0;m0){var l=s[h-1];if(i(d,l)===0&&n(l)!==T){h-=1;continue}}s[h++]=d}}return s.length=h,s}},3233:function(e){"use strict";var t="",r;e.exports=i;function i(a,n){if(typeof a!="string")throw new TypeError("expected a string");if(n===1)return a;if(n===2)return a+a;var o=a.length*n;if(r!==a||typeof r>"u")r=a,t="";else if(t.length>=o)return t.substr(0,o);for(;o>t.length&&n>1;)n&1&&(t+=a),n>>=1,a+=a;return t+=a,t=t.substr(0,o),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 i=r.length,a=r[r.length-1],n=i,o=i-2;o>=0;--o){var s=a,c=r[o];a=s+c;var h=a-s,m=c-h;m&&(r[--n]=a,a=m)}for(var d=0,o=n;o0){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=h*B;return F>=O||F<=-O?F:w(y,f,P)},function(y,f,P,L){var z=y[0]-L[0],F=f[0]-L[0],B=P[0]-L[0],O=y[1]-L[1],I=f[1]-L[1],N=P[1]-L[1],U=y[2]-L[2],W=f[2]-L[2],Q=P[2]-L[2],ue=F*N,se=B*I,he=B*O,H=z*N,$=z*I,J=F*O,X=U*(ue-se)+W*(he-H)+Q*($-J),oe=(Math.abs(ue)+Math.abs(se))*Math.abs(U)+(Math.abs(he)+Math.abs(H))*Math.abs(W)+(Math.abs($)+Math.abs(J))*Math.abs(Q),ne=m*oe;return X>ne||-X>ne?X:S(y,f,P,L)}];function g(u){var y=E[u.length];return y||(y=E[u.length]=_(u.length)),y.apply(void 0,u)}function b(u,y,f,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&&d>0||m<0&&d<0)return!1;var T=i(c,o,s),l=i(h,o,s);return T>0&&l>0||T<0&&l<0?!1:m===0&&d===0&&T===0&&l===0?a(o,s,c,h):!0}},8545:function(e){"use strict";e.exports=r;function t(i,a){var n=i+a,o=n-i,s=n-o,c=a-o,h=i-s,m=h+c;return m?[m,n]:[n]}function r(i,a){var n=i.length|0,o=a.length|0;if(n===1&&o===1)return t(i[0],-a[0]);var s=n+o,c=new Array(s),h=0,m=0,d=0,T=Math.abs,l=i[m],_=T(l),w=-a[d],S=T(w),E,g;_=o?(E=l,m+=1,m=o?(E=l,m+=1,m"u"&&(E=s(_));var g=_.length;if(g===0||E<1)return{cells:[],vertexIds:[],vertexWeights:[]};var b=c(w,+S),p=h(_,E),u=m(p,w,b,+S),y=d(p,w.length|0),f=o(E)(_,p.data,y,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(y),{cells:f,vertexIds:P,vertexWeights:L}}},1570:function(e){"use strict";e.exports=r;var t=[function(){function a(o,s,c,h){for(var m=Math.min(c,h)|0,d=Math.max(c,h)|0,T=o[2*m],l=o[2*m+1];T>1,w=s[2*_+1];if(w===d)return _;d>1,w=s[2*_+1];if(w===d)return _;d>1,w=s[2*_+1];if(w===d)return _;d>1,w=s[2*_+1];if(w===d)return _;d>1,B=h(y[F],f);B<=0?(B===0&&(z=F),P=F+1):B>0&&(L=F-1)}return z}i=l;function _(y,f){for(var P=new Array(y.length),L=0,z=P.length;L=y.length||h(y[ue],F)!==0););}return P}i=_;function w(y,f){if(!f)return _(T(E(y,0)),y,0);for(var P=new Array(f),L=0;L>>N&1&&I.push(z[N]);f.push(I)}return d(f)}i=S;function E(y,f){if(f<0)return[];for(var P=[],L=(1<0)-(n<0)},t.abs=function(n){var o=n>>r-1;return(n^o)-o},t.min=function(n,o){return o^(n^o)&-(n65535)<<4,n>>>=o,s=(n>255)<<3,n>>>=s,o|=s,s=(n>15)<<2,n>>>=s,o|=s,s=(n>3)<<1,n>>>=s,o|=s,o|n>>1},t.log10=function(n){return n>=1e9?9:n>=1e8?8:n>=1e7?7:n>=1e6?6:n>=1e5?5:n>=1e4?4:n>=1e3?3:n>=100?2:n>=10?1:0},t.popCount=function(n){return n=n-(n>>>1&1431655765),n=(n&858993459)+(n>>>2&858993459),(n+(n>>>4)&252645135)*16843009>>>24};function i(n){var o=32;return n&=-n,n&&o--,n&65535&&(o-=16),n&16711935&&(o-=8),n&252645135&&(o-=4),n&858993459&&(o-=2),n&1431655765&&(o-=1),o}t.countTrailingZeros=i,t.nextPow2=function(n){return n+=n===0,--n,n|=n>>>1,n|=n>>>2,n|=n>>>4,n|=n>>>8,n|=n>>>16,n+1},t.prevPow2=function(n){return n|=n>>>1,n|=n>>>2,n|=n>>>4,n|=n>>>8,n|=n>>>16,n-(n>>>1)},t.parity=function(n){return n^=n>>>16,n^=n>>>8,n^=n>>>4,n&=15,27030>>>n&1};var a=new Array(256);(function(n){for(var o=0;o<256;++o){var s=o,c=o,h=7;for(s>>>=1;s;s>>>=1)c<<=1,c|=s&1,--h;n[o]=c<>>8&255]<<16|a[n>>>16&255]<<8|a[n>>>24&255]},t.interleave2=function(n,o){return n&=65535,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,o&=65535,o=(o|o<<8)&16711935,o=(o|o<<4)&252645135,o=(o|o<<2)&858993459,o=(o|o<<1)&1431655765,n|o<<1},t.deinterleave2=function(n,o){return n=n>>>o&1431655765,n=(n|n>>>1)&858993459,n=(n|n>>>2)&252645135,n=(n|n>>>4)&16711935,n=(n|n>>>16)&65535,n<<16>>16},t.interleave3=function(n,o,s){return n&=1023,n=(n|n<<16)&4278190335,n=(n|n<<8)&251719695,n=(n|n<<4)&3272356035,n=(n|n<<2)&1227133513,o&=1023,o=(o|o<<16)&4278190335,o=(o|o<<8)&251719695,o=(o|o<<4)&3272356035,o=(o|o<<2)&1227133513,n|=o<<1,s&=1023,s=(s|s<<16)&4278190335,s=(s|s<<8)&251719695,s=(s|s<<4)&3272356035,s=(s|s<<2)&1227133513,n|s<<2},t.deinterleave3=function(n,o){return n=n>>>o&1227133513,n=(n|n>>>2)&3272356035,n=(n|n>>>4)&251719695,n=(n|n>>>8)&4278190335,n=(n|n>>>16)&1023,n<<22>>22},t.nextCombination=function(n){var o=n|n-1;return o+1|(~o&-~o)-1>>>i(n)+1}},2014:function(e,t,r){"use strict";"use restrict";var i=r(3105),a=r(4623);function n(u){for(var y=0,f=Math.max,P=0,L=u.length;P>1,F=c(u[z],y);F<=0?(F===0&&(L=z),f=z+1):F>0&&(P=z-1)}return L}t.findCell=T;function l(u,y){for(var f=new Array(u.length),P=0,L=f.length;P=u.length||c(u[Q],z)!==0););}return f}t.incidence=l;function _(u,y){if(!y)return l(d(S(u,0)),u,0);for(var f=new Array(y),P=0;P>>I&1&&O.push(L[I]);y.push(O)}return m(y)}t.explode=w;function S(u,y){if(y<0)return[];for(var f=[],P=(1<>1:(H>>1)-1}function P(H){for(var $=y(H);;){var J=$,X=2*H+1,oe=2*(H+1),ne=H;if(X0;){var J=f(H);if(J>=0){var X=y(J);if($0){var H=O[0];return u(0,U-1),U-=1,P(0),H}return-1}function F(H,$){var J=O[H];return _[J]===$?H:(_[J]=-1/0,L(H),z(),_[J]=$,U+=1,L(U-1))}function B(H){if(!w[H]){w[H]=!0;var $=T[H],J=l[H];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(m),S=0;S>1;S>=0;--S)P(S);for(;;){var W=z();if(W<0||_[W]>h)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=n;var i=r(3250);function a(o,s){var c,h;if(s[0][0]s[1][0])c=s[1],h=s[0];else{var m=Math.min(o[0][1],o[1][1]),d=Math.max(o[0][1],o[1][1]),T=Math.min(s[0][1],s[1][1]),l=Math.max(s[0][1],s[1][1]);return dl?m-l:d-l}var _,w;o[0][1]s[1][0])c=s[1],h=s[0];else return a(s,o);var m,d;if(o[0][0]o[1][0])m=o[1],d=o[0];else return-a(o,s);var T=i(c,h,d),l=i(c,h,m);if(T<0){if(l<=0)return T}else if(T>0){if(l>=0)return T}else if(l)return l;if(T=i(d,m,h),l=i(d,m,c),T<0){if(l<=0)return T}else if(T>0){if(l>=0)return T}else if(l)return l;return h[0]-d[0]}},4209:function(e,t,r){"use strict";e.exports=l;var i=r(2478),a=r(3840),n=r(3250),o=r(1303);function s(_,w,S){this.slabs=_,this.coordinates=w,this.horizontal=S}var c=s.prototype;function h(_,w){return _.y-w}function m(_,w){for(var S=null;_;){var E=_.key,g,b;E[0][0]0)if(w[0]!==E[1][0])S=_,_=_.right;else{var u=m(_.right,w);if(u)return u;_=_.left}else{if(w[0]!==E[1][0])return _;var u=m(_.right,w);if(u)return u;_=_.left}}return S}c.castUp=function(_){var w=i.le(this.coordinates,_[0]);if(w<0)return-1;var S=this.slabs[w],E=m(this.slabs[w],_),g=-1;if(E&&(g=E.value),this.coordinates[w]===_[0]){var b=null;if(E&&(b=E.key),w>0){var p=m(this.slabs[w-1],_);p&&(b?o(p.key,b)>0&&(b=p.key,g=p.value):(g=p.value,b=p.key))}var u=this.horizontal[w];if(u.length>0){var y=i.ge(u,_[1],h);if(y=u.length)return g;f=u[y]}}if(f.start)if(b){var P=n(b[0],b[1],[_[0],f.y]);b[0][0]>b[1][0]&&(P=-P),P>0&&(g=f.index)}else g=f.index;else f.y!==_[1]&&(g=f.index)}}}return g};function d(_,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),g=0;g1&&(w=1);for(var S=1-w,E=m.length,g=new Array(E),b=0;b0||_>0&&g<0){var b=o(w,g,S,_);T.push(b),l.push(b.slice())}g<0?l.push(S.slice()):g>0?T.push(S.slice()):(T.push(S.slice()),l.push(S.slice())),_=g}return{positive:T,negative:l}}function c(m,d){for(var T=[],l=n(m[m.length-1],d),_=m[m.length-1],w=m[0],S=0;S0||l>0&&E<0)&&T.push(o(_,E,w,l)),E>=0&&T.push(w.slice()),l=E}return T}function h(m,d){for(var T=[],l=n(m[m.length-1],d),_=m[m.length-1],w=m[0],S=0;S0||l>0&&E<0)&&T.push(o(_,E,w,l)),E<=0&&T.push(w.slice()),l=E}return T}},3387:function(e,t,r){var i;(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 n(m){return s(h(m),arguments)}function o(m,d){return n.apply(null,[m].concat(d||[]))}function s(m,d){var T=1,l=m.length,_,w="",S,E,g,b,p,u,y,f;for(S=0;S=0),g.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,g.width?parseInt(g.width):0);break;case"e":_=g.precision?parseFloat(_).toExponential(g.precision):parseFloat(_).toExponential();break;case"f":_=g.precision?parseFloat(_).toFixed(g.precision):parseFloat(_);break;case"g":_=g.precision?String(Number(_.toPrecision(g.precision))):parseFloat(_);break;case"o":_=(parseInt(_,10)>>>0).toString(8);break;case"s":_=String(_),_=g.precision?_.substring(0,g.precision):_;break;case"t":_=String(!!_),_=g.precision?_.substring(0,g.precision):_;break;case"T":_=Object.prototype.toString.call(_).slice(8,-1).toLowerCase(),_=g.precision?_.substring(0,g.precision):_;break;case"u":_=parseInt(_,10)>>>0;break;case"v":_=_.valueOf(),_=g.precision?_.substring(0,g.precision):_;break;case"x":_=(parseInt(_,10)>>>0).toString(16);break;case"X":_=(parseInt(_,10)>>>0).toString(16).toUpperCase();break}a.json.test(g.type)?w+=_:(a.number.test(g.type)&&(!y||g.sign)?(f=y?"+":"-",_=_.toString().replace(a.sign,"")):f="",p=g.pad_char?g.pad_char==="0"?"0":g.pad_char.charAt(1):" ",u=g.width-(f+_).length,b=g.width&&u>0?p.repeat(u):"",w+=g.align?f+_+b:p==="0"?f+b+_:b+f+_)}return w}var c=Object.create(null);function h(m){if(c[m])return c[m];for(var d=m,T,l=[],_=0;d;){if((T=a.text.exec(d))!==null)l.push(T[0]);else if((T=a.modulo.exec(d))!==null)l.push("%");else if((T=a.placeholder.exec(d))!==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");d=d.substring(T[0].length)}return c[m]=l}t.sprintf=n,t.vsprintf=o,typeof window<"u"&&(window.sprintf=n,window.vsprintf=o,i=function(){return{sprintf:n,vsprintf:o}}.call(t,r,t,e),i!==void 0&&(e.exports=i))})()},3711:function(e,t,r){"use strict";e.exports=h;var i=r(2640),a=r(781),n={"2d":function(m,d,T){var l=m({order:d,scalarArguments:3,getters:T==="generic"?[0]:void 0,phase:function(w,S,E,g){return w>g|0},vertex:function(w,S,E,g,b,p,u,y,f,P,L,z,F){var B=(u<<0)+(y<<1)+(f<<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*(g+E-2*F)/(E-g),S-.25-.25*(b+E-2*F)/(E-b)]);break;case 2:L.push([w-.75-.25*(-g-E+2*F)/(g-E),S-.25-.25*(p+g-2*F)/(g-p)]);break;case 3:L.push([w-.5,S-.5-.5*(b+E+p+g-4*F)/(E-b+g-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*(g+E+p+b-4*F)/(E-g+b-p),S-.5]);break;case 6:L.push([w-.5-.25*(-g-E+p+b)/(g-E+b-p),S-.5-.25*(-b-E+p+g)/(b-E+g-p)]);break;case 7:L.push([w-.75-.25*(p+b-2*F)/(b-p),S-.75-.25*(p+g-2*F)/(g-p)]);break;case 8:L.push([w-.75-.25*(-p-b+2*F)/(p-b),S-.75-.25*(-p-g+2*F)/(p-g)]);break;case 9:L.push([w-.5-.25*(g+E+-p-b)/(E-g+p-b),S-.5-.25*(b+E+-p-g)/(E-b+p-g)]);break;case 10:L.push([w-.5-.5*(-g-E+-p-b+4*F)/(g-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-g+4*F)/(b-E+p-g)]);break;case 13:L.push([w-.75-.25*(g+E-2*F)/(E-g),S-.25-.25*(-p-g+2*F)/(p-g)]);break;case 14:L.push([w-.25-.25*(-g-E+2*F)/(g-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,g,b,p,u,y,f){b?y.push([w,S]):y.push([S,w])}});return function(_,w){var S=[],E=[];return l(_,S,E,w),{positions:S,cells:E}}}};function o(m,d){var T=m.length+"d",l=n[T];if(l)return l(i,m,d)}function s(m,d){for(var T=a(m,d),l=T.length,_=new Array(l),w=new Array(l),S=0;SMath.max(g,b)?p[2]=1:g>Math.max(E,b)?p[0]=1:p[1]=1;for(var u=0,y=0,f=0;f<3;++f)u+=S[f]*S[f],y+=p[f]*S[f];for(var f=0;f<3;++f)p[f]-=y/u*S[f];return s(p,p),p}function T(S,E,g,b,p,u,y,f){this.center=i(g),this.up=i(b),this.right=i(p),this.radius=i([u]),this.angle=i([y,f]),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,g=this.computedRight,b=0,p=0,u=0;u<3;++u)p+=E[u]*g[u],b+=E[u]*E[u];for(var y=Math.sqrt(b),f=0,u=0;u<3;++u)g[u]-=E[u]*p/b,f+=g[u]*g[u],E[u]/=y;for(var P=Math.sqrt(f),u=0;u<3;++u)g[u]/=P;var L=this.computedToward;o(L,E,g),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,se=U,he=-O*U,H=-I*U,$=N,J=this.computedEye,X=this.computedMatrix,u=0;u<3;++u){var oe=Q*g[u]+ue*L[u]+se*E[u];X[4*u+1]=he*g[u]+H*L[u]+$*E[u],X[4*u+2]=oe,X[4*u+3]=0}var ne=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-ne*be,Re=ne*ce-j*re,We=h(Ae,ze,Re);Ae/=We,ze/=We,Re/=We,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 f=0,it=0;it<3;++it)f+=X[u+4*it]*J[it];X[12+u]=-f}X[15]=1},l.getMatrix=function(S,E){this.recalcMatrix(S);var g=this.computedMatrix;if(E){for(var b=0;b<16;++b)E[b]=g[b];return E}return g};var _=[0,0,0];l.rotate=function(S,E,g,b){if(this.angle.move(S,E,g),b){this.recalcMatrix(S);var p=this.computedMatrix;_[0]=p[2],_[1]=p[6],_[2]=p[10];for(var u=this.computedUp,y=this.computedRight,f=this.computedToward,P=0;P<3;++P)p[4*P]=u[P],p[4*P+1]=y[P],p[4*P+2]=f[P];n(p,p,b,_);for(var P=0;P<3;++P)u[P]=p[4*P],y[P]=p[4*P+1];this.up.set(S,u[0],u[1],u[2]),this.right.set(S,y[0],y[1],y[2])}},l.pan=function(S,E,g,b){E=E||0,g=g||0,b=b||0,this.recalcMatrix(S);var p=this.computedMatrix,u=Math.exp(this.computedRadius[0]),y=p[1],f=p[5],P=p[9],L=h(y,f,P);y/=L,f/=L,P/=L;var z=p[0],F=p[4],B=p[8],O=z*y+F*f+B*P;z-=y*O,F-=f*O,B-=P*O;var I=h(z,F,B);z/=I,F/=I,B/=I;var N=z*E+y*g,U=F*E+f*g,W=B*E+P*g;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,g,b){this.center.move(S,E||0,g||0,b||0)},l.setMatrix=function(S,E,g,b){var p=1;typeof g=="number"&&(p=g|0),(p<0||p>3)&&(p=1);var u=(p+2)%3,y=(p+1)%3;E||(this.recalcMatrix(S),E=this.computedMatrix);var f=E[p],P=E[p+4],L=E[p+8];if(b){var F=Math.abs(f),B=Math.abs(P),O=Math.abs(L),I=Math.max(F,B,O);F===I?(f=f<0?-1:1,P=L=0):O===I?(L=L<0?-1:1,f=P=0):(P=P<0?-1:1,f=L=0)}else{var z=h(f,P,L);f/=z,P/=z,L/=z}var N=E[u],U=E[u+4],W=E[u+8],Q=N*f+U*P+W*L;N-=f*Q,U-=P*Q,W-=L*Q;var ue=h(N,U,W);N/=ue,U/=ue,W/=ue;var se=P*W-L*U,he=L*N-f*W,H=f*U-P*N,$=h(se,he,H);se/=$,he/=$,H/=$,this.center.jump(S,_e,fe,Fe),this.radius.idle(S),this.up.jump(S,f,P,L),this.right.jump(S,N,U,W);var J,X;if(p===2){var oe=E[1],ne=E[5],j=E[9],ee=oe*N+ne*U+j*W,re=oe*se+ne*he+j*H;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*f+be*P+Ae*L,Re=ce*N+be*U+Ae*W,We=ce*se+be*he+Ae*H;J=Math.asin(m(ze)),X=Math.atan2(We,Re)}this.angle.jump(S,X,J),this.recalcMatrix(S);var it=E[2],ot=E[6],tt=E[10],ut=this.computedMatrix;a(ut,E);var Me=ut[15],_e=ut[12]/Me,fe=ut[13]/Me,Fe=ut[14]/Me,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,g,b){this.recalcMatrix(S),E=E||this.computedEye,g=g||this.computedCenter,b=b||this.computedUp;var p=b[0],u=b[1],y=b[2],f=h(p,u,y);if(!(f<1e-6)){p/=f,u/=f,y/=f;var P=E[0]-g[0],L=E[1]-g[1],z=E[2]-g[2],F=h(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+y*N;O-=U*p,I-=U*u,N-=U*y;var W=h(O,I,N);if(!(W<.01&&(O=u*z-y*L,I=y*P-p*z,N=p*L-u*P,W=h(O,I,N),W<1e-6))){O/=W,I/=W,N/=W,this.up.set(S,p,u,y),this.right.set(S,O,I,N),this.center.set(S,g[0],g[1],g[2]),this.radius.set(S,Math.log(F));var Q=u*N-y*I,ue=y*O-p*N,se=p*I-u*O,he=h(Q,ue,se);Q/=he,ue/=he,se/=he;var H=p*P+u*L+y*z,$=O*P+I*L+N*z,J=Q*P+ue*L+se*z,X=Math.asin(m(H)),oe=Math.atan2(J,$),ne=this.angle._state,j=ne[ne.length-1],ee=ne[ne.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 g(B){return new Int8Array(_(B),0,B)}t.mallocInt8=g;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 y(B){return new Float64Array(_(8*B),0,B)}t.mallocFloat64=t.mallocDouble=y;function f(B){return o?new Uint8ClampedArray(_(B),0,B):w(B)}t.mallocUint8Clamped=f;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=i.nextPow2(B);var O=i.log2(B),I=d[O];return I.length>0?I.pop():new n(B)}t.mallocBuffer=F,t.clearCache=function(){for(var O=0;O<32;++O)h.UINT8[O].length=0,h.UINT16[O].length=0,h.UINT32[O].length=0,h.INT8[O].length=0,h.INT16[O].length=0,h.INT32[O].length=0,h.FLOAT[O].length=0,h.DOUBLE[O].length=0,h.BIGUINT64[O].length=0,h.BIGINT64[O].length=0,h.UINT8C[O].length=0,m[O].length=0,d[O].length=0}},1755:function(e){"use strict";"use restrict";e.exports=t;function t(i){this.roots=new Array(i),this.ranks=new Array(i);for(var a=0;a",N="",U=I.length,W=N.length,Q=F[0]===_||F[0]===E,ue=0,se=-W;ue>-1&&(ue=B.indexOf(I,ue),!(ue===-1||(se=B.indexOf(N,ue+U),se===-1)||se<=ue));){for(var he=ue;he=se)O[he]=null,B=B.substr(0,he)+" "+B.substr(he+1);else if(O[he]!==null){var H=O[he].indexOf(F[0]);H===-1?O[he]+=F:Q&&(O[he]=O[he].substr(0,H+1)+(1+parseInt(O[he][H+1]))+O[he].substr(H+2))}var $=ue+U,J=B.substr($,se-$),X=J.indexOf(I);X!==-1?ue=X:ue=se+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*H*(kt-Lt)}if(N.superscripts===!0){var qt=fe.indexOf(_),Zt=Fe.indexOf(_),Sr=qt>-1?parseInt(fe[1+qt]):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*H*(xr-Sr)}if(N.bolds===!0){var jr=fe.indexOf(m)>-1,wr=Fe.indexOf(m)>-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(ne=0;ne0&&(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(f){f.permitHostObjects___&&f.permitHostObjects___(r)}typeof ses<"u"&&(ses.weakMapPermitHostObjects=r);var i=!1;if(typeof WeakMap=="function"){var a=WeakMap;if(!(typeof navigator<"u"&&/Firefox/.test(navigator.userAgent))){var n=new a,o=Object.freeze({});if(n.set(o,1),n.get(o)!==1)i=!0;else{e.exports=WeakMap;return}}}var s=Object.prototype.hasOwnProperty,c=Object.getOwnPropertyNames,h=Object.defineProperty,m=Object.isExtensible,d="weakmap:",T=d+"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=d+"rand:"+Array.prototype.map.call(_,function(f){return(f%36).toString(36)}).join("")+"___"}function w(f){return!(f.substr(0,d.length)==d&&f.substr(f.length-3)==="___")}if(h(Object,"getOwnPropertyNames",{value:function(P){return c(P).filter(w)}}),"getPropertyNames"in Object){var S=Object.getPropertyNames;h(Object,"getPropertyNames",{value:function(P){return S(P).filter(w)}})}function E(f){if(f!==Object(f))throw new TypeError("Not an object: "+f);var P=f[T];if(P&&P.key===f)return P;if(m(f)){P={key:f};try{return h(f,T,{value:P,writable:!1,enumerable:!1,configurable:!1}),P}catch{return}}}(function(){var f=Object.freeze;h(Object,"freeze",{value:function(F){return E(F),f(F)}});var P=Object.seal;h(Object,"seal",{value:function(F){return E(F),P(F)}});var L=Object.preventExtensions;h(Object,"preventExtensions",{value:function(F){return E(F),L(F)}})})();function g(f){return f.prototype=null,Object.freeze(f)}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,y=function(){this instanceof y||p();var f=[],P=[],L=u++;function z(I,N){var U,W=E(I);return W?L in W?W[L]:N:(U=f.indexOf(I),U>=0?P[U]:N)}function F(I){var N=E(I);return N?L in N:f.indexOf(I)>=0}function B(I,N){var U,W=E(I);return W?W[L]=N:(U=f.indexOf(I),U>=0?P[U]=N:(U=f.length,P[U]=N,f[U]=I)),this}function O(I){var N=E(I),U,W;return N?L in N&&delete N[L]:(U=f.indexOf(I),U<0?!1:(W=f.length-1,f[U]=void 0,P[U]=P[W],f[U]=f[W],f.length=W,P.length=W,!0))}return Object.create(y.prototype,{get___:{value:g(z)},has___:{value:g(F)},set___:{value:g(B)},delete___:{value:g(O)}})};y.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(){i&&typeof Proxy<"u"&&(Proxy=void 0);function f(){this instanceof y||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;i?O=function(N,U){return P.set(N,U),P.has(N)||(L||(L=new y),L.set(N,U)),this}:O=function(N,U){if(z)try{P.set(N,U)}catch{L||(L=new y),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(y.prototype,{get___:{value:g(F)},has___:{value:g(B)},set___:{value:g(O)},delete___:{value:g(I)},permitHostObjects___:{value:g(function(N){if(N===r)z=!0;else throw new Error("bogus call to permitHostObjects___")})}})}f.prototype=y.prototype,e.exports=f,Object.defineProperty(WeakMap.prototype,"constructor",{value:WeakMap,enumerable:!1,configurable:!0,writable:!0})}():(typeof Proxy<"u"&&(Proxy=void 0),e.exports=y)})()},236:function(e,t,r){var i=r(8284);e.exports=a;function a(){var n={};return function(o){if((typeof o!="object"||o===null)&&typeof o!="function")throw new Error("Weakmap-shim: Key must be object");var s=o.valueOf(n);return s&&s.identity===n?s:i(o,n)}}},8284:function(e){e.exports=t;function t(r,i){var a={identity:i},n=r.valueOf;return Object.defineProperty(r,"valueOf",{value:function(o){return o!==i?n.apply(this,arguments):a},writable:!0}),a}},606:function(e,t,r){var i=r(236);e.exports=a;function a(){var n=i();return{get:function(o,s){var c=n(o);return c.hasOwnProperty("value")?c.value:s},set:function(o,s){return n(o).value=s,this},has:function(o){return"value"in n(o)},delete:function(o){return delete n(o).value}}}},3349:function(e){"use strict";function t(){return function(s,c,h,m,d,T){var l=s[0],_=h[0],w=[0],S=_;m|=0;var E=0,g=_;for(E=0;E=0!=p>=0&&d.push(w[0]+.5+.5*(b+p)/(b-p))}m+=g,++w[0]}}}function r(){return t()}var i=r;function a(s){var c={};return function(m,d,T){var l=m.dtype,_=m.order,w=[l,_.join()].join(),S=c[w];return S||(c[w]=S=s([l,_])),S(m.shape.slice(0),m.data,m.stride,m.offset|0,d,T)}}function n(s){return a(i.bind(void 0,s))}function o(s){return n({funcName:s.funcName})}e.exports=o({funcName:"zeroCrossings"})},781:function(e,t,r){"use strict";e.exports=a;var i=r(3349);function a(n,o){var s=[];return o=+o||0,i(n.hi(n.shape[0]-1),s,o),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 v[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})()}}),_5=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]}}}),GN=Ze({"node_modules/color-normalize/node_modules/color-parse/index.js"(Z,q){"use strict";var v=_5();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,i;if(typeof M=="string")if(M=M.toLowerCase(),v[M])t=v[M].slice(),i="rgb";else if(M==="transparent")r=0,i="rgb",t=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(M)){var a=M.slice(1),n=a.length,o=n<=4;r=1,o?(t=[parseInt(a[0]+a[0],16),parseInt(a[1]+a[1],16),parseInt(a[2]+a[2],16)],n===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)],n===8&&(r=parseInt(a[6]+a[7],16)/255)),t[0]||(t[0]=0),t[1]||(t[1]=0),t[2]||(t[2]=0),i="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$/,"");i=a;var n=a==="cmyk"?4:a==="gray"?1:3;t=e[2].trim().split(/\s*[,\/]\s*|\s+/).map(function(d,T){if(/%$/.test(d))return T===n?parseFloat(d)/100:a==="rgb"?parseFloat(d)*255/100:parseFloat(d);if(a[T]==="h"){if(/deg$/.test(d))return parseFloat(d);if(x[d]!==void 0)return x[d]}return parseFloat(d)}),s===a&&t.push(1),r=c||t[n]===void 0?1:t[n],t=t.slice(0,n)}else M.length>10&&/[0-9](?:\s|\/)/.test(M)&&(t=M.match(/([0-9]+)/g).map(function(h){return parseFloat(h)}),i=M.match(/([a-z])/ig).join("").toLowerCase());else isNaN(M)?Array.isArray(M)||M.length?(t=[M[0],M[1],M[2]],i="rgb",r=M.length===4?M[3]:1):M instanceof Object&&(M.r!=null||M.red!=null||M.R!=null?(i="rgb",t=[M.r||M.red||M.R||0,M.g||M.green||M.G||0,M.b||M.blue||M.B||0]):(i="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)):(i="rgb",t=[M>>>16,(M&65280)>>>8,M&255]);return{space:i,values:t,alpha:r}}}}),HN=Ze({"node_modules/color-normalize/node_modules/color-rgba/index.js"(Z,q){"use strict";var v=GN();q.exports=function(M){Array.isArray(M)&&M.raw&&(M=String.raw.apply(null,arguments));var e,t,r,i=v(M);if(!i.space)return[];var a=[0,0,0],n=i.space[0]==="h"?[360,100,100]:[255,255,255];return e=Array(3),e[0]=Math.min(Math.max(i.values[0],a[0]),n[0]),e[1]=Math.min(Math.max(i.values[1],a[1]),n[1]),e[2]=Math.min(Math.max(i.values[2],a[2]),n[2]),i.space[0]==="h"&&(e=x(e)),e.push(Math.min(Math.max(i.alpha,0),1)),e};function x(A){var M=A[0]/360,e=A[1]/100,t=A[2]/100,r,i,a,n,o,s=0;if(e===0)return o=t*255,[o,o,o];for(i=t<.5?t*(1+e):t+e-t*e,r=2*t-i,n=[0,0,0];s<3;)a=M+1/3*-(s-1),a<0?a++:a>1&&a--,o=6*a<1?r+(i-r)*6*a:2*a<1?i:3*a<2?r+(i-r)*(2/3-a)*6:r,n[s++]=o*255;return n}}}),vx=Ze({"node_modules/clamp/index.js"(Z,q){q.exports=v;function v(x,A,M){return AM?M:x:xA?A:x}}}),Q3=Ze({"node_modules/dtype/index.js"(Z,q){q.exports=function(v){switch(v){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}}}}),hg=Ze({"node_modules/color-normalize/index.js"(Z,q){"use strict";var v=HN(),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 i=A(r),a=new i(4),n=r!=="uint8"&&r!=="uint8_clamped";return(!t.length||typeof t=="string")&&(t=v(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,n&&(a[0]/=255,a[1]/=255,a[2]/=255,a[3]/=255),a):(n?(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 v=hg();function x(A){return A?v(A):[0,0,0,1]}q.exports=x}}),em=Ze({"src/lib/gl_format_color.js"(Z,q){"use strict";var v=is(),x=Ch(),A=hg(),M=rc(),e=oh().defaultLine,t=xp().isArrayOrTypedArray,r=A(e),i=1;function a(h,m){var d=h;return d[3]*=m,d}function n(h){if(v(h))return r;var m=A(h);return m.length?m:r}function o(h){return v(h)?h:i}function s(h,m,d){var T=h.color;T&&T._inputArray&&(T=T._inputArray);var l=t(T),_=t(m),w=M.extractOpts(h),S=[],E,g,b,p,u;if(w.colorscale!==void 0?E=M.makeColorScaleFuncFromTrace(h):E=n,l?g=function(f,P){return f[P]===void 0?r:A(E(f[P]))}:g=n,_?b=function(f,P){return f[P]===void 0?i:o(f[P])}:b=o,l||_)for(var y=0;y0){var d=i.c2l(h);i._lowerLogErrorBound||(i._lowerLogErrorBound=d),i._lowerErrorBound=Math.min(i._lowerLogErrorBound,d)}}else n[o]=[-s[0]*r,s[1]*r]}return n}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)},d.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 f(P,L){var z=new m(P,L.uid);return z.update(L),z}q.exports=f}}),b5=Ze({"src/traces/scatter3d/attributes.js"(Z,q){"use strict";var v=tf(),x=tc(),A=Mu(),M=Qc().axisHoverFormat,e=Cs().hovertemplateAttrs,t=Cs().texttemplateAttrs,r=eu(),i=x5(),a=eT(),n=rs().extendFlat,o=pc().overrideAll,s=Km(),c=v.line,h=v.marker,m=h.line,d=n({width:c.width,dash:{valType:"enumerated",values:s(i),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=o({x:v.x,y:v.y,z:{valType:"data_array"},text:n({},v.text,{}),texttemplate:t({},{}),hovertext:n({},v.hovertext,{}),hovertemplate:e(),xhoverformat:M("x"),yhoverformat:M("y"),zhoverformat:M("z"),mode:n({},v.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:v.connectgaps,line:d,marker:n({symbol:{valType:"enumerated",values:s(a),dflt:"circle",arrayOk:!0},size:n({},h.size,{dflt:8}),sizeref:h.sizeref,sizemin:h.sizemin,sizemode:h.sizemode,opacity:n({},h.opacity,{arrayOk:!1}),colorbar:h.colorbar,line:n({width:n({},m.width,{arrayOk:!1})},A("marker.line"))},A("marker")),textposition:n({},v.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:n({},r.hoverinfo)},"calc","nested");l.x.editType=l.y.editType=l.z.editType="calc+clearAxisTypes"}}),ZN=Ze({"src/traces/scatter3d/defaults.js"(Z,q){"use strict";var v=oo(),x=ca(),A=Fu(),M=md(),e=Dd(),t=zd(),r=b5();q.exports=function(n,o,s,c){function h(E,g){return x.coerce(n,o,r,E,g)}var m=i(n,o,h,c);if(!m){o.visible=!1;return}h("text"),h("hovertext"),h("hovertemplate"),h("xhoverformat"),h("yhoverformat"),h("zhoverformat"),h("mode"),A.hasMarkers(o)&&M(n,o,s,c,h,{noSelect:!0,noAngle:!0}),A.hasLines(o)&&(h("connectgaps"),e(n,o,s,c,h)),A.hasText(o)&&(h("texttemplate"),t(n,o,c,h,{noSelect:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0}));var d=(o.line||{}).color,T=(o.marker||{}).color;h("surfaceaxis")>=0&&h("surfacecolor",d||T);for(var l=["x","y","z"],_=0;_<3;++_){var w="projection."+l[_];h(w+".show")&&(h(w+".opacity"),h(w+".scale"))}var S=v.getComponentMethod("errorbars","supplyDefaults");S(n,o,d||T||s,{axis:"z"}),S(n,o,d||T||s,{axis:"y",inherit:"z"}),S(n,o,d||T||s,{axis:"x",inherit:"z"})};function i(a,n,o,s){var c=0,h=o("x"),m=o("y"),d=o("z"),T=v.getComponentMethod("calendars","handleTraceDefaults");return T(a,n,["x","y","z"],s),h&&m&&d&&(c=Math.min(h.length,m.length,d.length),n._length=n._xlength=n._ylength=n._zlength=c),c}}}),YN=Ze({"src/traces/scatter3d/calc.js"(Z,q){"use strict";var v=Av(),x=Fd();q.exports=function(M,e){var t=[{x:!1,y:!1,trace:e,t:{}}];return v(t,e),x(M,e),t}}}),KN=Ze({"node_modules/get-canvas-context/index.js"(Z,q){q.exports=v;function v(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 i=0;i/g," "));o[s]=d,c.tickmode=h}}i.ticks=o;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)i.bounds[T][s]=r.glplot.bounds[T][s]}r.contourLevels=e(o)}}}),tU=Ze({"src/plots/gl3d/scene.js"(Z,q){"use strict";var v=Yh().gl_plot3d,x=v.createCamera,A=v.createScene,M=JN(),e=x2(),t=oo(),r=ca(),i=r.preserveDrawingBuffer(),a=Wo(),n=ef(),o=Qv(),s=w5(),c=NS(),h=$N(),m=QN(),d=eU(),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=h(F,F[this.id]),this.spikeOptions=m(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:i,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 g=!0;E.tryCreatePlot=function(){var z=this,F=z.prepareOptions(),B=!0;try{z.glplot=A(F)}catch{if(z.staticMode||!g||i)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{i=F.glOptions.preserveDrawingBuffer=!0,z.glplot=A(F)}catch{i=F.glOptions.preserveDrawingBuffer=!1,B=!1}}}return g=!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),d(z),z.glplot.axes.update(z.axesOptions);for(var ue=Object.keys(z.traces),se=null,he=z.glplot.selection,H=0;H")):B.type==="isosurface"||B.type==="volume"?(ne.valueLabel=a.hoverLabelText(z._mockAxis,z._mockAxis.d2l(he.traceCoordinate[3]),B.valuehoverformat),be.push("value: "+ne.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};n.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=[];n.loneHover({trace:X,x:(.5+.5*J[0]/J[3])*W,y:(.5-.5*J[1]/J[3])*Q,xLabel:ne.xLabel,yLabel:ne.yLabel,zLabel:ne.zLabel,text:ce,name:se.name,color:n.castHoverOption(X,oe,"bgcolor")||se.color,borderColor:n.castHoverOption(X,oe,"bordercolor"),fontFamily:n.castHoverOption(X,oe,"font.family"),fontSize:n.castHoverOption(X,oe,"font.size"),fontColor:n.castHoverOption(X,oe,"font.color"),nameLength:n.castHoverOption(X,oe,"namelength"),textAlign:n.castHoverOption(X,oe,"align"),hovertemplate:r.castOption(X,oe,"hovertemplate"),hovertemplateLabels:r.extendFlat({},Ae,ne),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 n.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"],se=F["_"+U+"length"];if(!r.isArrayOrTypedArray(Q))B[0][I]=Math.min(B[0][I],0),B[1][I]=Math.max(B[1][I],se-1);else for(var he,H=0;H<(se||Q.length);H++)if(r.isArrayOrTypedArray(Q[H]))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,ut=se.aspectmode;if(ut==="cube")tt=[1,1,1];else if(ut==="manual"){var Me=se.aspectratio;tt=[Me.x,Me.y,Me.z]}else if(ut==="auto"||ut==="data"){var _e=[1,1,1];for(U=0;U<3;++U){Q=se[b[U]],ue=Q.type;var fe=ne[ue];_e[U]=Math.pow(fe.acc,1/fe.count)/$[U]}ut==="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");se.aspectratio.x=he.aspectratio.x=tt[0],se.aspectratio.y=he.aspectratio.y=tt[1],se.aspectratio.z=he.aspectratio.z=tt[2],O.glplot.setAspectratio(se.aspectratio),O.viewInitial.aspectratio||(O.viewInitial.aspectratio={x:se.aspectratio.x,y:se.aspectratio.y,z:se.aspectratio.z}),O.viewInitial.aspectmode||(O.viewInitial.aspectmode=se.aspectmode);var Fe=se.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 y(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 f(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()),f(z.camera)},E.setViewport=function(z){var F=this,B=z.camera;F.camera.lookAt.apply(this,y(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,se,he,H){var $=["up","center","eye"],J=["x","y","z"];return se[$[he]]&&ue[$[he]][J[H]]===se[$[he]][J[H]]}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),se=F.isAspectChanged(z),he=ue||se;if(he){var H={};if(ue&&(O=F.getCamera(),I=r.nestedProperty(z,F.id+".camera"),N=I.get(),H[F.id+".camera"]=N),se&&(U=F.glplot.getAspectratio(),W=r.nestedProperty(z,F.id+".aspectratio"),Q=W.get(),H[F.id+".aspectratio"]=Q),t.call("_storeDirectGUIEdit",z,B._preGUI,H),ue){I.set(O);var $=r.nestedProperty(B,F.id+".camera");$.set(O)}if(se){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 se=B.id+".camera.up",he={x:0,y:0,z:1},H={};H[se]=he;var $=I.layout;t.call("_storeDirectGUIEdit",$,N._preGUI,H),U.up=he,r.nestedProperty($,se).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}}),rU=Ze({"src/plots/gl3d/layout/attributes.js"(Z,q){"use strict";q.exports={scene:{valType:"subplotid",dflt:"scene",editType:"calc+clearAxisTypes"}}}}),T5=Ze({"src/plots/gl3d/layout/axis_attributes.js"(Z,q){"use strict";var v=Yi(),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:v.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")}}),A5=Ze({"src/plots/gl3d/layout/layout_attributes.js"(Z,q){"use strict";var v=T5(),x=bc().attributes,A=rs().extendFlat,M=ca().counterRegex;function e(t,r,i){return{x:{valType:"number",dflt:t,editType:"camera"},y:{valType:"number",dflt:r,editType:"camera"},z:{valType:"number",dflt:i,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:v,yaxis:v,zaxis:v,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"}}}),aU=Ze({"src/plots/gl3d/layout/axis_defaults.js"(Z,q){"use strict";var v=Ch().mix,x=ca(),A=Dl(),M=T5(),e=OS(),t=z_(),r=["xaxis","yaxis","zaxis"],i=100*136/187;q.exports=function(n,o,s){var c,h;function m(l,_){return x.coerce(c,h,M,l,_)}for(var d=0;d1;function m(d){if(!h){var T=v.validate(o[d],t[d]);if(T)return o[d]}}M(o,s,c,{type:i,attributes:t,handleDefaults:a,fullLayout:s,font:s.font,fullData:c,getDfltFromLayout:m,autotypenumbersDflt:s.autotypenumbers,paper_bgcolor:s.paper_bgcolor,calendar:s.calendar})};function a(n,o,s,c){for(var h=s("bgcolor"),m=x.combine(h,c.paper_bgcolor),d=["up","center","eye"],T=0;T.999)&&(E="turntable")}else E="turntable";s("dragmode",E),s("hovermode",c.getDfltFromLayout("hovermode"))}}}),pg=Ze({"src/plots/gl3d/index.js"(Z){"use strict";var q=pc().overrideAll,v=Xm(),x=tU(),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=rU(),Z.layoutAttributes=A5(),Z.baseLayoutAttrOverrides=q({hoverlabel:v.hoverlabel},"plot","nested"),Z.supplyLayoutDefaults=nU(),Z.plot=function(a){for(var n=a._fullLayout,o=a._fullData,s=n._subplots[t],c=0;c0){P=c[L];break}return P}function T(y,f){if(!(y<1||f<1)){for(var P=m(y),L=m(f),z=1,F=0;FS;)L--,L/=d(L),L++,L1?z:1};function E(y,f,P){var L=P[8]+P[2]*f[0]+P[5]*f[1];return y[0]=(P[6]+P[0]*f[0]+P[3]*f[1])/L,y[1]=(P[7]+P[1]*f[0]+P[4]*f[1])/L,y}function g(y,f,P){return b(y,f,E,P),y}function b(y,f,P,L){for(var z=[0,0],F=y.shape[0],B=y.shape[1],O=0;O0&&this.contourStart[L]!==null&&this.contourEnd[L]!==null&&this.contourEnd[L]>this.contourStart[L]))for(f[L]=!0,z=this.contourStart[L];zQ&&(this.minValues[N]=Q),this.maxValues[N]c&&(i.isomin=null,i.isomax=null);var h=o("x"),m=o("y"),d=o("z"),T=o("value");if(!h||!h.length||!m||!m.length||!d||!d.length||!T||!T.length){i.visible=!1;return}var l=x.getComponentMethod("calendars","handleTraceDefaults");l(r,i,["x","y","z"],n),o("valuehoverformat"),["x","y","z"].forEach(function(E){o(E+"hoverformat");var g="caps."+E,b=o(g+".show");b&&o(g+".fill");var p="slices."+E,u=o(p+".show");u&&(o(p+".fill"),o(p+".locations"))});var _=o("spaceframe.show");_&&o("spaceframe.fill");var w=o("surface.show");w&&(o("surface.count"),o("surface.fill"),o("surface.pattern"));var S=o("contour.show");S&&(o("contour.color"),o("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){o(E)}),M(r,i,n,o,{prefix:"",cLetter:"c"}),i._length=null}q.exports={supplyDefaults:e,supplyIsoDefaults:t}}}),rT=Ze({"src/traces/streamtube/calc.js"(Z,q){"use strict";var v=ca(),x=jp();function A(r,i){i._len=Math.min(i.u.length,i.v.length,i.w.length,i.x.length,i.y.length,i.z.length),i._u=t(i.u,i._len),i._v=t(i.v,i._len),i._w=t(i.w,i._len),i._x=t(i.x,i._len),i._y=t(i.y,i._len),i._z=t(i.z,i._len);var a=M(i);i._gridFill=a.fill,i._Xs=a.Xs,i._Ys=a.Ys,i._Zs=a.Zs,i._len=a.len;var n=0,o,s,c;i.starts&&(o=t(i.starts.x||[]),s=t(i.starts.y||[]),c=t(i.starts.z||[]),n=Math.min(o.length,s.length,c.length)),i._startsX=o||[],i._startsY=s||[],i._startsZ=c||[];var h=0,m=1/0,d;for(d=0;d1&&(u=i[o-1],f=a[o-1],L=n[o-1]),s=0;su?"-":"+")+"x"),S=S.replace("y",(y>f?"-":"+")+"y"),S=S.replace("z",(P>L?"-":"+")+"z");var O=function(){o=0,z=[],F=[],B=[]};(!o||o0;m--){var d=Math.min(h[m],h[m-1]),T=Math.max(h[m],h[m-1]);if(T>d&&d-1}function ee(bt,Be){return bt===null?Be:bt}function re(bt,Be,Ke){ue();var Ue=[Be],Ee=[Ke];if(X>=1)Ue=[Be],Ee=[Ke];else if(X>0){var Ve=ne(Be,Ke);Ue=Ve.xyzv,Ee=Ve.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))}H(Te[0],Te[1],Te[2])}}function ce(bt,Be,Ke){var Ue=function(Ee,Ve,Ce){re(bt,[Be[Ee],Be[Ve],Be[Ce]],[Ke[Ee],Ke[Ve],Ke[Ce]])};Ue(0,1,2),Ue(2,3,0)}function be(bt,Be,Ke){var Ue=function(Ee,Ve,Ce){re(bt,[Be[Ee],Be[Ve],Be[Ce]],[Ke[Ee],Ke[Ve],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 Ee=bt[3];EeUe&&(Ee=Ue);for(var Ve=(bt[3]-Ee)/(bt[3]-Be[3]+1e-9),Ce=[],Te=0;Te<4;Te++)Ce[Te]=(1-Ve)*bt[Te]+Ve*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 We(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,Ee,Ve){Ve||(Ve=1),Ke=[-1,-1,-1];var Ce=!1,Te=[ze(Be[0][3],Ue,Ee),ze(Be[1][3],Ue,Ee),ze(Be[2][3],Ue,Ee)];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):VeTe?[z,Ve]:[Ve,F];qt(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(Qa.id),yt==="x"?Ba.push([Qa.distRatio,0,0]):yt==="y"?Ba.push([0,Qa.distRatio,0]):Ba.push([0,0,Qa.distRatio]))}else yt==="x"?la=jr(1,u-1):yt==="y"?la=jr(1,y-1):la=jr(1,f-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,y-1],rr,Qt,Tt[Gt]):Tt[Gt]=Qe(bt,[0,f-1],rr,Qt,Tt[Gt]),Gt++)}}),w===0&&se(),c._meshX=I,c._meshY=N,c._meshZ=U,c._meshIntensity=W,c._Xs=g,c._Ys=b,c._Zs=p}return Ir(),c}function s(c,h){var m=c.glplot.gl,d=v({gl:m}),T=new i(c,d,h.uid);return d._trace=T,T.update(h),c.glplot.add(d),T}q.exports={findNearestOnAxis:r,generateIsoMeshes:o,createIsosurfaceTrace:s}}}),fU=Ze({"src/traces/isosurface/index.js"(Z,q){"use strict";q.exports={attributes:tT(),supplyDefaults:M5().supplyDefaults,calc:E5(),colorbar:{min:"cmin",max:"cmax"},plot:aT().createIsosurfaceTrace,moduleType:"trace",name:"isosurface",basePlotModule:pg(),categories:["gl3d","showLegend"],meta:{}}}}),hU=Ze({"lib/isosurface.js"(Z,q){"use strict";q.exports=fU()}}),C5=Ze({"src/traces/volume/attributes.js"(Z,q){"use strict";var v=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},v("",{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"}}),pU=Ze({"src/traces/volume/defaults.js"(Z,q){"use strict";var v=ca(),x=C5(),A=M5().supplyIsoDefaults,M=S5().opacityscaleDefaults;q.exports=function(t,r,i,a){function n(o,s){return v.coerce(t,r,x,o,s)}A(t,r,i,a,n),M(t,r,a,n)}}}),dU=Ze({"src/traces/volume/convert.js"(Z,q){"use strict";var v=Yh().gl_mesh3d,x=em().parseColorScale,A=ca().isArrayOrTypedArray,M=Qv(),e=rc().extractOpts,t=E1(),r=aT().findNearestOnAxis,i=aT().generateIsoMeshes;function a(s,c,h){this.scene=s,this.uid=h,this.mesh=c,this.name="",this.data=null,this.showContour=!1}var n=a.prototype;n.handlePick=function(s){if(s.object===this.mesh){var c=s.data.index,h=this.data._meshX[c],m=this.data._meshY[c],d=this.data._meshZ[c],T=this.data._Ys.length,l=this.data._Zs.length,_=r(h,this.data._Xs).id,w=r(m,this.data._Ys).id,S=r(d,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 g=this.data.hovertext||this.data.text;return A(g)&&g[E]!==void 0?s.textLabel=g[E]:g&&(s.textLabel=g),!0}},n.update=function(s){var c=this.scene,h=c.fullSceneLayout;this.data=i(s);function m(w,S,E,g){return S.map(function(b){return w.d2l(b,0,g)*E})}var d=t(m(h.xaxis,s._meshX,c.dataScale[0],s.xcalendar),m(h.yaxis,s._meshY,c.dataScale[1],s.ycalendar),m(h.zaxis,s._meshZ,c.dataScale[2],s.zcalendar)),T=t(s._meshI,s._meshJ,s._meshK),l={positions:d,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)},n.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()};function o(s,c){var h=s.glplot.gl,m=v({gl:h}),d=new a(s,m,c.uid);return m._trace=d,d.update(c),s.glplot.add(m),d}q.exports=o}}),vU=Ze({"src/traces/volume/index.js"(Z,q){"use strict";q.exports={attributes:C5(),supplyDefaults:pU(),calc:E5(),colorbar:{min:"cmin",max:"cmax"},plot:dU(),moduleType:"trace",name:"volume",basePlotModule:pg(),categories:["gl3d","showLegend"],meta:{}}}}),mU=Ze({"lib/volume.js"(Z,q){"use strict";q.exports=vU()}}),gU=Ze({"src/traces/mesh3d/defaults.js"(Z,q){"use strict";var v=oo(),x=ca(),A=gh(),M=M1();q.exports=function(t,r,i,a){function n(m,d){return x.coerce(t,r,M,m,d)}function o(m){var d=m.map(function(T){var l=n(T);return l&&x.isArrayOrTypedArray(l)?l:null});return d.every(function(T){return T&&T.length===d[0].length})&&d}var s=o(["x","y","z"]);if(!s){r.visible=!1;return}if(o(["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=v.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(m){n(m)});var h=n("contour.show");h&&(n("contour.color"),n("contour.width")),"intensity"in t?(n("intensity"),n("intensitymode"),A(t,r,a,n,{prefix:"",cLetter:"c"})):(r.showscale=!1,"facecolor"in t?n("facecolor"):"vertexcolor"in t?n("vertexcolor"):n("color",i)),n("text"),n("hovertext"),n("hovertemplate"),n("xhoverformat"),n("yhoverformat"),n("zhoverformat"),r._length=null}}}),yU=Ze({"src/traces/mesh3d/calc.js"(Z,q){"use strict";var v=jp();q.exports=function(A,M){M.intensity&&v(A,M,{vals:M.intensity,containerStr:"",cLetter:"c"})}}}),_U=Ze({"src/traces/mesh3d/convert.js"(Z,q){"use strict";var v=Yh().gl_mesh3d,x=Yh().delaunay_triangulate,A=Yh().alpha_shape,M=Yh().convex_hull,e=em().parseColorScale,t=ca().isArrayOrTypedArray,r=Qv(),i=rc().extractOpts,a=E1();function n(l,_,w){this.scene=l,this.uid=w,this.mesh=_,this.name="",this.color="#fff",this.data=null,this.showContour=!1}var o=n.prototype;o.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}o.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)),g;if(l.i&&l.j&&l.k){if(l.i.length!==l.j.length||l.j.length!==l.k.length||!d(l.i,S)||!d(l.j,S)||!d(l.k,S))return;g=a(h(l.i),h(l.j),h(l.k))}else l.alphahull===0?g=M(E):l.alphahull>0?g=A(l.alphahull,E):g=m(l.delaunayaxis,E);var b={positions:E,cells:g,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=i(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)},o.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()};function T(l,_){var w=l.glplot.gl,S=v({gl:w}),E=new n(l,S,_.uid);return S._trace=E,E.update(_),l.glplot.add(S),E}q.exports=T}}),xU=Ze({"src/traces/mesh3d/index.js"(Z,q){"use strict";q.exports={attributes:M1(),supplyDefaults:gU(),calc:yU(),colorbar:{min:"cmin",max:"cmax"},plot:_U(),moduleType:"trace",name:"mesh3d",basePlotModule:pg(),categories:["gl3d","showLegend"],meta:{}}}}),bU=Ze({"lib/mesh3d.js"(Z,q){"use strict";q.exports=xU()}}),k5=Ze({"src/traces/cone/attributes.js"(Z,q){"use strict";var v=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,v("",{colorAttr:"u/v/w norm",showScaleDflt:!0,editTypeOverride:"calc"}));var i=["opacity","lightposition","lighting"];i.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}}),wU=Ze({"src/traces/cone/defaults.js"(Z,q){"use strict";var v=ca(),x=gh(),A=k5();q.exports=function(e,t,r,i){function a(T,l){return v.coerce(e,t,A,T,l)}var n=a("u"),o=a("v"),s=a("w"),c=a("x"),h=a("y"),m=a("z");if(!n||!n.length||!o||!o.length||!s||!s.length||!c||!c.length||!h||!h.length||!m||!m.length){t.visible=!1;return}var d=a("sizemode");a("sizeref",d==="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,i,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}}}),TU=Ze({"src/traces/cone/calc.js"(Z,q){"use strict";var v=jp();q.exports=function(A,M){for(var e=M.u,t=M.v,r=M.w,i=Math.min(M.x.length,M.y.length,M.z.length,e.length,t.length,r.length),a=-1/0,n=1/0,o=0;o2?d=h.slice(1,m-1):m===2?d=[(h[0]+h[1])/2]:d=h,d}function o(h){var m=h.length;return m===1?[.5,.5]:[h[1]-h[0],h[m-1]-h[m-2]]}function s(h,m){var d=h.fullSceneLayout,T=h.dataScale,l=m._len,_={};function w(he,H){var $=d[H],J=T[r[H]];return A.simpleMap(he,function(X){return $.d2l(X)*J})}if(_.vectors=t(w(m._u,"xaxis"),w(m._v,"yaxis"),w(m._w,"zaxis"),l),!l)return{positions:[],cells:[]};var S=w(m._Xs,"xaxis"),E=w(m._Ys,"yaxis"),g=w(m._Zs,"zaxis");_.meshgrid=[S,E,g],_.gridFill=m._gridFill;var b=m._slen;if(b)_.startingPositions=t(w(m._startsX,"xaxis"),w(m._startsY,"yaxis"),w(m._startsZ,"zaxis"));else{for(var p=E[0],u=n(S),y=n(g),f=new Array(u.length*y.length),P=0,L=0;Lp&&(p=P[0]),P[1]u&&(u=P[1])}function f(P){switch(P.type){case"GeometryCollection":P.geometries.forEach(f);break;case"Point":y(P.coordinates);break;case"MultiPoint":P.coordinates.forEach(y);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)f(w.objects[E]);return[g,b,p,u]}function e(w,S){for(var E,g=w.length,b=g-S;b<--g;)E=w[b],w[b++]=w[g],w[g]=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,g=S.bbox,b=S.properties==null?{}:S.properties,p=i(w,S);return E==null&&g==null?{type:"Feature",properties:b,geometry:p}:g==null?{type:"Feature",id:E,properties:b,geometry:p}:{type:"Feature",id:E,bbox:g,properties:b,geometry:p}}function i(w,S){var E=A(w.transform),g=w.arcs;function b(L,z){z.length&&z.pop();for(var F=g[L<0?~L:L],B=0,O=F.length;B1)g=s(w,S,E);else for(b=0,g=new Array(p=w.arcs.length);b1)for(var z=1,F=y(P[0]),B,O;zF&&(O=P[0],P[0]=P[z],P[z]=O,F=B);return P}).filter(function(f){return f.length>0})}}function d(w,S){for(var E=0,g=w.length;E>>1;w[b]=2))throw new Error("n must be \u22652");f=w.bbox||M(w);var E=f[0],g=f[1],b=f[2],p=f[3],u;S={scale:[b-E?(b-E)/(u-1):1,p-g?(p-g)/(u-1):1],translate:[E,g]}}else f=w.bbox;var y=l(S),f,P,L=w.objects,z={};function F(I){return y(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]=y(I[0],0);++N0&&(M.push(e),e=[])}return e.length>0&&M.push(e),M},Z.makeLine=function(v){return v.length===1?{type:"LineString",coordinates:v[0]}:{type:"MultiLineString",coordinates:v}},Z.makePolygon=function(v){if(v.length===1)return{type:"Polygon",coordinates:v};for(var x=new Array(v.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 n(L,z,F={}){return o(L.map(B=>a(B,z)),F)}function o(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 h(L,z,F={}){return A({type:"MultiPolygon",coordinates:L},z,F)}function m(L,z,F={}){return A({type:"GeometryCollection",geometries:L},z,F)}function d(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=v[z];if(!F)throw new Error(z+" units is invalid");return L*F}function l(L,z="kilometers"){let F=v[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 g(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 y(L){return L!==null&&typeof L=="object"&&!Array.isArray(L)}function f(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=g,Z.earthRadius=q,Z.factors=v,Z.feature=A,Z.featureCollection=o,Z.geometry=M,Z.geometryCollection=m,Z.isNumber=u,Z.isObject=y,Z.lengthToDegrees=_,Z.lengthToRadians=l,Z.lineString=a,Z.lineStrings=n,Z.multiLineString=s,Z.multiPoint=c,Z.multiPolygon=h,Z.point=e,Z.points=t,Z.polygon=r,Z.polygons=i,Z.radiansToDegrees=E,Z.radiansToLength=T,Z.round=d,Z.validateBBox=f,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 v(l,_,w){if(l!==null)for(var S,E,g,b,p,u,y,f=0,P=0,L,z=l.type,F=z==="FeatureCollection",B=z==="Feature",O=F?l.features.length:1,I=0;Iu||F>y||B>f){p=P,u=S,y=F,f=B,g=0;return}var O=q.lineString.call(void 0,[p,P],w.properties);if(_(O,S,E,B,g)===!1)return!1;g++,p=P})===!1)return!1}}})}function c(l,_,w){var S=w,E=!1;return s(l,function(g,b,p,u,y){E===!1&&w===void 0?S=g:S=_(S,g,b,p,u,y),E=!0}),S}function h(l,_){if(!l)throw new Error("geojson is required");n(l,function(w,S,E){if(w.geometry!==null){var g=w.geometry.type,b=w.geometry.coordinates;switch(g){case"LineString":if(_(w,S,E,0,0)===!1)return!1;break;case"Polygon":for(var p=0;pn+A(o),0)}function A(a){let n=0,o;switch(a.type){case"Polygon":return M(a.coordinates);case"MultiPolygon":for(o=0;o0){n+=Math.abs(r(a[0]));for(let o=1;o=n?(s+2)%n:s+2],d=c[0]*t,T=h[1]*t,l=m[0]*t;o+=(l-d)*Math.sin(T),s++}return o*e}var i=x;Z.area=x,Z.default=i}}),zU=Ze({"node_modules/@turf/centroid/dist/cjs/index.cjs"(Z){"use strict";Object.defineProperty(Z,"__esModule",{value:!0});var q=oT(),v=sT();function x(M,e={}){let t=0,r=0,i=0;return v.coordEach.call(void 0,M,function(a){t+=a[0],r+=a[1],i++},!0),q.point.call(void 0,[t/i,r/i],e.properties)}var A=x;Z.centroid=x,Z.default=A}}),FU=Ze({"node_modules/@turf/bbox/dist/cjs/index.cjs"(Z){"use strict";Object.defineProperty(Z,"__esModule",{value:!0});var q=sT();function v(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=n.tester(B);I.pts.pop(),p.push(I)}:u=function(z){p.push(n.tester(z))},E.type){case"MultiPolygon":for(y=0;y0?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(g.type){case"FeatureCollection":var P=g.features;for(u=0;up&&(p=f,g=y)}else g=E;return M(g).geometry.coordinates}function _(S){var E=window.PlotlyGeoAssets||{},g=[];function b(P){return new Promise(function(L,z){v.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")}}}),BU=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}}}),NU=Ze({"src/traces/scattergeo/select.js"(Z,q){"use strict";var v=Fu(),x=Vs().BADNUM;q.exports=function(M,e){var t=M.cd,r=M.xaxis,i=M.yaxis,a=[],n=t[0].trace,o,s,c,h,m,d=!v.hasMarkers(n)&&!v.hasText(n);if(d)return[];if(e===!1)for(m=0;mX?1:J>=X?0:NaN}function A(J){return J.length===1&&(J=M(J)),{left:function(X,oe,ne,j){for(ne==null&&(ne=0),j==null&&(j=X.length);ne>>1;J(X[ee],oe)<0?ne=ee+1:j=ee}return ne},right:function(X,oe,ne,j){for(ne==null&&(ne=0),j==null&&(j=X.length);ne>>1;J(X[ee],oe)>0?j=ee:ne=ee+1}return ne}}}function M(J){return function(X,oe){return x(J(X),oe)}}var e=A(x),t=e.right,r=e.left;function i(J,X){X==null&&(X=a);for(var oe=0,ne=J.length-1,j=J[0],ee=new Array(ne<0?0:ne);oeJ?1:X>=J?0:NaN}function s(J){return J===null?NaN:+J}function c(J,X){var oe=J.length,ne=0,j=-1,ee=0,re,ce,be=0;if(X==null)for(;++j1)return be/(ne-1)}function h(J,X){var oe=c(J,X);return oe&&Math.sqrt(oe)}function m(J,X){var oe=J.length,ne=-1,j,ee,re;if(X==null){for(;++ne=j)for(ee=re=j;++nej&&(ee=j),re=j)for(ee=re=j;++nej&&(ee=j),re0)return[J];if((ne=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>=g?5:ee>=b?2:1)*Math.pow(10,j):-Math.pow(10,-j)/(ee>=E?10:ee>=g?5:ee>=b?2:1)}function y(J,X,oe){var ne=Math.abs(X-J)/Math.max(0,oe),j=Math.pow(10,Math.floor(Math.log(ne)/Math.LN10)),ee=ne/j;return ee>=E?j*=10:ee>=g?j*=5:ee>=b&&(j*=2),XRe;)We.pop(),--it;var ot=new Array(it+1),tt;for(ee=0;ee<=it;++ee)tt=ot[ee]=[],tt.x0=ee>0?We[ee-1]:ze,tt.x1=ee=1)return+oe(J[ne-1],ne-1,J);var ne,j=(ne-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*h(J)*Math.pow(J.length,-1/3)))}function B(J,X){var oe=J.length,ne=-1,j,ee;if(X==null){for(;++ne=j)for(ee=j;++neee&&(ee=j)}else for(;++ne=j)for(ee=j;++neee&&(ee=j);return ee}function O(J,X){var oe=J.length,ne=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,ne=-1,j,ee;if(X==null){for(;++ne=j)for(ee=j;++nej&&(ee=j)}else for(;++ne=j)for(ee=j;++nej&&(ee=j);return ee}function W(J,X){for(var oe=X.length,ne=new Array(oe);oe--;)ne[oe]=J[X[oe]];return ne}function Q(J,X){if(oe=J.length){var oe,ne=0,j=0,ee,re=J[j];for(X==null&&(X=x);++ne0?1:er<0?-1:0},p=Math.sqrt,u=Math.tan;function y(er){return er>1?0:er<-1?a:Math.acos(er)}function f(er){return er>1?n:er<-1?-n:Math.asin(er)}function P(er){return(er=g(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 ia=er.features,$r=-1,La=ia.length;++$r=0?1:-1,La=$r*ia,pn=l(yr),In=g(yr),Yn=H*In,ri=he*pn+Yn*l(La),di=Yn*$r*g(La);U.add(T(di,ri)),se=er,he=pn,H=In}function j(er){return W.reset(),N(er,$),W*2}function ee(er){return[T(er[1],er[0]),f(er[2])]}function re(er){var yr=er[0],ia=er[1],$r=l(ia);return[$r*l(yr),$r*g(yr),g(ia)]}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 We,it,ot,tt,ut,Me,_e,fe,Fe=A(),rt,st,Qe={point:Lt,lineStart:qt,lineEnd:Zt,polygonStart:function(){Qe.point=Sr,Qe.lineStart=xr,Qe.lineEnd=jr,Fe.reset(),$.polygonStart()},polygonEnd:function(){$.polygonEnd(),Qe.point=Lt,Qe.lineStart=qt,Qe.lineEnd=Zt,U<0?(We=-(ot=180),it=-(tt=90)):Fe>r?tt=90:Fe<-r&&(it=-90),st[0]=We,st[1]=ot},sphere:function(){We=-(ot=180),it=-(tt=90)}};function Lt(er,yr){rt.push(st=[We=er,ot=er]),yrtt&&(tt=yr)}function kt(er,yr){var ia=re([er*h,yr*h]);if(fe){var $r=be(fe,ia),La=[$r[1],-$r[0],0],pn=be(La,$r);Re(pn),pn=ee(pn);var In=er-ut,Yn=In>0?1:-1,ri=pn[0]*c*Yn,di,Dn=m(In)>180;Dn^(Yn*uttt&&(tt=di)):(ri=(ri+360)%360-180,Dn^(Yn*uttt&&(tt=yr))),Dn?erwr(We,ot)&&(ot=er):wr(er,ot)>wr(We,ot)&&(We=er):ot>=We?(erot&&(ot=er)):er>ut?wr(We,er)>wr(We,ot)&&(ot=er):wr(er,ot)>wr(We,ot)&&(We=er)}else rt.push(st=[We=er,ot=er]);yrtt&&(tt=yr),fe=ia,ut=er}function qt(){Qe.point=kt}function Zt(){st[0]=We,st[1]=ot,Qe.point=Lt,fe=null}function Sr(er,yr){if(fe){var ia=er-ut;Fe.add(m(ia)>180?ia+(ia>0?360:-360):ia)}else Me=er,_e=yr;$.point(er,yr),kt(er,yr)}function xr(){$.lineStart()}function jr(){Sr(Me,_e),$.lineEnd(),m(Fe)>r&&(We=-(ot=180)),st[0]=We,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])):pn.push($r=La);for(In=-1/0,ia=pn.length-1,yr=0,$r=pn[ia];yr<=ia;$r=La,++yr)La=pn[yr],(Yn=wr($r[1],La[0]))>In&&(In=Yn,We=La[0],ot=$r[1])}return rt=st=null,We===1/0||it===1/0?[[NaN,NaN],[NaN,NaN]]:[[We,it],[ot,tt]]}var Ke,Ue,Ee,Ve,Ce,Te,Pe,at,yt,Tt,Ot,Gt,rr,Qt,Tr,la,Ua={sphere:L,point:Ba,lineStart:Qa,lineEnd:kn,polygonStart:function(){Ua.lineStart=Jt,Ua.lineEnd=Nt},polygonEnd:function(){Ua.lineStart=Qa,Ua.lineEnd=kn}};function Ba(er,yr){er*=h,yr*=h;var ia=l(yr);Ra(ia*l(er),ia*g(er),g(yr))}function Ra(er,yr,ia){++Ke,Ee+=(er-Ee)/Ke,Ve+=(yr-Ve)/Ke,Ce+=(ia-Ce)/Ke}function Qa(){Ua.point=za}function za(er,yr){er*=h,yr*=h;var ia=l(yr);Qt=ia*l(er),Tr=ia*g(er),la=g(yr),Ua.point=en,Ra(Qt,Tr,la)}function en(er,yr){er*=h,yr*=h;var ia=l(yr),$r=ia*l(er),La=ia*g(er),pn=g(yr),In=T(p((In=Tr*pn-la*La)*In+(In=la*$r-Qt*pn)*In+(In=Qt*La-Tr*$r)*In),Qt*$r+Tr*La+la*pn);Ue+=In,Te+=In*(Qt+(Qt=$r)),Pe+=In*(Tr+(Tr=La)),at+=In*(la+(la=pn)),Ra(Qt,Tr,la)}function kn(){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*=h,yr*=h,Ua.point=Wt;var ia=l(yr);Qt=ia*l(er),Tr=ia*g(er),la=g(yr),Ra(Qt,Tr,la)}function Wt(er,yr){er*=h,yr*=h;var ia=l(yr),$r=ia*l(er),La=ia*g(er),pn=g(yr),In=Tr*pn-la*La,Yn=la*$r-Qt*pn,ri=Qt*La-Tr*$r,di=p(In*In+Yn*Yn+ri*ri),Dn=f(di),On=di&&-Dn/di;yt+=On*In,Tt+=On*Yn,Ot+=On*ri,Ue+=Dn,Te+=Dn*(Qt+(Qt=$r)),Pe+=Dn*(Tr+(Tr=La)),at+=Dn*(la+(la=pn)),Ra(Qt,Tr,la)}function Pr(er){Ke=Ue=Ee=Ve=Ce=Te=Pe=at=yt=Tt=Ot=0,N(er,Ua);var yr=yt,ia=Tt,$r=Ot,La=yr*yr+ia*ia+$r*$r;return Laa?er+Math.round(-er/s)*s:er,yr]}ra.invert=ra;function Ia(er,yr,ia){return(er%=s)?yr||ia?ma(rn(er),nn(yr,ia)):rn(er):yr||ia?nn(yr,ia):ra}function Ha(er){return function(yr,ia){return yr+=er,[yr>a?yr-s:yr<-a?yr+s:yr,ia]}}function rn(er){var yr=Ha(er);return yr.invert=Ha(-er),yr}function nn(er,yr){var ia=l(er),$r=g(er),La=l(yr),pn=g(yr);function In(Yn,ri){var di=l(ri),Dn=l(Yn)*di,On=g(Yn)*di,qn=g(ri),xn=qn*ia+Dn*$r;return[T(On*La-xn*pn,Dn*ia-qn*$r),f(xn*La+On*pn)]}return In.invert=function(Yn,ri){var di=l(ri),Dn=l(Yn)*di,On=g(Yn)*di,qn=g(ri),xn=qn*La-On*pn;return[T(On*La+qn*pn,Dn*ia+xn*$r),f(xn*ia-Dn*$r)]},In}function yn(er){er=Ia(er[0]*h,er[1]*h,er.length>2?er[2]*h:0);function yr(ia){return ia=er(ia[0]*h,ia[1]*h),ia[0]*=c,ia[1]*=c,ia}return yr.invert=function(ia){return ia=er.invert(ia[0]*h,ia[1]*h),ia[0]*=c,ia[1]*=c,ia},yr}function xt(er,yr,ia,$r,La,pn){if(ia){var In=l(yr),Yn=g(yr),ri=$r*ia;La==null?(La=yr+$r*s,pn=yr-ri/2):(La=ct(In,La),pn=ct(In,pn),($r>0?Lapn)&&(La+=$r*s));for(var di,Dn=La;$r>0?Dn>pn:Dn1&&er.push(er.pop().concat(er.shift()))},result:function(){var ia=er;return er=[],yr=null,ia}}}function Rr(er,yr){return m(er[0]-yr[0])=0;--Yn)La.point((On=Dn[Yn])[0],On[1]);else $r(qn.x,qn.p.x,-1,La);qn=qn.p}qn=qn.o,Dn=qn.z,xn=!xn}while(!qn.v);La.lineEnd()}}}function Kr(er){if(yr=er.length){for(var yr,ia=0,$r=er[0],La;++ia=0?1:-1,Rs=Qs*xs,Ks=Rs>a,ys=Ki*xo;if(Ur.add(T(ys*Qs*g(Rs),ao*Qo+ys*l(Rs))),In+=Ks?xs+Qs*s:xs,Ks^xn>=ia^wi>=ia){var Fl=be(re(qn),re(co));Re(Fl);var yl=be(pn,Fl);Re(yl);var sl=(Ks^xs>=0?-1:1)*f(yl[2]);($r>sl||$r===sl&&(Fl[0]||Fl[1]))&&(Yn+=Ks^xs>=0?1:-1)}}return(In<-r||In0){for(ri||(La.polygonStart(),ri=!0),La.lineStart(),Qo=0;Qo1&&ui&2&&xo.push(xo.pop().concat(xo.shift())),Dn.push(xo.filter(It))}}return qn}}function It(er){return er.length>1}function dr(er,yr){return((er=er.x)[0]<0?er[1]-n-r:n-er[1])-((yr=yr.x)[0]<0?yr[1]-n-r:n-yr[1])}var kr=fa(function(){return!0},na,Fa,[-a,-n]);function na(er){var yr=NaN,ia=NaN,$r=NaN,La;return{lineStart:function(){er.lineStart(),La=1},point:function(pn,In){var Yn=pn>0?a:-a,ri=m(pn-yr);m(ri-a)0?n:-n),er.point($r,ia),er.lineEnd(),er.lineStart(),er.point(Yn,ia),er.point(pn,ia),La=0):$r!==Yn&&ri>=a&&(m(yr-$r)r?d((g(yr)*(pn=l($r))*g(ia)-g($r)*(La=l(yr))*g(er))/(La*pn*In)):(yr+$r)/2}function Fa(er,yr,ia,$r){var La;if(er==null)La=ia*n,$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(m(er[0]-yr[0])>r){var pn=er[0]0,La=m(yr)>r;function pn(Dn,On,qn,xn){xt(xn,er,ia,qn,Dn,On)}function In(Dn,On){return l(Dn)*l(On)>yr}function Yn(Dn){var On,qn,xn,Mi,Ki;return{lineStart:function(){Mi=xn=!1,Ki=1},point:function(ao,Ji){var co=[ao,Ji],wi,ui=In(ao,Ji),xo=$r?ui?0:di(ao,Ji):ui?di(ao+(ao<0?a:-a),Ji):0;if(!On&&(Mi=xn=ui)&&Dn.lineStart(),ui!==xn&&(wi=ri(On,co),(!wi||Rr(On,wi)||Rr(co,wi))&&(co[2]=1)),ui!==xn)Ki=0,ui?(Dn.lineStart(),wi=ri(co,On),Dn.point(wi[0],wi[1])):(wi=ri(On,co),Dn.point(wi[0],wi[1],2),Dn.lineEnd()),On=wi;else if(La&&On&&$r^ui){var Qo;!(xo&qn)&&(Qo=ri(co,On,!0))&&(Ki=0,$r?(Dn.lineStart(),Dn.point(Qo[0][0],Qo[0][1]),Dn.point(Qo[1][0],Qo[1][1]),Dn.lineEnd()):(Dn.point(Qo[1][0],Qo[1][1]),Dn.lineEnd(),Dn.lineStart(),Dn.point(Qo[0][0],Qo[0][1],3)))}ui&&(!On||!Rr(On,co))&&Dn.point(co[0],co[1]),On=co,xn=ui,qn=xo},lineEnd:function(){xn&&Dn.lineEnd(),On=null},clean:function(){return Ki|(Mi&&xn)<<1}}}function ri(Dn,On,qn){var xn=re(Dn),Mi=re(On),Ki=[1,0,0],ao=be(xn,Mi),Ji=ce(ao,ao),co=ao[0],wi=Ji-co*co;if(!wi)return!qn&&Dn;var ui=yr*Ji/wi,xo=-yr*co/wi,Qo=be(Ki,ao),xs=ze(Ki,ui),Qs=ze(ao,xo);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),!qn)return sl;var Ui=Dn[0],Io=On[0],Xs=Dn[1],Ls=On[1],ou;Io0^sl[1]<(m(sl[0]-Ui)a^(Ui<=sl[0]&&sl[0]<=Io)){var yu=ze(Rs,(-Ks+yl)/ys);return Ae(yu,xs),[sl,ee(yu)]}}}function di(Dn,On){var qn=$r?er:a-er,xn=0;return Dn<-qn?xn|=1:Dn>qn&&(xn|=2),On<-qn?xn|=4:On>qn&&(xn|=8),xn}return fa(In,Yn,pn,$r?[0,-er]:[-a,er-a])}function ha(er,yr,ia,$r,La,pn){var In=er[0],Yn=er[1],ri=yr[0],di=yr[1],Dn=0,On=1,qn=ri-In,xn=di-Yn,Mi;if(Mi=ia-In,!(!qn&&Mi>0)){if(Mi/=qn,qn<0){if(Mi0){if(Mi>On)return;Mi>Dn&&(Dn=Mi)}if(Mi=La-In,!(!qn&&Mi<0)){if(Mi/=qn,qn<0){if(Mi>On)return;Mi>Dn&&(Dn=Mi)}else if(qn>0){if(Mi0)){if(Mi/=xn,xn<0){if(Mi0){if(Mi>On)return;Mi>Dn&&(Dn=Mi)}if(Mi=pn-Yn,!(!xn&&Mi<0)){if(Mi/=xn,xn<0){if(Mi>On)return;Mi>Dn&&(Dn=Mi)}else if(xn>0){if(Mi0&&(er[0]=In+Dn*qn,er[1]=Yn+Dn*xn),On<1&&(yr[0]=In+On*qn,yr[1]=Yn+On*xn),!0}}}}}var Da=1e9,Zn=-Da;function Pn(er,yr,ia,$r){function La(di,Dn){return er<=di&&di<=ia&&yr<=Dn&&Dn<=$r}function pn(di,Dn,On,qn){var xn=0,Mi=0;if(di==null||(xn=In(di,On))!==(Mi=In(Dn,On))||ri(di,Dn)<0^On>0)do qn.point(xn===0||xn===3?er:ia,xn>1?$r:yr);while((xn=(xn+On+4)%4)!==Mi);else qn.point(Dn[0],Dn[1])}function In(di,Dn){return m(di[0]-er)0?0:3:m(di[0]-ia)0?2:1:m(di[1]-yr)0?1:0:Dn>0?3:2}function Yn(di,Dn){return ri(di.x,Dn.x)}function ri(di,Dn){var On=In(di,1),qn=In(Dn,1);return On!==qn?On-qn:On===0?Dn[1]-di[1]:On===1?di[0]-Dn[0]:On===2?di[1]-Dn[1]:Dn[0]-di[0]}return function(di){var Dn=di,On=Or(),qn,xn,Mi,Ki,ao,Ji,co,wi,ui,xo,Qo,xs={point:Qs,lineStart:Fl,lineEnd:yl,polygonStart:Ks,polygonEnd:ys};function Qs(Ui,Io){La(Ui,Io)&&Dn.point(Ui,Io)}function Rs(){for(var Ui=0,Io=0,Xs=xn.length;Io$r&&(Pc-Lc)*($r-yu)>(wu-yu)*(er-Lc)&&++Ui:wu<=$r&&(Pc-Lc)*($r-yu)<(wu-yu)*(er-Lc)&&--Ui;return Ui}function Ks(){Dn=On,qn=[],xn=[],Qo=!0}function ys(){var Ui=Rs(),Io=Qo&&Ui,Xs=(qn=x.merge(qn)).length;(Io||Xs)&&(di.polygonStart(),Io&&(di.lineStart(),pn(null,null,1,di),di.lineEnd()),Xs&&Gr(qn,Yn,Ui,pn,di),di.polygonEnd()),Dn=di,qn=xn=Mi=null}function Fl(){xs.point=sl,xn&&xn.push(Mi=[]),xo=!0,ui=!1,co=wi=NaN}function yl(){qn&&(sl(Ki,ao),Ji&&ui&&On.rejoin(),qn.push(On.result())),xs.point=Qs,ui&&Dn.lineEnd()}function sl(Ui,Io){var Xs=La(Ui,Io);if(xn&&Mi.push([Ui,Io]),xo)Ki=Ui,ao=Io,Ji=Xs,xo=!1,Xs&&(Dn.lineStart(),Dn.point(Ui,Io));else if(Xs&&ui)Dn.point(Ui,Io);else{var Ls=[co=Math.max(Zn,Math.min(Da,co)),wi=Math.max(Zn,Math.min(Da,wi))],ou=[Ui=Math.max(Zn,Math.min(Da,Ui)),Io=Math.max(Zn,Math.min(Da,Io))];ha(Ls,ou,er,yr,ia,$r)?(ui||(Dn.lineStart(),Dn.point(Ls[0],Ls[1])),Dn.point(ou[0],ou[1]),Xs||Dn.lineEnd(),Qo=!1):Xs&&(Dn.lineStart(),Dn.point(Ui,Io),Qo=!1)}co=Ui,wi=Io,ui=Xs}return xs}}function fi(){var er=0,yr=0,ia=960,$r=500,La,pn,In;return In={stream:function(Yn){return La&&pn===Yn?La:La=Pn(er,yr,ia,$r)(pn=Yn)},extent:function(Yn){return arguments.length?(er=+Yn[0][0],yr=+Yn[0][1],ia=+Yn[1][0],$r=+Yn[1][1],La=pn=null,In):[[er,yr],[ia,$r]]}}}var Ai=A(),ki,zi,Xi,to={sphere:L,point:L,lineStart:go,lineEnd:L,polygonStart:L,polygonEnd:L};function go(){to.point=Jo,to.lineEnd=pi}function pi(){to.point=to.lineEnd=L}function Jo(er,yr){er*=h,yr*=h,ki=er,zi=g(yr),Xi=l(yr),to.point=Xo}function Xo(er,yr){er*=h,yr*=h;var ia=g(yr),$r=l(yr),La=m(er-ki),pn=l(La),In=g(La),Yn=$r*In,ri=Xi*ia-zi*$r*pn,di=zi*ia+Xi*$r*pn;Ai.add(T(p(Yn*Yn+ri*ri),di)),ki=er,zi=ia,Xi=$r}function Ts(er){return Ai.reset(),N(er,to),+Ai}var Po=[null,null],so={type:"LineString",coordinates:Po};function qi(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 ia=er.features,$r=-1,La=ia.length;++$r0&&(La=qi(er[pn],er[pn-1]),La>0&&ia<=La&&$r<=La&&(ia+$r-La)*(1-Math.pow((ia-$r)/La,2))r}).map(qn)).concat(x.range(_(pn/di)*di,La,di).filter(function(wi){return m(wi%On)>r}).map(xn))}return Ji.lines=function(){return co().map(function(wi){return{type:"LineString",coordinates:wi}})},Ji.outline=function(){return{type:"Polygon",coordinates:[Mi($r).concat(Ki(In).slice(1),Mi(ia).reverse().slice(1),Ki(Yn).reverse().slice(1))]}},Ji.extent=function(wi){return arguments.length?Ji.extentMajor(wi).extentMinor(wi):Ji.extentMinor()},Ji.extentMajor=function(wi){return arguments.length?($r=+wi[0][0],ia=+wi[1][0],Yn=+wi[0][1],In=+wi[1][1],$r>ia&&(wi=$r,$r=ia,ia=wi),Yn>In&&(wi=Yn,Yn=In,In=wi),Ji.precision(ao)):[[$r,Yn],[ia,In]]},Ji.extentMinor=function(wi){return arguments.length?(yr=+wi[0][0],er=+wi[1][0],pn=+wi[0][1],La=+wi[1][1],yr>er&&(wi=yr,yr=er,er=wi),pn>La&&(wi=pn,pn=La,La=wi),Ji.precision(ao)):[[yr,pn],[er,La]]},Ji.step=function(wi){return arguments.length?Ji.stepMajor(wi).stepMinor(wi):Ji.stepMinor()},Ji.stepMajor=function(wi){return arguments.length?(Dn=+wi[0],On=+wi[1],Ji):[Dn,On]},Ji.stepMinor=function(wi){return arguments.length?(ri=+wi[0],di=+wi[1],Ji):[ri,di]},Ji.precision=function(wi){return arguments.length?(ao=+wi,qn=jn(pn,La,90),xn=Ci(yr,er,ao),Mi=jn(Yn,In,90),Ki=Ci($r,ia,ao),Ji):ao},Ji.extentMajor([[-180,-90+r],[180,90-r]]).extentMinor([[-180,-80-r],[180,80+r]])}function Bs(){return tl()()}function uo(er,yr){var ia=er[0]*h,$r=er[1]*h,La=yr[0]*h,pn=yr[1]*h,In=l($r),Yn=g($r),ri=l(pn),di=g(pn),Dn=In*l(ia),On=In*g(ia),qn=ri*l(La),xn=ri*g(La),Mi=2*f(p(P(pn-$r)+In*ri*P(La-ia))),Ki=g(Mi),ao=Mi?function(Ji){var co=g(Ji*=Mi)/Ki,wi=g(Mi-Ji)/Ki,ui=wi*Dn+co*qn,xo=wi*On+co*xn,Qo=wi*Yn+co*di;return[T(xo,ui)*c,T(Qo,p(ui*ui+xo*xo))*c]}:function(){return[ia*c,$r*c]};return ao.distance=Mi,ao}function $s(er){return er}var ms=A(),Is=A(),rl,Si,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(m(Is)),Is.reset()},result:function(){var er=ms/2;return ms.reset(),er}};function al(){As.point=$i}function $i(er,yr){As.point=zs,rl=po=er,Si=ro=yr}function zs(er,yr){Is.add(ro*er-po*yr),po=er,ro=yr}function au(){zs(rl,Si)}var fl=1/0,xu=fl,zl=-fl,Ns=zl,nu={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,qc=0,Sf=0,iu=0,Ll=0,nc,Ou,nl,vl,gs={point:qs,lineStart:ic,lineEnd:cl,polygonStart:function(){gs.lineStart=yh,gs.lineEnd=ls},polygonEnd:function(){gs.point=qs,gs.lineStart=ic,gs.lineEnd=cl},result:function(){var er=Ll?[Sf/Ll,iu/Ll]:qc?[pf/qc,Us/qc]:Af?[Bc/Af,Cu/Af]:[NaN,NaN];return Bc=Cu=Af=pf=Us=qc=Sf=iu=Ll=0,er}};function qs(er,yr){Bc+=er,Cu+=yr,++Af}function ic(){gs.point=Nl}function Nl(er,yr){gs.point=Vu,qs(nl=er,vl=yr)}function Vu(er,yr){var ia=er-nl,$r=yr-vl,La=p(ia*ia+$r*$r);pf+=La*(nl+er)/2,Us+=La*(vl+yr)/2,qc+=La,qs(nl=er,vl=yr)}function cl(){gs.point=qs}function yh(){gs.point=_h}function ls(){Ss(nc,Ou)}function _h(er,yr){gs.point=Ss,qs(nc=nl=er,Ou=vl=yr)}function Ss(er,yr){var ia=er-nl,$r=yr-vl,La=p(ia*ia+$r*$r);pf+=La*(nl+er)/2,Us+=La*(vl+yr)/2,qc+=La,La=vl*er-nl*yr,Sf+=La*(nl+er),iu+=La*(vl+yr),Ll+=La*3,qs(nl=er,vl=yr)}function Qi(er){this._context=er}Qi.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(),qu,Ul,Mf,wc,rf,Kl={point:L,lineStart:function(){Kl.point=Yf},lineEnd:function(){qu&&zf(Ul,Mf),Kl.point=L},polygonStart:function(){qu=!0},polygonEnd:function(){qu=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 ia=4.5,$r,La;function pn(In){return In&&(typeof ia=="function"&&La.pointRadius(+ia.apply(this,arguments)),N(In,$r(La))),La.result()}return pn.area=function(In){return N(In,$r(As)),As.result()},pn.measure=function(In){return N(In,$r(Kl)),Kl.result()},pn.bounds=function(In){return N(In,$r(nu)),nu.result()},pn.centroid=function(In){return N(In,$r(gs)),gs.result()},pn.projection=function(In){return arguments.length?($r=In==null?(er=null,$s):(er=In).stream,pn):er},pn.context=function(In){return arguments.length?(La=In==null?(yr=null,new af):new Qi(yr=In),typeof ia!="function"&&La.pointRadius(ia),pn):yr},pn.pointRadius=function(In){return arguments.length?(ia=typeof In=="function"?In:(La.pointRadius(+In),+In),pn):ia},pn.projection(er).context(yr)}function Of(er){return{stream:Gu(er)}}function Gu(er){return function(yr){var ia=new Ef;for(var $r in er)ia[$r]=er[$r];return ia.stream=yr,ia}}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,ia){var $r=er.clipExtent&&er.clipExtent();return er.scale(150).translate([0,0]),$r!=null&&er.clipExtent(null),N(ia,er.stream(nu)),yr(nu.result()),$r!=null&&er.clipExtent($r),er}function Hc(er,yr,ia){return oc(er,function($r){var La=yr[1][0]-yr[0][0],pn=yr[1][1]-yr[0][1],In=Math.min(La/($r[1][0]-$r[0][0]),pn/($r[1][1]-$r[0][1])),Yn=+yr[0][0]+(La-In*($r[1][0]+$r[0][0]))/2,ri=+yr[0][1]+(pn-In*($r[1][1]+$r[0][1]))/2;er.scale(150*In).translate([Yn,ri])},ia)}function Jl(er,yr,ia){return Hc(er,[[0,0],yr],ia)}function Uc(er,yr,ia){return oc(er,function($r){var La=+yr,pn=La/($r[1][0]-$r[0][0]),In=(La-pn*($r[1][0]+$r[0][0]))/2,Yn=-pn*$r[0][1];er.scale(150*pn).translate([In,Yn])},ia)}function Tc(er,yr,ia){return oc(er,function($r){var La=+yr,pn=La/($r[1][1]-$r[0][1]),In=-pn*$r[0][0],Yn=(La-pn*($r[1][1]+$r[0][1]))/2;er.scale(150*pn).translate([In,Yn])},ia)}var Gs=16,Cf=l(30*h);function lh(er,yr){return+yr?Wc(er,yr):Bf(er)}function Bf(er){return Gu({point:function(yr,ia){yr=er(yr,ia),this.stream.point(yr[0],yr[1])}})}function Wc(er,yr){function ia($r,La,pn,In,Yn,ri,di,Dn,On,qn,xn,Mi,Ki,ao){var Ji=di-$r,co=Dn-La,wi=Ji*Ji+co*co;if(wi>4*yr&&Ki--){var ui=In+qn,xo=Yn+xn,Qo=ri+Mi,xs=p(ui*ui+xo*xo+Qo*Qo),Qs=f(Qo/=xs),Rs=m(m(Qo)-1)yr||m((Ji*yl+co*sl)/wi-.5)>.3||In*qn+Yn*xn+ri*Mi2?Ui[2]%360*h:0,yl()):[Yn*c,ri*c,di*c]},ys.angle=function(Ui){return arguments.length?(On=Ui%360*h,yl()):On*c},ys.reflectX=function(Ui){return arguments.length?(qn=Ui?-1:1,yl()):qn<0},ys.reflectY=function(Ui){return arguments.length?(xn=Ui?-1:1,yl()):xn<0},ys.precision=function(Ui){return arguments.length?(Qo=lh(xs,xo=Ui*Ui),sl()):p(xo)},ys.fitExtent=function(Ui,Io){return Hc(ys,Ui,Io)},ys.fitSize=function(Ui,Io){return Jl(ys,Ui,Io)},ys.fitWidth=function(Ui,Io){return Uc(ys,Ui,Io)},ys.fitHeight=function(Ui,Io){return Tc(ys,Ui,Io)};function yl(){var Ui=ml(ia,0,0,qn,xn,On).apply(null,yr(pn,In)),Io=(On?ml:Nf)(ia,$r-Ui[0],La-Ui[1],qn,xn,On);return Dn=Ia(Yn,ri,di),xs=ma(yr,Io),Qs=ma(Dn,xs),Qo=lh(xs,xo),sl()}function sl(){return Rs=Ks=null,ys}return function(){return yr=er.apply(this,arguments),ys.invert=yr.invert&&Fl,yl()}}function il(er){var yr=0,ia=a/3,$r=Ac(er),La=$r(yr,ia);return La.parallels=function(pn){return arguments.length?$r(yr=pn[0]*h,ia=pn[1]*h):[yr*c,ia*c]},La}function dc(er){var yr=l(er);function ia($r,La){return[$r*yr,g(La)/yr]}return ia.invert=function($r,La){return[$r/yr,f(La*yr)]},ia}function vu(er,yr){var ia=g(er),$r=(ia+g(yr))/2;if(m($r)=.12&&ao<.234&&Ki>=-.425&&Ki<-.214?La:ao>=.166&&ao<.234&&Ki>=-.214&&Ki<-.115?In:ia).invert(qn)},Dn.stream=function(qn){return er&&yr===qn?er:er=Uf([ia.stream(yr=qn),La.stream(qn),In.stream(qn)])},Dn.precision=function(qn){return arguments.length?(ia.precision(qn),La.precision(qn),In.precision(qn),On()):ia.precision()},Dn.scale=function(qn){return arguments.length?(ia.scale(qn),La.scale(qn*.35),In.scale(qn),Dn.translate(ia.translate())):ia.scale()},Dn.translate=function(qn){if(!arguments.length)return ia.translate();var xn=ia.scale(),Mi=+qn[0],Ki=+qn[1];return $r=ia.translate(qn).clipExtent([[Mi-.455*xn,Ki-.238*xn],[Mi+.455*xn,Ki+.238*xn]]).stream(di),pn=La.translate([Mi-.307*xn,Ki+.201*xn]).clipExtent([[Mi-.425*xn+r,Ki+.12*xn+r],[Mi-.214*xn-r,Ki+.234*xn-r]]).stream(di),Yn=In.translate([Mi-.205*xn,Ki+.212*xn]).clipExtent([[Mi-.214*xn+r,Ki+.166*xn+r],[Mi-.115*xn-r,Ki+.234*xn-r]]).stream(di),On()},Dn.fitExtent=function(qn,xn){return Hc(Dn,qn,xn)},Dn.fitSize=function(qn,xn){return Jl(Dn,qn,xn)},Dn.fitWidth=function(qn,xn){return Uc(Dn,qn,xn)},Dn.fitHeight=function(qn,xn){return Tc(Dn,qn,xn)};function On(){return er=yr=null,Dn}return Dn.scale(1070)}function Bu(er){return function(yr,ia){var $r=l(yr),La=l(ia),pn=er($r*La);return[pn*La*g(yr),pn*g(ia)]}}function Sc(er){return function(yr,ia){var $r=p(yr*yr+ia*ia),La=er($r),pn=g(La),In=l(La);return[T(yr*pn,$r*In),f($r&&ia*pn/$r)]}}var vc=Bu(function(er){return p(2/(1+er))});vc.invert=Sc(function(er){return 2*f(er/2)});function Lh(){return Lu(vc).scale(124.75).clipAngle(180-.001)}var nf=Bu(function(er){return(er=y(er))&&er/g(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((n+yr)/2))]}Nu.invert=function(er,yr){return[er,2*d(w(yr))-n]};function of(){return tu(Nu).scale(961/s)}function tu(er){var yr=Lu(er),ia=yr.center,$r=yr.scale,La=yr.translate,pn=yr.clipExtent,In=null,Yn,ri,di;yr.scale=function(On){return arguments.length?($r(On),Dn()):$r()},yr.translate=function(On){return arguments.length?(La(On),Dn()):La()},yr.center=function(On){return arguments.length?(ia(On),Dn()):ia()},yr.clipExtent=function(On){return arguments.length?(On==null?In=Yn=ri=di=null:(In=+On[0][0],Yn=+On[0][1],ri=+On[1][0],di=+On[1][1]),Dn()):In==null?null:[[In,Yn],[ri,di]]};function Dn(){var On=a*$r(),qn=yr(yn(yr.rotate()).invert([0,0]));return pn(In==null?[[qn[0]-On,qn[1]-On],[qn[0]+On,qn[1]+On]]:er===Nu?[[Math.max(qn[0]-On,In),Yn],[Math.min(qn[0]+On,ri),di]]:[[In,Math.max(qn[1]-On,Yn)],[ri,Math.min(qn[1]+On,di)]])}return Dn()}function Xc(er){return u((n+er)/2)}function uh(er,yr){var ia=l(er),$r=er===yr?g(er):S(ia/l(yr))/S(Xc(yr)/Xc(er)),La=ia*E(Xc(er),$r)/$r;if(!$r)return Nu;function pn(In,Yn){La>0?Yn<-n+r&&(Yn=-n+r):Yn>n-r&&(Yn=n-r);var ri=La/E(Xc(Yn),$r);return[ri*g($r*In),La-ri*l($r*In)]}return pn.invert=function(In,Yn){var ri=La-Yn,di=b($r)*p(In*In+ri*ri),Dn=T(In,m(ri))*b(ri);return ri*$r<0&&(Dn-=a*b(In)*b(ri)),[Dn/$r,2*d(E(La/di,1/$r))-n]},pn}function vf(){return il(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 ia=l(er),$r=er===yr?g(er):(ia-l(yr))/(yr-er),La=ia/$r+er;if(m($r)r&&--$r>0);return[er/(.8707+(pn=ia*ia)*(-.131979+pn*(-.013791+pn*pn*pn*(.003971-.001529*pn)))),ia]};function mc(){return Lu(Ec).scale(175.295)}function jl(er,yr){return[l(yr)*g(er),g(yr)]}jl.invert=Sc(f);function gu(){return Lu(jl).scale(249.5).clipAngle(90+r)}function Cc(er,yr){var ia=l(yr),$r=1+l(er)*ia;return[ia*g(er)/$r,g(yr)/$r]}Cc.invert=Sc(function(er){return 2*d(er)});function Yc(){return Lu(Cc).scale(250).clipAngle(142)}function sc(er,yr){return[S(u((n+yr)/2)),-er]}sc.invert=function(er,yr){return[-yr,2*d(w(er))-n]};function kc(){var er=tu(sc),yr=er.center,ia=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?ia([$r[0],$r[1],$r.length>2?$r[2]+90:90]):($r=ia(),[$r[0],$r[1],$r[2]-90])},ia([0,0,90]).scale(159.155)}v.geoAlbers=Ml,v.geoAlbersUsa=Jf,v.geoArea=j,v.geoAzimuthalEqualArea=Lh,v.geoAzimuthalEqualAreaRaw=vc,v.geoAzimuthalEquidistant=df,v.geoAzimuthalEquidistantRaw=nf,v.geoBounds=Be,v.geoCentroid=Pr,v.geoCircle=Nr,v.geoClipAntimeridian=kr,v.geoClipCircle=Ya,v.geoClipExtent=fi,v.geoClipRectangle=Pn,v.geoConicConformal=vf,v.geoConicConformalRaw=uh,v.geoConicEqualArea=bu,v.geoConicEqualAreaRaw=vu,v.geoConicEquidistant=kf,v.geoConicEquidistantRaw=Pu,v.geoContains=Yo,v.geoDistance=qi,v.geoEqualEarth=Lf,v.geoEqualEarthRaw=Zc,v.geoEquirectangular=mu,v.geoEquirectangularRaw=ol,v.geoGnomonic=jf,v.geoGnomonicRaw=ru,v.geoGraticule=tl,v.geoGraticule10=Bs,v.geoIdentity=Xu,v.geoInterpolate=uo,v.geoLength=Ts,v.geoMercator=of,v.geoMercatorRaw=Nu,v.geoNaturalEarth1=mc,v.geoNaturalEarth1Raw=Ec,v.geoOrthographic=gu,v.geoOrthographicRaw=jl,v.geoPath=Ff,v.geoProjection=Lu,v.geoProjectionMutator=Ac,v.geoRotation=yn,v.geoStereographic=Yc,v.geoStereographicRaw=Cc,v.geoStream=N,v.geoTransform=Of,v.geoTransverseMercator=kc,v.geoTransverseMercatorRaw=sc,Object.defineProperty(v,"__esModule",{value:!0})})}}),UU=Ze({"node_modules/d3-geo-projection/dist/d3-geo-projection.js"(Z,q){(function(v,x){typeof Z=="object"&&typeof q<"u"?x(Z,D5(),yx()):x(v.d3=v.d3||{},v.d3,v.d3)})(Z,function(v,x,A){"use strict";var M=Math.abs,e=Math.atan,t=Math.atan2,r=Math.cos,i=Math.exp,a=Math.floor,n=Math.log,o=Math.max,s=Math.min,c=Math.pow,h=Math.round,m=Math.sign||function(He){return He>0?1:He<0?-1:0},d=Math.sin,T=Math.tan,l=1e-6,_=1e-12,w=Math.PI,S=w/2,E=w/4,g=Math.SQRT1_2,b=F(2),p=F(w),u=w*2,y=180/w,f=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=i(2*He),(He-1)/(He+1)}function O(He){return(i(He)-i(-He))/2}function I(He){return(i(He)+i(-He))/2}function N(He){return n(He+F(He*He+1))}function U(He){return n(He+F(He*He-1))}function W(He){var Je=T(He/2),lt=2*n(r(He/2))/(Je*Je);function dt(Ct,wt){var Dt=r(Ct),ur=r(wt),mr=d(wt),Er=ur*Dt,Br=-((1-Er?n((1+Er)/2)/(1-Er):-.5)+lt/(1+Er));return[Br*ur*d(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=d(Br),Sa=ga/Qr,Oa=-n(M(Qr));ur-=Er=(2/Sa*Oa-lt*Sa-Dt)/(-Oa/(ga*ga)+1-lt/(2*Qr*Qr))*(Qr<0?.7:1)}while(M(Er)>l&&--mr>0);var vn=d(ur);return[t(Ct*vn,Dt*r(ur)),L(wt*vn/Dt)]},dt}function Q(){var He=S,Je=x.geoProjectionMutator(W),lt=Je(He);return lt.radius=function(dt){return arguments.length?Je(He=dt*f):He*y},lt.scale(179.976).clipAngle(147)}function ue(He,Je){var lt=r(Je),dt=P(z(lt*r(He/=2)));return[2*lt*d(He)*dt,d(Je)*dt]}ue.invert=function(He,Je){if(!(He*He+4*Je*Je>w*w+l)){var lt=He,dt=Je,Ct=25;do{var wt=d(lt),Dt=d(lt/2),ur=r(lt/2),mr=d(dt),Er=r(dt),Br=d(2*dt),Qr=mr*mr,ga=Er*Er,Sa=Dt*Dt,Oa=1-ga*ur*ur,vn=Oa?z(Er*ur)*F(Xn=1/Oa):Xn=0,Xn,Hn=2*vn*Er*Dt-He,oi=vn*mr-Je,Ti=Xn*(ga*Sa+vn*Er*ur*Qr),Wi=Xn*(.5*wt*Br-vn*2*mr*Dt),Bi=Xn*.25*(Br*Dt-vn*mr*ga*wt),Ao=Xn*(Qr*ur+vn*Sa*Er),ss=Wi*Bi-Ao*Ti;if(!ss)break;var So=(oi*Wi-Hn*Ao)/ss,Ko=(Hn*Bi-oi*Ti)/ss;lt-=So,dt-=Ko}while((M(So)>l||M(Ko)>l)&&--Ct>0);return[lt,dt]}};function se(){return x.geoProjection(ue).scale(152.63)}function he(He){var Je=d(He),lt=r(He),dt=He>=0?1:-1,Ct=T(dt*He),wt=(1+Je-lt)/2;function Dt(ur,mr){var Er=r(mr),Br=r(ur/=2);return[(1+Er)*d(ur),(dt*mr>-t(Br,Ct)-.001?0:-dt*10)+wt+d(mr)*lt-(1+Er)*Je*Br]}return Dt.invert=function(ur,mr){var Er=0,Br=0,Qr=50;do{var ga=r(Er),Sa=d(Er),Oa=r(Br),vn=d(Br),Xn=1+Oa,Hn=Xn*Sa-ur,oi=wt+vn*lt-Xn*Je*ga-mr,Ti=Xn*ga/2,Wi=-Sa*vn,Bi=Je*Xn*Sa/2,Ao=lt*Oa+Je*ga*vn,ss=Wi*Bi-Ao*Ti,So=(oi*Wi-Hn*Ao)/ss/2,Ko=(Hn*Bi-oi*Ti)/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 H(){var He=20*f,Je=He>=0?1:-1,lt=T(Je*He),dt=x.geoProjectionMutator(he),Ct=dt(He),wt=Ct.stream;return Ct.parallel=function(Dt){return arguments.length?(lt=T((Je=(He=Dt*f)>=0?1:-1)*He),dt(He)):He*y},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*f/2),lt)*y);Er.lineEnd(),Er.polygonEnd()},mr},Ct.scale(218.695).center([0,28.0974])}function $(He,Je){var lt=T(Je/2),dt=F(1-lt*lt),Ct=1+dt*r(He/=2),wt=d(He)*dt/Ct,Dt=lt/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 lt=He*He,dt=Je*Je,Ct=1+lt+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[m(He)*2*t(O(ur)*mr,.25-Br),m(Je)*2*t(Er*d(Dt),.25+Br)]};function J(){return x.geoProjection($).scale(66.1603)}var X=F(8),oe=n(1+b);function ne(He,Je){var lt=M(Je);return lt_&&--dt>0);return[He/(r(lt)*(X-1/d(lt))),m(Je)*lt]};function j(){return x.geoProjection(ne).scale(112.314)}function ee(He){var Je=2*w/He;function lt(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*h((Dt-S)/Je)+S,Er=t(d(Dt-=mr),2-r(Dt));Dt=mr+L(w/ur*d(Er))-Er,wt[0]=ur*r(Dt),wt[1]=ur*d(Dt)}return wt}return lt.invert=function(dt,Ct){var wt=F(dt*dt+Ct*Ct);if(wt>S){var Dt=t(Ct,dt),ur=Je*h((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*d(Dt)}return x.geoAzimuthalEquidistantRaw.invert(dt,Ct)},lt}function re(){var He=5,Je=x.geoProjectionMutator(ee),lt=Je(He),dt=lt.stream,Ct=.01,wt=-r(Ct*f),Dt=d(Ct*f);return lt.lobes=function(ur){return arguments.length?Je(He=+ur):He},lt.stream=function(ur){var mr=lt.rotate(),Er=dt(ur),Br=(lt.rotate([0,0]),dt(ur));return lt.rotate(mr),Er.sphere=function(){Br.polygonStart(),Br.lineStart();for(var Qr=0,ga=360/He,Sa=2*w/He,Oa=90-180/He,vn=S;Qr0&&M(Ct)>l);return dt<0?NaN:lt}function Re(He,Je,lt){return Je===void 0&&(Je=40),lt===void 0&&(lt=_),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 vn=(wt>0?-1:1)*lt,Xn=(Dt>0?-1:1)*lt,Hn=He(wt+vn,Dt),oi=He(wt,Dt+Xn),Ti=(Hn[0]-Qr[0])/vn,Wi=(Hn[1]-Qr[1])/vn,Bi=(oi[0]-Qr[0])/Xn,Ao=(oi[1]-Qr[1])/Xn,ss=Ao*Ti-Wi*Bi,So=(M(ss)<.5?.5:1)/ss;if(mr=(Sa*Bi-ga*Ao)*So,Er=(ga*Wi-Sa*Ti)*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(We()).rotate([-16.5,-42]).scale(176.57).center([7.93,.09])}function ot(He,Je){var lt=He*d(Je),dt=30,Ct;do Je-=Ct=(Je+d(Je)-lt)/(1+r(Je));while(M(Ct)>l&&--dt>0);return Je/2}function tt(He,Je,lt){function dt(Ct,wt){return[He*Ct*r(wt=ot(lt,wt)),Je*d(wt)]}return dt.invert=function(Ct,wt){return wt=L(wt/Je),[Ct/(He*r(wt)),L((2*wt+d(2*wt))/lt)]},dt}var ut=tt(b/S,b,w);function Me(){return x.geoProjection(ut).scale(169.529)}var _e=2.00276,fe=1.11072;function Fe(He,Je){var lt=ot(w,Je);return[_e*He/(1/r(Je)+fe/r(lt)),(Je+b*d(lt))/_e]}Fe.invert=function(He,Je){var lt=_e*Je,dt=Je<0?-E:E,Ct=25,wt,Dt;do Dt=lt-b*d(dt),dt-=wt=(d(2*dt)+2*dt-w*d(Dt))/(2*r(2*dt)+2+w*r(Dt)*b*r(dt));while(M(wt)>l&&--Ct>0);return Dt=lt-b*d(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,lt=x.geoProjectionMutator(He),dt=lt(Je);return dt.parallel=function(Ct){return arguments.length?lt(Je=Ct*f):Je*y},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 lt(dt,Ct){var wt=Je+He-Ct,Dt=wt&&dt*r(Ct)/wt;return[wt*d(Dt),Je-wt*r(Dt)]}return lt.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]},lt}function qt(){return st(kt).scale(123.082).center([0,26.1441]).parallel(45)}function Zt(He){function Je(lt,dt){var Ct=S-dt,wt=Ct&<*He*d(Ct)/Ct;return[Ct*d(wt)/He,S-Ct*r(wt)]}return Je.invert=function(lt,dt){var Ct=lt*He,wt=S-dt,Dt=F(Ct*Ct+wt*wt),ur=t(Ct,wt);return[(Dt?Dt/d(Dt):1)*ur/He,S-Dt]},Je}function Sr(){var He=.5,Je=x.geoProjectionMutator(Zt),lt=Je(He);return lt.fraction=function(dt){return arguments.length?Je(He=+dt):He},lt.scale(158.837)}var xr=tt(1,4/w,w);function jr(){return x.geoProjection(xr).scale(152.63)}function wr(He,Je,lt,dt,Ct,wt){var Dt=r(wt),ur;if(M(He)>1||M(wt)>1)ur=z(lt*Ct+Je*dt*Dt);else{var mr=d(He/2),Er=d(wt/2);ur=2*L(F(mr*mr+Je*dt*Er*Er))}return M(ur)>l?[ur,t(dt*d(wt),Je*Ct-lt*dt*Dt)]:[0,0]}function Ir(He,Je,lt){return z((He*He+Je*Je-lt*lt)/(2*He*Je))}function bt(He){return He-2*w*a((He+w)/(2*w))}function Be(He,Je,lt){for(var dt=[[He[0],He[1],d(He[1]),r(He[1])],[Je[0],Je[1],d(Je[1]),r(Je[1])],[lt[0],lt[1],d(lt[1]),r(lt[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]*d(ur))];function Qr(ga,Sa){var Oa=d(Sa),vn=r(Sa),Xn=new Array(3),Hn;for(Hn=0;Hn<3;++Hn){var oi=dt[Hn];if(Xn[Hn]=wr(Sa-oi[1],oi[3],oi[2],vn,Oa,ga-oi[0]),!Xn[Hn][0])return oi.point;Xn[Hn][1]=bt(Xn[Hn][1]-oi.v[1])}var Ti=Br.slice();for(Hn=0;Hn<3;++Hn){var Wi=Hn==2?0:Hn+1,Bi=Ir(dt[Hn].v[0],Xn[Hn][0],Xn[Wi][0]);Xn[Hn][1]<0&&(Bi=-Bi),Hn?Hn==1?(Bi=mr-Bi,Ti[0]-=Xn[Hn][0]*r(Bi),Ti[1]-=Xn[Hn][0]*d(Bi)):(Bi=Er-Bi,Ti[0]+=Xn[Hn][0]*r(Bi),Ti[1]+=Xn[Hn][0]*d(Bi)):(Ti[0]+=Xn[Hn][0]*r(Bi),Ti[1]-=Xn[Hn][0]*d(Bi))}return Ti[0]/=3,Ti[1]/=3,Ti}return Qr}function Ke(He){return He[0]*=f,He[1]*=f,He}function Ue(){return Ee([0,22],[45,22],[22.5,-22]).scale(380).center([22.5,2])}function Ee(He,Je,lt){var dt=x.geoCentroid({type:"MultiPoint",coordinates:[He,Je,lt]}),Ct=[-dt[0],-dt[1]],wt=x.geoRotation(Ct),Dt=Be(Ke(wt(He)),Ke(wt(Je)),Ke(wt(lt)));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 Ve(He,Je){var lt=F(1-d(Je));return[2/p*He*lt,p*(1-lt)]}Ve.invert=function(He,Je){var lt=(lt=Je/p-1)*lt;return[lt>0?He*F(w/lt)/2:0,L(1-lt)]};function Ce(){return x.geoProjection(Ve).scale(95.6464).center([0,30])}function Te(He){var Je=T(He);function lt(dt,Ct){return[dt,(dt?dt/d(dt):1)*(d(Ct)*r(dt)-Je*r(Ct))]}return lt.invert=Je?function(dt,Ct){dt&&(Ct*=d(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)]},lt}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*d(Je/3)]}yt.invert=function(He,Je){var lt=3*L(Je/(at*p));return[p*He/(at*(2*r(2*lt/3)-1)),lt]};function Tt(){return x.geoProjection(yt).scale(156.19)}function Ot(He){var Je=r(He);function lt(dt,Ct){return[dt*Je,d(Ct)/Je]}return lt.invert=function(dt,Ct){return[dt/Je,L(Ct*Je)]},lt}function Gt(){return st(Ot).parallel(38.58).scale(195.044)}function rr(He){var Je=r(He);function lt(dt,Ct){return[dt*Je,(1+Je)*T(Ct/2)]}return lt.invert=function(dt,Ct){return[dt/Je,e(Ct/(1+Je))*2]},lt}function Qt(){return st(rr).scale(124.75)}function Tr(He,Je){var lt=F(8/(3*w));return[lt*He*(1-M(Je)/w),lt*Je]}Tr.invert=function(He,Je){var lt=F(8/(3*w)),dt=Je/lt;return[He/(lt*(1-M(dt)/w)),dt]};function la(){return x.geoProjection(Tr).scale(165.664)}function Ua(He,Je){var lt=F(4-3*d(M(Je)));return[2/F(6*w)*He*lt,m(Je)*F(2*w/3)*(2-lt)]}Ua.invert=function(He,Je){var lt=2-M(Je)/F(2*w/3);return[He*F(6*w)/(2*lt),m(Je)*L((4-lt*lt)/3)]};function Ba(){return x.geoProjection(Ua).scale(165.664)}function Ra(He,Je){var lt=F(w*(4+w));return[2/lt*He*(1+F(1-4*Je*Je/(w*w))),4/lt*Je]}Ra.invert=function(He,Je){var lt=F(w*(4+w))/2;return[He*lt/(1+F(1-Je*Je*(4+w)/(4*w))),Je*lt/2]};function Qa(){return x.geoProjection(Ra).scale(180.739)}function za(He,Je){var lt=(2+S)*d(Je);Je/=2;for(var dt=0,Ct=1/0;dt<10&&M(Ct)>l;dt++){var wt=r(Je);Je-=Ct=(Je+d(Je)*(wt+2)-lt)/(2*wt*(1+wt))}return[2/F(w*(4+w))*He*(1+r(Je)),2*F(w/(4+w))*d(Je)]}za.invert=function(He,Je){var lt=Je*F((4+w)/w)/2,dt=L(lt),Ct=r(dt);return[He/(2/F(w*(4+w))*(1+Ct)),L((dt+lt*(Ct+2))/(2+S))]};function en(){return x.geoProjection(za).scale(180.739)}function kn(He,Je){return[He*(1+r(Je))/F(2+w),2*Je/F(2+w)]}kn.invert=function(He,Je){var lt=F(2+w),dt=Je*lt/2;return[lt*He/(1+r(dt)),dt]};function Jt(){return x.geoProjection(kn).scale(173.044)}function Nt(He,Je){for(var lt=(1+S)*d(Je),dt=0,Ct=1/0;dt<10&&M(Ct)>l;dt++)Je-=Ct=(Je+d(Je)-lt)/(1+r(Je));return lt=F(2+w),[He*(1+r(Je))/lt,2*Je/lt]}Nt.invert=function(He,Je){var lt=1+S,dt=F(lt/2);return[He*2*dt/(1+r(Je*=dt)),L((Je+d(Je))/lt)]};function Kt(){return x.geoProjection(Nt).scale(173.044)}var Wt=3+2*b;function Pr(He,Je){var lt=d(He/=2),dt=r(He),Ct=F(r(Je)),wt=r(Je/=2),Dt=d(Je)/(wt+b*dt*Ct),ur=F(2/(1+Dt*Dt)),mr=F((b*wt+(dt+lt)*Ct)/(b*wt+(dt-lt)*Ct));return[Wt*(ur*(mr-1/mr)-2*n(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 lt=wt[0],dt=wt[1],Ct=20,wt;He/=Wt,Je/=Wt;do{var Dt=lt/2,ur=dt/2,mr=d(Dt),Er=r(Dt),Br=d(ur),Qr=r(ur),ga=r(dt),Sa=F(ga),Oa=Br/(Qr+b*Er*Sa),vn=Oa*Oa,Xn=F(2/(1+vn)),Hn=b*Qr+(Er+mr)*Sa,oi=b*Qr+(Er-mr)*Sa,Ti=Hn/oi,Wi=F(Ti),Bi=Wi-1/Wi,Ao=Wi+1/Wi,ss=Xn*Bi-2*n(Wi)-He,So=Xn*Oa*Ao-2*e(Oa)-Je,Ko=Br&&g*Sa*mr*vn/Br,hs=(b*Er*Qr+Sa)/(2*(Qr+b*Er*Sa)*(Qr+b*Er*Sa)*Sa),ll=-.5*Oa*Xn*Xn*Xn,Js=ll*Ko,es=ll*hs,ts=(ts=2*Qr+b*Sa*(Er-mr))*ts*Wi,Pl=(b*Er*Qr*Sa+ga)/ts,$l=-(b*mr*Br)/(Sa*ts),Ru=Bi*Js-2*Pl/Wi+Xn*(Pl+Pl/Ti),hu=Bi*es-2*$l/Wi+Xn*($l+$l/Ti),wl=Oa*Ao*Js-2*Ko/(1+vn)+Xn*Ao*Ko+Xn*Oa*(Pl-Pl/Ti),su=Oa*Ao*es-2*hs/(1+vn)+Xn*Ao*hs+Xn*Oa*($l-$l/Ti),uc=hu*wl-su*Ru;if(!uc)break;var Vl=(So*hu-ss*su)/uc,ql=(ss*wl-So*Ru)/uc;lt-=Vl,dt=o(-S,s(S,dt-ql))}while((M(Vl)>l||M(ql)>l)&&--Ct>0);return M(M(dt)-S)dt){var Qr=F(Br),ga=t(Er,mr),Sa=lt*h(ga/lt),Oa=ga-Sa,vn=He*r(Oa),Xn=(He*d(Oa)-Oa*d(vn))/(S-vn),Hn=Rr(Oa,Xn),oi=(w-He)/Lr(Hn,vn,w);mr=Qr;var Ti=50,Wi;do mr-=Wi=(He+Lr(Hn,vn,mr)*oi-Qr)/(Hn(mr)*oi);while(M(Wi)>l&&--Ti>0);Er=Oa*d(mr),mrdt){var mr=F(ur),Er=t(Dt,wt),Br=lt*h(Er/lt),Qr=Er-Br;wt=mr*r(Qr),Dt=mr*d(Qr);for(var ga=wt-S,Sa=d(wt),Oa=Dt/Sa,vn=wtl||M(Oa)>l)&&--vn>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 lt=He*He,dt=Je*Je;return[He*(1-.162388*dt)*(.87-952426e-9*lt*lt),Je*(1+dt/12)]}kr.invert=function(He,Je){var lt=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=lt*lt)*ur;lt-=wt=(lt*(.87-952426e-9*ur)-He)/(.87-.00476213*ur)}while(M(wt)>l&&--Ct>0);return[lt,dt]};function na(){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 lt(dt,Ct){var wt=dt>0?-.5:.5,Dt=He(dt+wt*w,Ct);return Dt[0]-=wt*Je,Dt}return He.invert&&(lt.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}),lt}function ha(He,Je){var lt=m(He),dt=m(Je),Ct=r(Je),wt=r(He)*Ct,Dt=d(He)*Ct,ur=d(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]*=lt,mr[1]*=-dt,mr}ha.invert=function(He,Je){M(He)>1&&(He=m(He)*2-He),M(Je)>1&&(Je=m(Je)*2-Je);var lt=m(He),dt=m(Je),Ct=-lt*He,wt=-dt*Je,Dt=wt/Ct<1,ur=Zn(Dt?wt:Ct,Dt?Ct:wt),mr=ur[0],Er=ur[1],Br=r(Er);return Dt&&(mr=-S-mr),[lt*(t(d(mr)*Br,-d(Er))+w),dt*L(r(mr)*Br)]};function Da(He,Je){if(Je===S)return[0,0];var lt=d(Je),dt=lt*lt,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-lt)/Er,Qr=F(Br),ga=Br*wt,Sa=F(ga),Oa=Qr*ur,vn,Xn;if(He===0)return[0,-(Oa+dt*Sa)];var Hn=r(Je),oi=1/Hn,Ti=2*lt*Hn,Wi=(-3*dt+mr*Dt)*Ti,Bi=(-Er*Hn-(1-lt)*Wi)/(Er*Er),Ao=.5*Bi/Qr,ss=ur*Ao-2*dt*Qr*Ti,So=dt*wt*Bi+Br*Dt*Ti,Ko=-oi*Ti,hs=-oi*So,ll=-2*oi*ss,Js=4*He/w,es;if(He>.222*w||Je.175*w){if(vn=(Oa+dt*F(ga*(1+Ct)-Oa*Oa))/(1+Ct),He>w/4)return[vn,vn];var ts=vn,Pl=.5*vn;vn=.5*(Pl+ts),Xn=50;do{var $l=F(ga-vn*vn),Ru=vn*(ll+Ko*$l)+hs*L(vn/Sa)-Js;if(!Ru)break;Ru<0?Pl=vn:ts=vn,vn=.5*(Pl+ts)}while(M(ts-Pl)>l&&--Xn>0)}else{vn=l,Xn=25;do{var hu=vn*vn,wl=F(ga-hu),su=ll+Ko*wl,uc=vn*su+hs*L(vn/Sa)-Js,Vl=su+(hs-Ko*hu)/wl;vn-=es=wl?uc/Vl:0}while(M(es)>l&&--Xn>0)}return[vn,-Oa-dt*F(ga-vn*vn)]}function Zn(He,Je){for(var lt=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,vn=F(Oa),Xn=Je+Sa+Ct*vn;if(M(dt-lt)<_||--wt===0||Xn===0)break;Xn>0?lt=Ct:dt=Ct,Ct=.5*(lt+dt)}if(!wt)return null;var Hn=L(ur),oi=r(Hn),Ti=1/oi,Wi=2*ur*oi,Bi=(-3*Ct+mr*(1+3*Dt))*Wi,Ao=(-Er*oi-(1-ur)*Bi)/(Er*Er),ss=.5*Ao/Qr,So=(1-Dt)*ss-2*Ct*Qr*Wi,Ko=-2*Ti*So,hs=-Ti*Wi,ll=-Ti*(Ct*(1+Dt)*Ao+Br*(1+3*Dt)*Wi);return[w/4*(He*(Ko+hs*vn)+ll*L(He/F(ga))),Hn]}function Pn(){return x.geoProjection(Ya(ha)).scale(239.75)}function fi(He,Je,lt){var dt,Ct,wt;return He?(dt=Ai(He,lt),Je?(Ct=Ai(Je,1-lt),wt=Ct[1]*Ct[1]+lt*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,-lt*dt[0]*dt[1]*Ct[0]/wt]]):[[dt[0],0],[dt[1],0],[dt[2],0]]):(Ct=Ai(Je,1-lt),[[0,Ct[0]/Ct[1]],[1/Ct[1],0],[Ct[2]/Ct[1],0]])}function Ai(He,Je){var lt,dt,Ct,wt,Dt;if(Je=1-l)return lt=(1-Je)/4,dt=I(He),wt=B(He),Ct=1/dt,Dt=dt*O(He),[wt+lt*(Dt-He)/(dt*dt),Ct-lt*wt*Ct*(Dt-He),Ct+lt*wt*Ct*(Dt+He),2*e(i(He))-S+lt*(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;)lt=ur[Er++],mr[Er]=(lt-dt)/2,ur[Er]=(lt+dt)/2,dt=F(lt*dt),Dt*=2;Ct=Dt*ur[Er]*He;do wt=mr[Er]*d(dt=Ct)/ur[Er],Ct=(L(wt)+Ct)/2;while(--Er);return[d(Ct),wt=r(Ct),wt/r(Ct-dt),Ct]}function ki(He,Je,lt){var dt=M(He),Ct=M(Je),wt=O(Ct);if(dt){var Dt=1/d(dt),ur=1/(T(dt)*T(dt)),mr=-(ur+lt*(wt*wt*Dt*Dt)-1+lt),Er=(lt-1)*ur,Br=(-mr+F(mr*mr-4*Er))/2;return[zi(e(1/F(Br)),lt)*m(He),zi(e(F((Br/ur-1)/lt)),1-lt)*m(Je)]}return[0,zi(e(wt),1-lt)*m(Je)]}function zi(He,Je){if(!Je)return He;if(Je===1)return n(T(He/2+E));for(var lt=1,dt=F(1-Je),Ct=F(Je),wt=0;M(Ct)>l;wt++){if(He%w){var Dt=e(dt*T(He)/lt);Dt<0&&(Dt+=w),He+=Dt+~~(He/w)*w}else He+=He;Ct=(lt+dt)/2,dt=F(lt*dt),Ct=((lt=Ct)-dt)/2}return He/(c(2,wt)*lt)}function Xi(He,Je){var lt=(b-1)/(b+1),dt=F(1-lt*lt),Ct=zi(S,dt*dt),wt=-1,Dt=n(T(w/4+M(Je)/2)),ur=i(wt*Dt)/F(lt),mr=to(ur*r(wt*He),ur*d(wt*He)),Er=ki(mr[0],mr[1],dt*dt);return[-Er[1],(Je>=0?1:-1)*(.5*Ct-Er[0])]}function to(He,Je){var lt=He*He,dt=Je+1,Ct=1-lt-Je*Je;return[.5*((He>=0?S:-S)-t(Ct,2*He)),-.25*n(Ct*Ct+4*lt)+.5*n(dt*dt+lt)]}function go(He,Je){var lt=Je[0]*Je[0]+Je[1]*Je[1];return[(He[0]*Je[0]+He[1]*Je[1])/lt,(He[1]*Je[0]-He[0]*Je[1])/lt]}Xi.invert=function(He,Je){var lt=(b-1)/(b+1),dt=F(1-lt*lt),Ct=zi(S,dt*dt),wt=-1,Dt=fi(.5*Ct-Je,-He,dt*dt),ur=go(Dt[0],Dt[1]),mr=t(ur[1],ur[0])/wt;return[mr,2*e(i(.5/wt*n(lt*ur[0]*ur[0]+lt*ur[1]*ur[1])))-S]};function pi(){return x.geoProjection(Ya(Xi)).scale(151.496)}function Jo(He){var Je=d(He),lt=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=d(Dt),Er=r(Dt),Br=r(wt),Qr=z(Je*mr+lt*Er*Br),ga=d(Qr),Sa=M(ga)>l?Qr/ga:1;return[Sa*lt*d(wt),(M(wt)>S?Sa:-Sa)*(Je*Er-lt*mr*Br)]}return Ct.invert=function(wt,Dt){var ur=F(wt*wt+Dt*Dt),mr=-d(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),vn=(ur>S?-1:1)*t(wt*mr,ur*r(Oa)*Er+Dt*d(Oa)*mr);return dt.invert(vn,Oa)},Ct}function Xo(He){var Je=d(He),lt=r(He);return function(dt,Ct){var wt=r(Ct),Dt=r(dt)*wt,ur=d(dt)*wt,mr=d(Ct);return[t(ur,Dt*lt-mr*Je),L(mr*lt+Dt*Je)]}}function Ts(){var He=0,Je=x.geoProjectionMutator(Jo),lt=Je(He),dt=lt.rotate,Ct=lt.stream,wt=x.geoCircle();return lt.parallel=function(Dt){if(!arguments.length)return He*y;var ur=lt.rotate();return Je(He=Dt*f).rotate(ur)},lt.rotate=function(Dt){return arguments.length?(dt.call(lt,[Dt[0],Dt[1]-He*y]),wt.center([-Dt[0],-Dt[1]]),lt):(Dt=dt.call(lt),Dt[1]+=He*y,Dt)},lt.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},lt.scale(79.4187).parallel(45).clipAngle(180-.001)}var Po=3,so=L(1-1/Po)*y,qi=Ot(0);function To(He){var Je=so*f,lt=Ve(w,Je)[0]-Ve(-w,Je)[0],dt=qi(0,Je)[1],Ct=Ve(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,o(0,a((Br+w)/Dt)));Br+=w*(He-1)/He-Oa*Dt,ga=Ve(Br,Sa),ga[0]=ga[0]*u/lt-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=qi(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,o(0,a((Br+w)/Dt)));Br=(Br+w*(He-1)/He-Sa*Dt)*lt/u;var Oa=Ve.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 qi.invert(Br,Qr)},Er}function Vo(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(Vo),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),lt=Je(He),dt=lt.stream;return lt.lobes=function(Ct){return arguments.length?Je(He=+Ct):He},lt.stream=function(Ct){var wt=lt.rotate(),Dt=dt(Ct),ur=(lt.rotate([0,0]),dt(Ct));return lt.rotate(wt),Dt.sphere=function(){x.geoStream(Co(180/He),ur)},Dt},lt.scale(239.75)}function Ys(He){var Je=1+He,lt=d(1/Je),dt=L(lt),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-d(Qr),Sa,Oa;if(ga&&ga<2){var vn=S-Qr,Xn=25,Hn;do{var oi=d(vn),Ti=r(vn),Wi=dt+t(oi,Je-Ti),Bi=1+mr-2*Je*Ti;vn-=Hn=(vn-ur*dt-Je*oi+Bi*Wi-.5*ga*wt)/(2*Je*oi*Wi)}while(M(Hn)>_&&--Xn>0);Sa=Ct*F(Bi),Oa=Br*Wi/w}else Sa=Ct*(He+ga),Oa=Br*dt/w;return[Sa*d(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),vn=d(Oa),Xn=dt+t(vn,Je-Sa);return[L(Br/F(ga))*w/Xn,L(1-2*(Oa-ur*dt-Je*vn+(1+mr-2*Je*Sa)*Xn)/wt)]},Er}function Os(){var He=1,Je=x.geoProjectionMutator(Ys),lt=Je(He);return lt.ratio=function(dt){return arguments.length?Je(He=+dt):He},lt.scale(167.774).center([0,18.67])}var Yo=.7109889596207567,jn=.0528035274542;function Ci(He,Je){return Je>-Yo?(He=ut(He,Je),He[1]+=jn,He):Qe(He,Je)}Ci.invert=function(He,Je){return Je>-Yo?ut.invert(He,Je-jn):Qe.invert(He,Je)};function tl(){return x.geoProjection(Ci).rotate([-20,-55]).scale(164.263).center([0,-5.4036])}function Bs(He,Je){return M(Je)>Yo?(He=ut(He,Je),He[1]-=Je>0?jn:-jn,He):Qe(He,Je)}Bs.invert=function(He,Je){return M(Je)>Yo?ut.invert(He,Je+(Je>0?jn:-jn)):Qe.invert(He,Je)};function uo(){return x.geoProjection(Bs).scale(152.63)}function $s(He,Je,lt,dt){var Ct=F(4*w/(2*lt+(1+He-Je/2)*d(2*lt)+(He+Je)/2*d(4*lt)+Je/2*d(6*lt))),wt=F(dt*d(lt)*F((1+He*r(2*lt)+Je*r(4*lt))/(1+He+Je))),Dt=lt*mr(1);function ur(Qr){return F(1+He*r(2*Qr)+Je*r(4*Qr))}function mr(Qr){var ga=Qr*lt;return(2*ga+(1+He-Je/2)*d(2*ga)+(He+Je)/2*d(4*ga)+Je/2*d(6*ga))/lt}function Er(Qr){return ur(Qr)*d(Qr)}var Br=function(Qr,ga){var Sa=lt*ze(mr,Dt*d(ga)/lt,ga/w);isNaN(Sa)&&(Sa=lt*m(ga));var Oa=Ct*ur(Sa);return[Oa*wt*Qr/w*r(Sa),Oa/wt*d(Sa)]};return Br.invert=function(Qr,ga){var Sa=ze(Er,ga*wt/Ct);return[Qr*w/(r(Sa)*Ct*wt*ur(Sa)),L(lt*mr(Sa/lt)/Dt)]},lt===0&&(Ct=F(dt/w),Br=function(Qr,ga){return[Qr*Ct,d(ga)/Ct]},Br.invert=function(Qr,ga){return[Qr/Ct,L(ga*Ct)]}),Br}function ms(){var He=1,Je=0,lt=45*f,dt=2,Ct=x.geoProjectionMutator($s),wt=Ct(He,Je,lt,dt);return wt.a=function(Dt){return arguments.length?Ct(He=+Dt,Je,lt,dt):He},wt.b=function(Dt){return arguments.length?Ct(He,Je=+Dt,lt,dt):Je},wt.psiMax=function(Dt){return arguments.length?Ct(He,Je,lt=+Dt*f,dt):lt*y},wt.ratio=function(Dt){return arguments.length?Ct(He,Je,lt,dt=+Dt):dt},wt.scale(180.739)}function Is(He,Je,lt,dt,Ct,wt,Dt,ur,mr,Er,Br){if(Br.nanEncountered)return NaN;var Qr,ga,Sa,Oa,vn,Xn,Hn,oi,Ti,Wi;if(Qr=lt-Je,ga=He(Je+Qr*.25),Sa=He(lt-Qr*.25),isNaN(ga)){Br.nanEncountered=!0;return}if(isNaN(Sa)){Br.nanEncountered=!0;return}return Oa=Qr*(dt+4*ga+Ct)/12,vn=Qr*(Ct+4*Sa+wt)/12,Xn=Oa+vn,Wi=(Xn-Dt)/15,Er>mr?(Br.maxDepthCount++,Xn+Wi):Math.abs(Wi)>1;do mr[Xn]>Sa?vn=Xn:Oa=Xn,Xn=Oa+vn>>1;while(Xn>Oa);var Hn=mr[Xn+1]-mr[Xn];return Hn&&(Hn=(Sa-mr[Xn+1])/Hn),(Xn+1+Hn)/Dt}var Qr=2*Br(1)/w*wt/lt,ga=function(Sa,Oa){var vn=Br(M(d(Oa))),Xn=dt(vn)*Sa;return vn/=Qr,[Xn,Oa>=0?vn:-vn]};return ga.invert=function(Sa,Oa){var vn;return Oa*=Qr,M(Oa)<1&&(vn=m(Oa)*L(Ct(M(Oa))*wt)),[Sa/dt(M(Oa)),vn]},ga}function po(){var He=0,Je=2.5,lt=1.183136,dt=x.geoProjectionMutator(Si),Ct=dt(He,Je,lt);return Ct.alpha=function(wt){return arguments.length?dt(He=+wt,Je,lt):He},Ct.k=function(wt){return arguments.length?dt(He,Je=+wt,lt):Je},Ct.gamma=function(wt){return arguments.length?dt(He,Je,lt=+wt):lt},Ct.scale(152.63)}function ro(He,Je){return M(He[0]-Je[0])=0;--mr)lt=He[1][mr],dt=lt[0][0],Ct=lt[0][1],wt=lt[1][1],Dt=lt[2][0],ur=lt[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 $i(He,Je,lt){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}lt?wt.invert=lt(wt):He.invert&&(wt.invert=function(mr,Er){for(var Br=Ct[+(Er<0)],Qr=Je[+(Er<0)],ga=0,Sa=Br.length;gaOa&&(vn=Sa,Sa=Oa,Oa=vn),[[Qr,Sa],[ga,Oa]]})}),Dt):Je.map(function(Er){return Er.map(function(Br){return[[Br[0][0]*y,Br[0][1]*y],[Br[1][0]*y,Br[1][1]*y],[Br[2][0]*y,Br[2][1]*y]]})})},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 $i(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 $i(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 $i(ut,zl).scale(169.529)}var nu=[[[[-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 $i(ut,nu).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 $i(Ci,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 $i(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 qc(){return x.geoProjection(Us).scale(158.837)}function Sf(He){function Je(lt,dt){if(M(M(dt)-S)2)return null;lt/=2,dt/=2;var wt=lt*lt,Dt=dt*dt,ur=2*dt/(1+wt+Dt);return ur=c((1+ur)/(1-ur),1/He),[t(2*lt,1-wt-Dt)/He,L((ur-1)/(ur+1))]},Je}function iu(){var He=.5,Je=x.geoProjectionMutator(Sf),lt=Je(He);return lt.spacing=function(dt){return arguments.length?Je(He=+dt):He},lt.scale(124.75)}var Ll=w/b;function nc(He,Je){return[He*(1+F(r(Je)))/2,Je/(r(Je/2)*r(He/6))]}nc.invert=function(He,Je){var lt=M(He),dt=M(Je),Ct=l,wt=S;dtl||M(Xn)>l)&&--Ct>0);return Ct&&[lt,dt]};function vl(){return x.geoProjection(nl).scale(139.98)}function gs(He,Je){return[d(He)/r(Je),T(Je)*r(He)]}gs.invert=function(He,Je){var lt=He*He,dt=Je*Je,Ct=dt+1,wt=lt+Ct,Dt=He?g*F((wt-F(wt*wt-4*lt))/lt):1/F(Ct);return[L(He*Dt),m(Je)*z(Dt)]};function qs(){return x.geoProjection(gs).scale(144.049).clipAngle(90-.001)}function ic(He){var Je=r(He),lt=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 lt.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 vn=ga*ga+Sa*Sa,Xn,Hn;Dt-=Xn=(Br*ga+Qr*Sa)/vn,ur-=Hn=(Qr*ga-Br*Sa)/vn}while(M(Xn)+M(Hn)>l*l&&--wt>0);if(wt){var oi=F(Dt*Dt+ur*ur),Ti=2*e(oi*.5),Wi=d(Ti);return[t(Dt*Wi,oi*r(Ti)),oi?L(ur*Wi/oi):0]}},lt}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]],Qi=[[.9245,0],[0,0],[.01943,0]],Gc=[[.721316,0],[0,0],[-.00881625,-.00617325]];function qu(){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(Qi,[-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 lt=x.geoProjection(yh(He)).rotate(Je).clipAngle(90),dt=x.geoRotation(Je),Ct=lt.center;return delete lt.rotate,lt.center=function(wt){return arguments.length?Ct(dt(wt)):dt.invert(Ct())},lt}var Yf=F(6),zf=F(7);function af(He,Je){var lt=L(7*d(Je)/(3*Yf));return[Yf*He*(2*r(2*lt/3)-1)/zf,9*d(lt/3)/zf]}af.invert=function(He,Je){var lt=3*L(Je*zf/9);return[He*zf/(Yf*(2*r(2*lt/3)-1)),L(d(lt)*3*Yf/7)]};function Nc(){return x.geoProjection(af).scale(164.859)}function Ff(He,Je){for(var lt=(1+g)*d(Je),dt=Je,Ct=0,wt;Ct<25&&(dt-=wt=(d(dt/2)+d(dt)-lt)/(.5*r(dt/2)+r(dt)),!(M(wt)_&&--dt>0);return wt=lt*lt,Dt=wt*wt,ur=wt*Dt,[He/(.84719-.13063*wt+ur*ur*(-.04515+.05494*wt-.02326*Dt+.00331*ur)),lt]};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 lt=Je/2,dt=0,Ct=1/0;dt<10&&M(Ct)>l;++dt){var wt=r(Je/2);Je-=Ct=(Je-T(Je/2)-lt)/(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 $i(ce(1/0),Tc).rotate([20,0]).scale(152.63)}function Cf(He,Je){var lt=d(Je),dt=r(Je),Ct=m(He);if(He===0||M(Je)===S)return[0,Je];if(Je===0)return[He,0];if(M(He)===S)return[He*dt,S*lt];var wt=w/(2*He)-2*He/w,Dt=2*Je/w,ur=(1-Dt*Dt)/(lt-Dt),mr=wt*wt,Er=ur*ur,Br=1+mr/Er,Qr=1+Er/mr,ga=(wt*lt/ur-wt/2)/Br,Sa=(Er*lt/mr+ur/2)/Qr,Oa=ga*ga+dt*dt/Br,vn=Sa*Sa-(Er*lt*lt/mr+ur*lt-1)/Qr;return[S*(ga+F(Oa)*Ct),S*(Sa+F(vn<0?0:vn)*m(-Je*wt)*Ct)]}Cf.invert=function(He,Je){He/=S,Je/=S;var lt=He*He,dt=Je*Je,Ct=lt+dt,wt=w*w;return[He?(Ct-1+F((1-Ct)*(1-Ct)+4*lt))/(2*He)*S:0,ze(function(Dt){return Ct*(w*d(Dt)-2*Dt)*w+4*Dt*Dt*(Je-d(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,il=1.790857183;function dc(He,Je){var lt=Je*Je;return[He,Je*(Bf+lt*lt*(Wc+lt*(Kf+ku*lt)))]}dc.invert=function(He,Je){Je>il?Je=il:Je<-il&&(Je=-il);var lt=Je,dt;do{var Ct=lt*lt;lt-=dt=(lt*(Bf+Ct*Ct*(Wc+Ct*(Kf+ku*Ct)))-Je)/(Nf+Ct*Ct*(ml+Ct*(Lu+Ac*Ct)))}while(M(dt)>l);return[He,lt]};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],lt[0]===dt[0]&<[1]===dt[1]){if(wt)return[wt,lt];wt=lt}}}function tu(He){for(var Je=He.length,lt=[],dt=He[Je-1],Ct=0;Ct0?[-dt[0],0]:[180-dt[0],180])};var Je=vf.map(function(lt){return{face:lt,project:He(lt)}});return[-1,0,0,1,0,1,4,5].forEach(function(lt,dt){var Ct=Je[lt];Ct&&(Ct.children||(Ct.children=[])).push(Je[dt])}),nf(Je[0],function(lt,dt){return Je[lt<-w/2?dt<0?6:4:lt<0?dt<0?2:0:ltdt^Sa>dt&<<(ga-Er)*(dt-Br)/(Sa-Br)+Er&&(Ct=!Ct)}return Ct}function ru(He,Je){var lt=Je.stream,dt;if(!lt)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,lt)}function jf(He,Je){return{type:"FeatureCollection",features:He.features.map(function(lt){return Xu(lt,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(lt){return mc(lt,Je)})}}function mc(He,Je){if(!He)return null;if(He.type==="GeometryCollection")return Ec(He,Je);var lt;switch(He.type){case"Point":lt=Cc;break;case"MultiPoint":lt=Cc;break;case"LineString":lt=Yc;break;case"MultiLineString":lt=Yc;break;case"Polygon":lt=sc;break;case"MultiPolygon":lt=sc;break;case"Sphere":lt=sc;break;default:return null}return x.geoStream(He,Je(lt)),lt.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(lt){Zc(lt)?He.push([lt]):Je.push(lt)}),Je.forEach(function(lt){var dt=lt[0];He.some(function(Ct){if(Lf(Ct[0],dt))return Ct.push(lt),!0})||He.push([lt])}),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 lt(dt,Ct){var wt=M(dt)0?dt-w:dt+w,Ct),ur=(Dt[0]-Dt[1])*g,mr=(Dt[0]+Dt[1])*g;if(wt)return[ur,mr];var Er=Je*g,Br=ur>0^mr>0?-1:1;return[Br*ur-m(mr)*Er,Br*mr-m(ur)*Er]}return He.invert&&(lt.invert=function(dt,Ct){var wt=(dt+Ct)*g,Dt=(Ct-dt)*g,ur=M(wt)<.5*Je&&M(Dt)<.5*Je;if(!ur){var mr=Je*g,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)*g,Dt=(Br-Qr)*g}var ga=He.invert(wt,Dt);return ur||(ga[0]+=wt>0?w:-w),ga}),x.geoProjection(lt).rotate([-90,-90,45]).clipAngle(180-.001)}function er(){return kc(ha).scale(176.423)}function yr(){return kc(Xi).scale(111.48)}function ia(He,Je){if(!(0<=(Je=+Je)&&Je<=20))throw new Error("invalid digits");function lt(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(lt(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:lt(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=d(He);function lt(dt,Ct){var wt=Je?T(dt*Je/2)/Je:dt/2;if(!Ct)return[2*wt,-He];var Dt=2*e(wt*d(Ct)),ur=1/T(Ct);return[d(Dt)*ur,Ct+(1-r(Dt))*ur-He]}return lt.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)]}In.invert=function(He,Je){var lt=Je/S,dt=lt*90,Ct=s(18,M(dt/5)),wt=o(0,a(Ct));do{var Dt=pn[wt][1],ur=pn[wt+1][1],mr=pn[s(19,wt+2)][1],Er=mr-Dt,Br=mr-2*ur+Dt,Qr=2*(M(lt)-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,vn;do Ct=s(18,M(dt)/5),wt=a(Ct),Sa=Ct-wt,Dt=pn[wt][1],ur=pn[wt+1][1],mr=pn[s(19,wt+2)][1],dt-=(vn=(Je>=0?S:-S)*(ur+Sa*(mr-Dt)/2+Sa*Sa*(mr-2*ur+Dt)/2)-Je)*y;while(M(vn)>_&&--Oa>0);break}}while(--wt>=0);var Xn=pn[wt][0],Hn=pn[wt+1][0],oi=pn[s(19,wt+2)][0];return[He/(Hn+Sa*(oi-Xn)/2+Sa*Sa*(oi-2*Hn+Xn)/2),dt*f]};function Yn(){return x.geoProjection(In).scale(152.63)}function ri(He){function Je(lt,dt){var Ct=r(dt),wt=(He-1)/(He-Ct*r(lt));return[wt*Ct*d(lt),wt*d(dt)]}return Je.invert=function(lt,dt){var Ct=lt*lt+dt*dt,wt=F(Ct),Dt=(He-F(1-Ct*(He+1)/(He-1)))/((He-1)/wt+wt/(He-1));return[t(lt*Dt,wt*F(1-Dt*Dt)),wt?L(dt*Dt/wt):0]},Je}function di(He,Je){var lt=ri(He);if(!Je)return lt;var dt=r(Je),Ct=d(Je);function wt(Dt,ur){var mr=lt(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 lt.invert(mr*Dt,mr*ur*dt)},wt}function Dn(){var He=2,Je=0,lt=x.geoProjectionMutator(di),dt=lt(He,Je);return dt.distance=function(Ct){return arguments.length?lt(He=+Ct,Je):He},dt.tilt=function(Ct){return arguments.length?lt(He,Je=Ct*f):Je*y},dt.scale(432.147).clipAngle(z(1/He)*y-1e-6)}var On=1e-4,qn=1e4,xn=-180,Mi=xn+On,Ki=180,ao=Ki-On,Ji=-90,co=Ji+On,wi=90,ui=wi-On;function xo(He){return He.length>0}function Qo(He){return Math.floor(He*qn)/qn}function xs(He){return He===Ji||He===wi?[0,He]:[xn,Qo(He)]}function Qs(He){var Je=He[0],lt=He[1],dt=!1;return Je<=Mi?(Je=xn,dt=!0):Je>=ao&&(Je=Ki,dt=!0),lt<=co?(lt=Ji,dt=!0):lt>=ui&&(lt=wi,dt=!0),dt?[Je,lt]:He}function Rs(He){return He.map(Qs)}function Ks(He,Je,lt){for(var dt=0,Ct=He.length;dt=ao||Br<=co||Br>=ui){wt[Dt]=Qs(mr);for(var Qr=Dt+1;QrMi&&Saco&&Oa=ur)break;lt.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,lt=He.length,dt={},Ct={},wt,Dt,ur,mr,Er;for(Je=0;Je0?w-ur:ur)*y],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 lt(dt,Ct){var wt=x.geoGnomonicRaw(dt,Ct);return wt[0]*=Je,wt}return lt.invert=function(dt,Ct){return x.geoGnomonicRaw.invert(dt/Je,Ct)},lt}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,lt=-Je,dt=He*He,Ct=T(lt),wt=.5/d(lt);function Dt(ur,mr){var Er=z(r(mr)*r(ur-Je)),Br=z(r(mr)*r(ur-lt)),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+lt)*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[m(He)*(F(Ct*Ct+4)+Ct)*w/4,S*Dt]};function Yu(){return x.geoProjection(lc).scale(127.16)}function Ne(He,Je,lt,dt,Ct){function wt(Dt,ur){var mr=lt*d(dt*ur),Er=F(1-mr*mr),Br=F(2/(1+Er*r(Dt*=Ct)));return[He*Er*Br*d(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*d(Qr)/(Je*lt*Br))/dt]},wt}function R(He,Je,lt,dt){var Ct=w/3;He=o(He,l),Je=o(Je,l),He=s(He,S),Je=s(Je,w-l),lt=o(lt,0),lt=s(lt,100-l),dt=o(dt,l);var wt=lt/100+1,Dt=dt/100,ur=z(wt*r(Ct))/Ct,mr=d(He)/d(ur*S),Er=Je/w,Br=F(Dt*d(He/2)/d(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*f,Je=60*f,lt=20,dt=200,Ct=x.geoProjectionMutator(R),wt=Ct(He,Je,lt,dt);return wt.poleline=function(Dt){return arguments.length?Ct(He=+Dt*f,Je,lt,dt):He*y},wt.parallels=function(Dt){return arguments.length?Ct(He,Je=+Dt*f,lt,dt):Je*y},wt.inflation=function(Dt){return arguments.length?Ct(He,Je,lt=+Dt,dt):lt},wt.ratio=function(Dt){return arguments.length?Ct(He,Je,lt,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 lt=r(Je),dt=r(He)*lt,Ct=1-dt,wt=r(He=t(d(He)*lt,-d(Je))),Dt=d(He);return lt=F(1-dt*dt),[Dt*lt-wt*Ct,-wt*lt-Dt*Ct]}br.invert=function(He,Je){var lt=(He*He+Je*Je)/-2,dt=F(-lt*(2+lt)),Ct=Je*lt+He*dt,wt=He*lt-Je*dt,Dt=F(wt*wt+Ct*Ct);return[t(dt*Ct,Dt*(1+lt)),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 lt=ue(He,Je);return[(lt[0]+He/S)/2,(lt[1]+Je)/2]}Yr.invert=function(He,Je){var lt=He,dt=Je,Ct=25;do{var wt=r(dt),Dt=d(dt),ur=d(2*dt),mr=Dt*Dt,Er=wt*wt,Br=d(lt),Qr=r(lt/2),ga=d(lt/2),Sa=ga*ga,Oa=1-Er*Qr*Qr,vn=Oa?z(wt*Qr)*F(Xn=1/Oa):Xn=0,Xn,Hn=.5*(2*vn*wt*ga+lt/S)-He,oi=.5*(vn*Dt+dt)-Je,Ti=.5*Xn*(Er*Sa+vn*wt*Qr*mr)+.5/S,Wi=Xn*(Br*ur/4-vn*Dt*ga),Bi=.125*Xn*(ur*ga-vn*Dt*Er*Br),Ao=.5*Xn*(mr*Qr+vn*Sa*wt)+.5,ss=Wi*Bi-Ao*Ti,So=(oi*Wi-Hn*Ao)/ss,Ko=(Hn*Bi-oi*Ti)/ss;lt-=So,dt-=Ko}while((M(So)>l||M(Ko)>l)&&--Ct>0);return[lt,dt]};function sa(){return x.geoProjection(Yr).scale(158.837)}v.geoNaturalEarth=x.geoNaturalEarth1,v.geoNaturalEarthRaw=x.geoNaturalEarth1Raw,v.geoAiry=Q,v.geoAiryRaw=W,v.geoAitoff=se,v.geoAitoffRaw=ue,v.geoArmadillo=H,v.geoArmadilloRaw=he,v.geoAugust=J,v.geoAugustRaw=$,v.geoBaker=j,v.geoBakerRaw=ne,v.geoBerghaus=re,v.geoBerghausRaw=ee,v.geoBertin1953=it,v.geoBertin1953Raw=We,v.geoBoggs=rt,v.geoBoggsRaw=Fe,v.geoBonne=qt,v.geoBonneRaw=kt,v.geoBottomley=Sr,v.geoBottomleyRaw=Zt,v.geoBromley=jr,v.geoBromleyRaw=xr,v.geoChamberlin=Ee,v.geoChamberlinRaw=Be,v.geoChamberlinAfrica=Ue,v.geoCollignon=Ce,v.geoCollignonRaw=Ve,v.geoCraig=Pe,v.geoCraigRaw=Te,v.geoCraster=Tt,v.geoCrasterRaw=yt,v.geoCylindricalEqualArea=Gt,v.geoCylindricalEqualAreaRaw=Ot,v.geoCylindricalStereographic=Qt,v.geoCylindricalStereographicRaw=rr,v.geoEckert1=la,v.geoEckert1Raw=Tr,v.geoEckert2=Ba,v.geoEckert2Raw=Ua,v.geoEckert3=Qa,v.geoEckert3Raw=Ra,v.geoEckert4=en,v.geoEckert4Raw=za,v.geoEckert5=Jt,v.geoEckert5Raw=kn,v.geoEckert6=Kt,v.geoEckert6Raw=Nt,v.geoEisenlohr=ta,v.geoEisenlohrRaw=Pr,v.geoFahey=Ia,v.geoFaheyRaw=ra,v.geoFoucaut=rn,v.geoFoucautRaw=Ha,v.geoFoucautSinusoidal=yn,v.geoFoucautSinusoidalRaw=nn,v.geoGilbert=Nr,v.geoGingery=Gr,v.geoGingeryRaw=Or,v.geoGinzburg4=aa,v.geoGinzburg4Raw=Ur,v.geoGinzburg5=fa,v.geoGinzburg5Raw=da,v.geoGinzburg6=dr,v.geoGinzburg6Raw=It,v.geoGinzburg8=na,v.geoGinzburg8Raw=kr,v.geoGinzburg9=Fa,v.geoGinzburg9Raw=Ca,v.geoGringorten=Pn,v.geoGringortenRaw=ha,v.geoGuyou=pi,v.geoGuyouRaw=Xi,v.geoHammer=Ae,v.geoHammerRaw=ce,v.geoHammerRetroazimuthal=Ts,v.geoHammerRetroazimuthalRaw=Jo,v.geoHealpix=os,v.geoHealpixRaw=To,v.geoHill=Os,v.geoHillRaw=Ys,v.geoHomolosine=uo,v.geoHomolosineRaw=Bs,v.geoHufnagel=ms,v.geoHufnagelRaw=$s,v.geoHyperelliptical=po,v.geoHyperellipticalRaw=Si,v.geoInterrupt=$i,v.geoInterruptedBoggs=au,v.geoInterruptedHomolosine=xu,v.geoInterruptedMollweide=Ns,v.geoInterruptedMollweideHemispheres=Eu,v.geoInterruptedSinuMollweide=Cu,v.geoInterruptedSinusoidal=pf,v.geoKavrayskiy7=qc,v.geoKavrayskiy7Raw=Us,v.geoLagrange=iu,v.geoLagrangeRaw=Sf,v.geoLarrivee=Ou,v.geoLarriveeRaw=nc,v.geoLaskowski=vl,v.geoLaskowskiRaw=nl,v.geoLittrow=qs,v.geoLittrowRaw=gs,v.geoLoximuthal=Nl,v.geoLoximuthalRaw=ic,v.geoMiller=cl,v.geoMillerRaw=Vu,v.geoModifiedStereographic=Kl,v.geoModifiedStereographicRaw=yh,v.geoModifiedStereographicAlaska=qu,v.geoModifiedStereographicGs48=Ul,v.geoModifiedStereographicGs50=Mf,v.geoModifiedStereographicMiller=wc,v.geoModifiedStereographicLee=rf,v.geoMollweide=Me,v.geoMollweideRaw=ut,v.geoMtFlatPolarParabolic=Nc,v.geoMtFlatPolarParabolicRaw=af,v.geoMtFlatPolarQuartic=Of,v.geoMtFlatPolarQuarticRaw=Ff,v.geoMtFlatPolarSinusoidal=Ef,v.geoMtFlatPolarSinusoidalRaw=Gu,v.geoNaturalEarth2=Hc,v.geoNaturalEarth2Raw=oc,v.geoNellHammer=Uc,v.geoNellHammerRaw=Jl,v.geoInterruptedQuarticAuthalic=Gs,v.geoNicolosi=lh,v.geoNicolosiRaw=Cf,v.geoPatterson=vu,v.geoPattersonRaw=dc,v.geoPolyconic=Ml,v.geoPolyconicRaw=bu,v.geoPolyhedral=nf,v.geoPolyhedralButterfly=ol,v.geoPolyhedralCollignon=kf,v.geoPolyhedralWaterman=hl,v.geoProject=ru,v.geoGringortenQuincuncial=er,v.geoPeirceQuincuncial=yr,v.geoPierceQuincuncial=yr,v.geoQuantize=ia,v.geoQuincuncial=kc,v.geoRectangularPolyconic=La,v.geoRectangularPolyconicRaw=$r,v.geoRobinson=Yn,v.geoRobinsonRaw=In,v.geoSatellite=Dn,v.geoSatelliteRaw=di,v.geoSinuMollweide=tl,v.geoSinuMollweideRaw=Ci,v.geoSinusoidal=Lt,v.geoSinusoidalRaw=Qe,v.geoStitch=sl,v.geoTimes=Io,v.geoTimesRaw=Ui,v.geoTwoPointAzimuthal=Iu,v.geoTwoPointAzimuthalRaw=Ls,v.geoTwoPointAzimuthalUsa=ou,v.geoTwoPointEquidistant=yu,v.geoTwoPointEquidistantRaw=Zu,v.geoTwoPointEquidistantUsa=Lc,v.geoVanDerGrinten=wu,v.geoVanDerGrintenRaw=Pc,v.geoVanDerGrinten2=fo,v.geoVanDerGrinten2Raw=gc,v.geoVanDerGrinten3=Ic,v.geoVanDerGrinten3Raw=zo,v.geoVanDerGrinten4=Yu,v.geoVanDerGrinten4Raw=lc,v.geoWagner=ae,v.geoWagner7=we,v.geoWagnerRaw=R,v.geoWagner4=At,v.geoWagner4Raw=pt,v.geoWagner6=$t,v.geoWagner6Raw=Bt,v.geoWiechel=Ar,v.geoWiechelRaw=br,v.geoWinkel3=sa,v.geoWinkel3Raw=Yr,Object.defineProperty(v,"__esModule",{value:!0})})}}),jU=Ze({"src/plots/geo/zoom.js"(Z,q){"use strict";var v=Oi(),x=ca(),A=oo(),M=Math.PI/180,e=180/Math.PI,t={cursor:"pointer"},r={cursor:"auto"};function i(y,f){var P=y.projection,L;return f._isScoped?L=o:f._isClipped?L=c:L=s,L(y,P)}q.exports=i;function a(y,f){return v.behavior.zoom().translate(f.translate()).scale(f.scale())}function n(y,f,P){var L=y.id,z=y.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 se=x.nestedProperty(I,Q);se.get()!==ue&&(se.set(ue),x.nestedProperty(B,Q).set(ue),U[L+"."+Q]=ue)}P(W),W("projection.scale",f.scale()/y.fitScale),W("fitbounds",!1),z.emit("plotly_relayout",U)}function o(y,f){var P=a(y,f);function L(){v.select(this).style(t)}function z(){f.scale(v.event.scale).translate(v.event.translate),y.render(!0);var O=f.invert(y.midPt);y.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":f.scale()/y.fitScale,"geo.center.lon":O[0],"geo.center.lat":O[1]})}function F(O){var I=f.invert(y.midPt);O("center.lon",I[0]),O("center.lat",I[1])}function B(){v.select(this).style(r),n(y,f,F)}return P.on("zoomstart",L).on("zoom",z).on("zoomend",B),P}function s(y,f){var P=a(y,f),L=2,z,F,B,O,I,N,U,W,Q;function ue(X){return f.invert(X)}function se(X){var oe=ue(X);if(!oe)return!0;var ne=f(oe);return Math.abs(ne[0]-X[0])>L||Math.abs(ne[1]-X[1])>L}function he(){v.select(this).style(t),z=v.mouse(this),F=f.rotate(),B=f.translate(),O=F,I=ue(z)}function H(){if(N=v.mouse(this),se(z)){P.scale(f.scale()),P.translate(f.translate());return}f.scale(v.event.scale),f.translate([B[0],v.event.translate[1]]),I?ue(N)&&(W=ue(N),U=[O[0]+(W[0]-I[0]),F[1],F[2]],f.rotate(U),O=U):(z=N,I=ue(z)),Q=!0,y.render(!0);var X=f.rotate(),oe=f.invert(y.midPt);y.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":f.scale()/y.fitScale,"geo.center.lon":oe[0],"geo.center.lat":oe[1],"geo.projection.rotation.lon":-X[0]})}function $(){v.select(this).style(r),Q&&n(y,f,J)}function J(X){var oe=f.rotate(),ne=f.invert(y.midPt);X("projection.rotation.lon",-oe[0]),X("center.lon",ne[0]),X("center.lat",ne[1])}return P.on("zoomstart",he).on("zoom",H).on("zoomend",$),P}function c(y,f){var P={r:f.rotate(),k:f.scale()},L=a(y,f),z=u(L,"zoomstart","zoom","zoomend"),F=0,B=L.on,O;L.on("zoomstart",function(){v.select(this).style(t);var Q=v.mouse(this),ue=f.rotate(),se=ue,he=f.translate(),H=m(ue);O=h(f,Q),B.call(L,"zoom",function(){var $=v.mouse(this);if(f.scale(P.k=v.event.scale),!O)Q=$,O=h(f,Q);else if(h(f,$)){f.rotate(ue).translate(he);var J=h(f,$),X=T(O,J),oe=E(d(H,X)),ne=P.r=l(oe,O,se);(!isFinite(ne[0])||!isFinite(ne[1])||!isFinite(ne[2]))&&(ne=se),f.rotate(ne),se=ne}N(z.of(this,arguments))}),I(z.of(this,arguments))}).on("zoomend",function(){v.select(this).style(r),B.call(L,"zoom",null),U(z.of(this,arguments)),n(y,f,W)}).on("zoom.redraw",function(){y.render(!0);var Q=f.rotate();y.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":f.scale()/y.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=f.rotate();Q("projection.rotation.lon",-ue[0]),Q("projection.rotation.lat",-ue[1])}return v.rebind(L,z,"on")}function h(y,f){var P=y.invert(f);return P&&isFinite(P[0])&&isFinite(P[1])&&g(P)}function m(y){var f=.5*y[0]*M,P=.5*y[1]*M,L=.5*y[2]*M,z=Math.sin(f),F=Math.cos(f),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 d(y,f){var P=y[0],L=y[1],z=y[2],F=y[3],B=f[0],O=f[1],I=f[2],N=f[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(y,f){if(!(!y||!f)){var P=p(y,f),L=Math.sqrt(b(P,P)),z=.5*Math.acos(Math.max(-1,Math.min(1,b(y,f)))),F=Math.sin(z)/L;return L&&[Math.cos(z),P[2]*F,-P[1]*F,P[0]*F]}}function l(y,f,P){var L=S(f,2,y[0]);L=S(L,1,y[1]),L=S(L,0,y[2]-P[2]);var z=f[0],F=f[1],B=f[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 se=180-ue-2*U,he=(Math.atan2(N,O)-Math.atan2(B,Q))*e,H=(Math.atan2(N,O)-Math.atan2(B,-Q))*e,$=_(P[0],P[1],ue,he),J=_(P[0],P[1],se,H);return $<=J?[ue,he,P[2]]:[se,H,P[2]]}function _(y,f,P,L){var z=w(P-y),F=w(L-f);return Math.sqrt(z*z+F*F)}function w(y){return(y%360+540)%360-180}function S(y,f,P){var L=P*M,z=y.slice(),F=f===0?1:0,B=f===2?1:2,O=Math.cos(L),I=Math.sin(L);return z[F]=y[F]*O-y[B]*I,z[B]=y[B]*O+y[F]*I,z}function E(y){return[Math.atan2(2*(y[0]*y[1]+y[2]*y[3]),1-2*(y[1]*y[1]+y[2]*y[2]))*e,Math.asin(Math.max(-1,Math.min(1,2*(y[0]*y[2]-y[3]*y[1]))))*e,Math.atan2(2*(y[0]*y[3]+y[1]*y[2]),1-2*(y[2]*y[2]+y[3]*y[3]))*e]}function g(y){var f=y[0]*M,P=y[1]*M,L=Math.cos(P);return[L*Math.cos(f),L*Math.sin(f),Math.sin(P)]}function b(y,f){for(var P=0,L=0,z=y.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),se=[[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||{},H=I.rotation||{},$=N.range||[],J=U.range||[];if(F.fitbounds){W._length=se[1][0]-se[0][0],Q._length=se[1][1]-se[0][1],W.range=h(z,W),Q.range=h(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},H={lon:X,lat:oe,roll:H.roll};var ne=I.type,j=w.lonaxisSpan[ne]/2||180,ee=w.lataxisSpan[ne]/2||90;$=[X-j,X+j],J=[oe-ee,oe+ee]}else he={lon:X,lat:oe},H={lon:X,lat:H.lat,roll:H.roll}}ue.center([he.lon-H.lon,he.lat-H.lat]).rotate([-H.lon,-H.lat,H.roll]).parallels(I.parallels);var re=f($,J);ue.fitExtent(se,re);var ce=this.bounds=ue.getBounds(re),be=this.fitScale=ue.scale(),Ae=ue.translate();if(F.fitbounds){var ze=ue.getBounds(f(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 We=this.midPt=[(ce[0][0]+ce[1][0])/2,(ce[0][1]+ce[1][1])/2];if(ue.translate([Ae[0]+(We[0]-Ae[0]),Ae[1]+(We[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(se){return se==="lonaxis"||se==="lataxis"}function N(se){return!!w.lineLayers[se]}function U(se){return!!w.fillLayers[se]}var W=this.hasChoropleth?w.layersForChoropleth:w.layers,Q=W.filter(function(se){return N(se)||U(se)?L["show"+se]:I(se)?L[se].showgrid:!0}),ue=z.framework.selectAll(".layer").data(Q,String);ue.exit().each(function(se){delete B[se],delete O[se],v.select(this).remove()}),ue.enter().append("g").attr("class",function(se){return"layer "+se}).each(function(se){var he=B[se]=v.select(this);se==="bg"?z.bgRect=he.append("rect").style("pointer-events","all"):I(se)?O[se]=he.append("path").style("fill","none"):se==="backplot"?he.append("g").classed("choroplethlayer",!0):se==="frontplot"?he.append("g").classed("scatterlayer",!0):N(se)?O[se]=he.append("path").style("fill","none").style("stroke-miterlimit",2):U(se)&&(O[se]=he.append("path").style("stroke","none"))}),ue.order(),ue.each(function(se){var he=O[se],H=w.layerNameToAdjective[se];se==="frame"?he.datum(w.sphereSVG):N(se)||U(se)?he.datum(g(F,F.objects[se])):I(se)&&he.datum(y(se,L,P)).call(a.stroke,L[se].gridcolor).call(n.dashLine,L[se].griddash,L[se].gridwidth),N(se)?he.call(a.stroke,L[H+"color"]).call(n.dashLine,"",L[H+"width"]):U(se)&&he.call(a.fill,L[H+"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;n.setRect(this.clipRect,B,O,I,N),this.bgRect.call(n.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,se={};for(var he in ue)se[z.id+"."+he]=ue[he];t.call("_guiRelayout",F,se),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,se){if(se.isRect){var he=ue.range={};he[z.id]=[U([se.xmin,se.ymin]),U([se.xmax,se.ymax])]}else{var H=ue.lassoPoints={};H[z.id]=se.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,se,he){d(ue,se,he,Q,O)},m.init(Q)),B.on("mousemove",function(){var ue=z.projection.invert(r.getPositionFromD3Event());if(!ue)return m.unhover(F,v.event);z.xaxis.p2c=function(){return ue[0]},z.yaxis.p2c=function(){return ue[1]},o.hover(F,v.event,z.id)}),B.on("mouseout",function(){F._dragging||m.unhover(F,v.event)}),B.on("click",function(){O!=="select"&&O!=="lasso"&&(I.indexOf("select")>-1&&l(v.event,F,[z.xaxis],[z.yaxis],z.id,Q),I.indexOf("event")>-1&&o.click(F,v.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=v.select(P.container).append("g").attr("class","geo "+P.id).call(n.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?i(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;WH}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 y(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,ne){return[oe,ne]}):P==="lataxis"&&(N=I.lataxisRange,U=I.lonaxisRange,W=function(oe,ne){return[ne,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 se=ue.length,he=new Array(se),H=0;H0&&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]]]}}}}),z5=Ze({"src/plots/geo/layout_attributes.js"(Z,q){"use strict";var v=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:v.lightLine},gridwidth:{valType:"number",min:0,dflt:1},griddash:A},i=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:v.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:v.defaultLine},countrywidth:{valType:"number",min:0,dflt:1},showsubunits:{valType:"boolean"},subunitcolor:{valType:"color",dflt:v.defaultLine},subunitwidth:{valType:"number",min:0,dflt:1},showframe:{valType:"boolean"},framecolor:{valType:"color",dflt:v.defaultLine},framewidth:{valType:"number",min:0,dflt:1},bgcolor:{valType:"color",dflt:v.background},lonaxis:r,lataxis:r},"plot","from-root");i.uirevision={valType:"any",editType:"none"}}}),qU=Ze({"src/plots/geo/layout_defaults.js"(Z,q){"use strict";var v=ca(),x=ng(),A=Hh().getSubplotData,M=gx(),e=z5(),t=M.axesNames;q.exports=function(a,n,o){x(a,n,o,{type:"geo",attributes:e,handleDefaults:r,fullData:o,partition:"y"})};function r(i,a,n,o){var s=A(o.fullData,"geo",o.id),c=s.map(function(J){return J.index}),h=n("resolution"),m=n("scope"),d=M.scopeDefaults[m],T=n("projection.type",d.projType),l=a._isAlbersUsa=T==="albers usa";l&&(m=a.scope="usa");var _=a._isScoped=m!=="world",w=a._isSatellite=T==="satellite",S=a._isConic=T.indexOf("conic")!==-1||T==="albers",E=a._isClipped=!!M.lonaxisSpan[T];if(i.visible===!1){var g=v.extendDeep({},a._template);g.showcoastlines=!1,g.showcountries=!1,g.showframe=!1,g.showlakes=!1,g.showland=!1,g.showocean=!1,g.showrivers=!1,g.showsubunits=!1,g.lonaxis&&(g.lonaxis.showgrid=!1),g.lataxis&&(g.lataxis.showgrid=!1),a._template=g}for(var b=n("visible"),p,u=0;u0&&U<0&&(U+=360);var W=(N+U)/2,Q;if(!l){var ue=_?d.projRotate:[W,0,0];Q=n("projection.rotation.lon",ue[0]),n("projection.rotation.lat",ue[1]),n("projection.rotation.roll",ue[2]),p=n("showcoastlines",!_&&b),p&&(n("coastlinecolor"),n("coastlinewidth")),p=n("showocean",b?void 0:!1),p&&n("oceancolor")}var se,he;if(l?(se=-96.6,he=38.7):(se=_?W:Q,he=(I[0]+I[1])/2),n("center.lon",se),n("center.lat",he),w&&(n("projection.tilt"),n("projection.distance")),S){var H=d.projParallels||[0,60];n("projection.parallels",H)}n("projection.scale"),p=n("showland",b?void 0:!1),p&&n("landcolor"),p=n("showlakes",b?void 0:!1),p&&n("lakecolor"),p=n("showrivers",b?void 0:!1),p&&(n("rivercolor"),n("riverwidth")),p=n("showcountries",_&&m!=="usa"&&b),p&&(n("countrycolor"),n("countrywidth")),(m==="usa"||m==="north america"&&h===50)&&(n("showsubunits",b),n("subunitcolor"),n("subunitwidth")),_||(p=n("showframe",b),p&&(n("framecolor"),n("framewidth"))),n("bgcolor");var $=n("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))}}}),F5=Ze({"src/plots/geo/index.js"(Z,q){"use strict";var v=Hh().getSubplotCalcData,x=ca().counterRegex,A=VU(),M="geo",e=x(M),t={};t[M]={valType:"subplotid",dflt:M,editType:"calc"};function r(n){for(var o=n._fullLayout,s=n.calcdata,c=o._subplots[M],h=0;h")}}}}),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=[],i,a,n,o,s;if(A===!1)for(i=0;i=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],y=m[p],f=d[p],L=c.c2p(y)-T,z=h.c2p(f)-l,F=Math.sqrt(L*L+z*z),F100},Z.isDotSymbol=function(v){return typeof v=="string"?q.DOT_RE.test(v):v>200}}}),YU=Ze({"src/traces/scattergl/defaults.js"(Z,q){"use strict";var v=ca(),x=oo(),A=dT(),M=_x(),e=Tv(),t=Fu(),r=i1(),i=Qd(),a=md(),n=Dd(),o=ev(),s=zd();q.exports=function(h,m,d,T){function l(u,y){return v.coerce(h,m,M,u,y)}var _=h.marker?A.isOpenSymbol(h.marker.symbol):!1,w=t.isBubble(h),S=r(h,m,T,l);if(!S){m.visible=!1;return}i(h,m,T,l),l("xhoverformat"),l("yhoverformat");var E=S>>1,h=r[c],m=a!==void 0?a(h,i):h-i;m>=0?(s=c,o=c-1):n=c+1}return s}function x(r,i,a,n,o){for(var s=o+1;n<=o;){var c=n+o>>>1,h=r[c],m=a!==void 0?a(h,i):h-i;m>0?(s=c,o=c-1):n=c+1}return s}function A(r,i,a,n,o){for(var s=n-1;n<=o;){var c=n+o>>>1,h=r[c],m=a!==void 0?a(h,i):h-i;m<0?(s=c,n=c+1):o=c-1}return s}function M(r,i,a,n,o){for(var s=n-1;n<=o;){var c=n+o>>>1,h=r[c],m=a!==void 0?a(h,i):h-i;m<=0?(s=c,n=c+1):o=c-1}return s}function e(r,i,a,n,o){for(;n<=o;){var s=n+o>>>1,c=r[s],h=a!==void 0?a(c,i):c-i;if(h===0)return s;h<=0?n=s+1:o=s-1}return-1}function t(r,i,a,n,o,s){return typeof a=="function"?s(r,i,a,n===void 0?0:n|0,o===void 0?r.length-1:o|0):s(r,i,void 0,a===void 0?0:a|0,n===void 0?r.length-1:n|0)}q.exports={ge:function(r,i,a,n,o){return t(r,i,a,n,o,v)},gt:function(r,i,a,n,o){return t(r,i,a,n,o,x)},lt:function(r,i,a,n,o){return t(r,i,a,n,o,A)},le:function(r,i,a,n,o){return t(r,i,a,n,o,M)},eq:function(r,i,a,n,o){return t(r,i,a,n,o,e)}}}}),Ev=Ze({"node_modules/pick-by-alias/index.js"(Z,q){"use strict";q.exports=function(M,e,t){var r={},i,a;if(typeof e=="string"&&(e=x(e)),Array.isArray(e)){var n={};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=v(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}}}),v0=Ze({"node_modules/array-bounds/index.js"(Z,q){"use strict";q.exports=v;function v(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[i]),x[i]>>1,w;m.dtype||(m.dtype="array"),typeof m.dtype=="string"?w=new(a(m.dtype))(_):m.dtype&&(w=m.dtype,Array.isArray(w)&&(w.length=_));for(let L=0;L<_;++L)w[L]=L;let S=[],E=[],g=[],b=[];u(0,0,1,w,0,1);let p=0;for(let L=0;Ld||I>o){for(let oe=0;oere||W>ce||Q=se||j===ee)return;let be=S[ne];ee===void 0&&(ee=be.length);for(let Me=j;Me=B&&fe<=I&&Fe>=O&&Fe<=N&&he.push(_e)}let Ae=E[ne],ze=Ae[j*4+0],Re=Ae[j*4+1],We=Ae[j*4+2],it=Ae[j*4+3],ot=$(Ae,j+1),tt=oe*.5,ut=ne+1;H(J,X,tt,ut,ze,Re||We||it||ot),H(J,X+tt,tt,ut,Re,We||it||ot),H(J+tt,X,tt,ut,We,it||ot),H(J+tt,X+tt,tt,ut,it,ot)}function $(J,X){let oe=null,ne=0;for(;oe===null;)if(oe=J[X*4+ne],ne++,ne>J.length)return null;return oe}return he}function f(L,z,F,B,O){let I=[];for(let N=0;N1&&(h=1),h<-1&&(h=-1),c*Math.acos(h)},t=function(a,n,o,s,c,h,m,d,T,l,_,w){var S=Math.pow(c,2),E=Math.pow(h,2),g=Math.pow(_,2),b=Math.pow(w,2),p=S*E-S*b-E*g;p<0&&(p=0),p/=S*b+E*g,p=Math.sqrt(p)*(m===d?-1:1);var u=p*c/h*w,y=p*-h/c*_,f=l*u-T*y+(a+o)/2,P=T*u+l*y+(n+s)/2,L=(_-u)/c,z=(w-y)/h,F=(-_-u)/c,B=(-w-y)/h,O=e(1,0,L,z),I=e(L,z,F,B);return d===0&&I>0&&(I-=x),d===1&&I<0&&(I+=x),[f,P,O,I]},r=function(a){var n=a.px,o=a.py,s=a.cx,c=a.cy,h=a.rx,m=a.ry,d=a.xAxisRotation,T=d===void 0?0:d,l=a.largeArcFlag,_=l===void 0?0:l,w=a.sweepFlag,S=w===void 0?0:w,E=[];if(h===0||m===0)return[];var g=Math.sin(T*x/360),b=Math.cos(T*x/360),p=b*(n-s)/2+g*(o-c)/2,u=-g*(n-s)/2+b*(o-c)/2;if(p===0&&u===0)return[];h=Math.abs(h),m=Math.abs(m);var y=Math.pow(p,2)/Math.pow(h,2)+Math.pow(u,2)/Math.pow(m,2);y>1&&(h*=Math.sqrt(y),m*=Math.sqrt(y));var f=t(n,o,s,c,h,m,_,S,g,b,p,u),P=v(f,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?(i=l[l.length-4],a=l[l.length-3]):(i=h,a=m),r.push(l)}return r}function A(e,t,r,i){return["C",e,t,r,i,r,i]}function M(e,t,r,i,a,n){return["C",e/3+2/3*r,t/3+2/3*i,a/3+2/3*r,n/3+2/3*i,a,n]}}}),N5=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))}}}),nj=Ze({"node_modules/svg-path-bounds/index.js"(Z,q){"use strict";var v=M_(),x=B5(),A=aj(),M=N5(),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=v(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 i=[1/0,1/0,-1/0,-1/0],a=0,n=r.length;ai[2]&&(i[2]=o[s+0]),o[s+1]>i[3]&&(i[3]=o[s+1]);return i}}}),ij=Ze({"node_modules/normalize-svg-path/index.js"(Z,q){var v=Math.PI,x=i(120);q.exports=A;function A(a){for(var n,o=[],s=0,c=0,h=0,m=0,d=null,T=null,l=0,_=0,w=0,S=a.length;w7&&(o.push(E.splice(0,7)),E.unshift("C"));break;case"S":var b=l,p=_;(n=="C"||n=="S")&&(b+=b-s,p+=p-c),E=["C",b,p,E[1],E[2],E[3],E[4]];break;case"T":n=="Q"||n=="T"?(d=l*2-d,T=_*2-T):(d=l,T=_),E=e(l,_,d,T,E[1],E[2]);break;case"Q":d=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,_,h,m);break}n=g,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=_),o.push(E)}return o}function M(a,n,o,s){return["C",a,n,o,s,o,s]}function e(a,n,o,s,c,h){return["C",a/3+2/3*o,n/3+2/3*s,c/3+2/3*o,h/3+2/3*s,c,h]}function t(a,n,o,s,c,h,m,d,T,l){if(l)f=l[0],P=l[1],u=l[2],y=l[3];else{var _=r(a,n,-c);a=_.x,n=_.y,_=r(d,T,-c),d=_.x,T=_.y;var w=(a-d)/2,S=(n-T)/2,E=w*w/(o*o)+S*S/(s*s);E>1&&(E=Math.sqrt(E),o=E*o,s=E*s);var g=o*o,b=s*s,p=(h==m?-1:1)*Math.sqrt(Math.abs((g*b-g*S*S-b*w*w)/(g*S*S+b*w*w)));p==1/0&&(p=1);var u=p*o*S/s+(a+d)/2,y=p*-s*w/o+(n+T)/2,f=Math.asin(((n-y)/s).toFixed(9)),P=Math.asin(((T-y)/s).toFixed(9));f=aP&&(f=f-v*2),!m&&P>f&&(P=P-v*2)}if(Math.abs(P-f)>x){var L=P,z=d,F=T;P=f+x*(m&&P>f?1:-1),d=u+o*Math.cos(P),T=y+s*Math.sin(P);var B=t(d,T,o,s,c,0,m,z,F,[P,L,u,y])}var O=Math.tan((P-f)/4),I=4/3*o*O,N=4/3*s*O,U=[2*a-(a+I*Math.sin(f)),2*n-(n-N*Math.cos(f)),d+I*Math.sin(P),T-N*Math.cos(P),d,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(d)),r.translate(c*.5,h*.5),r.scale(_,_),n()){var w=new Path2D(o);r.fill(w),d&&r.stroke(w)}else{var S=x(o);A(r,S),r.fill(),d&&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:m*.5});return E}var a;function n(){if(a!=null)return a;var o=document.createElement("canvas").getContext("2d");if(o.canvas.width=o.canvas.height=1,!window.Path2D)return a=!1;var s=new Path2D("M0,0h1v1h-1v-1Z");o.fillStyle="black",o.fill(s);var c=o.getImageData(0,0,1,1);return a=c&&c.data&&c.data[3]===255}}}),g0=Ze({"src/traces/scattergl/convert.js"(Z,q){"use strict";var v=is(),x=lj(),A=hg(),M=oo(),e=ca(),t=e.isArrayOrTypedArray,r=as(),i=$c(),a=em().formatColor,n=Fu(),o=r1(),s=dT(),c=mg(),h=Zm().DESELECTDIM,m={start:1,left:1,end:-1,right:-1,middle:0,center:0,bottom:1,top:-1},d=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(n.hasText(O)&&(N.text=l(B,O),N.textSel=E(B,O,O.selected),N.textUnsel=E(B,O,O.unselected)),n.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),se=t(N.color),he=t(N.line.color),H=t(N.opacity),$=t(N.size),J=t(N.line.width),X;if(Q||(X=s.isOpenSymbol(N.symbol)),Q||se||he||H||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,ne=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||n.hasMarkers(O)?"rect":"round";if(he&&O.connectgaps){var $=W[0],J=W[1];for(Q=0;Q1?se[Q]:se[0]:se,X=t(he)?he.length>1?he[Q]:he[0]:he,oe=m[J],ne=m[X],j=H?H/.8+1:0,ee=-ne*j-ne*.5;W.offset[Q]=[oe*j/$,ee/$]}}return W}q.exports={style:T,markerStyle:w,markerSelection:S,linePositions:L,errorBarPositions:z,textPosition:F}}}),U5=Ze({"src/traces/scattergl/scene_update.js"(Z,q){"use strict";var v=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(){v.extendFlat(e,r,t)},e.init(),e.update=function(a){var n=v.repeat(a,e.count);if(e.fill2d&&e.fill2d.update(n),e.scatter2d&&e.scatter2d.update(n),e.line2d&&e.line2d.update(n),e.error2d&&e.error2d.update(n.concat(n)),e.select2d&&e.select2d.update(n),e.glText)for(var o=0;o=h,u=b*2,y={},f,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(f=0;f1&&x.extendFlat(g.line,o.linePositions(T,_,w)),g.errorX||g.errorY){var b=o.errorBarPositions(T,_,w,S,E);g.errorX&&x.extendFlat(g.errorX,b.x),g.errorY&&x.extendFlat(g.errorY,b.y)}return g.text&&(x.extendFlat(g.text,{positions:w},o.textPosition(T,_,g.text,g.marker)),x.extendFlat(g.textSel,{positions:w},o.textPosition(T,_,g.text,g.markerSel)),x.extendFlat(g.textUnsel,{positions:w},o.textPosition(T,_,g.text,g.markerUnsel))),g}}}),j5=Ze({"src/traces/scattergl/edit_style.js"(Z,q){"use strict";var v=ca(),x=Yi(),A=Zm().DESELECTDIM;function M(e){var t=e[0],r=t.trace,i=t.t,a=i._scene,n=i.index,o=a.selectBatch[n],s=a.unselectBatch[n],c=a.textOptions[n],h=a.textSelectedOptions[n]||{},m=a.textUnselectedOptions[n]||{},d=v.extendFlat({},c),T,l;if(o.length||s.length){var _=h.color,w=m.color,S=c.color,E=v.isArrayOrTypedArray(S);for(d.color=new Array(r._length),T=0;T>>24,r=(M&16711680)>>>16,i=(M&65280)>>>8,a=M&255;return e===!1?[t,r,i,a]:[t/255,r/255,i/255,a/255]}}}),sh=Ze({"node_modules/object-assign/index.js"(Z,q){"use strict";var v=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={},i=0;i<10;i++)r["_"+String.fromCharCode(i)]=i;var a=Object.getOwnPropertyNames(r).map(function(o){return r[o]});if(a.join("")!=="0123456789")return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach(function(o){n[o]=o}),Object.keys(Object.assign({},n)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}q.exports=e()?Object.assign:function(t,r){for(var i,a=M(t),n,o=1;oy.length)&&(f=y.length);for(var P=0,L=new Array(f);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; } `]),se.vert=d([`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&&(se.frag=se.frag.replace("smoothstep","smoothStep"),ue.frag=ue.frag.replace("smoothstep","smoothStep")),this.drawCircle=y(se)}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 y=this,f=arguments.length,P=new Array(f),L=0;L_e)?ut.tree=h(tt,{bounds:Qe}):_e&&_e.length&&(ut.tree=_e),ut.tree){var Lt={primitive:"points",usage:"static",data:ut.tree,type:"uint32"};ut.elements?ut.elements(Lt):ut.elements=B.elements(Lt)}var kt=S.float32(tt);fe({data:kt,usage:"dynamic"});var qt=S.fract32(tt,kt);return Fe({data:qt,usage:"dynamic"}),rt({data:new Uint8Array(st),type:"uint8",usage:"stream"}),tt}},{marker:function(tt,ut,Me){var _e=ut.activation;if(_e.forEach(function(qt){return qt&&qt.destroy&&qt.destroy()}),_e.length=0,!tt||typeof tt[0]=="number"){var fe=y.addMarker(tt);_e[fe]=!0}else{for(var Fe=[],rt=0,st=Math.min(tt.length,ut.count);rt=0)return z;var F;if(y instanceof Uint8Array||y instanceof Uint8ClampedArray)F=y;else{F=new Uint8Array(y.length);for(var B=0,O=y.length;BL*4&&(this.tooManyColors=!0),this.updatePalette(P),z.length===1?z[0]:z},b.prototype.updatePalette=function(y){if(!this.tooManyColors){var f=this.maxColors,P=this.paletteTexture,L=Math.ceil(y.length*.25/f);if(L>1){y=y.slice();for(var z=y.length*.25%f;z80*I){ue=he=B[0],se=H=B[1];for(var oe=I;oehe&&(he=$),J>H&&(H=J);X=Math.max(he-ue,H-se),X=X!==0?32767/X:0}return M(W,Q,I,ue,se,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&&h(B,N,U,W);for(var ue=B,se,he;B.prev!==B.next;){if(se=B.prev,he=B.next,W?t(B,N,U,W):e(B)){O.push(se.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&&i(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,se=I.y,he=N.y,H=UW?U>Q?U:Q:W>Q?W:Q,X=ue>se?ue>he?ue:he:se>he?se:he,oe=N.next;oe!==O;){if(oe.x>=H&&oe.x<=J&&oe.y>=$&&oe.y<=X&&l(U,ue,W,se,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,se=W.x,he=Q.x,H=U.y,$=W.y,J=Q.y,X=uese?ue>he?ue:he:se>he?se:he,j=H>$?H>J?H:J:$>J?$:J,ee=d(X,oe,O,I,N),re=d(ne,j,O,I,N),ce=B.prevZ,be=B.nextZ;ce&&ce.z>=ee&&be&&be.z<=re;){if(ce.x>=X&&ce.x<=ne&&ce.y>=oe&&ce.y<=j&&ce!==U&&ce!==Q&&l(ue,H,se,$,he,J,ce.x,ce.y)&&w(ce.prev,ce,ce.next)>=0||(ce=ce.prevZ,be.x>=X&&be.x<=ne&&be.y>=oe&&be.y<=j&&be!==U&&be!==Q&&l(ue,H,se,$,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<=ne&&ce.y>=oe&&ce.y<=j&&ce!==U&&ce!==Q&&l(ue,H,se,$,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<=ne&&be.y>=oe&&be.y<=j&&be!==U&&be!==Q&&l(ue,H,se,$,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 i(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 se=f(Q,ue);Q=A(Q,Q.next),se=A(se,se.next),M(Q,O,I,N,U,W,0),M(se,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,se,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!==se);return Q}function c(B,O){return w(B.prev,B,O.prev)<0&&w(O.next,B,B.next)<0}function h(B,O,I,N){var U=B;do U.z===0&&(U.z=d(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,m(U)}function m(B){var O,I,N,U,W,Q,ue,se,he=1;do{for(I=B,B=null,W=null,Q=0;I;){for(Q++,N=I,ue=0,O=0;O0||se>0&&N;)ue!==0&&(se===0||!N||I.z<=N.z)?(U=I,I=I.nextZ,ue--):(U=N,N=N.nextZ,se--),W?W.nextZ=U:B=U,U.prevZ=W,W=U;I=N}W.nextZ=null,he*=2}while(Q>1);return B}function d(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)&&y(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&&g(B,I,O)||W===0&&g(B,N,O)||Q===0&&g(I,B,N)||ue===0&&g(I,O,N))}function g(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 y(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 f(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}v.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,se=O.length;ue0&&(N+=B[U-1].length,I.holes.push(N))}return I}}}),vj=Ze({"node_modules/array-normalize/index.js"(Z,q){"use strict";var v=v0();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=v(A,M));for(var t=0;t-1}}}),K5=Ze({"node_modules/es5-ext/string/#/contains/index.js"(Z,q){"use strict";q.exports=Cj()()?String.prototype.contains:kj()}}),rm=Ze({"node_modules/d/index.js"(Z,q){"use strict";var v=y0(),x=Z5(),A=_T(),M=Y5(),e=K5(),t=q.exports=function(r,i){var a,n,o,s,c;return arguments.length<2||typeof r!="string"?(s=i,i=r,r=null):s=arguments[2],v(r)?(a=e.call(r,"c"),n=e.call(r,"e"),o=e.call(r,"w")):(a=o=!0,n=!1),c={value:i,configurable:a,enumerable:n,writable:o},s?A(M(s),c):c};t.gs=function(r,i,a){var n,o,s,c;return typeof r!="string"?(s=a,a=i,i=r,r=null):s=arguments[3],v(i)?x(i)?v(a)?x(a)||(s=a,a=void 0):a=void 0:(s=i,i=a=void 0):i=void 0,v(r)?(n=e.call(r,"c"),o=e.call(r,"e")):(n=!0,o=!1),c={get:i,set:a,configurable:n,enumerable:o},s?A(M(s),c):c}}}),xx=Ze({"node_modules/es5-ext/function/is-arguments.js"(Z,q){"use strict";var v=Object.prototype.toString,x=v.call(function(){return arguments}());q.exports=function(A){return v.call(A)===x}}}),bx=Ze({"node_modules/es5-ext/string/is-string.js"(Z,q){"use strict";var v=Object.prototype.toString,x=v.call("");q.exports=function(A){return typeof A=="string"||A&&typeof A=="object"&&(A instanceof String||v.call(A)===x)||!1}}}),Lj=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}}}),Pj=Ze({"node_modules/ext/global-this/implementation.js"(Z,q){var v=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 v()}try{return __global__||v()}finally{delete Object.prototype.__global__}}()}}),wx=Ze({"node_modules/ext/global-this/index.js"(Z,q){"use strict";q.exports=Lj()()?globalThis:Pj()}}),Ij=Ze({"node_modules/es6-symbol/is-implemented.js"(Z,q){"use strict";var v=wx(),x={object:!0,symbol:!0};q.exports=function(){var A=v.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])}}}),Rj=Ze({"node_modules/es6-symbol/is-symbol.js"(Z,q){"use strict";q.exports=function(v){return v?typeof v=="symbol"?!0:!v.constructor||v.constructor.name!=="Symbol"?!1:v[v.constructor.toStringTag]==="Symbol":!1}}}),J5=Ze({"node_modules/es6-symbol/validate-symbol.js"(Z,q){"use strict";var v=Rj();q.exports=function(x){if(!v(x))throw new TypeError(x+" is not a symbol");return x}}}),Dj=Ze({"node_modules/es6-symbol/lib/private/generate-name.js"(Z,q){"use strict";var v=rm(),x=Object.create,A=Object.defineProperty,M=Object.prototype,e=x(null);q.exports=function(t){for(var r=0,i,a;e[t+(r||"")];)++r;return t+=r||"",e[t]=!0,i="@@"+t,A(M,i,v.gs(null,function(n){a||(a=!0,A(this,i,v(n)),a=!1)})),i}}}),zj=Ze({"node_modules/es6-symbol/lib/private/setup/standard-symbols.js"(Z,q){"use strict";var v=rm(),x=wx().Symbol;q.exports=function(A){return Object.defineProperties(A,{hasInstance:v("",x&&x.hasInstance||A("hasInstance")),isConcatSpreadable:v("",x&&x.isConcatSpreadable||A("isConcatSpreadable")),iterator:v("",x&&x.iterator||A("iterator")),match:v("",x&&x.match||A("match")),replace:v("",x&&x.replace||A("replace")),search:v("",x&&x.search||A("search")),species:v("",x&&x.species||A("species")),split:v("",x&&x.split||A("split")),toPrimitive:v("",x&&x.toPrimitive||A("toPrimitive")),toStringTag:v("",x&&x.toStringTag||A("toStringTag")),unscopables:v("",x&&x.unscopables||A("unscopables"))})}}}),Fj=Ze({"node_modules/es6-symbol/lib/private/setup/symbol-registry.js"(Z,q){"use strict";var v=rm(),x=J5(),A=Object.create(null);q.exports=function(M){return Object.defineProperties(M,{for:v(function(e){return A[e]?A[e]:A[e]=M(String(e))}),keyFor:v(function(e){var t;x(e);for(t in A)if(A[t]===e)return t})})}}}),Oj=Ze({"node_modules/es6-symbol/polyfill.js"(Z,q){"use strict";var v=rm(),x=J5(),A=wx().Symbol,M=Dj(),e=zj(),t=Fj(),r=Object.create,i=Object.defineProperties,a=Object.defineProperty,n,o,s;if(typeof A=="function")try{String(A()),s=!0}catch{}else A=null;o=function(h){if(this instanceof o)throw new TypeError("Symbol is not a constructor");return n(h)},q.exports=n=function c(h){var m;if(this instanceof c)throw new TypeError("Symbol is not a constructor");return s?A(h):(m=r(o.prototype),h=h===void 0?"":String(h),i(m,{__description__:v("",h),__name__:v("",M(h))}))},e(n),t(n),i(o.prototype,{constructor:v(n),toString:v("",function(){return this.__name__})}),i(n.prototype,{toString:v(function(){return"Symbol ("+x(this).__description__+")"}),valueOf:v(function(){return x(this)})}),a(n.prototype,n.toPrimitive,v("",function(){var c=x(this);return typeof c=="symbol"?c:c.toString()})),a(n.prototype,n.toStringTag,v("c","Symbol")),a(o.prototype,n.toStringTag,v("c",n.prototype[n.toStringTag])),a(o.prototype,n.toPrimitive,v("c",n.prototype[n.toPrimitive]))}}),yg=Ze({"node_modules/es6-symbol/index.js"(Z,q){"use strict";q.exports=Ij()()?wx().Symbol:Oj()}}),Bj=Ze({"node_modules/es5-ext/array/#/clear.js"(Z,q){"use strict";var v=tm();q.exports=function(){return v(this).length=0,this}}}),L1=Ze({"node_modules/es5-ext/object/valid-callable.js"(Z,q){"use strict";q.exports=function(v){if(typeof v!="function")throw new TypeError(v+" is not a function");return v}}}),Nj=Ze({"node_modules/type/string/coerce.js"(Z,q){"use strict";var v=y0(),x=yT(),A=Object.prototype.toString;q.exports=function(M){if(!v(M))return null;if(x(M)){var e=M.toString;if(typeof e!="function"||e===A)return null}try{return""+M}catch{return null}}}}),Uj=Ze({"node_modules/type/lib/safe-to-string.js"(Z,q){"use strict";q.exports=function(v){try{return v.toString()}catch{try{return String(v)}catch{return null}}}}}),jj=Ze({"node_modules/type/lib/to-short-string.js"(Z,q){"use strict";var v=Uj(),x=/[\n\r\u2028\u2029]/g;q.exports=function(A){var M=v(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)}}}),$5=Ze({"node_modules/type/lib/resolve-exception.js"(Z,q){"use strict";var v=y0(),x=yT(),A=Nj(),M=jj(),e=function(t,r){return t.replace("%v",M(r))};q.exports=function(t,r,i){if(!x(i))throw new TypeError(e(r,t));if(!v(t)){if("default"in i)return i.default;if(i.isOptional)return null}var a=A(i.errorMessage);throw v(a)||(a=r),new TypeError(e(a,t))}}}),Vj=Ze({"node_modules/type/value/ensure.js"(Z,q){"use strict";var v=$5(),x=y0();q.exports=function(A){return x(A)?A:v(A,"Cannot use %v",arguments[1])}}}),qj=Ze({"node_modules/type/plain-function/ensure.js"(Z,q){"use strict";var v=$5(),x=Z5();q.exports=function(A){return x(A)?A:v(A,"%v is not a plain function",arguments[1])}}}),Gj=Ze({"node_modules/es5-ext/array/from/is-implemented.js"(Z,q){"use strict";q.exports=function(){var v=Array.from,x,A;return typeof v!="function"?!1:(x=["raz","dwa"],A=v(x),!!(A&&A!==x&&A[1]==="dwa"))}}}),Hj=Ze({"node_modules/es5-ext/function/is-function.js"(Z,q){"use strict";var v=Object.prototype.toString,x=RegExp.prototype.test.bind(/^[object [A-Za-z0-9]*Function]$/);q.exports=function(A){return typeof A=="function"&&x(v.call(A))}}}),Wj=Ze({"node_modules/es5-ext/math/sign/is-implemented.js"(Z,q){"use strict";q.exports=function(){var v=Math.sign;return typeof v!="function"?!1:v(10)===1&&v(-20)===-1}}}),Xj=Ze({"node_modules/es5-ext/math/sign/shim.js"(Z,q){"use strict";q.exports=function(v){return v=Number(v),isNaN(v)||v===0?v:v>0?1:-1}}}),Zj=Ze({"node_modules/es5-ext/math/sign/index.js"(Z,q){"use strict";q.exports=Wj()()?Math.sign:Xj()}}),Yj=Ze({"node_modules/es5-ext/number/to-integer.js"(Z,q){"use strict";var v=Zj(),x=Math.abs,A=Math.floor;q.exports=function(M){return isNaN(M)?0:(M=Number(M),M===0||!isFinite(M)?M:v(M)*A(x(M)))}}}),Kj=Ze({"node_modules/es5-ext/number/to-pos-integer.js"(Z,q){"use strict";var v=Yj(),x=Math.max;q.exports=function(A){return x(0,v(A))}}}),Jj=Ze({"node_modules/es5-ext/array/from/shim.js"(Z,q){"use strict";var v=yg().iterator,x=xx(),A=Hj(),M=Kj(),e=L1(),t=tm(),r=gg(),i=bx(),a=Array.isArray,n=Function.prototype.call,o={configurable:!0,enumerable:!0,writable:!0,value:null},s=Object.defineProperty;q.exports=function(c){var h=arguments[1],m=arguments[2],d,T,l,_,w,S,E,g,b,p;if(c=Object(t(c)),r(h)&&e(h),!this||this===Array||!A(this)){if(!h){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=h?n.call(h,m,p,l):p,d?(o.value=p,s(_,l,o)):_[l]=p,++l;w=l}}if(w===void 0)for(w=M(c.length),d&&(_=new d(w)),T=0;T=this.__nextIndex__)){if(++this.__nextIndex__,!this.__redo__){i(this,"__redo__",e("c",[o]));return}this.__redo__.forEach(function(s,c){s>=o&&(this.__redo__[c]=++s)},this),this.__redo__.push(o)}}),_onDelete:e(function(o){var s;o>=this.__nextIndex__||(--this.__nextIndex__,this.__redo__&&(s=this.__redo__.indexOf(o),s!==-1&&this.__redo__.splice(s,1),this.__redo__.forEach(function(c,h){c>o&&(this.__redo__[h]=--c)},this)))}),_onClear:e(function(){this.__redo__&&v.call(this.__redo__),this.__nextIndex__=0})}))),i(n.prototype,r.iterator,e(function(){return this}))}}),nV=Ze({"node_modules/es6-iterator/array.js"(Z,q){"use strict";var v=gT(),x=K5(),A=rm(),M=yg(),e=Q5(),t=Object.defineProperty,r;r=q.exports=function(i,a){if(!(this instanceof r))throw new TypeError("Constructor requires 'new'");e.call(this,i),a?x.call(a,"key+value")?a="key+value":x.call(a,"key")?a="key":a="value":a="value",t(this,"__kind__",A("",a))},v&&v(r,e),delete r.prototype.constructor,r.prototype=Object.create(e.prototype,{_resolve:A(function(i){return this.__kind__==="value"?this.__list__[i]:this.__kind__==="key+value"?[i,this.__list__[i]]:i})}),t(r.prototype,M.toStringTag,A("c","Array Iterator"))}}),iV=Ze({"node_modules/es6-iterator/string.js"(Z,q){"use strict";var v=gT(),x=rm(),A=yg(),M=Q5(),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))},v&&v(t,M),delete t.prototype.constructor,t.prototype=Object.create(M.prototype,{_next:x(function(){if(this.__list__){if(this.__nextIndex__=55296&&a<=56319?i+this.__list__[this.__nextIndex__++]:i)})}),e(t.prototype,A.toStringTag,x("c","String Iterator"))}}),oV=Ze({"node_modules/es6-iterator/is-iterable.js"(Z,q){"use strict";var v=xx(),x=gg(),A=bx(),M=yg().iterator,e=Array.isArray;q.exports=function(t){return x(t)?e(t)||A(t)||v(t)?!0:typeof t[M]=="function":!1}}}),sV=Ze({"node_modules/es6-iterator/valid-iterable.js"(Z,q){"use strict";var v=oV();q.exports=function(x){if(!v(x))throw new TypeError(x+" is not iterable");return x}}}),eC=Ze({"node_modules/es6-iterator/get.js"(Z,q){"use strict";var v=xx(),x=bx(),A=nV(),M=iV(),e=sV(),t=yg().iterator;q.exports=function(r){return typeof e(r)[t]=="function"?r[t]():v(r)?new A(r):x(r)?new M(r):new A(r)}}}),lV=Ze({"node_modules/es6-iterator/for-of.js"(Z,q){"use strict";var v=xx(),x=L1(),A=bx(),M=eC(),e=Array.isArray,t=Function.prototype.call,r=Array.prototype.some;q.exports=function(i,a){var n,o=arguments[2],s,c,h,m,d,T,l;if(e(i)||v(i)?n="array":A(i)?n="string":i=M(i),x(a),c=function(){h=!0},n==="array"){r.call(i,function(_){return t.call(a,o,_,c),h});return}if(n==="string"){for(d=i.length,m=0;m=55296&&l<=56319&&(T+=i[++m])),t.call(a,o,T,c),!h);++m);return}for(s=i.next();!s.done;){if(t.call(a,o,s.value,c),h)return;s=i.next()}}}}),uV=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]"}()}}),cV=Ze({"node_modules/es6-weak-map/polyfill.js"(Z,q){"use strict";var v=gg(),x=gT(),A=_j(),M=tm(),e=xj(),t=rm(),r=eC(),i=lV(),a=yg().toStringTag,n=uV(),o=Array.isArray,s=Object.defineProperty,c=Object.prototype.hasOwnProperty,h=Object.getPrototypeOf,m;q.exports=m=function(){var d=arguments[0],T;if(!(this instanceof m))throw new TypeError("Constructor requires 'new'");return T=n&&x&&WeakMap!==m?x(new WeakMap,h(this)):this,v(d)&&(o(d)||(d=r(d))),s(T,"__weakMapData__",t("c","$weakMap$"+e())),d&&i(d,function(l){M(l),T.set(l[0],l[1])}),T},n&&(x&&x(m,WeakMap),m.prototype=Object.create(WeakMap.prototype,{constructor:t(m)})),Object.defineProperties(m.prototype,{delete:t(function(d){return c.call(A(d),this.__weakMapData__)?(delete d[this.__weakMapData__],!0):!1}),get:t(function(d){if(c.call(A(d),this.__weakMapData__))return d[this.__weakMapData__]}),has:t(function(d){return c.call(A(d),this.__weakMapData__)}),set:t(function(d,T){return s(A(d),this.__weakMapData__,t("c",T)),this}),toString:t(function(){return"[object WeakMap]"})}),s(m.prototype,a,t("c","WeakMap"))}}),tC=Ze({"node_modules/es6-weak-map/index.js"(Z,q){"use strict";q.exports=mj()()?WeakMap:cV()}}),fV=Ze({"node_modules/array-find-index/index.js"(Z,q){"use strict";q.exports=function(v,x,A){if(typeof Array.prototype.findIndex=="function")return v.findIndex(x,A);if(typeof x!="function")throw new TypeError("predicate must be a function");var M=Object(v),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 n,_.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,y)=>y.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,y)=>[y.viewport.x,y.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,y)=>!y.overlay},stencil:{enable:!1},scissor:{enable:!0,box:w.prop("viewport")},viewport:w.prop("viewport")},g=w(A({vert:c,frag:h,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=g}return{fill:w({primitive:"triangle",elements:(u,y)=>y.triangles,offset:0,vert:m,frag:d,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,y)=>[y.viewport.x,y.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:g,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?v(b.fill,"uint8"):null),b.viewport!=null&&(u.viewport=o(b.viewport)),u.viewport||(u.viewport=o([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;Nse-he),W=[],Q=0,ue=u.hole!=null?u.hole[0]:null;if(ue!=null){let se=s(U,he=>he>=ue);U=U.slice(0,se),U.push(ue)}for(let se=0;seJ-ue+(U[se]-Q)),$=t(he,H);$=$.map(J=>J+Q+(J+Q{w.colorBuffer.destroy(),w.positionBuffer.destroy(),w.dashTexture.destroy()}),this.passes.length=0,this}}}),hV=Ze({"node_modules/regl-error2d/index.js"(Z,q){"use strict";var v=v0(),x=hg(),A=q5(),M=Ev(),e=sh(),t=m0(),{float32:r,fract32:i}=mT();q.exports=n;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 n(o,s){if(typeof o=="function"?(s||(s={}),s.regl=o):s=o,s.length&&(s.positions=s),o=s.regl,!o.hasExtension("ANGLE_instanced_arrays"))throw Error("regl-error2d: `ANGLE_instanced_arrays` extension should be enabled");let c=o._gl,h,m,d,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=o.buffer({usage:"dynamic",type:"uint8",data:new Uint8Array(0)}),m=o.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),d=o.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),l=o.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),_=o.buffer({usage:"static",type:"float",data:a}),p(s),h=o({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:o.prop("range"),lineWidth:o.prop("lineWidth"),capSize:o.prop("capSize"),opacity:o.prop("opacity"),scale:o.prop("scale"),translate:o.prop("translate"),scaleFract:o.prop("scaleFract"),translateFract:o.prop("translateFract"),viewport:(y,f)=>[f.viewport.x,f.viewport.y,y.viewportWidth,y.viewportHeight]},attributes:{color:{buffer:T,offset:(y,f)=>f.offset*4,divisor:1},position:{buffer:m,offset:(y,f)=>f.offset*8,divisor:1},positionFract:{buffer:d,offset:(y,f)=>f.offset*8,divisor:1},error:{buffer:l,offset:(y,f)=>f.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:o.prop("viewport")},viewport:o.prop("viewport"),stencil:!1,instances:o.prop("count"),count:a.length}),e(E,{update:p,draw:g,destroy:u,regl:o,gl:c,canvas:c.canvas,groups:S}),E;function E(y){y?p(y):y===null&&u(),g()}function g(y){if(typeof y=="number")return b(y);y&&!Array.isArray(y)&&(y=[y]),o._refresh(),S.forEach((f,P)=>{if(f){if(y&&(y[P]?f.draw=!0:f.draw=!1),!f.draw){f.draw=!0;return}b(P)}})}function b(y){typeof y=="number"&&(y=S[y]),y!=null&&y&&y.count&&y.color&&y.opacity&&y.positions&&y.positions.length>1&&(y.scaleRatio=[y.scale[0]*y.viewport.width,y.scale[1]*y.viewport.height],h(y),y.after&&y.after(y))}function p(y){if(!y)return;y.length!=null?typeof y[0]=="number"&&(y=[{positions:y}]):Array.isArray(y)||(y=[y]);let f=0,P=0;if(E.groups=S=y.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=v(I,2),N.offset=f,f+=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=i(N.scale),N.translateFract=i(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}),f||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:se,errors:he}=N;Q&&(O.set(se,ue*4),I.set(he,ue*4),B.set(W,ue*2))});var L=r(B);m(L);var z=i(B,L);d(z),T(O),l(I)}}function u(){m.destroy(),d.destroy(),T.destroy(),l.destroy(),_.destroy()}}}}),pV=Ze({"node_modules/unquote/index.js"(Z,q){var v=/[\'\"]/;q.exports=function(A){return A?(v.test(A.charAt(0))&&(A=A.substr(1)),v.test(A.charAt(A.length-1))&&(A=A.substr(0,A.length-1)),A):""}}}),aC=Ze({"node_modules/css-global-keywords/index.json"(){}}),nC=Ze({"node_modules/css-system-font-keywords/index.json"(){}}),iC=Ze({"node_modules/css-font-weight-keywords/index.json"(){}}),oC=Ze({"node_modules/css-font-style-keywords/index.json"(){}}),sC=Ze({"node_modules/css-font-stretch-keywords/index.json"(){}}),dV=Ze({"node_modules/parenthesis/index.js"(Z,q){"use strict";function v(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]:["{}","[]","()"],i=e.escape||"___",a=!!e.flat;r.forEach(function(s){var c=new RegExp(["\\",s[0],"[^\\",s[0],"\\",s[1],"]*\\",s[1]].join("")),h=[];function m(d,T,l){var _=t.push(d.slice(s[0].length,-s[1].length))-1;return h.push(_),i+_+i}t.forEach(function(d,T){for(var l,_=0;d!=l;)if(l=d,d=d.replace(c,m),_++>1e4)throw Error("References have circular dependency. Please, check them.");t[T]=d}),h=h.reverse(),t=t.map(function(d){return h.forEach(function(T){d=d.replace(new RegExp("(\\"+i+T+"\\"+i+")","g"),s[0]+"$1"+s[1])}),d})});var n=new RegExp("\\"+i+"([0-9]+)\\"+i);function o(s,c,h){for(var m=[],d,T=0;d=n.exec(s);){if(T++>1e4)throw Error("Circular references in parenthesis");m.push(s.slice(0,d.index)),m.push(o(c[d[1]],c)),s=s.slice(d.index+d[0].length)}return m.push(s),m}return a?t:o(t[0],t)}function x(M,e){if(e&&e.flat){var t=e&&e.escape||"___",r=M[0],i;if(!r)return"";for(var a=new RegExp("\\"+t+"([0-9]+)\\"+t),n=0;r!=i;){if(n++>1e4)throw Error("Circular references in "+M);i=r,r=r.replace(a,o)}return r}return M.reduce(function s(c,h){return Array.isArray(h)&&(h=h.reduce(s,"")),c+h},"");function o(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):v(M,e)}A.parse=v,A.stringify=x,q.exports=A}}),vV=Ze({"node_modules/string-split-by/index.js"(Z,q){"use strict";var v=dV();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=v.parse(A,{flat:!0,brackets:e.ignore}),r=t[0],i=r.split(M);if(e.escape){for(var a=[],n=0;n1&&Yt===cr&&(Yt==='"'||Yt==="'"))return['"'+r(nt.substr(1,nt.length-2))+'"'];var ua=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(nt);if(ua)return i(nt.substr(0,ua.index)).concat(i(ua[1])).concat(i(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,hn=!1,yi={},Bn=function(ea){},Ln=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&&(Sn=S(Yt.optionalExtensions)),"onDone"in Yt&&(Bn=Yt.onDone),"profile"in Yt&&(hn=!!Yt.profile),"pixelRatio"in Yt&&(wn=+Yt.pixelRatio),"cachedCode"in Yt&&(yi=Yt.cachedCode))),cr&&(cr.nodeName.toLowerCase()==="canvas"?Aa=cr:ua=cr),!xa){if(!Aa){var Va=T(ua||document.body,Bn,wn);if(!Va)return null;Aa=Va.canvas,Ln=Va.onDestroy}wa.premultipliedAlpha===void 0&&(wa.premultipliedAlpha=!0),xa=l(Aa,wa)}return xa?{gl:xa,canvas:Aa,container:ua,extensions:Ja,optionalExtensions:Sn,pixelRatio:wn,profile:hn,cachedCode:yi,onDone:Bn,onDestroy:Ln}:(Ln(),Bn("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(),Sn;try{Sn=cr[Ja]=nt.getExtension(Ja)}catch{}return!!Sn}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 y:Ja=new Uint8Array(Yt(wa),0,wa);break;case f: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,se=3413,he=3414,H=3415,$=33901,J=33902,X=3379,oe=3386,ne=34921,j=36347,ee=36348,re=35661,ce=35660,be=34930,Ae=36349,ze=34076,Re=34024,We=7936,it=7937,ot=7938,tt=35724,ut=34047,Me=36063,_e=34852,fe=3553,Fe=34067,rt=34069,st=33984,Qe=6408,Lt=5126,kt=5121,qt=36160,Zt=36053,Sr=36064,xr=16384,jr=function(nt,Yt){var cr=1;Yt.ext_texture_filter_anisotropic&&(cr=nt.getParameter(ut));var ua=1,Aa=1;Yt.webgl_draw_buffers&&(ua=nt.getParameter(_e),Aa=nt.getParameter(Me));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(qt,Ja),nt.framebufferTexture2D(qt,Sr,fe,wa,0),nt.bindTexture(fe,null),nt.checkFramebufferStatus(qt)!==Zt)xa=!1;else{nt.viewport(0,0,1,1),nt.clearColor(1,0,0,1),nt.clear(xr);var Sn=N.allocType(Lt,4);nt.readPixels(0,0,1,1,Qe,Lt,Sn),nt.getError()?xa=!1:(nt.deleteFramebuffer(Ja),nt.deleteTexture(wa),xa=Sn[0]===1),N.freeType(Sn)}}var wn=typeof navigator<"u"&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion)||/Edge/.test(navigator.userAgent)),hn=!0;if(!wn){var yi=nt.createTexture(),Bn=N.allocType(kt,36);nt.activeTexture(st),nt.bindTexture(Fe,yi),nt.texImage2D(rt,0,Qe,3,3,0,Qe,kt,Bn),N.freeType(Bn),nt.bindTexture(Fe,null),nt.deleteTexture(yi),hn=!nt.getError()}return{colorBits:[nt.getParameter(W),nt.getParameter(Q),nt.getParameter(ue),nt.getParameter(se)],depthBits:nt.getParameter(he),stencilBits:nt.getParameter(H),subpixelBits:nt.getParameter(U),extensions:Object.keys(Yt).filter(function(Ln){return!!Yt[Ln]}),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(ne),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(We),version:nt.getParameter(ot),readFloat:xa,npotTextureCube:hn}},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 hi;if(Array.isArray(Ea[0])){Rn=za(Ea);for(var Za=1,qa=1;qa0){if(typeof Za[0]=="number"){var Mn=N.allocType(Wa.dtype,Za.length);Pr(Mn,Za),Rn(Mn,Qn),N.freeType(Mn)}else if(Array.isArray(Za[0])||wr(Za[0])){Fn=za(Za);var An=Qa(Za,Fn,Wa.dtype);Rn(An,Qn),N.freeType(An)}}}else if(Ir(Za)){Fn=Za.shape;var Jn=Za.stride,mi=0,Ii=0,zn=0,ii=0;Fn.length===1?(mi=Fn[0],Ii=1,zn=Jn[0],ii=0):Fn.length===2&&(mi=Fn[0],Ii=Fn[1],zn=Jn[0],ii=Jn[1]);var Ei=Array.isArray(Za.data)?Wa.dtype:Wt(Za.data),Ri=N.allocType(Ei,mi*Ii);ta(Ri,Za.data,mi,Ii,zn,ii,Za.offset),Rn(Ri,Qn),N.freeType(Ri)}return Vn}return an||Vn(ea),Vn._reglType="buffer",Vn._buffer=Wa,Vn.subdata=hi,cr.profile&&(Vn.stats=Wa.stats),Vn.destroy=function(){Bn(Wa)},Vn}function Va(){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:Ln,createStream:Sn,destroyStream:wn,clear:function(){bt(xa).forEach(Bn),Ja.forEach(Bn)},getBuffer:function(ea){return ea&&ea._buffer instanceof wa?ea._buffer:null},restore:Va,_initBuffer:yi}}var ra=0,Ia=0,Ha=1,rn=1,nn=4,yn=4,xt={points:ra,point:Ia,lines:Ha,line:rn,triangles:nn,triangle:yn,"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(Va){this.id=xa++,Aa[this.id]=this,this.buffer=Va,this.primType=Or,this.vertCount=0,this.type=0}Ja.prototype.bind=function(){this.buffer.bind()};var Sn=[];function wn(Va){var ea=Sn.pop();return ea||(ea=new Ja(cr.create(null,da,!0,!1)._buffer)),yi(ea,Va,fa,-1,-1,0,0),ea}function hn(Va){Sn.push(Va)}function yi(Va,ea,Ea,an,gn,Wa,Vn){Va.buffer.bind();var Rn;if(ea){var hi=Vn;!Vn&&(!wr(ea)||Ir(ea)&&!wr(ea.data))&&(hi=Yt.oes_element_index_uint?aa:Kr),cr._initBuffer(Va.buffer,ea,Ea,hi,3)}else nt.bufferData(da,Wa,Ea),Va.buffer.dtype=Rn||Lr,Va.buffer.usage=Ea,Va.buffer.dimension=3,Va.buffer.byteLength=Wa;if(Rn=Vn,!Vn){switch(Va.buffer.dtype){case Lr:case Rr:Rn=Lr;break;case Kr:case Gr:Rn=Kr;break;case aa:case Ur:Rn=aa;break;default:}Va.buffer.dtype=Rn}Va.type=Rn;var Za=gn;Za<0&&(Za=Va.buffer.byteLength,Rn===Kr?Za>>=1:Rn===aa&&(Za>>=2)),Va.vertCount=Za;var qa=an;if(an<0){qa=Or;var Qn=Va.buffer.dimension;Qn===1&&(qa=ct),Qn===2&&(qa=Nr),Qn===3&&(qa=Or)}Va.primType=qa}function Bn(Va){ua.elementsCount--,delete Aa[Va.id],Va.buffer.destroy(),Va.buffer=null}function Ln(Va,ea){var Ea=cr.create(null,da,!0),an=new Ja(Ea._buffer);ua.elementsCount++;function gn(Wa){if(!Wa)Ea(),an.primType=Or,an.vertCount=0,an.type=Lr;else if(typeof Wa=="number")Ea(Wa),an.primType=Or,an.vertCount=Wa|0,an.type=Lr;else{var Vn=null,Rn=It,hi=-1,Za=-1,qa=0,Qn=0;Array.isArray(Wa)||wr(Wa)||Ir(Wa)?Vn=Wa:("data"in Wa&&(Vn=Wa.data),"usage"in Wa&&(Rn=Ra[Wa.usage]),"primitive"in Wa&&(hi=xt[Wa.primitive]),"count"in Wa&&(Za=Wa.count|0),"type"in Wa&&(Qn=wa[Wa.type]),"length"in Wa?qa=Wa.length|0:(qa=Za,Qn===Kr||Qn===Gr?qa*=2:(Qn===aa||Qn===Ur)&&(qa*=4))),yi(an,Vn,Rn,hi,Za,qa,Qn)}return gn}return gn(Va),gn._reglType="elements",gn._elements=an,gn.subdata=function(Wa,Vn){return Ea.subdata(Wa,Vn),gn},gn.destroy=function(){Bn(an)},gn}return{create:Ln,createStream:wn,destroyStream:hn,getElements:function(Va){return typeof Va=="function"&&Va._elements instanceof Ja?Va._elements:null},clear:function(){bt(Aa).forEach(Bn)}}}var kr=new Float32Array(1),na=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,Zn=34067,Pn=34069,fi=6408,Ai=6406,ki=6407,zi=6409,Xi=6410,to=32854,go=32855,pi=36194,Jo=32819,Xo=32820,Ts=33635,Po=34042,so=6402,qi=34041,To=35904,Vo=35906,Oo=36193,lo=33776,Co=33777,os=33778,Ys=33779,Os=35986,Yo=35987,jn=34798,Ci=35840,tl=35841,Bs=35842,uo=35843,$s=36196,ms=5121,Is=5123,rl=5125,Si=5126,po=10242,ro=10243,As=10497,al=33071,$i=33648,zs=10240,au=10241,fl=9728,xu=9729,zl=9984,Ns=9985,nu=9986,Eu=9987,Bc=33170,Cu=4352,Af=4353,pf=4354,Us=34046,qc=3317,Sf=37440,iu=37441,Ll=37443,nc=37444,Ou=33984,nl=[zl,nu,Ns,Eu],vl=[0,zi,Xi,ki,fi],gs={};gs[zi]=gs[Ai]=gs[so]=1,gs[qi]=gs[Xi]=2,gs[ki]=gs[To]=3,gs[fi]=gs[Vo]=4;function qs(nt){return"[object "+nt+"]"}var ic=qs("HTMLCanvasElement"),Nl=qs("OffscreenCanvas"),Vu=qs("CanvasRenderingContext2D"),cl=qs("ImageBitmap"),yh=qs("HTMLImageElement"),ls=qs("HTMLVideoElement"),_h=Object.keys(Pe).concat([ic,Nl,Vu,cl,yh,ls]),Ss=[];Ss[ms]=1,Ss[Si]=4,Ss[Oo]=2,Ss[Is]=2,Ss[rl]=4;var Qi=[];Qi[to]=2,Qi[go]=2,Qi[pi]=2,Qi[qi]=4,Qi[lo]=.5,Qi[Co]=.5,Qi[os]=1,Qi[Ys]=1,Qi[Os]=.5,Qi[Yo]=1,Qi[jn]=1,Qi[Ci]=.5,Qi[tl]=.25,Qi[Bs]=.5,Qi[uo]=.25,Qi[$s]=.5;function Gc(nt){return Array.isArray(nt)&&(nt.length===0||typeof nt[0]=="number")}function qu(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)===ic}function wc(nt){return Ul(nt)===Nl}function rf(nt){return Ul(nt)===Vu}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)||qu(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 Si: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?Si: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,Sn=nt.channels,wn=wa*Ja*Sn,hn=Of(nt,wn),yi=0,Bn=0;Bn=1;)Ja+=wa*Sn*Sn,Sn/=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},Sn={repeat:As,clamp:al,mirror:$i},wn={nearest:fl,linear:xu},hn=v({mipmap:Eu,"nearest mipmap nearest":zl,"linear mipmap nearest":Ns,"nearest mipmap linear":nu,"linear mipmap linear":Eu},wn),yi={none:0,browser:nc},Bn={uint8:ms,rgba4:Jo,rgb565:Ts,"rgb5 a1":Xo},Ln={alpha:Ai,luminance:zi,"luminance alpha":Xi,rgb:ki,rgba:fi,rgba4:to,"rgb5 a1":go,rgb565:pi},Va={};Yt.ext_srgb&&(Ln.srgb=To,Ln.srgba=Vo),Yt.oes_texture_float&&(Bn.float32=Bn.float=Si),Yt.oes_texture_half_float&&(Bn.float16=Bn["half float"]=Oo),Yt.webgl_depth_texture&&(v(Ln,{depth:so,"depth stencil":qi}),v(Bn,{uint16:Is,uint32:rl,"depth stencil":Po})),Yt.webgl_compressed_texture_s3tc&&v(Va,{"rgb s3tc dxt1":lo,"rgba s3tc dxt1":Co,"rgba s3tc dxt3":os,"rgba s3tc dxt5":Ys}),Yt.webgl_compressed_texture_atc&&v(Va,{"rgb atc":Os,"rgba atc explicit alpha":Yo,"rgba atc interpolated alpha":jn}),Yt.webgl_compressed_texture_pvrtc&&v(Va,{"rgb pvrtc 4bppv1":Ci,"rgb pvrtc 2bppv1":tl,"rgba pvrtc 4bppv1":Bs,"rgba pvrtc 2bppv1":uo}),Yt.webgl_compressed_texture_etc1&&(Va["rgb etc1"]=$s);var ea=Array.prototype.slice.call(nt.getParameter(ha));Object.keys(Va).forEach(function(Le){var $e=Va[Le];ea.indexOf($e)>=0&&(Ln[Le]=$e)});var Ea=Object.keys(Ln);cr.textureFormats=Ea;var an=[];Object.keys(Ln).forEach(function(Le){var $e=Ln[Le];an[$e]=Le});var gn=[];Object.keys(Bn).forEach(function(Le){var $e=Bn[Le];gn[$e]=Le});var Wa=[];Object.keys(wn).forEach(function(Le){var $e=wn[Le];Wa[$e]=Le});var Vn=[];Object.keys(hn).forEach(function(Le){var $e=hn[Le];Vn[$e]=Le});var Rn=[];Object.keys(Sn).forEach(function(Le){var $e=Sn[Le];Rn[$e]=Le});var hi=Ea.reduce(function(Le,$e){var mt=Ln[$e];return mt===zi||mt===Ai||mt===zi||mt===Xi||mt===so||mt===qi||Yt.ext_srgb&&(mt===To||mt===Vo)?Le[mt]=mt:mt===go||$e.indexOf("rgba")>=0?Le[mt]=fi:Le[mt]=ki,Le},{});function Za(){this.internalformat=fi,this.format=fi,this.type=ms,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=nc,this.width=0,this.height=0,this.channels=0}function qa(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 Qn(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=yi[$e.colorSpace]),"type"in $e){var mt=$e.type;Le.type=Bn[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=Ln[Et];Le.format=hi[Ft],Et in Bn&&("type"in $e||(Le.type=Bn[Et])),Et in Va&&(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 Fn(Le){nt.pixelStorei(Sf,Le.flipY),nt.pixelStorei(iu,Le.premultiplyAlpha),nt.pixelStorei(Ll,Le.colorSpace),nt.pixelStorei(qc,Le.unpackAlignment)}function Mn(){Za.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function An(Le,$e){var mt=null;if(af($e)?mt=$e:$e&&(Qn(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,nr,fr,sr,pr;hr.length===3?(nr=hr[2],pr=gt[2]):(nr=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=nr,Le.format=Le.internalformat=vl[nr],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(qu(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 Vt=Be.shape(mt),Dr=1,Jr=0;Jr>=_r,mt.height>>=_r,An(mt,jt[_r]),Le.mipmask|=1<<_r;else mt=Le.images[0]=zn(),qa(mt,Le),An(mt,$e),Le.mipmask=1;qa(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=wn[jt]}var _r=Le.wrapS,Fr=Le.wrapT;if("wrap"in $e){var hr=$e.wrap;typeof hr=="string"?_r=Fr=Sn[hr]:Array.isArray(hr)&&(_r=Sn[hr[0]],Fr=Sn[hr[1]])}else{if("wrapS"in $e){var gt=$e.wrapS;_r=Sn[gt]}if("wrapT"in $e){var Et=$e.wrapT;Fr=Sn[Et]}}if(Le.wrapS=_r,Le.wrapT=Fr,"anisotropic"in $e){var Ft=$e.anisotropic;Le.anisotropic=$e.anisotropic}if("mipmap"in $e){var nr=!1;switch(typeof $e.mipmap){case"string":Le.mipmapHint=Ja[$e.mipmap],Le.genMipmaps=!0,nr=!0;break;case"boolean":nr=Le.genMipmaps=$e.mipmap;break;case"object":Le.genMipmaps=!1,nr=!0;break;default:}nr&&!("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 Hi(Le){Za.call(this),this.mipmask=0,this.internalformat=fi,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--}v(Hi.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 Hi(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"?Ri(Ft,hr|0,gt|0):Ri(Ft,hr|0,hr|0):hr?(Al(Et,hr),Gi(Ft,hr)):Ri(Ft,1,1),Et.genMipmaps&&(Ft.mipmask=(Ft.width<<1)-1),mt.mipmask=Ft.mipmask,qa(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=an[mt.internalformat],jt.type=gn[mt.type],jt.mag=Wa[Et.magFilter],jt.min=Vn[Et.minFilter],jt.wrapS=Rn[Et.wrapS],jt.wrapT=Rn[Et.wrapT],jt}function _r(hr,gt,Et,Ft){var nr=gt|0,fr=Et|0,sr=Ft|0,pr=zn();return qa(pr,mt),pr.width=0,pr.height=0,An(pr,hr),pr.width=pr.width||(mt.width>>sr)-nr,pr.height=pr.height||(mt.height>>sr)-fr,Cl(mt),mi(pr,Da,nr,fr,sr),Lo(),ii(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 nr=0;mt.mipmask>>nr;++nr){var fr=Et>>nr,sr=Ft>>nr;if(!fr||!sr)break;nt.texImage2D(Da,nr,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 Hi(Zn);Fs[hr.id]=hr,xa.cubeCount++;var gt=new Array(6);function Et(fr,sr,pr,lr,Xt,or){var Vt,Dr=hr.texInfo;for(fs.call(Dr),Vt=0;Vt<6;++Vt)gt[Vt]=ho();if(typeof fr=="number"||!fr){var Jr=fr|0||1;for(Vt=0;Vt<6;++Vt)Ri(gt[Vt],Jr,Jr)}else if(typeof fr=="object")if(sr)Gi(gt[0],fr),Gi(gt[1],sr),Gi(gt[2],pr),Gi(gt[3],lr),Gi(gt[4],Xt),Gi(gt[5],or);else if(Al(Dr,fr),Qn(hr,fr),"faces"in fr){var ba=fr.faces;for(Vt=0;Vt<6;++Vt)qa(gt[Vt],hr),Gi(gt[Vt],ba[Vt])}else for(Vt=0;Vt<6;++Vt)Gi(gt[Vt],fr);for(qa(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),Vt=0;Vt<6;++Vt)Ps(gt[Vt],Pn+Vt);for(El(Dr,Zn),Lo(),wa.profile&&(hr.stats.size=oc(hr.internalformat,hr.type,Et.width,Et.height,Dr.genMipmaps,!0)),Et.format=an[hr.internalformat],Et.type=gn[hr.type],Et.mag=Wa[Dr.magFilter],Et.min=Vn[Dr.minFilter],Et.wrapS=Rn[Dr.wrapS],Et.wrapT=Rn[Dr.wrapT],Vt=0;Vt<6;++Vt)Hl(gt[Vt]);return Et}function Ft(fr,sr,pr,lr,Xt){var or=pr|0,Vt=lr|0,Dr=Xt|0,Jr=zn();return qa(Jr,hr),Jr.width=0,Jr.height=0,An(Jr,sr),Jr.width=Jr.width||(hr.width>>Dr)-or,Jr.height=Jr.height||(hr.height>>Dr)-Vt,Cl(hr),mi(Jr,Pn+fr,or,Vt,Dr),Lo(),ii(Jr),Et}function nr(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(Pn+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=nr,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(Pn+_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:Sn.indexOf(fs)>=0&&(Hl=!1))),("depthTexture"in Hi||"depthStencilTexture"in Hi)&&(bl=!!(Hi.depthTexture||Hi.depthStencilTexture)),"depth"in Hi&&(typeof Hi.depth=="boolean"?Ps=Hi.depth:(Ql=Hi.depth,xl=!1)),"stencil"in Hi&&(typeof Hi.stencil=="boolean"?xl=Hi.stencil:(Fs=Hi.stencil,Ps=!1)),"depthStencil"in Hi&&(typeof Hi.depthStencil=="boolean"?Ps=xl=Hi.depthStencil:(pl=Hi.depthStencil,Ps=!1,xl=!1))}var Lo=null,ve=null,Y=null,ye=null;if(Array.isArray(ho))Lo=ho.map(Va);else if(ho)Lo=[Va(ho)];else for(Lo=new Array(El),Ei=0;Ei0&&(ii.depth=An[0].depth,ii.stencil=An[0].stencil,ii.depthStencil=An[0].depthStencil),An[zn]?An[zn](ii):An[zn]=qa(ii)}return v(Jn,{width:Ei,height:Ei,color:fs})}function mi(Ii){var zn,ii=Ii|0;if(ii===Jn.width)return Jn;var Ei=Jn.color;for(zn=0;zn=Ei.byteLength?Ri.subdata(Ei):(Ri.destroy(),qa.buffers[Ii]=null)),qa.buffers[Ii]||(Ri=qa.buffers[Ii]=Aa.create(zn,vf,!1,!0)),ii.buffer=Aa.getBuffer(Ri),ii.size=ii.buffer.dimension|0,ii.normalized=!1,ii.type=ii.buffer.dtype,ii.offset=0,ii.stride=0,ii.divisor=0,ii.state=1,Jn[Ii]=1}else Aa.getBuffer(zn)?(ii.buffer=Aa.getBuffer(zn),ii.size=ii.buffer.dimension|0,ii.normalized=!1,ii.type=ii.buffer.dtype,ii.offset=0,ii.stride=0,ii.divisor=0,ii.state=1):Aa.getBuffer(zn.buffer)?(ii.buffer=Aa.getBuffer(zn.buffer),ii.size=(+zn.size||ii.buffer.dimension)|0,ii.normalized=!!zn.normalized||!1,"type"in zn?ii.type=la[zn.type]:ii.type=ii.buffer.dtype,ii.offset=(zn.offset||0)|0,ii.stride=(zn.stride||0)|0,ii.divisor=(zn.divisor||0)|0,ii.state=1):"x"in zn&&(ii.x=+zn.x||0,ii.y=+zn.y||0,ii.z=+zn.z||0,ii.w=+zn.w||0,ii.state=2)}for(var Gi=0;Gi1)for(var Fn=0;Fnea&&(ea=Ea.stats.uniformsCount)}),ea},cr.getMaxAttributesCount=function(){var ea=0;return hn.forEach(function(Ea){Ea.stats.attributesCount>ea&&(ea=Ea.stats.attributesCount)}),ea});function Va(){Aa={},xa={};for(var ea=0;ea16&&(cr=Dn(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=Dn(ua.concat(kc(Yt)),512+Yt.length*8);return er(Dn(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,Sn=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,Sn=Ja}var wn="";for(Aa=ua.length-1;Aa>=0;Aa--)wn+=Yt.charAt(ua[Aa]);var hn=Math.ceil(nt.length*8/(Math.log(Yt.length)/Math.log(2)));for(Aa=wn.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 ia(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 pn(nt){return yr(nt,2)^yr(nt,13)^yr(nt,22)}function In(nt){return yr(nt,6)^yr(nt,11)^yr(nt,25)}function Yn(nt){return yr(nt,7)^yr(nt,18)^ia(nt,3)}function ri(nt){return yr(nt,17)^yr(nt,19)^ia(nt,10)}var di=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 Dn(nt,Yt){var cr=new Array(1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225),ua=new Array(64),Aa,xa,wa,Ja,Sn,wn,hn,yi,Bn,Ln,Va,ea;for(nt[Yt>>5]|=128<<24-Yt%32,nt[(Yt+64>>9<<4)+15]=Yt,Bn=0;Bn>16)+(Yt>>16)+(cr>>16);return ua<<16|cr&65535}function qn(nt){return Array.prototype.slice.call(nt)}function xn(nt){return qn(nt).join("")}function Mi(nt){var Yt=nt&&nt.cache,cr=0,ua=[],Aa=[],xa=[];function wa(Va,ea){var Ea=ea&&ea.stable;if(!Ea){for(var an=0;an0&&(Va.push(gn,"="),Va.push.apply(Va,qn(arguments)),Va.push(";")),gn}return v(ea,{def:an,toString:function(){return xn([Ea.length>0?"var "+Ea.join(",")+";":"",xn(Va)])}})}function Sn(){var Va=Ja(),ea=Ja(),Ea=Va.toString,an=ea.toString;function gn(Wa,Vn){ea(Wa,Vn,"=",Va.def(Wa,Vn),";")}return v(function(){Va.apply(Va,qn(arguments))},{def:Va.def,entry:Va,exit:ea,save:gn,set:function(Wa,Vn,Rn){gn(Wa,Vn),Va(Wa,Vn,"=",Rn,";")},toString:function(){return Ea()+an()}})}function wn(){var Va=xn(arguments),ea=Sn(),Ea=Sn(),an=ea.toString,gn=Ea.toString;return v(ea,{then:function(){return ea.apply(ea,qn(arguments)),this},else:function(){return Ea.apply(Ea,qn(arguments)),this},toString:function(){var Wa=gn();return Wa&&(Wa="else{"+Wa+"}"),xn(["if(",Va,"){",an(),"}",Wa])}})}var hn=Ja(),yi={};function Bn(Va,ea){var Ea=[];function an(){var hi="a"+Ea.length;return Ea.push(hi),hi}ea=ea||0;for(var gn=0;gn":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 mn(nt){return Array.isArray(nt)||wr(nt)||Ir(nt)}function cn(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,Sn=0;Sn=1&&(wa=!0),hn>=2&&(Ja=!0)}else wn.type===xs&&(xa=xa||wn.data.thisDep,wa=wa||wn.data.contextDep,Ja=Ja||wn.data.propDep)}return new Pa(xa,wa,Ja,Yt)}else return new Pa(cr===Qo,cr===xo,cr===ui,Yt)}}var Pi=new Pa(!1,!1,!1,function(){});function Zi(nt,Yt,cr,ua,Aa,xa,wa,Ja,Sn,wn,hn,yi,Bn,Ln,Va,ea){var Ea=wn.Record,an={add:32774,subtract:32778,"reverse subtract":32779};cr.ext_blend_minmax&&(an.min=_t,an.max=St);var gn=cr.angle_instanced_arrays,Wa=cr.webgl_draw_buffers,Vn=cr.oes_vertex_array_object,Rn={dirty:!0,profile:ea.profile},hi={},Za=[],qa={},Qn={};function Fn(gt){return gt.replace(".","_")}function Mn(gt,Et,Ft){var nr=Fn(gt);Za.push(gt),hi[nr]=Rn[nr]=!!Ft,qa[nr]=Et}function An(gt,Et,Ft){var nr=Fn(gt);Za.push(gt),Array.isArray(Ft)?(Rn[nr]=Ft.slice(),hi[nr]=Ft.slice()):Rn[nr]=hi[nr]=Ft,Qn[nr]=Et}function Jn(gt){return!!isNaN(gt)}Mn(Ks,vn),Mn(ys,Oa),An(Fl,"blendColor",[0,0,0,0]),An(yl,"blendEquationSeparate",[Wr,Wr]),An(sl,"blendFuncSeparate",[qr,gr,qr,gr]),Mn(Ui,Hn,!0),An(Io,"depthFunc",Ta),An(Xs,"depthRange",[0,1]),An(Ls,"depthMask",!0),An(ou,ou,[!0,!0,!0,!0]),Mn(Iu,Sa),An(Zu,"cullFace",De),An(Lc,Lc,vt),An(yu,yu,1),Mn(Pc,Ti),An(wu,"polygonOffset",[0,0]),Mn(gc,Wi),Mn(fo,Bi),An(zo,"sampleCoverage",[1,!1]),Mn(Ic,Xn),An(lc,"stencilMask",-1),An(Yu,"stencilFunc",[ar,0,-1]),An(Ne,"stencilOpSeparate",[de,zt,zt,zt]),An(R,"stencilOpSeparate",[De,zt,zt,zt]),Mn(ae,oi),An(we,"scissor",[0,0,nt.drawingBufferWidth,nt.drawingBufferHeight]),An(Se,Se,[0,0,nt.drawingBufferWidth,nt.drawingBufferHeight]);var mi={gl:nt,context:Bn,strings:Yt,next:hi,current:Rn,draw:yi,elements:xa,buffer:Aa,shader:hn,attributes:wn.state,vao:wn,uniforms:Sn,framebuffer:Ja,extensions:cr,timer:Ln,isBufferArgs:mn},Ii={primTypes:xt,compareFuncs:Ma,blendFuncs:on,blendEquations:an,stencilOps:Na,glTypes:la,orientationType:Ka};Wa&&(Ii.backBuffer=[De],Ii.drawBuffer=p(ua.maxDrawbuffers,function(gt){return gt===0?[0]:p(gt,function(Et){return tn+Et})}));var zn=0;function ii(){var gt=Mi({cache:Va}),Et=gt.link,Ft=gt.global;gt.id=zn++,gt.batchId="0";var nr=Et(mi),fr=gt.shared={props:"a0"};Object.keys(mi).forEach(function(or){fr[or]=Ft.def(nr,".",or)});var sr=gt.next={},pr=gt.current={};Object.keys(Qn).forEach(function(or){Array.isArray(Rn[or])&&(sr[or]=Ft.def(fr.next,".",or),pr[or]=Ft.def(fr.current,".",or))});var lr=gt.constants={};Object.keys(Ii).forEach(function(or){lr[or]=Ft.def(JSON.stringify(Ii[or]))}),gt.invoke=function(or,Vt){switch(Vt.type){case wi:var Dr=["this",fr.context,fr.props,gt.batchId];return or.def(Et(Vt.data),".call(",Dr.slice(0,Math.max(Vt.data.length+1,4)),")");case ui:return or.def(fr.props,Vt.data);case xo:return or.def(fr.context,Vt.data);case Qo:return or.def("this",Vt.data);case xs:return Vt.data.append(gt,or),Vt.data.ref;case Qs:return Vt.data.toString();case Rs:return Vt.data.map(function(Jr){return gt.invoke(or,Jr)})}},gt.attribCache={};var Xt={};return gt.scopeAttrib=function(or){var Vt=Yt.id(or);if(Vt in Xt)return Xt[Vt];var Dr=wn.scope[Vt];Dr||(Dr=wn.scope[Vt]=new Ea);var Jr=Xt[Vt]=Et(Dr);return Jr},gt}function Ei(gt){var Et=gt.static,Ft=gt.dynamic,nr;if(Oe in Et){var fr=!!Et[Oe];nr=ni(function(pr,lr){return fr}),nr.enable=fr}else if(Oe in Ft){var sr=Ft[Oe];nr=vi(sr,function(pr,lr){return pr.invoke(lr,sr)})}return nr}function Ri(gt,Et){var Ft=gt.static,nr=gt.dynamic;if(pt in Ft){var fr=Ft[pt];return fr?(fr=Ja.getFramebuffer(fr),ni(function(pr,lr){var Xt=pr.link(fr),or=pr.shared;lr.set(or.framebuffer,".next",Xt);var Vt=or.context;return lr.set(Vt,"."+dt,Xt+".width"),lr.set(Vt,"."+Ct,Xt+".height"),Xt})):ni(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 nr){var sr=nr[pt];return vi(sr,function(pr,lr){var Xt=pr.invoke(lr,sr),or=pr.shared,Vt=or.framebuffer,Dr=lr.def(Vt,".getFramebuffer(",Xt,")");lr.set(Vt,".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 Gi(gt,Et,Ft){var nr=gt.static,fr=gt.dynamic;function sr(Xt){if(Xt in nr){var or=nr[Xt],Vt=!0,Dr=or.x|0,Jr=or.y|0,ba,_n;return"width"in or?ba=or.width|0:Vt=!1,"height"in or?_n=or.height|0:Vt=!1,new Pa(!Vt&&Et&&Et.thisDep,!Vt&&Et&&Et.contextDep,!Vt&&Et&&Et.propDep,function($n,Nn){var dn=$n.shared.context,Tn=ba;"width"in or||(Tn=Nn.def(dn,".",dt,"-",Dr));var En=_n;return"height"in or||(En=Nn.def(dn,".",Ct,"-",Jr)),[Dr,Jr,Tn,En]})}else if(Xt in fr){var Xa=fr[Xt],ln=vi(Xa,function($n,Nn){var dn=$n.invoke(Nn,Xa),Tn=$n.shared.context,En=Nn.def(dn,".x|0"),Gn=Nn.def(dn,".y|0"),ci=Nn.def('"width" in ',dn,"?",dn,".width|0:","(",Tn,".",dt,"-",En,")"),bo=Nn.def('"height" in ',dn,"?",dn,".height|0:","(",Tn,".",Ct,"-",Gn,")");return[En,Gn,ci,bo]});return Et&&(ln.thisDep=ln.thisDep||Et.thisDep,ln.contextDep=ln.contextDep||Et.contextDep,ln.propDep=ln.propDep||Et.propDep),ln}else return Et?new Pa(Et.thisDep,Et.contextDep,Et.propDep,function($n,Nn){var dn=$n.shared.context;return[0,0,Nn.def(dn,".",dt),Nn.def(dn,".",Ct)]}):null}var pr=sr(Se);if(pr){var lr=pr;pr=new Pa(pr.thisDep,pr.contextDep,pr.propDep,function(Xt,or){var Vt=lr.append(Xt,or),Dr=Xt.shared.context;return or.set(Dr,"."+wt,Vt[2]),or.set(Dr,"."+Dt,Vt[3]),Vt})}return{viewport:pr,scissor_box:sr(we)}}function Ps(gt,Et){var Ft=gt.static,nr=typeof Ft[Bt]=="string"&&typeof Ft[At]=="string";if(nr){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"+En+"?"+Vt+".constant["+En+"]:0;"}).join(""),"}}else{","if(",ba,"(",Vt,".buffer)){",$n,"=",_n,".createStream(",Qr,",",Vt,".buffer);","}else{",$n,"=",_n,".getBuffer(",Vt,".buffer);","}",Nn,'="type" in ',Vt,"?",Jr.glTypes,"[",Vt,".type]:",$n,".dtype;",Xa.normalized,"=!!",Vt,".normalized;");function dn(Tn){or(Xa[Tn],"=",Vt,".",Tn,"|0;")}return dn("size"),dn("offset"),dn("stride"),dn("divisor"),or("}}"),or.exit("if(",Xa.isStream,"){",_n,".destroyStream(",$n,");","}"),Xa}fr[sr]=vi(pr,lr)}),fr}function El(gt){var Et=gt.static,Ft=gt.dynamic,nr={};return Object.keys(Et).forEach(function(fr){var sr=Et[fr];nr[fr]=ni(function(pr,lr){return typeof sr=="number"||typeof sr=="boolean"?""+sr:pr.link(sr)})}),Object.keys(Ft).forEach(function(fr){var sr=Ft[fr];nr[fr]=vi(sr,function(pr,lr){return pr.invoke(lr,sr)})}),nr}function Ql(gt,Et,Ft,nr,fr){var sr=gt.static,pr=gt.dynamic,lr=Ps(gt,Et),Xt=Ri(gt,fr),or=Gi(gt,Xt,fr),Vt=ho(gt,fr),Dr=Hl(gt,fr),Jr=xl(gt,fr,lr);function ba(dn){var Tn=or[dn];Tn&&(Dr[dn]=Tn)}ba(Se),ba(Fn(we));var _n=Object.keys(Dr).length>0,Xa={framebuffer:Xt,draw:Vt,shader:Jr,state:Dr,dirty:_n,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(Xa.profile=Ei(gt,fr),Xa.uniforms=fs(Ft,fr),Xa.drawVAO=Xa.scopeVAO=Vt.vao,!Xa.drawVAO&&Jr.program&&!lr&&cr.angle_instanced_arrays&&Vt.static.elements){var ln=!0,$n=Jr.program.attributes.map(function(dn){var Tn=Et.static[dn];return ln=ln&&!!Tn,Tn});if(ln&&$n.length>0){var Nn=wn.getVAO(wn.createVAO({attributes:$n,elements:Vt.static.elements}));Xa.drawVAO=new Pa(null,null,null,function(dn,Tn){return dn.link(Nn)}),Xa.useVAO=!0}}return lr?Xa.useVAO=!0:Xa.attributes=Al(Et,fr),Xa.context=El(nr,fr),Xa}function Fs(gt,Et,Ft){var nr=gt.shared,fr=nr.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,nr){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,Vt=Xt.backBuffer,Dr;Ft?Dr=Ft.append(gt,Et):Dr=Et.def(pr,".next"),nr||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(",Vt,");"),Et("}",pr,".cur=",Dr,";"),nr||Et("}")}function bl(gt,Et,Ft){var nr=gt.shared,fr=nr.gl,sr=gt.current,pr=gt.next,lr=nr.current,Xt=nr.next,or=gt.cond(lr,".dirty");Za.forEach(function(Vt){var Dr=Fn(Vt);if(!(Dr in Ft.state)){var Jr,ba;if(Dr in pr){Jr=pr[Dr],ba=sr[Dr];var _n=p(Rn[Dr].length,function(ln){return or.def(Jr,"[",ln,"]")});or(gt.cond(_n.map(function(ln,$n){return ln+"!=="+ba+"["+$n+"]"}).join("||")).then(fr,".",Qn[Dr],"(",_n,");",_n.map(function(ln,$n){return ba+"["+$n+"]="+ln}).join(";"),";"))}else{Jr=or.def(Xt,".",Dr);var Xa=gt.cond(Jr,"!==",lr,".",Dr);or(Xa),Dr in qa?Xa(gt.cond(Jr).then(fr,".enable(",qa[Dr],");").else(fr,".disable(",qa[Dr],");"),lr,".",Dr,"=",Jr,";"):Xa(fr,".",Qn[Dr],"(",Jr,");",lr,".",Dr,"=",Jr,";")}}}),Object.keys(Ft.state).length===0&&or(lr,".dirty=false;"),Et(or)}function Hi(gt,Et,Ft,nr){var fr=gt.shared,sr=gt.current,pr=fr.current,lr=fr.gl,Xt;cn(Object.keys(Ft)).forEach(function(or){var Vt=Ft[or];if(!(nr&&!nr(Vt))){var Dr=Vt.append(gt,Et);if(qa[or]){var Jr=qa[or];si(Vt)?(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,".",Qn[or],"(",Dr,");",Dr.map(function(_n,Xa){return ba+"["+Xa+"]="+_n}).join(";"),";")}else si(Vt)?(Xt=gt.link(Dr,{stable:!0}),Et(lr,".",Qn[or],"(",Xt,");",pr,".",or,"=",Xt,";")):Et(lr,".",Qn[or],"(",Dr,");",pr,".",or,"=",Dr,";")}})}function Cl(gt,Et){gn&&(gt.instancing=Et.def(gt.shared.extensions,".angle_instanced_arrays"))}function Lo(gt,Et,Ft,nr,fr){var sr=gt.shared,pr=gt.stats,lr=sr.current,Xt=sr.timer,or=Ft.profile;function Vt(){return typeof performance>"u"?"Date.now()":"performance.now()"}var Dr,Jr;function ba(dn){Dr=Et.def(),dn(Dr,"=",Vt(),";"),typeof fr=="string"?dn(pr,".count+=",fr,";"):dn(pr,".count++;"),Ln&&(nr?(Jr=Et.def(),dn(Jr,"=",Xt,".getNumPendingQueries();")):dn(Xt,".beginQuery(",pr,");"))}function _n(dn){dn(pr,".cpuTime+=",Vt(),"-",Dr,";"),Ln&&(nr?dn(Xt,".pushScopeStats(",Jr,",",Xt,".getNumPendingQueries(),",pr,");"):dn(Xt,".endQuery();"))}function Xa(dn){var Tn=Et.def(lr,".profile");Et(lr,".profile=",dn,";"),Et.exit(lr,".profile=",Tn,";")}var ln;if(or){if(si(or)){or.enable?(ba(Et),_n(Et.exit),Xa("true")):Xa("false");return}ln=or.append(gt,Et),Xa(ln)}else ln=Et.def(lr,".profile");var $n=gt.block();ba($n),Et("if(",ln,"){",$n,"}");var Nn=gt.block();_n(Nn),Et.exit("if(",ln,"){",Nn,"}")}function ve(gt,Et,Ft,nr,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,Vt){var Dr=sr.gl,Jr=Et.def(Xt,".location"),ba=Et.def(sr.attributes,"[",Jr,"]"),_n=Vt.state,Xa=Vt.buffer,ln=[Vt.x,Vt.y,Vt.z,Vt.w],$n=["buffer","normalized","offset","stride"];function Nn(){Et("if(!",ba,".buffer){",Dr,".enableVertexAttribArray(",Jr,");}");var Tn=Vt.type,En;if(Vt.size?En=Et.def(Vt.size,"||",or):En=or,Et("if(",ba,".type!==",Tn,"||",ba,".size!==",En,"||",$n.map(function(ci){return ba+"."+ci+"!=="+Vt[ci]}).join("||"),"){",Dr,".bindBuffer(",Qr,",",Xa,".buffer);",Dr,".vertexAttribPointer(",[Jr,En,Tn,Vt.normalized,Vt.stride,Vt.offset],");",ba,".type=",Tn,";",ba,".size=",En,";",$n.map(function(ci){return ba+"."+ci+"="+Vt[ci]+";"}).join(""),"}"),gn){var Gn=Vt.divisor;Et("if(",ba,".divisor!==",Gn,"){",gt.instancing,".vertexAttribDivisorANGLE(",[Jr,Gn],");",ba,".divisor=",Gn,";}")}}function dn(){Et("if(",ba,".buffer){",Dr,".disableVertexAttribArray(",Jr,");",ba,".buffer=null;","}if(",Ki.map(function(Tn,En){return ba+"."+Tn+"!=="+ln[En]}).join("||"),"){",Dr,".vertexAttrib4f(",Jr,",",ln,");",Ki.map(function(Tn,En){return ba+"."+Tn+"="+ln[En]+";"}).join(""),"}")}_n===Ji?Nn():_n===co?dn():(Et("if(",_n,"===",Ji,"){"),Nn(),Et("}else{"),dn(),Et("}"))}nr.forEach(function(Xt){var or=Xt.name,Vt=Ft.attributes[or],Dr;if(Vt){if(!fr(Vt))return;Dr=Vt.append(gt,Et)}else{if(!fr(Pi))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,nr,fr,sr){for(var pr=gt.shared,lr=pr.gl,Xt,or=0;or1){for(var jo=[],ks=[],Fo=0;Fo>1)",Xa],");")}function Gn(){Ft(ln,".drawArraysInstancedANGLE(",[Jr,ba,_n,Xa],");")}Vt&&Vt!=="null"?Nn?En():(Ft("if(",Vt,"){"),En(),Ft("}else{"),Gn(),Ft("}")):Gn()}function Tn(){function En(){Ft(sr+".drawElements("+[Jr,_n,$n,ba+"<<(("+$n+"-"+ao+")>>1)"]+");")}function Gn(){Ft(sr+".drawArrays("+[Jr,ba,_n]+");")}Vt&&Vt!=="null"?Nn?En():(Ft("if(",Vt,"){"),En(),Ft("}else{"),Gn(),Ft("}")):Gn()}gn&&(typeof Xa!="number"||Xa>=0)?typeof Xa=="string"?(Ft("if(",Xa,">0){"),dn(),Ft("}else if(",Xa,"<0){"),Tn(),Ft("}")):dn():Tn()}function te(gt,Et,Ft,nr,fr){var sr=ii(),pr=sr.proc("body",fr);return gn&&(sr.instancing=pr.def(sr.shared.extensions,".angle_instanced_arrays")),gt(sr,pr,Ft,nr),sr.compile().body}function me(gt,Et,Ft,nr){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,nr.attributes,function(){return!0})),Y(gt,Et,Ft,nr.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),Hi(gt,Ft,Et.state),Lo(gt,Ft,Et,!1,!0);var nr=Et.shader.progVar.append(gt,Ft);if(Ft(gt.shared.gl,".useProgram(",nr,".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(nr,".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)}),"(",nr,");",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,nr){gt.batchId="a1",Cl(gt,Et);function fr(){return!0}ve(gt,Et,Ft,nr.attributes,fr),Y(gt,Et,Ft,nr.uniforms,fr,!1),ye(gt,Et,Et,Ft)}function $e(gt,Et,Ft,nr){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(),Vt=gt.scope();Et(or.entry,"for(",sr,"=0;",sr,"<",lr,";++",sr,"){",Xt,"=",pr,"[",sr,"];",Vt,"}",or.exit);function Dr($n){return $n.contextDep&&fr||$n.propDep}function Jr($n){return!Dr($n)}if(Ft.needsContext&&Fs(gt,Vt,Ft.context),Ft.needsFramebuffer&&pl(gt,Vt,Ft.framebuffer),Hi(gt,Vt,Ft.state,Dr),Ft.profile&&Dr(Ft.profile)&&Lo(gt,Vt,Ft,!1,!0),nr)Ft.useVAO?Ft.drawVAO?Dr(Ft.drawVAO)?Vt(gt.shared.vao,".setVAO(",Ft.drawVAO.append(gt,Vt),");"):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,nr.attributes,Jr),ve(gt,Vt,Ft,nr.attributes,Dr)),Y(gt,or,Ft,nr.uniforms,Jr,!1),Y(gt,Vt,Ft,nr.uniforms,Dr,!0),ye(gt,or,Vt,Ft);else{var ba=gt.global.def("{}"),_n=Ft.shader.progVar.append(gt,Vt),Xa=Vt.def(_n,".id"),ln=Vt.def(ba,"[",Xa,"]");Vt(gt.shared.gl,".useProgram(",_n,".program);","if(!",ln,"){",ln,"=",ba,"[",Xa,"]=",gt.link(function($n){return te(Le,gt,Ft,$n,2)}),"(",_n,");}",ln,".call(this,a0[",sr,"],",sr,");")}}function mt(gt,Et){var Ft=gt.proc("batch",2);gt.batchId="0",Cl(gt,Ft);var nr=!1,fr=!0;Object.keys(Et.context).forEach(function(ba){nr=nr||Et.context[ba].propDep}),nr||(Fs(gt,Ft,Et.context),fr=!1);var sr=Et.framebuffer,pr=!1;sr?(sr.propDep?nr=pr=!0:sr.contextDep&&nr&&(pr=!0),pr||pl(gt,Ft,sr)):pl(gt,Ft,null),Et.state.viewport&&Et.state.viewport.propDep&&(nr=!0);function lr(ba){return ba.contextDep&&nr||ba.propDep}bl(gt,Ft,Et),Hi(gt,Ft,Et.state,function(ba){return!lr(ba)}),(!Et.profile||!lr(Et.profile))&&Lo(gt,Ft,Et,!1,"a1"),Et.contextDep=nr,Et.needsContext=fr,Et.needsFramebuffer=pr;var Xt=Et.shader.progVar;if(Xt.contextDep&&nr||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 Vt=gt.global.def("{}"),Dr=Ft.def(or,".id"),Jr=Ft.def(Vt,"[",Dr,"]");Ft(gt.cond(Jr).then(Jr,".call(this,a0,a1);").else(Jr,"=",Vt,"[",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 nr=gt.shared,fr=nr.current;if(Fs(gt,Ft,Et.context),Et.framebuffer&&Et.framebuffer.append(gt,Ft),cn(Object.keys(Et.state)).forEach(function(lr){var Xt=Et.state[lr],or=Xt.append(gt,Ft);Ya(or)?or.forEach(function(Vt,Dr){Jn(Vt)?Ft.set(gt.next[lr],"["+Dr+"]",Vt):Ft.set(gt.next[lr],"["+Dr+"]",gt.link(Vt,{stable:!0}))}):si(Xt)?Ft.set(nr.next,"."+lr,gt.link(or,{stable:!0})):Ft.set(nr.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);Jn(or)?Ft.set(nr.draw,"."+lr,or):Ft.set(nr.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 Jn(or)?or:gt.link(or,{stable:!0})})+"]"),Ft.set(nr.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(Vt){Ft.set(or,"."+Vt,Xt[Vt])})}),Et.scopeVAO){var sr=Et.scopeVAO.append(gt,Ft);Jn(sr)?Ft.set(nr.vao,".targetVAO",sr):Ft.set(nr.vao,".targetVAO",gt.link(sr,{stable:!0}))}function pr(lr){var Xt=Et.shader[lr];if(Xt){var or=Xt.append(gt,Ft);Jn(or)?Ft.set(nr.shader,"."+lr,or):Ft.set(nr.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=mi[te];me&&me(Va,null,0)}cr.flush(),hn&&hn.update()}function Gi(){!Ei&&mi.length>0&&(Ei=h.next(Ri))}function Ps(){Ei&&(h.cancel(Ri),Ei=null)}function xl(te){te.preventDefault(),Aa=!0,Ps(),Ii.forEach(function(me){me()})}function ho(te){cr.getError(),Aa=!1,xa.restore(),hi.restore(),gn.restore(),Za.restore(),qa.restore(),Qn.restore(),Vn.restore(),hn&&hn.restore(),Fn.procs.refresh(),Gi(),zn.forEach(function(me){me()})}Jn&&(Jn.addEventListener(cs,xl,!1),Jn.addEventListener(ps,ho,!1));function Hl(){mi.length=0,Ps(),Jn&&(Jn.removeEventListener(cs,xl),Jn.removeEventListener(ps,ho)),hi.clear(),Qn.clear(),qa.clear(),Vn.clear(),Za.clear(),Wa.clear(),gn.clear(),hn&&hn.clear(),ii.forEach(function(te){te()})}function fs(te){function me(sr){var pr=v({},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(Vt){pr[Xt+"."+Vt]=or[Vt]})}}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 Vt=sr[or];if(c.isDynamic(Vt)){Xt[or]=c.unbox(Vt,or);return}else if(pr&&Array.isArray(Vt)){for(var Dr=0;Dr0)return gt.call(this,nr(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 v(fr,{stats:_r,destroy:function(){Fr.destroy()}})}var Al=Qn.setFBO=fs({framebuffer:c.define.call(null,Tl,"framebuffer")});function El(te,me){var Ge=0;Fn.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|=gi),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(v({framebuffer:te.framebuffer.faces[me]},te),El);else Al(te,El);else El(null,te)}function Fs(te){mi.push(te);function me(){var Ge=Il(mi,te);function Le(){var $e=Il(mi,Le);mi[$e]=mi[mi.length-1],mi.length-=1,mi.length<=0&&Ps()}mi[Ge]=Le}return Gi(),{cancel:me}}function pl(){var te=An.viewport,me=An.scissor_box;te[0]=te[1]=me[0]=me[1]=0,Va.viewportWidth=Va.framebufferWidth=Va.drawingBufferWidth=te[2]=me[2]=cr.drawingBufferWidth,Va.viewportHeight=Va.framebufferHeight=Va.drawingBufferHeight=te[3]=me[3]=cr.drawingBufferHeight}function bl(){Va.tick+=1,Va.time=Cl(),pl(),Fn.procs.poll()}function Hi(){Za.refresh(),pl(),Fn.procs.refresh(),hn&&hn.update()}function Cl(){return(m()-yi)/1e3}Hi();function Lo(te,me){var Ge;switch(te){case"frame":return Fs(me);case"lost":Ge=Ii;break;case"restore":Ge=zn;break;case"destroy":Ge=ii;break;default:}return Ge.push(me),{cancel:function(){for(var Le=0;Le=0},read:Mn,destroy:Hl,_gl:cr,_refresh:Hi,poll:function(){bl(),hn&&hn.update()},now:Cl,stats:Ja,getCachedCode:ve,preloadCachedCode:Y});return Yt.onDone(null,ye),ye}return yc})}}),xV=Ze({"node_modules/gl-util/context.js"(Z,q){"use strict";var v=Ev();q.exports=function(i){if(i?typeof i=="string"&&(i={container:i}):i={},A(i)?i={container:i}:M(i)?i={container:i}:e(i)?i={gl:i}:i=v(i,{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),i.pixelRatio||(i.pixelRatio=window.pixelRatio||1),i.gl)return i.gl;if(i.canvas&&(i.container=i.canvas.parentNode),i.container){if(typeof i.container=="string"){var a=document.querySelector(i.container);if(!a)throw Error("Element "+i.container+" is not found");i.container=a}A(i.container)?(i.canvas=i.container,i.container=i.canvas.parentNode):i.canvas||(i.canvas=t(),i.container.appendChild(i.canvas),x(i))}else if(!i.canvas)if(typeof document<"u")i.container=document.body||document.documentElement,i.canvas=t(),i.container.appendChild(i.canvas),x(i);else throw Error("Not DOM environment. Use headless-gl.");return i.gl||["webgl","experimental-webgl","webgl-experimental"].some(function(n){try{i.gl=i.canvas.getContext(n,i.attrs)}catch{}return i.gl}),i.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 i=r.container.getBoundingClientRect();r.canvas.width=r.width||i.right-i.left,r.canvas.height=r.height||i.bottom-i.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}}}),bV=Ze({"node_modules/font-atlas/index.js"(Z,q){"use strict";var v=uC(),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,i=typeof M.step=="number"?[M.step,M.step]:M.step||[32,32],a=M.chars||x;if(r&&typeof r!="string"&&(r=v(r)),!Array.isArray(a))a=String(a).split("");else if(a.length===2&&typeof a[0]=="number"&&typeof a[1]=="number"){for(var n=[],o=a[0],s=0;o<=a[1];o++)n[s++]=String.fromCharCode(o);a=n}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 h=i[0]/2,m=i[1]/2,o=0;oe[0]-i[0]/2&&(h=i[0]/2,m+=i[1]);return t}}}),cC=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 v(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=v,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>>>v(A)+1}}}),wV=Ze({"node_modules/dup/dup.js"(Z,q){"use strict";function v(M,e,t){var r=M[t]|0;if(r<=0)return[];var i=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 v(M,e,0);break}return[]}q.exports=A}}),TV=Ze({"node_modules/typedarray-pool/pool.js"(Z){"use strict";var q=cC(),v=wV(),x=t0().Buffer;window.__TYPEDARRAY_POOL||(window.__TYPEDARRAY_POOL={UINT8:v([32,0]),UINT16:v([32,0]),UINT32:v([32,0]),BIGUINT64:v([32,0]),INT8:v([32,0]),INT16:v([32,0]),INT32:v([32,0]),BIGINT64:v([32,0]),FLOAT:v([32,0]),DOUBLE:v([32,0]),DATA:v([32,0]),UINT8C:v([32,0]),BUFFER:v([32,0])});var A=typeof Uint8ClampedArray<"u",M=typeof BigUint64Array<"u",e=typeof BigInt64Array<"u",t=window.__TYPEDARRAY_POOL;t.UINT8C||(t.UINT8C=v([32,0])),t.BIGUINT64||(t.BIGUINT64=v([32,0])),t.BIGINT64||(t.BIGINT64=v([32,0])),t.BUFFER||(t.BUFFER=v([32,0]));var r=t.DATA,i=t.BUFFER;Z.free=function(u){if(x.isBuffer(u))i[q.log2(u.length)].push(u);else{if(Object.prototype.toString.call(u)!=="[object ArrayBuffer]"&&(u=u.buffer),!u)return;var y=u.length||u.byteLength,f=q.log2(y)|0;r[f].push(u)}};function a(p){if(p){var u=p.length||p.byteLength,y=q.log2(u);r[y].push(p)}}function n(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=n,Z.freeArrayBuffer=a,Z.freeBuffer=function(u){i[q.log2(u.length)].push(u)},Z.malloc=function(u,y){if(y===void 0||y==="arraybuffer")return o(u);switch(y){case"uint8":return s(u);case"uint16":return c(u);case"uint32":return h(u);case"int8":return m(u);case"int16":return d(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 g(u);default:return null}return null};function o(u){var u=q.nextPow2(u),y=q.log2(u),f=r[y];return f.length>0?f.pop():new ArrayBuffer(u)}Z.mallocArrayBuffer=o;function s(p){return new Uint8Array(o(p),0,p)}Z.mallocUint8=s;function c(p){return new Uint16Array(o(2*p),0,p)}Z.mallocUint16=c;function h(p){return new Uint32Array(o(4*p),0,p)}Z.mallocUint32=h;function m(p){return new Int8Array(o(p),0,p)}Z.mallocInt8=m;function d(p){return new Int16Array(o(2*p),0,p)}Z.mallocInt16=d;function T(p){return new Int32Array(o(4*p),0,p)}Z.mallocInt32=T;function l(p){return new Float32Array(o(4*p),0,p)}Z.mallocFloat32=Z.mallocFloat=l;function _(p){return new Float64Array(o(8*p),0,p)}Z.mallocFloat64=Z.mallocDouble=_;function w(p){return A?new Uint8ClampedArray(o(p),0,p):s(p)}Z.mallocUint8Clamped=w;function S(p){return M?new BigUint64Array(o(8*p),0,p):null}Z.mallocBigUint64=S;function E(p){return e?new BigInt64Array(o(8*p),0,p):null}Z.mallocBigInt64=E;function g(p){return new DataView(o(p),0,p)}Z.mallocDataView=g;function b(p){p=q.nextPow2(p);var u=q.log2(p),y=i[u];return y.length>0?y.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,i[u].length=0}}}),AV=Ze({"node_modules/is-plain-obj/index.js"(Z,q){"use strict";var v=Object.prototype.toString;q.exports=function(x){var A;return v.call(x)==="[object Object]"&&(A=Object.getPrototypeOf(x),A===null||A===Object.getPrototypeOf({}))}}}),fC=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}}}),SV=Ze({"node_modules/to-px/topx.js"(Z,q){"use strict";var v=fC();q.exports=e;var x=96;function A(t,r){var i=v(getComputedStyle(t).getPropertyValue(r));return i[0]*e(i[1],t)}function M(t,r){var i=document.createElement("div");i.style["font-size"]="128"+t,r.appendChild(i);var a=A(i,"font-size")/128;return r.removeChild(i),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}}}),MV=Ze({"node_modules/detect-kerning/index.js"(Z,q){"use strict";q.exports=M;var v=M.canvas=document.createElement("canvas"),x=v.getContext("2d"),A=e([32,126]);M.createPairs=e,M.ascii=A;function M(t,r){Array.isArray(t)&&(t=t.join(", "));var i={},a,n=16,o=.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&&(n=r.fontSize),r.threshold!=null&&(o=r.threshold))),a||(a=A),x.font=n+"px "+t;for(var s=0;sn*o){var d=(m-h)/n;i[c]=d*1e3}}return i}function e(t){for(var r=[],i=t[0];i<=t[1];i++)for(var a=String.fromCharCode(i),n=t[0];n0;i-=4)if(r[i]!==0)return Math.floor((i-3)*.25/t)}}}),CV=Ze({"node_modules/gl-text/dist.js"(Z,q){"use strict";var v=yV(),x=Ev(),A=_V(),M=xV(),e=tC(),t=hg(),r=bV(),i=TV(),a=k1(),n=AV(),o=fC(),s=SV(),c=MV(),h=sh(),m=EV(),d=m0(),T=cC(),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){g(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(n(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(f,P){return[P.atlas.width,P.atlas.height]},atlasDim:function(f,P){return[P.atlas.cols,P.atlas.rows]},atlas:function(f,P){return P.atlas.texture},charStep:function(f,P){return P.atlas.step},em:function(f,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; }`}),y={};return{regl:p,draw:u,atlas:y}},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=d(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 y=!1,f=!1;if(p.font&&(Array.isArray(p.font)?p.font:[p.font]).forEach(function(fe,Fe){if(typeof fe=="string")try{fe=v.parse(fe)}catch{fe=v.parse(E.baseFontSize+"px "+fe)}else{var rt=fe.style,st=fe.weight,Qe=fe.stretch,Lt=fe.variant;fe=v.parse(v.stringify(fe)),rt&&(fe.style=rt),st&&(fe.weight=st),Qe&&(fe.stretch=Qe),Lt&&(fe.variant=Lt)}var kt=v.stringify({size:E.baseFontSize,family:fe.family,stretch:w?fe.stretch:void 0,variant:fe.variant,weight:fe.weight,style:fe.style}),qt=o(fe.size),Zt=Math.round(qt[0]*s(qt[1]));if(Zt!==u.fontSize[Fe]&&(f=!0,u.fontSize[Fe]=Zt),(!u.font[Fe]||kt!=u.font[Fe].baseString)&&(y=!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:m(Sr,{origin:"top",fontSize:E.baseFontSize,fontStyle:xr.join(" ")})},E.fonts[kt]=u.font[Fe]}}),(y||f)&&this.font.forEach(function(fe,Fe){var rt=v.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=i.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=i.mallocUint8(Re);for(var We=(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(ut){var Me=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(Me);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 g(b){return typeof b=="function"&&b._gl&&b.prop&&b.texture&&b.buffer}q.exports=E}}),kV=Ze({"node_modules/@plotly/regl/dist/regl.unchecked.js"(Z,q){(function(v,x){typeof Z=="object"&&typeof q<"u"?q.exports=x():v.createREGL=x()})(Z,function(){"use strict";var v=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 i(nt.substr(0,ua.index)).concat(i(ua[1])).concat(i(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,hn=!1,yi={},Bn=function(ea){},Ln=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&&(Sn=S(Yt.optionalExtensions)),"onDone"in Yt&&(Bn=Yt.onDone),"profile"in Yt&&(hn=!!Yt.profile),"pixelRatio"in Yt&&(wn=+Yt.pixelRatio),"cachedCode"in Yt&&(yi=Yt.cachedCode))),cr&&(cr.nodeName.toLowerCase()==="canvas"?Aa=cr:ua=cr),!xa){if(!Aa){var Va=T(ua||document.body,Bn,wn);if(!Va)return null;Aa=Va.canvas,Ln=Va.onDestroy}wa.premultipliedAlpha===void 0&&(wa.premultipliedAlpha=!0),xa=l(Aa,wa)}return xa?{gl:xa,canvas:Aa,container:ua,extensions:Ja,optionalExtensions:Sn,pixelRatio:wn,profile:hn,cachedCode:yi,onDone:Bn,onDestroy:Ln}:(Ln(),Bn("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(),Sn;try{Sn=cr[Ja]=nt.getExtension(Ja)}catch{}return!!Sn}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 y:Ja=new Uint8Array(Yt(wa),0,wa);break;case f: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,se=3413,he=3414,H=3415,$=33901,J=33902,X=3379,oe=3386,ne=34921,j=36347,ee=36348,re=35661,ce=35660,be=34930,Ae=36349,ze=34076,Re=34024,We=7936,it=7937,ot=7938,tt=35724,ut=34047,Me=36063,_e=34852,fe=3553,Fe=34067,rt=34069,st=33984,Qe=6408,Lt=5126,kt=5121,qt=36160,Zt=36053,Sr=36064,xr=16384,jr=function(nt,Yt){var cr=1;Yt.ext_texture_filter_anisotropic&&(cr=nt.getParameter(ut));var ua=1,Aa=1;Yt.webgl_draw_buffers&&(ua=nt.getParameter(_e),Aa=nt.getParameter(Me));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(qt,Ja),nt.framebufferTexture2D(qt,Sr,fe,wa,0),nt.bindTexture(fe,null),nt.checkFramebufferStatus(qt)!==Zt)xa=!1;else{nt.viewport(0,0,1,1),nt.clearColor(1,0,0,1),nt.clear(xr);var Sn=N.allocType(Lt,4);nt.readPixels(0,0,1,1,Qe,Lt,Sn),nt.getError()?xa=!1:(nt.deleteFramebuffer(Ja),nt.deleteTexture(wa),xa=Sn[0]===1),N.freeType(Sn)}}var wn=typeof navigator<"u"&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion)||/Edge/.test(navigator.userAgent)),hn=!0;if(!wn){var yi=nt.createTexture(),Bn=N.allocType(kt,36);nt.activeTexture(st),nt.bindTexture(Fe,yi),nt.texImage2D(rt,0,Qe,3,3,0,Qe,kt,Bn),N.freeType(Bn),nt.bindTexture(Fe,null),nt.deleteTexture(yi),hn=!nt.getError()}return{colorBits:[nt.getParameter(W),nt.getParameter(Q),nt.getParameter(ue),nt.getParameter(se)],depthBits:nt.getParameter(he),stencilBits:nt.getParameter(H),subpixelBits:nt.getParameter(U),extensions:Object.keys(Yt).filter(function(Ln){return!!Yt[Ln]}),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(ne),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(We),version:nt.getParameter(ot),readFloat:xa,npotTextureCube:hn}},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 hi;if(Array.isArray(Ea[0])){Rn=za(Ea);for(var Za=1,qa=1;qa0){if(typeof Za[0]=="number"){var Mn=N.allocType(Wa.dtype,Za.length);Pr(Mn,Za),Rn(Mn,Qn),N.freeType(Mn)}else if(Array.isArray(Za[0])||wr(Za[0])){Fn=za(Za);var An=Qa(Za,Fn,Wa.dtype);Rn(An,Qn),N.freeType(An)}}}else if(Ir(Za)){Fn=Za.shape;var Jn=Za.stride,mi=0,Ii=0,zn=0,ii=0;Fn.length===1?(mi=Fn[0],Ii=1,zn=Jn[0],ii=0):Fn.length===2&&(mi=Fn[0],Ii=Fn[1],zn=Jn[0],ii=Jn[1]);var Ei=Array.isArray(Za.data)?Wa.dtype:Wt(Za.data),Ri=N.allocType(Ei,mi*Ii);ta(Ri,Za.data,mi,Ii,zn,ii,Za.offset),Rn(Ri,Qn),N.freeType(Ri)}return Vn}return an||Vn(ea),Vn._reglType="buffer",Vn._buffer=Wa,Vn.subdata=hi,cr.profile&&(Vn.stats=Wa.stats),Vn.destroy=function(){Bn(Wa)},Vn}function Va(){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:Ln,createStream:Sn,destroyStream:wn,clear:function(){bt(xa).forEach(Bn),Ja.forEach(Bn)},getBuffer:function(ea){return ea&&ea._buffer instanceof wa?ea._buffer:null},restore:Va,_initBuffer:yi}}var ra=0,Ia=0,Ha=1,rn=1,nn=4,yn=4,xt={points:ra,point:Ia,lines:Ha,line:rn,triangles:nn,triangle:yn,"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(Va){this.id=xa++,Aa[this.id]=this,this.buffer=Va,this.primType=Or,this.vertCount=0,this.type=0}Ja.prototype.bind=function(){this.buffer.bind()};var Sn=[];function wn(Va){var ea=Sn.pop();return ea||(ea=new Ja(cr.create(null,da,!0,!1)._buffer)),yi(ea,Va,fa,-1,-1,0,0),ea}function hn(Va){Sn.push(Va)}function yi(Va,ea,Ea,an,gn,Wa,Vn){Va.buffer.bind();var Rn;if(ea){var hi=Vn;!Vn&&(!wr(ea)||Ir(ea)&&!wr(ea.data))&&(hi=Yt.oes_element_index_uint?aa:Kr),cr._initBuffer(Va.buffer,ea,Ea,hi,3)}else nt.bufferData(da,Wa,Ea),Va.buffer.dtype=Rn||Lr,Va.buffer.usage=Ea,Va.buffer.dimension=3,Va.buffer.byteLength=Wa;if(Rn=Vn,!Vn){switch(Va.buffer.dtype){case Lr:case Rr:Rn=Lr;break;case Kr:case Gr:Rn=Kr;break;case aa:case Ur:Rn=aa;break;default:}Va.buffer.dtype=Rn}Va.type=Rn;var Za=gn;Za<0&&(Za=Va.buffer.byteLength,Rn===Kr?Za>>=1:Rn===aa&&(Za>>=2)),Va.vertCount=Za;var qa=an;if(an<0){qa=Or;var Qn=Va.buffer.dimension;Qn===1&&(qa=ct),Qn===2&&(qa=Nr),Qn===3&&(qa=Or)}Va.primType=qa}function Bn(Va){ua.elementsCount--,delete Aa[Va.id],Va.buffer.destroy(),Va.buffer=null}function Ln(Va,ea){var Ea=cr.create(null,da,!0),an=new Ja(Ea._buffer);ua.elementsCount++;function gn(Wa){if(!Wa)Ea(),an.primType=Or,an.vertCount=0,an.type=Lr;else if(typeof Wa=="number")Ea(Wa),an.primType=Or,an.vertCount=Wa|0,an.type=Lr;else{var Vn=null,Rn=It,hi=-1,Za=-1,qa=0,Qn=0;Array.isArray(Wa)||wr(Wa)||Ir(Wa)?Vn=Wa:("data"in Wa&&(Vn=Wa.data),"usage"in Wa&&(Rn=Ra[Wa.usage]),"primitive"in Wa&&(hi=xt[Wa.primitive]),"count"in Wa&&(Za=Wa.count|0),"type"in Wa&&(Qn=wa[Wa.type]),"length"in Wa?qa=Wa.length|0:(qa=Za,Qn===Kr||Qn===Gr?qa*=2:(Qn===aa||Qn===Ur)&&(qa*=4))),yi(an,Vn,Rn,hi,Za,qa,Qn)}return gn}return gn(Va),gn._reglType="elements",gn._elements=an,gn.subdata=function(Wa,Vn){return Ea.subdata(Wa,Vn),gn},gn.destroy=function(){Bn(an)},gn}return{create:Ln,createStream:wn,destroyStream:hn,getElements:function(Va){return typeof Va=="function"&&Va._elements instanceof Ja?Va._elements:null},clear:function(){bt(Aa).forEach(Bn)}}}var kr=new Float32Array(1),na=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,Zn=34067,Pn=34069,fi=6408,Ai=6406,ki=6407,zi=6409,Xi=6410,to=32854,go=32855,pi=36194,Jo=32819,Xo=32820,Ts=33635,Po=34042,so=6402,qi=34041,To=35904,Vo=35906,Oo=36193,lo=33776,Co=33777,os=33778,Ys=33779,Os=35986,Yo=35987,jn=34798,Ci=35840,tl=35841,Bs=35842,uo=35843,$s=36196,ms=5121,Is=5123,rl=5125,Si=5126,po=10242,ro=10243,As=10497,al=33071,$i=33648,zs=10240,au=10241,fl=9728,xu=9729,zl=9984,Ns=9985,nu=9986,Eu=9987,Bc=33170,Cu=4352,Af=4353,pf=4354,Us=34046,qc=3317,Sf=37440,iu=37441,Ll=37443,nc=37444,Ou=33984,nl=[zl,nu,Ns,Eu],vl=[0,zi,Xi,ki,fi],gs={};gs[zi]=gs[Ai]=gs[so]=1,gs[qi]=gs[Xi]=2,gs[ki]=gs[To]=3,gs[fi]=gs[Vo]=4;function qs(nt){return"[object "+nt+"]"}var ic=qs("HTMLCanvasElement"),Nl=qs("OffscreenCanvas"),Vu=qs("CanvasRenderingContext2D"),cl=qs("ImageBitmap"),yh=qs("HTMLImageElement"),ls=qs("HTMLVideoElement"),_h=Object.keys(Pe).concat([ic,Nl,Vu,cl,yh,ls]),Ss=[];Ss[ms]=1,Ss[Si]=4,Ss[Oo]=2,Ss[Is]=2,Ss[rl]=4;var Qi=[];Qi[to]=2,Qi[go]=2,Qi[pi]=2,Qi[qi]=4,Qi[lo]=.5,Qi[Co]=.5,Qi[os]=1,Qi[Ys]=1,Qi[Os]=.5,Qi[Yo]=1,Qi[jn]=1,Qi[Ci]=.5,Qi[tl]=.25,Qi[Bs]=.5,Qi[uo]=.25,Qi[$s]=.5;function Gc(nt){return Array.isArray(nt)&&(nt.length===0||typeof nt[0]=="number")}function qu(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)===ic}function wc(nt){return Ul(nt)===Nl}function rf(nt){return Ul(nt)===Vu}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)||qu(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 Si: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?Si: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,Sn=nt.channels,wn=wa*Ja*Sn,hn=Of(nt,wn),yi=0,Bn=0;Bn=1;)Ja+=wa*Sn*Sn,Sn/=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},Sn={repeat:As,clamp:al,mirror:$i},wn={nearest:fl,linear:xu},hn=v({mipmap:Eu,"nearest mipmap nearest":zl,"linear mipmap nearest":Ns,"nearest mipmap linear":nu,"linear mipmap linear":Eu},wn),yi={none:0,browser:nc},Bn={uint8:ms,rgba4:Jo,rgb565:Ts,"rgb5 a1":Xo},Ln={alpha:Ai,luminance:zi,"luminance alpha":Xi,rgb:ki,rgba:fi,rgba4:to,"rgb5 a1":go,rgb565:pi},Va={};Yt.ext_srgb&&(Ln.srgb=To,Ln.srgba=Vo),Yt.oes_texture_float&&(Bn.float32=Bn.float=Si),Yt.oes_texture_half_float&&(Bn.float16=Bn["half float"]=Oo),Yt.webgl_depth_texture&&(v(Ln,{depth:so,"depth stencil":qi}),v(Bn,{uint16:Is,uint32:rl,"depth stencil":Po})),Yt.webgl_compressed_texture_s3tc&&v(Va,{"rgb s3tc dxt1":lo,"rgba s3tc dxt1":Co,"rgba s3tc dxt3":os,"rgba s3tc dxt5":Ys}),Yt.webgl_compressed_texture_atc&&v(Va,{"rgb atc":Os,"rgba atc explicit alpha":Yo,"rgba atc interpolated alpha":jn}),Yt.webgl_compressed_texture_pvrtc&&v(Va,{"rgb pvrtc 4bppv1":Ci,"rgb pvrtc 2bppv1":tl,"rgba pvrtc 4bppv1":Bs,"rgba pvrtc 2bppv1":uo}),Yt.webgl_compressed_texture_etc1&&(Va["rgb etc1"]=$s);var ea=Array.prototype.slice.call(nt.getParameter(ha));Object.keys(Va).forEach(function(Le){var $e=Va[Le];ea.indexOf($e)>=0&&(Ln[Le]=$e)});var Ea=Object.keys(Ln);cr.textureFormats=Ea;var an=[];Object.keys(Ln).forEach(function(Le){var $e=Ln[Le];an[$e]=Le});var gn=[];Object.keys(Bn).forEach(function(Le){var $e=Bn[Le];gn[$e]=Le});var Wa=[];Object.keys(wn).forEach(function(Le){var $e=wn[Le];Wa[$e]=Le});var Vn=[];Object.keys(hn).forEach(function(Le){var $e=hn[Le];Vn[$e]=Le});var Rn=[];Object.keys(Sn).forEach(function(Le){var $e=Sn[Le];Rn[$e]=Le});var hi=Ea.reduce(function(Le,$e){var mt=Ln[$e];return mt===zi||mt===Ai||mt===zi||mt===Xi||mt===so||mt===qi||Yt.ext_srgb&&(mt===To||mt===Vo)?Le[mt]=mt:mt===go||$e.indexOf("rgba")>=0?Le[mt]=fi:Le[mt]=ki,Le},{});function Za(){this.internalformat=fi,this.format=fi,this.type=ms,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=nc,this.width=0,this.height=0,this.channels=0}function qa(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 Qn(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=yi[$e.colorSpace]),"type"in $e){var mt=$e.type;Le.type=Bn[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=Ln[Et];Le.format=hi[Ft],Et in Bn&&("type"in $e||(Le.type=Bn[Et])),Et in Va&&(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 Fn(Le){nt.pixelStorei(Sf,Le.flipY),nt.pixelStorei(iu,Le.premultiplyAlpha),nt.pixelStorei(Ll,Le.colorSpace),nt.pixelStorei(qc,Le.unpackAlignment)}function Mn(){Za.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function An(Le,$e){var mt=null;if(af($e)?mt=$e:$e&&(Qn(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,nr,fr,sr,pr;hr.length===3?(nr=hr[2],pr=gt[2]):(nr=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=nr,Le.format=Le.internalformat=vl[nr],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(qu(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 Vt=Be.shape(mt),Dr=1,Jr=0;Jr>=_r,mt.height>>=_r,An(mt,jt[_r]),Le.mipmask|=1<<_r;else mt=Le.images[0]=zn(),qa(mt,Le),An(mt,$e),Le.mipmask=1;qa(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=wn[jt]}var _r=Le.wrapS,Fr=Le.wrapT;if("wrap"in $e){var hr=$e.wrap;typeof hr=="string"?_r=Fr=Sn[hr]:Array.isArray(hr)&&(_r=Sn[hr[0]],Fr=Sn[hr[1]])}else{if("wrapS"in $e){var gt=$e.wrapS;_r=Sn[gt]}if("wrapT"in $e){var Et=$e.wrapT;Fr=Sn[Et]}}if(Le.wrapS=_r,Le.wrapT=Fr,"anisotropic"in $e){var Ft=$e.anisotropic;Le.anisotropic=$e.anisotropic}if("mipmap"in $e){var nr=!1;switch(typeof $e.mipmap){case"string":Le.mipmapHint=Ja[$e.mipmap],Le.genMipmaps=!0,nr=!0;break;case"boolean":nr=Le.genMipmaps=$e.mipmap;break;case"object":Le.genMipmaps=!1,nr=!0;break;default:}nr&&!("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 Hi(Le){Za.call(this),this.mipmask=0,this.internalformat=fi,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--}v(Hi.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 Hi(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"?Ri(Ft,hr|0,gt|0):Ri(Ft,hr|0,hr|0):hr?(Al(Et,hr),Gi(Ft,hr)):Ri(Ft,1,1),Et.genMipmaps&&(Ft.mipmask=(Ft.width<<1)-1),mt.mipmask=Ft.mipmask,qa(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=an[mt.internalformat],jt.type=gn[mt.type],jt.mag=Wa[Et.magFilter],jt.min=Vn[Et.minFilter],jt.wrapS=Rn[Et.wrapS],jt.wrapT=Rn[Et.wrapT],jt}function _r(hr,gt,Et,Ft){var nr=gt|0,fr=Et|0,sr=Ft|0,pr=zn();return qa(pr,mt),pr.width=0,pr.height=0,An(pr,hr),pr.width=pr.width||(mt.width>>sr)-nr,pr.height=pr.height||(mt.height>>sr)-fr,Cl(mt),mi(pr,Da,nr,fr,sr),Lo(),ii(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 nr=0;mt.mipmask>>nr;++nr){var fr=Et>>nr,sr=Ft>>nr;if(!fr||!sr)break;nt.texImage2D(Da,nr,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 Hi(Zn);Fs[hr.id]=hr,xa.cubeCount++;var gt=new Array(6);function Et(fr,sr,pr,lr,Xt,or){var Vt,Dr=hr.texInfo;for(fs.call(Dr),Vt=0;Vt<6;++Vt)gt[Vt]=ho();if(typeof fr=="number"||!fr){var Jr=fr|0||1;for(Vt=0;Vt<6;++Vt)Ri(gt[Vt],Jr,Jr)}else if(typeof fr=="object")if(sr)Gi(gt[0],fr),Gi(gt[1],sr),Gi(gt[2],pr),Gi(gt[3],lr),Gi(gt[4],Xt),Gi(gt[5],or);else if(Al(Dr,fr),Qn(hr,fr),"faces"in fr){var ba=fr.faces;for(Vt=0;Vt<6;++Vt)qa(gt[Vt],hr),Gi(gt[Vt],ba[Vt])}else for(Vt=0;Vt<6;++Vt)Gi(gt[Vt],fr);for(qa(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),Vt=0;Vt<6;++Vt)Ps(gt[Vt],Pn+Vt);for(El(Dr,Zn),Lo(),wa.profile&&(hr.stats.size=oc(hr.internalformat,hr.type,Et.width,Et.height,Dr.genMipmaps,!0)),Et.format=an[hr.internalformat],Et.type=gn[hr.type],Et.mag=Wa[Dr.magFilter],Et.min=Vn[Dr.minFilter],Et.wrapS=Rn[Dr.wrapS],Et.wrapT=Rn[Dr.wrapT],Vt=0;Vt<6;++Vt)Hl(gt[Vt]);return Et}function Ft(fr,sr,pr,lr,Xt){var or=pr|0,Vt=lr|0,Dr=Xt|0,Jr=zn();return qa(Jr,hr),Jr.width=0,Jr.height=0,An(Jr,sr),Jr.width=Jr.width||(hr.width>>Dr)-or,Jr.height=Jr.height||(hr.height>>Dr)-Vt,Cl(hr),mi(Jr,Pn+fr,or,Vt,Dr),Lo(),ii(Jr),Et}function nr(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(Pn+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=nr,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(Pn+_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:Sn.indexOf(fs)>=0&&(Hl=!1))),("depthTexture"in Hi||"depthStencilTexture"in Hi)&&(bl=!!(Hi.depthTexture||Hi.depthStencilTexture)),"depth"in Hi&&(typeof Hi.depth=="boolean"?Ps=Hi.depth:(Ql=Hi.depth,xl=!1)),"stencil"in Hi&&(typeof Hi.stencil=="boolean"?xl=Hi.stencil:(Fs=Hi.stencil,Ps=!1)),"depthStencil"in Hi&&(typeof Hi.depthStencil=="boolean"?Ps=xl=Hi.depthStencil:(pl=Hi.depthStencil,Ps=!1,xl=!1))}var Lo=null,ve=null,Y=null,ye=null;if(Array.isArray(ho))Lo=ho.map(Va);else if(ho)Lo=[Va(ho)];else for(Lo=new Array(El),Ei=0;Ei0&&(ii.depth=An[0].depth,ii.stencil=An[0].stencil,ii.depthStencil=An[0].depthStencil),An[zn]?An[zn](ii):An[zn]=qa(ii)}return v(Jn,{width:Ei,height:Ei,color:fs})}function mi(Ii){var zn,ii=Ii|0;if(ii===Jn.width)return Jn;var Ei=Jn.color;for(zn=0;zn=Ei.byteLength?Ri.subdata(Ei):(Ri.destroy(),qa.buffers[Ii]=null)),qa.buffers[Ii]||(Ri=qa.buffers[Ii]=Aa.create(zn,vf,!1,!0)),ii.buffer=Aa.getBuffer(Ri),ii.size=ii.buffer.dimension|0,ii.normalized=!1,ii.type=ii.buffer.dtype,ii.offset=0,ii.stride=0,ii.divisor=0,ii.state=1,Jn[Ii]=1}else Aa.getBuffer(zn)?(ii.buffer=Aa.getBuffer(zn),ii.size=ii.buffer.dimension|0,ii.normalized=!1,ii.type=ii.buffer.dtype,ii.offset=0,ii.stride=0,ii.divisor=0,ii.state=1):Aa.getBuffer(zn.buffer)?(ii.buffer=Aa.getBuffer(zn.buffer),ii.size=(+zn.size||ii.buffer.dimension)|0,ii.normalized=!!zn.normalized||!1,"type"in zn?ii.type=la[zn.type]:ii.type=ii.buffer.dtype,ii.offset=(zn.offset||0)|0,ii.stride=(zn.stride||0)|0,ii.divisor=(zn.divisor||0)|0,ii.state=1):"x"in zn&&(ii.x=+zn.x||0,ii.y=+zn.y||0,ii.z=+zn.z||0,ii.w=+zn.w||0,ii.state=2)}for(var Gi=0;Gi1)for(var Fn=0;Fnea&&(ea=Ea.stats.uniformsCount)}),ea},cr.getMaxAttributesCount=function(){var ea=0;return hn.forEach(function(Ea){Ea.stats.attributesCount>ea&&(ea=Ea.stats.attributesCount)}),ea});function Va(){Aa={},xa={};for(var ea=0;ea16&&(cr=Dn(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=Dn(ua.concat(kc(Yt)),512+Yt.length*8);return er(Dn(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,Sn=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,Sn=Ja}var wn="";for(Aa=ua.length-1;Aa>=0;Aa--)wn+=Yt.charAt(ua[Aa]);var hn=Math.ceil(nt.length*8/(Math.log(Yt.length)/Math.log(2)));for(Aa=wn.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 ia(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 pn(nt){return yr(nt,2)^yr(nt,13)^yr(nt,22)}function In(nt){return yr(nt,6)^yr(nt,11)^yr(nt,25)}function Yn(nt){return yr(nt,7)^yr(nt,18)^ia(nt,3)}function ri(nt){return yr(nt,17)^yr(nt,19)^ia(nt,10)}var di=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 Dn(nt,Yt){var cr=new Array(1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225),ua=new Array(64),Aa,xa,wa,Ja,Sn,wn,hn,yi,Bn,Ln,Va,ea;for(nt[Yt>>5]|=128<<24-Yt%32,nt[(Yt+64>>9<<4)+15]=Yt,Bn=0;Bn>16)+(Yt>>16)+(cr>>16);return ua<<16|cr&65535}function qn(nt){return Array.prototype.slice.call(nt)}function xn(nt){return qn(nt).join("")}function Mi(nt){var Yt=nt&&nt.cache,cr=0,ua=[],Aa=[],xa=[];function wa(Va,ea){var Ea=ea&&ea.stable;if(!Ea){for(var an=0;an0&&(Va.push(gn,"="),Va.push.apply(Va,qn(arguments)),Va.push(";")),gn}return v(ea,{def:an,toString:function(){return xn([Ea.length>0?"var "+Ea.join(",")+";":"",xn(Va)])}})}function Sn(){var Va=Ja(),ea=Ja(),Ea=Va.toString,an=ea.toString;function gn(Wa,Vn){ea(Wa,Vn,"=",Va.def(Wa,Vn),";")}return v(function(){Va.apply(Va,qn(arguments))},{def:Va.def,entry:Va,exit:ea,save:gn,set:function(Wa,Vn,Rn){gn(Wa,Vn),Va(Wa,Vn,"=",Rn,";")},toString:function(){return Ea()+an()}})}function wn(){var Va=xn(arguments),ea=Sn(),Ea=Sn(),an=ea.toString,gn=Ea.toString;return v(ea,{then:function(){return ea.apply(ea,qn(arguments)),this},else:function(){return Ea.apply(Ea,qn(arguments)),this},toString:function(){var Wa=gn();return Wa&&(Wa="else{"+Wa+"}"),xn(["if(",Va,"){",an(),"}",Wa])}})}var hn=Ja(),yi={};function Bn(Va,ea){var Ea=[];function an(){var hi="a"+Ea.length;return Ea.push(hi),hi}ea=ea||0;for(var gn=0;gn":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 mn(nt){return Array.isArray(nt)||wr(nt)||Ir(nt)}function cn(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,Sn=0;Sn=1&&(wa=!0),hn>=2&&(Ja=!0)}else wn.type===xs&&(xa=xa||wn.data.thisDep,wa=wa||wn.data.contextDep,Ja=Ja||wn.data.propDep)}return new Pa(xa,wa,Ja,Yt)}else return new Pa(cr===Qo,cr===xo,cr===ui,Yt)}}var Pi=new Pa(!1,!1,!1,function(){});function Zi(nt,Yt,cr,ua,Aa,xa,wa,Ja,Sn,wn,hn,yi,Bn,Ln,Va,ea){var Ea=wn.Record,an={add:32774,subtract:32778,"reverse subtract":32779};cr.ext_blend_minmax&&(an.min=_t,an.max=St);var gn=cr.angle_instanced_arrays,Wa=cr.webgl_draw_buffers,Vn=cr.oes_vertex_array_object,Rn={dirty:!0,profile:ea.profile},hi={},Za=[],qa={},Qn={};function Fn(gt){return gt.replace(".","_")}function Mn(gt,Et,Ft){var nr=Fn(gt);Za.push(gt),hi[nr]=Rn[nr]=!!Ft,qa[nr]=Et}function An(gt,Et,Ft){var nr=Fn(gt);Za.push(gt),Array.isArray(Ft)?(Rn[nr]=Ft.slice(),hi[nr]=Ft.slice()):Rn[nr]=hi[nr]=Ft,Qn[nr]=Et}function Jn(gt){return!!isNaN(gt)}Mn(Ks,vn),Mn(ys,Oa),An(Fl,"blendColor",[0,0,0,0]),An(yl,"blendEquationSeparate",[Wr,Wr]),An(sl,"blendFuncSeparate",[qr,gr,qr,gr]),Mn(Ui,Hn,!0),An(Io,"depthFunc",Ta),An(Xs,"depthRange",[0,1]),An(Ls,"depthMask",!0),An(ou,ou,[!0,!0,!0,!0]),Mn(Iu,Sa),An(Zu,"cullFace",De),An(Lc,Lc,vt),An(yu,yu,1),Mn(Pc,Ti),An(wu,"polygonOffset",[0,0]),Mn(gc,Wi),Mn(fo,Bi),An(zo,"sampleCoverage",[1,!1]),Mn(Ic,Xn),An(lc,"stencilMask",-1),An(Yu,"stencilFunc",[ar,0,-1]),An(Ne,"stencilOpSeparate",[de,zt,zt,zt]),An(R,"stencilOpSeparate",[De,zt,zt,zt]),Mn(ae,oi),An(we,"scissor",[0,0,nt.drawingBufferWidth,nt.drawingBufferHeight]),An(Se,Se,[0,0,nt.drawingBufferWidth,nt.drawingBufferHeight]);var mi={gl:nt,context:Bn,strings:Yt,next:hi,current:Rn,draw:yi,elements:xa,buffer:Aa,shader:hn,attributes:wn.state,vao:wn,uniforms:Sn,framebuffer:Ja,extensions:cr,timer:Ln,isBufferArgs:mn},Ii={primTypes:xt,compareFuncs:Ma,blendFuncs:on,blendEquations:an,stencilOps:Na,glTypes:la,orientationType:Ka};Wa&&(Ii.backBuffer=[De],Ii.drawBuffer=p(ua.maxDrawbuffers,function(gt){return gt===0?[0]:p(gt,function(Et){return tn+Et})}));var zn=0;function ii(){var gt=Mi({cache:Va}),Et=gt.link,Ft=gt.global;gt.id=zn++,gt.batchId="0";var nr=Et(mi),fr=gt.shared={props:"a0"};Object.keys(mi).forEach(function(or){fr[or]=Ft.def(nr,".",or)});var sr=gt.next={},pr=gt.current={};Object.keys(Qn).forEach(function(or){Array.isArray(Rn[or])&&(sr[or]=Ft.def(fr.next,".",or),pr[or]=Ft.def(fr.current,".",or))});var lr=gt.constants={};Object.keys(Ii).forEach(function(or){lr[or]=Ft.def(JSON.stringify(Ii[or]))}),gt.invoke=function(or,Vt){switch(Vt.type){case wi:var Dr=["this",fr.context,fr.props,gt.batchId];return or.def(Et(Vt.data),".call(",Dr.slice(0,Math.max(Vt.data.length+1,4)),")");case ui:return or.def(fr.props,Vt.data);case xo:return or.def(fr.context,Vt.data);case Qo:return or.def("this",Vt.data);case xs:return Vt.data.append(gt,or),Vt.data.ref;case Qs:return Vt.data.toString();case Rs:return Vt.data.map(function(Jr){return gt.invoke(or,Jr)})}},gt.attribCache={};var Xt={};return gt.scopeAttrib=function(or){var Vt=Yt.id(or);if(Vt in Xt)return Xt[Vt];var Dr=wn.scope[Vt];Dr||(Dr=wn.scope[Vt]=new Ea);var Jr=Xt[Vt]=Et(Dr);return Jr},gt}function Ei(gt){var Et=gt.static,Ft=gt.dynamic,nr;if(Oe in Et){var fr=!!Et[Oe];nr=ni(function(pr,lr){return fr}),nr.enable=fr}else if(Oe in Ft){var sr=Ft[Oe];nr=vi(sr,function(pr,lr){return pr.invoke(lr,sr)})}return nr}function Ri(gt,Et){var Ft=gt.static,nr=gt.dynamic;if(pt in Ft){var fr=Ft[pt];return fr?(fr=Ja.getFramebuffer(fr),ni(function(pr,lr){var Xt=pr.link(fr),or=pr.shared;lr.set(or.framebuffer,".next",Xt);var Vt=or.context;return lr.set(Vt,"."+dt,Xt+".width"),lr.set(Vt,"."+Ct,Xt+".height"),Xt})):ni(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 nr){var sr=nr[pt];return vi(sr,function(pr,lr){var Xt=pr.invoke(lr,sr),or=pr.shared,Vt=or.framebuffer,Dr=lr.def(Vt,".getFramebuffer(",Xt,")");lr.set(Vt,".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 Gi(gt,Et,Ft){var nr=gt.static,fr=gt.dynamic;function sr(Xt){if(Xt in nr){var or=nr[Xt],Vt=!0,Dr=or.x|0,Jr=or.y|0,ba,_n;return"width"in or?ba=or.width|0:Vt=!1,"height"in or?_n=or.height|0:Vt=!1,new Pa(!Vt&&Et&&Et.thisDep,!Vt&&Et&&Et.contextDep,!Vt&&Et&&Et.propDep,function($n,Nn){var dn=$n.shared.context,Tn=ba;"width"in or||(Tn=Nn.def(dn,".",dt,"-",Dr));var En=_n;return"height"in or||(En=Nn.def(dn,".",Ct,"-",Jr)),[Dr,Jr,Tn,En]})}else if(Xt in fr){var Xa=fr[Xt],ln=vi(Xa,function($n,Nn){var dn=$n.invoke(Nn,Xa),Tn=$n.shared.context,En=Nn.def(dn,".x|0"),Gn=Nn.def(dn,".y|0"),ci=Nn.def('"width" in ',dn,"?",dn,".width|0:","(",Tn,".",dt,"-",En,")"),bo=Nn.def('"height" in ',dn,"?",dn,".height|0:","(",Tn,".",Ct,"-",Gn,")");return[En,Gn,ci,bo]});return Et&&(ln.thisDep=ln.thisDep||Et.thisDep,ln.contextDep=ln.contextDep||Et.contextDep,ln.propDep=ln.propDep||Et.propDep),ln}else return Et?new Pa(Et.thisDep,Et.contextDep,Et.propDep,function($n,Nn){var dn=$n.shared.context;return[0,0,Nn.def(dn,".",dt),Nn.def(dn,".",Ct)]}):null}var pr=sr(Se);if(pr){var lr=pr;pr=new Pa(pr.thisDep,pr.contextDep,pr.propDep,function(Xt,or){var Vt=lr.append(Xt,or),Dr=Xt.shared.context;return or.set(Dr,"."+wt,Vt[2]),or.set(Dr,"."+Dt,Vt[3]),Vt})}return{viewport:pr,scissor_box:sr(we)}}function Ps(gt,Et){var Ft=gt.static,nr=typeof Ft[Bt]=="string"&&typeof Ft[At]=="string";if(nr){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"+En+"?"+Vt+".constant["+En+"]:0;"}).join(""),"}}else{","if(",ba,"(",Vt,".buffer)){",$n,"=",_n,".createStream(",Qr,",",Vt,".buffer);","}else{",$n,"=",_n,".getBuffer(",Vt,".buffer);","}",Nn,'="type" in ',Vt,"?",Jr.glTypes,"[",Vt,".type]:",$n,".dtype;",Xa.normalized,"=!!",Vt,".normalized;");function dn(Tn){or(Xa[Tn],"=",Vt,".",Tn,"|0;")}return dn("size"),dn("offset"),dn("stride"),dn("divisor"),or("}}"),or.exit("if(",Xa.isStream,"){",_n,".destroyStream(",$n,");","}"),Xa}fr[sr]=vi(pr,lr)}),fr}function El(gt){var Et=gt.static,Ft=gt.dynamic,nr={};return Object.keys(Et).forEach(function(fr){var sr=Et[fr];nr[fr]=ni(function(pr,lr){return typeof sr=="number"||typeof sr=="boolean"?""+sr:pr.link(sr)})}),Object.keys(Ft).forEach(function(fr){var sr=Ft[fr];nr[fr]=vi(sr,function(pr,lr){return pr.invoke(lr,sr)})}),nr}function Ql(gt,Et,Ft,nr,fr){var sr=gt.static,pr=gt.dynamic,lr=Ps(gt,Et),Xt=Ri(gt,fr),or=Gi(gt,Xt,fr),Vt=ho(gt,fr),Dr=Hl(gt,fr),Jr=xl(gt,fr,lr);function ba(dn){var Tn=or[dn];Tn&&(Dr[dn]=Tn)}ba(Se),ba(Fn(we));var _n=Object.keys(Dr).length>0,Xa={framebuffer:Xt,draw:Vt,shader:Jr,state:Dr,dirty:_n,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(Xa.profile=Ei(gt,fr),Xa.uniforms=fs(Ft,fr),Xa.drawVAO=Xa.scopeVAO=Vt.vao,!Xa.drawVAO&&Jr.program&&!lr&&cr.angle_instanced_arrays&&Vt.static.elements){var ln=!0,$n=Jr.program.attributes.map(function(dn){var Tn=Et.static[dn];return ln=ln&&!!Tn,Tn});if(ln&&$n.length>0){var Nn=wn.getVAO(wn.createVAO({attributes:$n,elements:Vt.static.elements}));Xa.drawVAO=new Pa(null,null,null,function(dn,Tn){return dn.link(Nn)}),Xa.useVAO=!0}}return lr?Xa.useVAO=!0:Xa.attributes=Al(Et,fr),Xa.context=El(nr,fr),Xa}function Fs(gt,Et,Ft){var nr=gt.shared,fr=nr.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,nr){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,Vt=Xt.backBuffer,Dr;Ft?Dr=Ft.append(gt,Et):Dr=Et.def(pr,".next"),nr||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(",Vt,");"),Et("}",pr,".cur=",Dr,";"),nr||Et("}")}function bl(gt,Et,Ft){var nr=gt.shared,fr=nr.gl,sr=gt.current,pr=gt.next,lr=nr.current,Xt=nr.next,or=gt.cond(lr,".dirty");Za.forEach(function(Vt){var Dr=Fn(Vt);if(!(Dr in Ft.state)){var Jr,ba;if(Dr in pr){Jr=pr[Dr],ba=sr[Dr];var _n=p(Rn[Dr].length,function(ln){return or.def(Jr,"[",ln,"]")});or(gt.cond(_n.map(function(ln,$n){return ln+"!=="+ba+"["+$n+"]"}).join("||")).then(fr,".",Qn[Dr],"(",_n,");",_n.map(function(ln,$n){return ba+"["+$n+"]="+ln}).join(";"),";"))}else{Jr=or.def(Xt,".",Dr);var Xa=gt.cond(Jr,"!==",lr,".",Dr);or(Xa),Dr in qa?Xa(gt.cond(Jr).then(fr,".enable(",qa[Dr],");").else(fr,".disable(",qa[Dr],");"),lr,".",Dr,"=",Jr,";"):Xa(fr,".",Qn[Dr],"(",Jr,");",lr,".",Dr,"=",Jr,";")}}}),Object.keys(Ft.state).length===0&&or(lr,".dirty=false;"),Et(or)}function Hi(gt,Et,Ft,nr){var fr=gt.shared,sr=gt.current,pr=fr.current,lr=fr.gl,Xt;cn(Object.keys(Ft)).forEach(function(or){var Vt=Ft[or];if(!(nr&&!nr(Vt))){var Dr=Vt.append(gt,Et);if(qa[or]){var Jr=qa[or];si(Vt)?(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,".",Qn[or],"(",Dr,");",Dr.map(function(_n,Xa){return ba+"["+Xa+"]="+_n}).join(";"),";")}else si(Vt)?(Xt=gt.link(Dr,{stable:!0}),Et(lr,".",Qn[or],"(",Xt,");",pr,".",or,"=",Xt,";")):Et(lr,".",Qn[or],"(",Dr,");",pr,".",or,"=",Dr,";")}})}function Cl(gt,Et){gn&&(gt.instancing=Et.def(gt.shared.extensions,".angle_instanced_arrays"))}function Lo(gt,Et,Ft,nr,fr){var sr=gt.shared,pr=gt.stats,lr=sr.current,Xt=sr.timer,or=Ft.profile;function Vt(){return typeof performance>"u"?"Date.now()":"performance.now()"}var Dr,Jr;function ba(dn){Dr=Et.def(),dn(Dr,"=",Vt(),";"),typeof fr=="string"?dn(pr,".count+=",fr,";"):dn(pr,".count++;"),Ln&&(nr?(Jr=Et.def(),dn(Jr,"=",Xt,".getNumPendingQueries();")):dn(Xt,".beginQuery(",pr,");"))}function _n(dn){dn(pr,".cpuTime+=",Vt(),"-",Dr,";"),Ln&&(nr?dn(Xt,".pushScopeStats(",Jr,",",Xt,".getNumPendingQueries(),",pr,");"):dn(Xt,".endQuery();"))}function Xa(dn){var Tn=Et.def(lr,".profile");Et(lr,".profile=",dn,";"),Et.exit(lr,".profile=",Tn,";")}var ln;if(or){if(si(or)){or.enable?(ba(Et),_n(Et.exit),Xa("true")):Xa("false");return}ln=or.append(gt,Et),Xa(ln)}else ln=Et.def(lr,".profile");var $n=gt.block();ba($n),Et("if(",ln,"){",$n,"}");var Nn=gt.block();_n(Nn),Et.exit("if(",ln,"){",Nn,"}")}function ve(gt,Et,Ft,nr,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,Vt){var Dr=sr.gl,Jr=Et.def(Xt,".location"),ba=Et.def(sr.attributes,"[",Jr,"]"),_n=Vt.state,Xa=Vt.buffer,ln=[Vt.x,Vt.y,Vt.z,Vt.w],$n=["buffer","normalized","offset","stride"];function Nn(){Et("if(!",ba,".buffer){",Dr,".enableVertexAttribArray(",Jr,");}");var Tn=Vt.type,En;if(Vt.size?En=Et.def(Vt.size,"||",or):En=or,Et("if(",ba,".type!==",Tn,"||",ba,".size!==",En,"||",$n.map(function(ci){return ba+"."+ci+"!=="+Vt[ci]}).join("||"),"){",Dr,".bindBuffer(",Qr,",",Xa,".buffer);",Dr,".vertexAttribPointer(",[Jr,En,Tn,Vt.normalized,Vt.stride,Vt.offset],");",ba,".type=",Tn,";",ba,".size=",En,";",$n.map(function(ci){return ba+"."+ci+"="+Vt[ci]+";"}).join(""),"}"),gn){var Gn=Vt.divisor;Et("if(",ba,".divisor!==",Gn,"){",gt.instancing,".vertexAttribDivisorANGLE(",[Jr,Gn],");",ba,".divisor=",Gn,";}")}}function dn(){Et("if(",ba,".buffer){",Dr,".disableVertexAttribArray(",Jr,");",ba,".buffer=null;","}if(",Ki.map(function(Tn,En){return ba+"."+Tn+"!=="+ln[En]}).join("||"),"){",Dr,".vertexAttrib4f(",Jr,",",ln,");",Ki.map(function(Tn,En){return ba+"."+Tn+"="+ln[En]+";"}).join(""),"}")}_n===Ji?Nn():_n===co?dn():(Et("if(",_n,"===",Ji,"){"),Nn(),Et("}else{"),dn(),Et("}"))}nr.forEach(function(Xt){var or=Xt.name,Vt=Ft.attributes[or],Dr;if(Vt){if(!fr(Vt))return;Dr=Vt.append(gt,Et)}else{if(!fr(Pi))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,nr,fr,sr){for(var pr=gt.shared,lr=pr.gl,Xt,or=0;or1){for(var jo=[],ks=[],Fo=0;Fo>1)",Xa],");")}function Gn(){Ft(ln,".drawArraysInstancedANGLE(",[Jr,ba,_n,Xa],");")}Vt&&Vt!=="null"?Nn?En():(Ft("if(",Vt,"){"),En(),Ft("}else{"),Gn(),Ft("}")):Gn()}function Tn(){function En(){Ft(sr+".drawElements("+[Jr,_n,$n,ba+"<<(("+$n+"-"+ao+")>>1)"]+");")}function Gn(){Ft(sr+".drawArrays("+[Jr,ba,_n]+");")}Vt&&Vt!=="null"?Nn?En():(Ft("if(",Vt,"){"),En(),Ft("}else{"),Gn(),Ft("}")):Gn()}gn&&(typeof Xa!="number"||Xa>=0)?typeof Xa=="string"?(Ft("if(",Xa,">0){"),dn(),Ft("}else if(",Xa,"<0){"),Tn(),Ft("}")):dn():Tn()}function te(gt,Et,Ft,nr,fr){var sr=ii(),pr=sr.proc("body",fr);return gn&&(sr.instancing=pr.def(sr.shared.extensions,".angle_instanced_arrays")),gt(sr,pr,Ft,nr),sr.compile().body}function me(gt,Et,Ft,nr){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,nr.attributes,function(){return!0})),Y(gt,Et,Ft,nr.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),Hi(gt,Ft,Et.state),Lo(gt,Ft,Et,!1,!0);var nr=Et.shader.progVar.append(gt,Ft);if(Ft(gt.shared.gl,".useProgram(",nr,".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(nr,".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)}),"(",nr,");",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,nr){gt.batchId="a1",Cl(gt,Et);function fr(){return!0}ve(gt,Et,Ft,nr.attributes,fr),Y(gt,Et,Ft,nr.uniforms,fr,!1),ye(gt,Et,Et,Ft)}function $e(gt,Et,Ft,nr){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(),Vt=gt.scope();Et(or.entry,"for(",sr,"=0;",sr,"<",lr,";++",sr,"){",Xt,"=",pr,"[",sr,"];",Vt,"}",or.exit);function Dr($n){return $n.contextDep&&fr||$n.propDep}function Jr($n){return!Dr($n)}if(Ft.needsContext&&Fs(gt,Vt,Ft.context),Ft.needsFramebuffer&&pl(gt,Vt,Ft.framebuffer),Hi(gt,Vt,Ft.state,Dr),Ft.profile&&Dr(Ft.profile)&&Lo(gt,Vt,Ft,!1,!0),nr)Ft.useVAO?Ft.drawVAO?Dr(Ft.drawVAO)?Vt(gt.shared.vao,".setVAO(",Ft.drawVAO.append(gt,Vt),");"):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,nr.attributes,Jr),ve(gt,Vt,Ft,nr.attributes,Dr)),Y(gt,or,Ft,nr.uniforms,Jr,!1),Y(gt,Vt,Ft,nr.uniforms,Dr,!0),ye(gt,or,Vt,Ft);else{var ba=gt.global.def("{}"),_n=Ft.shader.progVar.append(gt,Vt),Xa=Vt.def(_n,".id"),ln=Vt.def(ba,"[",Xa,"]");Vt(gt.shared.gl,".useProgram(",_n,".program);","if(!",ln,"){",ln,"=",ba,"[",Xa,"]=",gt.link(function($n){return te(Le,gt,Ft,$n,2)}),"(",_n,");}",ln,".call(this,a0[",sr,"],",sr,");")}}function mt(gt,Et){var Ft=gt.proc("batch",2);gt.batchId="0",Cl(gt,Ft);var nr=!1,fr=!0;Object.keys(Et.context).forEach(function(ba){nr=nr||Et.context[ba].propDep}),nr||(Fs(gt,Ft,Et.context),fr=!1);var sr=Et.framebuffer,pr=!1;sr?(sr.propDep?nr=pr=!0:sr.contextDep&&nr&&(pr=!0),pr||pl(gt,Ft,sr)):pl(gt,Ft,null),Et.state.viewport&&Et.state.viewport.propDep&&(nr=!0);function lr(ba){return ba.contextDep&&nr||ba.propDep}bl(gt,Ft,Et),Hi(gt,Ft,Et.state,function(ba){return!lr(ba)}),(!Et.profile||!lr(Et.profile))&&Lo(gt,Ft,Et,!1,"a1"),Et.contextDep=nr,Et.needsContext=fr,Et.needsFramebuffer=pr;var Xt=Et.shader.progVar;if(Xt.contextDep&&nr||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 Vt=gt.global.def("{}"),Dr=Ft.def(or,".id"),Jr=Ft.def(Vt,"[",Dr,"]");Ft(gt.cond(Jr).then(Jr,".call(this,a0,a1);").else(Jr,"=",Vt,"[",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 nr=gt.shared,fr=nr.current;if(Fs(gt,Ft,Et.context),Et.framebuffer&&Et.framebuffer.append(gt,Ft),cn(Object.keys(Et.state)).forEach(function(lr){var Xt=Et.state[lr],or=Xt.append(gt,Ft);Ya(or)?or.forEach(function(Vt,Dr){Jn(Vt)?Ft.set(gt.next[lr],"["+Dr+"]",Vt):Ft.set(gt.next[lr],"["+Dr+"]",gt.link(Vt,{stable:!0}))}):si(Xt)?Ft.set(nr.next,"."+lr,gt.link(or,{stable:!0})):Ft.set(nr.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);Jn(or)?Ft.set(nr.draw,"."+lr,or):Ft.set(nr.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 Jn(or)?or:gt.link(or,{stable:!0})})+"]"),Ft.set(nr.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(Vt){Ft.set(or,"."+Vt,Xt[Vt])})}),Et.scopeVAO){var sr=Et.scopeVAO.append(gt,Ft);Jn(sr)?Ft.set(nr.vao,".targetVAO",sr):Ft.set(nr.vao,".targetVAO",gt.link(sr,{stable:!0}))}function pr(lr){var Xt=Et.shader[lr];if(Xt){var or=Xt.append(gt,Ft);Jn(or)?Ft.set(nr.shader,"."+lr,or):Ft.set(nr.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=mi[te];me&&me(Va,null,0)}cr.flush(),hn&&hn.update()}function Gi(){!Ei&&mi.length>0&&(Ei=h.next(Ri))}function Ps(){Ei&&(h.cancel(Ri),Ei=null)}function xl(te){te.preventDefault(),Aa=!0,Ps(),Ii.forEach(function(me){me()})}function ho(te){cr.getError(),Aa=!1,xa.restore(),hi.restore(),gn.restore(),Za.restore(),qa.restore(),Qn.restore(),Vn.restore(),hn&&hn.restore(),Fn.procs.refresh(),Gi(),zn.forEach(function(me){me()})}Jn&&(Jn.addEventListener(cs,xl,!1),Jn.addEventListener(ps,ho,!1));function Hl(){mi.length=0,Ps(),Jn&&(Jn.removeEventListener(cs,xl),Jn.removeEventListener(ps,ho)),hi.clear(),Qn.clear(),qa.clear(),Vn.clear(),Za.clear(),Wa.clear(),gn.clear(),hn&&hn.clear(),ii.forEach(function(te){te()})}function fs(te){function me(sr){var pr=v({},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(Vt){pr[Xt+"."+Vt]=or[Vt]})}}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 Vt=sr[or];if(c.isDynamic(Vt)){Xt[or]=c.unbox(Vt,or);return}else if(pr&&Array.isArray(Vt)){for(var Dr=0;Dr0)return gt.call(this,nr(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 v(fr,{stats:_r,destroy:function(){Fr.destroy()}})}var Al=Qn.setFBO=fs({framebuffer:c.define.call(null,Tl,"framebuffer")});function El(te,me){var Ge=0;Fn.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|=gi),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(v({framebuffer:te.framebuffer.faces[me]},te),El);else Al(te,El);else El(null,te)}function Fs(te){mi.push(te);function me(){var Ge=Il(mi,te);function Le(){var $e=Il(mi,Le);mi[$e]=mi[mi.length-1],mi.length-=1,mi.length<=0&&Ps()}mi[Ge]=Le}return Gi(),{cancel:me}}function pl(){var te=An.viewport,me=An.scissor_box;te[0]=te[1]=me[0]=me[1]=0,Va.viewportWidth=Va.framebufferWidth=Va.drawingBufferWidth=te[2]=me[2]=cr.drawingBufferWidth,Va.viewportHeight=Va.framebufferHeight=Va.drawingBufferHeight=te[3]=me[3]=cr.drawingBufferHeight}function bl(){Va.tick+=1,Va.time=Cl(),pl(),Fn.procs.poll()}function Hi(){Za.refresh(),pl(),Fn.procs.refresh(),hn&&hn.update()}function Cl(){return(m()-yi)/1e3}Hi();function Lo(te,me){var Ge;switch(te){case"frame":return Fs(me);case"lost":Ge=Ii;break;case"restore":Ge=zn;break;case"destroy":Ge=ii;break;default:}return Ge.push(me),{cancel:function(){for(var Le=0;Le=0},read:Mn,destroy:Hl,_gl:cr,_refresh:Hi,poll:function(){bl(),hn&&hn.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 v=w5(),x=kV();q.exports=function(M,e,t){var r=M._fullLayout,i=!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{i=!1}a.regl||(i=!1),i&&this.addEventListener("webglcontextlost",function(n){M&&M.emit&&M.emit("plotly_webglcontextlost",{event:n,layer:a.key})},!1)}}),i||v({container:r._glcontainer.node()}),i}}}),hC=Ze({"src/traces/scattergl/plot.js"(c,q){"use strict";var v=G5(),x=rC(),A=hV(),M=CV(),e=ca(),t=Jd().selectMode,r=xT(),i=Fu(),a=FS(),n=j5().styleTextSelection,o={};function s(h,m,d,T){var l=h._size,_=h.width*T,w=h.height*T,S=l.l*T,E=l.b*T,g=l.r*T,b=l.t*T,p=l.w*T,u=l.h*T;return[S+m.domain[0]*p,E+d.domain[0]*u,_-g-(1-m.domain[1])*p,w-b-(1-d.domain[1])*u]}var c=q.exports=function(m,d,T){if(T.length){var l=m._fullLayout,_=d._scene,w=d.xaxis,S=d.yaxis,E,g;if(_){var b=r(m,["ANGLE_instanced_arrays","OES_element_index_uint"],o);if(!b){_.init();return}var p=_.count,u=l._glcanvas.data()[0].regl;if(a(m,d,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=v(u)),_.fill2d===!0&&(_.fill2d=x(u)),_.glText===!0)for(_.glText=new Array(p),E=0;E_.glText.length){var y=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,We,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,ut,Me;if(be.fill==="tozeroy"){for(ut=0;utut&&isNaN(tt[Me+1]);)Me-=2;tt[ut+1]!==0&&(ot=[tt[ut],0]),ot=ot.concat(tt.slice(ut,Me+2)),tt[Me+1]!==0&&(ot=ot.concat([tt[Me],0]))}else if(be.fill==="tozerox"){for(ut=0;utut&&isNaN(tt[Me]);)Me-=2;tt[ut]!==0&&(ot=[0,tt[ut+1]]),ot=ot.concat(tt.slice(ut,Me+2)),tt[Me]!==0&&(ot=ot.concat([0,tt[Me+1]]))}else if(be.fill==="toself"||be.fill==="tonext"){for(ot=[],Re=0,j.splitNull=!0,We=0;We-1;for(E=0;Ew&&d||_n,f;for(y?f=d.sizeAvg||Math.max(d.size,3):f=A(c,m),S=0;S<_.length;S++)w=_[S],E=h[w],g=x.getFromId(s,c._diag[w][0])||{},b=x.getFromId(s,c._diag[w][1])||{},M(s,c,g,b,T[S],T[S],f);var P=i(s,c);return P.matrix||(P.matrix=!0),P.matrixOptions=d,P.selectedOptions=t(s,c,c.selected),P.unselectedOptions=t(s,c,c.unselected),[{x:!1,y:!1,t:{},trace:c}]}}}),zV=Ze({"node_modules/performance-now/lib/performance-now.js"(Z,q){(function(){var v,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(v()-e)/1e6},x=process.hrtime,v=function(){var r;return r=x(),r[0]*1e9+r[1]},M=v(),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)}}),FV=Ze({"node_modules/raf/index.js"(Z,q){var v=zV(),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)},i.prototype.update=function(...s){if(!s.length)return;for(let m=0;mf||!d.lower&&y{c[T+_]=m})}this.scatter.draw(...c)}return this},i.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,h){let m=s.id!=null?s.id:s,d=c,T=h;return m<<16|(d&255)<<8|T&255}function n(s,c,h){let m,d,T,l,_,w,S,E,g=s[c],b=s[h];return g.length>2?(m=g[0],T=g[2],d=g[1],l=g[3]):g.length?(m=d=g[0],T=l=g[1]):(m=g.x,d=g.y,T=g.x+g.width,l=g.y+g.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),[_,d,S,l]}function o(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]}}}}),NV=Ze({"src/traces/splom/plot.js"(Z,q){"use strict";var v=BV(),x=ca(),A=$c(),M=Jd().selectMode;q.exports=function(r,i,a){if(a.length)for(var n=0;n-1,B=M(d)||!!n.selectedpoints||F,O=!0;if(B){var I=n._length;if(n.selectedpoints){s.selectBatch=n.selectedpoints;var N=n.selectedpoints,U={};for(_=0;_=W[Q][0]&&U<=W[Q][1])return!0;return!1}function c(U){U.attr("x",-v.bar.captureWidth/2).attr("width",v.bar.captureWidth)}function h(U){U.attr("visibility","visible").style("visibility","visible").attr("fill","yellow").attr("opacity",0)}function m(U){if(!U.brush.filterSpecified)return"0,"+U.height;for(var W=d(U.brush.filter.getConsolidated(),U.height),Q=[0],ue,se,he,H=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",m)}function w(U,W){var Q=x.select(U).selectAll(".highlight, .highlight-shadow"),ue=W?Q.transition().duration(v.bar.snapDuration).each("end",W):Q;_(ue)}function S(U,W){var Q=U.brush,ue=Q.filterSpecified,se=NaN,he={},H;if(ue){var $=U.height,J=Q.filter.getConsolidated(),X=d(J,$),oe=NaN,ne=NaN,j=NaN;for(H=0;H<=X.length;H++){var ee=X[H];if(ee&&ee[0]<=W&&W<=ee[1]){oe=H;break}else if(ne=H?H-1:NaN,ee&&ee[0]>W){j=H;break}}if(se=oe,isNaN(se)&&(isNaN(ne)||isNaN(j)?se=isNaN(ne)?j:ne:se=W-X[ne][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*v.verticalPadding,ue=W.unitToPaddedPx.invert(Q),se=W.brush,he=S(W,Q),H=he.interval,$=se.svgBrush;if($.wasDragged=!1,$.grabbingBar=he.region==="ns",$.grabbingBar){var J=H.map(W.unitToPaddedPx);$.grabPoint=Q-J[0]-v.verticalPadding,$.barLength=J[1]-J[0]}$.clickableOrdinalRange=he.clickableOrdinalRange,$.stayingIntervals=W.multiselect&&se.filterSpecified?se.filter.getConsolidated():[],H&&($.stayingIntervals=$.stayingIntervals.filter(function(X){return X[0]!==H[0]&&X[1]!==H[1]})),$.startExtent=he.region?H[he.region==="s"?1:0]:ue,W.parent.inBrushDrag=!0,$.brushStartCallback()}function g(U,W){x.event.sourceEvent.stopPropagation();var Q=W.height-x.mouse(U)[1]-2*v.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,se=Q.svgBrush;se._dragging||(p(U,W),g(U,W),W.brush.svgBrush.wasDragged=!1),se._dragging=!1;var he=x.event;he.sourceEvent.stopPropagation();var H=se.grabbingBar;if(se.grabbingBar=!1,se.grabLocation=void 0,W.parent.inBrushDrag=!1,l(),!se.wasDragged){se.wasDragged=void 0,se.clickableOrdinalRange?Q.filterSpecified&&W.multiselect?se.extent.push(se.clickableOrdinalRange):(se.extent=[se.clickableOrdinalRange],Q.filterSpecified=!0):H?(se.extent=se.stayingIntervals,se.extent.length===0&&z(Q)):z(Q),se.brushCallback(W),w(U.parentNode),se.brushEndCallback(Q.filterSpecified?ue.getConsolidated():[]);return}var $=function(){ue.set(ue.getConsolidated())};if(W.ordinal){var J=W.unitTickvals;J[J.length-1]se.newExtent[0];se.extent=se.stayingIntervals.concat(X?[se.newExtent]:[]),se.extent.length||z(Q),se.brushCallback(W),X?w(U.parentNode,$):($(),w(U.parentNode))}else $();se.brushEndCallback(Q.filterSpecified?ue.getConsolidated():[])}function p(U,W){var Q=W.height-x.mouse(U)[1]-2*v.verticalPadding,ue=S(W,Q),se="crosshair";ue.clickableOrdinalRange?se="pointer":ue.region&&(se=ue.region+"-resize"),x.select(document.body).style("cursor",se)}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){g(this,W)}).on("dragend",function(W){b(this,W)}))}function y(U,W){return U[0]-W[0]}function f(U,W,Q){var ue=Q._context.staticPlot,se=U.selectAll(".background").data(M);se.enter().append("rect").classed("background",!0).call(c).call(h).style("pointer-events",ue?"none":"auto").attr("transform",t(0,v.verticalPadding)),se.call(u).attr("height",function($){return $.height-v.verticalPadding});var he=U.selectAll(".highlight-shadow").data(M);he.enter().append("line").classed("highlight-shadow",!0).attr("x",-v.bar.width/2).attr("stroke-width",v.bar.width+v.bar.strokeWidth).attr("stroke",W).attr("opacity",v.bar.strokeOpacity).attr("stroke-linecap","butt"),he.attr("y1",function($){return $.height}).call(_);var H=U.selectAll(".highlight").data(M);H.enter().append("line").classed("highlight",!0).attr("x",-v.bar.width/2).attr("stroke-width",v.bar.width-v.bar.strokeWidth).attr("stroke",v.bar.fillColor).attr("opacity",v.bar.fillOpacity).attr("stroke-linecap","butt"),H.attr("y1",function($){return $.height}).call(_)}function P(U,W,Q){var ue=U.selectAll("."+v.cn.axisBrush).data(M,A);ue.enter().append("g").classed(v.cn.axisBrush,!0),f(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,se=L(ue),he=se.slice();ue.filter.set(he),U()}}function B(U){for(var W=U.slice(),Q=[],ue,se=W.shift();se;){for(ue=se.slice();(se=W.shift())&&se[0]<=ue[1];)ue[1]=Math.max(ue[1],se[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(se){return se.slice().sort(e)}).sort(y),U.length===1&&U[0][0]===-1/0&&U[0][1]===1/0&&(U=[[0,-1]]),W=B(U),Q=U.reduce(function(se,he){return[Math.min(se[0],he[0]),Math.max(se[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,se,he){var H=O();return H.set(Q),{filter:H,filterSpecified:W,svgBrush:{extent:[],brushStartCallback:ue,brushCallback:F(se),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(y)):U=[U[0]]):U=[U.sort(e)],W.tickvals){var Q=W.tickvals.slice().sort(e);if(U=U.map(function(ue){var se=[o(0,Q,ue[0],[]),o(1,Q,ue[1],[])];if(se[1]>se[0])return se}).filter(function(ue){return ue}),!U.length)return}return U.length>1?U:U[0]}q.exports={makeBrush:I,ensureAxisBrush:P,cleanRanges:N}}}),XV=Ze({"src/traces/parcoords/defaults.js"(Z,q){"use strict";var v=ca(),x=Up().hasColorscale,A=gh(),M=bc().defaults,e=fp(),t=Wo(),r=vC(),i=mC(),a=Tx().maxDimensionCount,n=bT();function o(c,h,m,d,T){var l=T("line.color",m);if(x(c,"line")&&v.isArrayOrTypedArray(l)){if(l.length)return T("line.colorscale"),A(c,h,d,T,{prefix:"line.",cLetter:"c"}),l.length;h.line.color=m}return 1/0}function s(c,h,m,d){function T(E,g){return v.coerce(c,h,r.dimensions,E,g)}var l=T("values"),_=T("visible");if(l&&l.length||(_=h.visible=!1),_){T("label"),T("tickvals"),T("ticktext"),T("tickformat");var w=T("range");h._ax={_id:"y",type:"linear",showexponent:"all",exponentformat:"B",range:w},t.setConvert(h._ax,d.layout),T("multiselect");var S=T("constraintrange");S&&(h.constraintrange=i.cleanRanges(S,h))}}q.exports=function(h,m,d,T){function l(g,b){return v.coerce(h,m,r,g,b)}var _=h.dimensions;Array.isArray(_)&&_.length>a&&(v.log("parcoords traces support up to "+a+" dimensions at the moment"),_.splice(a));var w=e(h,m,{name:"dimensions",layout:T,handleItemDefaults:s}),S=o(h,m,d,T,l);M(m,T,l),(!Array.isArray(w)||!w.length)&&(m.visible=!1),n(m,w,"values",S);var E=v.extendFlat({},T.font,{size:Math.round(T.font.size/1.2)});v.coerceFont(l,"labelfont",E),v.coerceFont(l,"tickfont",E,{autoShadowDflt:!0}),v.coerceFont(l,"rangefont",E),l("labelangle"),l("labelside"),l("unselected.line.color"),l("unselected.line.opacity")}}}),ZV=Ze({"src/traces/parcoords/calc.js"(Z,q){"use strict";var v=ca().isArrayOrTypedArray,x=rc(),A=Cv().wrap;q.exports=function(t,r){var i,a;return x.hasColorscale(r,"line")&&v(r.line.color)?(i=r.line.color,a=x.extractOpts(r.line).colorscale,x.calc(t,r,{vals:i,containerStr:"line",cLetter:"c"})):(i=M(r._length),a=[[0,r.line.color],[1,r.line.color]]),A({lineColor:i,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,i=r<=4;M=1,i?(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 n=e==="cmyk"?4:e==="gray"?1:3;A=x[2].trim().split(/\s*[,\/]\s*|\s+/),e==="color"&&(e=A.shift()),A=A.map(function(o,s){if(o[o.length-1]==="%")return o=parseFloat(o)/100,s===3?o:e==="rgb"?o*255:e[0]==="h"||e[0]==="l"&&!s?o*100:e==="lab"?o*125:e==="lch"?s<2?o*150:o*360:e[0]==="o"&&!s?o:e==="oklab"?o*.4:e==="oklch"?s<2?o*.4:o*360:o;if(e[s]==="h"||s===2&&e[e.length-1]==="h"){if(TT[o]!==void 0)return TT[o];if(o.endsWith("deg"))return parseFloat(o);if(o.endsWith("turn"))return parseFloat(o)*360;if(o.endsWith("grad"))return parseFloat(o)*360/400;if(o.endsWith("rad"))return parseFloat(o)*180/Math.PI}return o==="none"?0:parseFloat(o)}),M=A.length>n?A.pop():1}else/[0-9](?:\s|\/|,)/.test(Z)&&(A=Z.match(/([0-9]+)/g).map(function(o){return parseFloat(o)}),e=((v=(q=Z.match(/([a-z])/ig))==null?void 0:q.join(""))==null?void 0:v.toLowerCase())||"rgb");return{space:e,values:A,alpha:M}}var wT,gC,TT,KV=mo({"node_modules/color-parse/index.js"(){wT=cu(_5(),1),gC=YV,TT={red:0,orange:60,yellow:120,green:180,blue:240,purple:300}}}),Ax,yC=mo({"node_modules/color-space/rgb.js"(){Ax={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]}}}),Sx,JV=mo({"node_modules/color-space/hsl.js"(){yC(),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,v=Z[1]/100,x=Z[2]/100,A,M,e,t,r,i=0;if(v===0)return r=x*255,[r,r,r];for(M=x<.5?x*(1+v):x+v-x*v,A=2*x-M,t=[0,0,0];i<3;)e=q+1/3*-(i-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[i++]=r*255;return t}},Ax.hsl=function(Z){var q=Z[0]/255,v=Z[1]/255,x=Z[2]/255,A=Math.min(q,v,x),M=Math.max(q,v,x),e=M-A,t,r,i;return M===A?t=0:q===M?t=(v-x)/e:v===M?t=2+(x-q)/e:x===M&&(t=4+(q-v)/e),t=Math.min(t*60,360),t<0&&(t+=360),i=(A+M)/2,M===A?r=0:i<=.5?r=e/(M+A):r=e/(2-M-A),[t,r*100,i*100]}}}),_C={};Ws(_C,{default:()=>$V});function $V(Z){Array.isArray(Z)&&Z.raw&&(Z=String.raw(...arguments)),Z instanceof Number&&(Z=+Z);var q,v,x,A=gC(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 QV=mo({"node_modules/color-rgba/index.js"(){KV(),yC(),JV()}}),xC=Ze({"src/traces/parcoords/helpers.js"(Z){"use strict";var q=ca().isTypedArray;Z.convertTypedArray=function(v){return q(v)?Array.prototype.slice.call(v):v},Z.isOrdinal=function(v){return!!v.tickvals},Z.isVisible=function(v){return v.visible||!("visible"in v)}}}),eq=Ze({"src/traces/parcoords/lines.js"(Z,q){"use strict";var v=["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),i=new Uint8Array(4),a={shape:[256,1],format:"rgba",type:"uint8",mag:"nearest",min:"nearest"};function n(b){b.read({x:0,y:0,width:1,height:1,data:r})}function o(b,p,u,y,f){var P=b._gl;P.enable(P.SCISSOR_TEST),P.scissor(p,u,y,f),b.clear({color:[0,0,0,0],depth:1})}function s(b,p,u,y,f,P){var L=P.key;function z(F){var B=Math.min(y,f-F*y);F===0&&(window.cancelAnimationFrame(u.currentRafs[L]),delete u.currentRafs[L],o(b,P.scissorX,P.scissorY,P.scissorWidth,P.viewBoxSize[1])),!u.clearOnly&&(P.count=2*B,P.offset=2*F*y,p(P),F*y+B>>8*p)%256/255}function d(b,p,u){for(var y=new Array(b*(A+4)),f=0,P=0;PRe&&(Re=ne[ce].dim1.canvasX,Ae=ce);re===0&&o(f,0,0,B.canvasWidth,B.canvasHeight);var We=H(u);for(ce=0;cece._length&&(ut=ut.slice(0,ce._length));var Me=ce.tickvals,_e;function fe(Lt,kt){return{val:Lt,text:_e[kt]}}function Fe(Lt,kt){return Lt.val-kt.val}if(A(Me)&&Me.length){x.isTypedArray(Me)&&(Me=Array.from(Me)),_e=ce.ticktext,!A(_e)||!_e.length?_e=Me.map(M(ce.tickformat)):_e.length>Me.length?_e=_e.slice(0,Me.length):Me.length>_e.length&&(Me=Me.slice(0,_e.length));for(var rt=1;rt=kt||xr>=qt)return;var jr=Qe.lineLayer.readPixel(Sr,qt-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 i(Qe.model.translateX,Qe.model.translateY)});var We=Re.selectAll("."+T.cn.parcoordsControlView).data(h,c);We.enter().append("g").classed(T.cn.parcoordsControlView,!0),We.attr("transform",function(Qe){return i(Qe.model.pad.l,Qe.model.pad.t)});var it=We.selectAll("."+T.cn.yAxis).data(function(Qe){return Qe.dimensions},c);it.enter().append("g").classed(T.cn.yAxis,!0),We.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 i(Qe.xScale(Qe.xIndex),0)}),it.call(v.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,v.event.x)),Qe.canvasX=Qe.x*Qe.model.canvasPixelRatio,it.sort(function(kt,qt){return kt.x-qt.x}).each(function(kt,qt){kt.xIndex=qt,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 i(kt.xScale(kt.xIndex),0)}),v.select(this).attr("transform",i(Qe.x,0)),it.each(function(kt,qt,Zt){Zt===Qe.parent.key&&(Lt.dimensions[qt]=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),v.select(this).attr("transform",function(kt){return i(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(h,c);ot.enter().append("g").classed(T.cn.axisOverlays,!0),ot.selectAll("."+T.cn.axis).remove();var tt=ot.selectAll("."+T.cn.axis).data(h,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,qt=kt.domain();v.select(this).call(v.svg.axis().orient("left").tickSize(4).outerTickSize(2).ticks(Lt,Qe.tickFormat).tickValues(Qe.ordinal?qt:null).tickFormat(function(Zt){return d.isOrdinal(Qe)?Zt:W(Qe.model.dimensions[Qe.visibleIndex],Zt)}).scale(kt)),n.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 ut=ot.selectAll("."+T.cn.axisHeading).data(h,c);ut.enter().append("g").classed(T.cn.axisHeading,!0);var Me=ut.selectAll("."+T.cn.axisTitle).data(h,c);Me.enter().append("text").classed(T.cn.axisTitle,!0).attr("text-anchor","middle").style("cursor","ew-resize").style("pointer-events",J?"none":"auto"),Me.text(function(Qe){return Qe.label}).each(function(Qe){var Lt=v.select(this);n.font(Lt,Qe.model.labelFont),a.convertToTspans(Lt,se)}).attr("transform",function(Qe){var Lt=I(Qe.model.labelAngle,Qe.model.labelSide),kt=T.axisTitleOffset;return(Lt.dir>0?"":i(0,2*kt+Qe.model.height))+r(Lt.degrees)+i(-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),qt=Math.abs(Lt.dy);return 2*kt>qt?Lt.dir*Lt.dx<0?"start":"end":"middle"});var _e=ot.selectAll("."+T.cn.axisExtent).data(h,c);_e.enter().append("g").classed(T.cn.axisExtent,!0);var fe=_e.selectAll("."+T.cn.axisExtentTop).data(h,c);fe.enter().append("g").classed(T.cn.axisExtentTop,!0),fe.attr("transform",i(0,-T.axisExtentOffset));var Fe=fe.selectAll("."+T.cn.axisExtentTopText).data(h,c);Fe.enter().append("text").classed(T.cn.axisExtentTopText,!0).call(B),Fe.text(function(Qe){return Q(Qe,!0)}).each(function(Qe){n.font(v.select(this),Qe.model.rangeFont)});var rt=_e.selectAll("."+T.cn.axisExtentBottom).data(h,c);rt.enter().append("g").classed(T.cn.axisExtentBottom,!0),rt.attr("transform",function(Qe){return i(0,Qe.model.height+T.axisExtentOffset)});var st=rt.selectAll("."+T.cn.axisExtentBottomText).data(h,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){n.font(v.select(this),Qe.model.rangeFont)}),l.ensureAxisBrush(ot,ee,se)}}}),bC=Ze({"src/traces/parcoords/plot.js"(r,q){"use strict";var v=tq(),x=xT(),A=xC().isVisible,M={};function e(i,a,n){var o=a.indexOf(n),s=i.indexOf(o);return s===-1&&(s+=a.length),s}function t(i,a){return function(o,s){return e(i,a,o)-e(i,a,s)}}var r=q.exports=function(a,n){var o=a._fullLayout,s=x(a,[],M);if(s){var c={},h={},m={},d={},T=o._size;n.forEach(function(E,g){var b=E[0].trace;m[g]=b.index;var p=d[g]=b.index;c[g]=a.data[p].dimensions,h[g]=a.data[p].dimensions.slice()});var l=function(E,g,b){var p=h[E][g],u=b.map(function(F){return F.slice()}),y="dimensions["+g+"].constraintrange",f=o._tracePreGUI[a._fullData[m[E]]._fullInput.uid];if(f[y]===void 0){var P=p.constraintrange;f[y]=P||null}var L=a._fullData[m[E]].dimensions[g];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[y]=u,a.emit("plotly_restyle",[z,[d[E]]])},_=function(E){a.emit("plotly_hover",E)},w=function(E){a.emit("plotly_unhover",E)},S=function(E,g){var b=t(g,h[E].filter(A));c[E].sort(b),h[E].filter(function(p){return!A(p)}).sort(function(p){return h[E].indexOf(p)}).forEach(function(p){c[E].splice(c[E].indexOf(p),1),c[E].splice(h[E].indexOf(p),0,p)}),a.emit("plotly_restyle",[{dimensions:[c[E]]},[d[E]]])};v(a,n,{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}}),rq=Ze({"src/traces/parcoords/base_plot.js"(Z){"use strict";var q=Oi(),v=Hh().getModuleCalcData,x=bC(),A=vd();Z.name="parcoords",Z.plot=function(M){var e=v(M.calcdata,"parcoords")[0];e.length&&x(M,e)},Z.clean=function(M,e,t,r){var i=r._has&&r._has("parcoords"),a=e._has&&e._has("parcoords");i&&!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,n){return n===t.size()-1}).selectAll(".gl-canvas-context, .gl-canvas-focus");function i(){var a=this,n=a.toDataURL("image/png"),o=e.append("svg:image");o.attr({xmlns:A.svg,"xlink:href":n,preserveAspectRatio:"none",x:0,y:0,width:a.style.width,height:a.style.height})}r.each(i),window.setTimeout(function(){q.selectAll("#filterBarPattern").attr("id","filterBarPattern")},60)}}}),aq=Ze({"src/traces/parcoords/base_index.js"(Z,q){"use strict";q.exports={attributes:vC(),supplyDefaults:XV(),calc:ZV(),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcoords",basePlotModule:rq(),categories:["gl","regl","noOpacity","noHover"],meta:{}}}}),nq=Ze({"src/traces/parcoords/index.js"(Z,q){"use strict";var v=aq();v.plot=bC(),q.exports=v}}),iq=Ze({"lib/parcoords.js"(Z,q){"use strict";q.exports=nq()}}),wC=Ze({"src/traces/parcats/attributes.js"(Z,q){"use strict";var v=rs().extendFlat,x=eu(),A=tc(),M=Mu(),e=Cs().hovertemplateAttrs,t=bc().attributes,r=v({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:v({},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}}}),oq=Ze({"src/traces/parcats/defaults.js"(Z,q){"use strict";var v=ca(),x=Up().hasColorscale,A=gh(),M=bc().defaults,e=fp(),t=wC(),r=bT(),i=xp().isTypedArraySpec;function a(o,s,c,h,m){m("line.shape"),m("line.hovertemplate");var d=m("line.color",h.colorway[0]);if(x(o,"line")&&v.isArrayOrTypedArray(d)){if(d.length)return m("line.colorscale"),A(o,s,h,m,{prefix:"line.",cLetter:"c"}),d.length;s.line.color=c}return 1/0}function n(o,s){function c(w,S){return v.coerce(o,s,t.dimensions,w,S)}var h=c("values"),m=c("visible");if(h&&h.length||(m=s.visible=!1),m){c("label"),c("displayindex",s._index);var d=o.categoryarray,T=v.isArrayOrTypedArray(d)&&d.length>0||i(d),l;T&&(l="array");var _=c("categoryorder",l);_==="array"?(c("categoryarray"),c("ticktext")):(delete o.categoryarray,delete o.ticktext),!T&&_==="array"&&(s.categoryorder="trace")}}q.exports=function(s,c,h,m){function d(w,S){return v.coerce(s,c,t,w,S)}var T=e(s,c,{name:"dimensions",handleItemDefaults:n}),l=a(s,c,h,m,d);M(c,m,d),(!Array.isArray(T)||!T.length)&&(c.visible=!1),r(c,T,"values",l),d("hoveron"),d("hovertemplate"),d("arrangement"),d("bundlecolors"),d("sortpaths"),d("counts");var _=m.font;v.coerceFont(d,"labelfont",_,{overrideDflt:{size:Math.round(_.size)}}),v.coerceFont(d,"tickfont",_,{autoShadowDflt:!0,overrideDflt:{size:Math.round(_.size/1.2)}})}}}),sq=Ze({"src/traces/parcats/calc.js"(Z,q){"use strict";var v=Cv().wrap,x=Up().hasColorscale,A=jp(),M=rS(),e=as(),t=ca(),r=is();q.exports=function(_,w){var S=t.filterVisible(w.dimensions);if(S.length===0)return[];var E=S.map(function(H){var $;if(H.categoryorder==="trace")$=null;else if(H.categoryorder==="array")$=H.categoryarray;else{$=M(H.values);for(var J=!0,X=0;X<$.length;X++)if(!r($[X])){J=!1;break}$.sort(J?t.sorterAsc:void 0),H.categoryorder==="category descending"&&($=$.reverse())}return h(H.values,$)}),g,b,p;t.isArrayOrTypedArray(w.counts)?g=w.counts:g=[w.counts],m(S),S.forEach(function(H,$){d(H,E[$])});var u=w.line,y;u?(x(w,"line")&&A(_,w,{vals:w.line.color,containerStr:"line",cLetter:"c"}),y=e.tryColorscale(u)):y=t.identity;function f(H){var $,J;return t.isArrayOrTypedArray(u.color)?($=u.color[H%u.color.length],J=$):$=u.color,{color:y($),rawColor:J}}var P=S[0].values.length,L={},z=E.map(function(H){return H.inds});p=0;var F,B;for(F=0;F=l.length||_[l[w]]!==void 0)return!1;_[l[w]]=!0}return!0}}}),lq=Ze({"src/traces/parcats/parcats.js"(Z,q){"use strict";var v=Oi(),x=(h0(),ih(fg)).interpolateNumber,A=C2(),M=ef(),e=ca(),t=e.strTranslate,r=as(),i=Ch(),a=fu();function n(X,oe,ne,j){var ee=oe._context.staticPlot,re=X.map(se.bind(0,oe,ne)),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,o),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},o);Re.attr("fill",function(fe){return fe.model.color});var We=Re.enter().append("path").attr("class","path").attr("stroke-opacity",0).attr("fill",function(fe){return fe.model.color}).attr("fill-opacity",0);_(We),Re.attr("d",function(fe){return fe.svgD}),We.empty()||Re.sort(c),Re.exit().remove(),Re.on("mouseover",h).on("mouseout",m).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},o);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},o),ut=tt.enter().append("g").attr("class","category");tt.attr("transform",function(fe){return t(0,fe.y)}),ut.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(ut);var Me=tt.selectAll("rect.bandrect").data(function(fe){return fe.bands},o);Me.each(function(){e.raiseToTop(this)}),Me.attr("fill",function(fe){return fe.color});var _e=Me.enter().append("rect").attr("class","bandrect").attr("stroke-opacity",0).attr("fill",function(fe){return fe.color}).attr("fill-opacity",0);Me.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),Me.exit().remove(),ut.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(v.select(this),fe.parcatsViewModel.categorylabelfont),a.convertToTspans(v.select(this),oe)}),ut.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(v.select(this),fe.parcatsViewModel.labelfont)}),tt.selectAll("rect.bandrect").on("mouseover",B).on("mouseout",O),tt.exit().remove(),ot.call(v.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=v.select(this),fe.pathSelection=v.select(this).selectAll("g.paths").selectAll("path.path"),fe.dimensionSelection=v.select(this).selectAll("g.dimensions").selectAll("g.dimension")}),be.exit().remove()}q.exports=function(X,oe,ne,j){n(ne,X,j,oe)};function o(X){return X.key}function s(X){var oe=X.parcatsViewModel.dimensions.length,ne=X.parcatsViewModel.dimensions[oe-1].model.dimensionInd;return X.model.dimensionInd===ne}function c(X,oe){return X.model.rawColor>oe.model.rawColor?1:X.model.rawColor"),Qe=v.mouse(ee)[0];M.loneHover({trace:re,x:tt-be.left+Ae.left,y:ut-be.top+Ae.top,text:st,color:X.model.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:10,fontColor:Me,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,ut=be.model.categoryLabel,Me=tt/be.parcatsViewModel.model.count,_e={countLabel:tt,categoryLabel:ut,probabilityLabel:Me.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*(We-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:ut,probability:Me}]}}function z(X,oe,ne){var j=[];return v.select(ne.parentNode.parentNode).selectAll("g.category").select("rect.catrect").each(function(){var ee=this;j.push(L(X,oe,ee))}),j}function F(X,oe,ne){X._fullLayout._calcInverseTransform(X);var j=X._fullLayout._invScaleX,ee=X._fullLayout._invScaleY,re=ne.getBoundingClientRect(),ce=v.select(ne).datum(),be=ce.categoryViewModel,Ae=be.parcatsViewModel,ze=Ae.model.dimensions[be.model.dimensionInd],Re=Ae.trace,We=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,ut=ce.parcatsViewModel.model.count,Me=0;ce.categoryViewModel.bands.forEach(function(Zt){Zt.color===ce.color&&(Me+=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=Me/ut,rt=Me/fe,st=Me/_e,Qe={countLabel:Me,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("
"),qt=i.mostReadable(ce.color,["black","white"]);return{trace:Re,x:j*(it-oe.left),y:ee*(We-oe.top),text:kt,color:ce.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontColor:qt,fontSize:10,idealAlign:ot,hovertemplate:Re.hovertemplate,hovertemplateLabels:Qe,eventData:[{data:Re._input,fullData:Re,category:tt,count:ut,probability:Fe,categorycount:_e,colorcount:fe,bandcolorcount:Me}]}}function B(X){if(!X.parcatsViewModel.dragDimension&&X.parcatsViewModel.hoverinfoItems.indexOf("skip")===-1){var oe=v.mouse(this)[1];if(oe<-1)return;var ne=X.parcatsViewModel.graphDiv,j=ne._fullLayout,ee=j._paperdiv.node().getBoundingClientRect(),re=X.parcatsViewModel.hoveron,ce=this;if(re==="color"?(y(ce),P(ce,"plotly_hover",v.event)):(u(ce),f(ce,"plotly_hover",v.event)),X.parcatsViewModel.hoverinfoItems.indexOf("none")===-1){var be;re==="category"?be=L(ne,ee,ce):re==="color"?be=F(ne,ee,ce):re==="dimension"&&(be=z(ne,ee,ce)),be&&M.loneHover(be,{container:j._hoverlayer.node(),outerContainer:j._paper.node(),gd:ne})}}}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 ne=X.parcatsViewModel.hoveron,j=this;ne==="color"?P(j,"plotly_unhover",v.event):f(j,"plotly_unhover",v.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,v.select(this).selectAll("g.category").select("rect.catrect").each(function(oe){var ne=v.mouse(this)[0],j=v.mouse(this)[1];-2<=ne&&ne<=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),v.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=v.event.x;var We=X.parcatsViewModel.dimensions[ne],it=X.parcatsViewModel.dimensions[j];We!==void 0&&ee.model.dragXit.x&&(ee.model.displayInd=it.model.displayInd,it.model.displayInd=X.dragDimensionDisplayInd),X.dragDimensionDisplayInd=ee.model.displayInd}$(X.parcatsViewModel),H(X.parcatsViewModel),ue(X.parcatsViewModel),Q(X.parcatsViewModel)}}function U(X){if(X.parcatsViewModel.arrangement!=="fixed"&&X.dragDimensionDisplayInd!==null){v.select(this).selectAll("text").attr("font-weight","normal");var oe={},ne=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",v.event.sourceEvent):f(X.potentialClickBand,"plotly_click",v.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),H(X.parcatsViewModel);var We=v.transition().duration(300).ease("cubic-in-out");We.each(function(){ue(X.parcatsViewModel,!0),Q(X.parcatsViewModel,!0)}).each("end",function(){(ee||re)&&A.restyle(X.parcatsViewModel.graphDiv,oe,[ne])})}}function W(X){for(var oe,ne=X.graphDiv._fullData,j=0;j=0;Ae--)ze+="C"+ce[Ae]+","+(oe[Ae+1]+j)+" "+re[Ae]+","+(oe[Ae]+j)+" "+(X[Ae]+ne[Ae])+","+(oe[Ae]+j),ze+="l-"+ne[Ae]+",0 ";return ze+="Z",ze}function H(X){var oe=X.dimensions,ne=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 ne.paths)ne.paths.hasOwnProperty(Re)&&ze.push(ne.paths[Re]);function We(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=We(jr),bt=We(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}),ut=0;ut0?_e=tt*(Me.count/ot):_e=0;for(var fe=new Array(j.length),Fe=0;Fe1?ce=(X.width-2*ne-j)/(ee-1):ce=0,be=ne,Ae=be+ce*re;var ze=[],Re=X.model.maxCats,We=oe.categories.length,it=8,ot=oe.count,tt=X.height-it*(Re-1),ut,Me,_e,fe,Fe,rt=(Re-We)*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?ut=Me.count/ot*tt:ut=0,_e={key:Me.valueInds[0],model:Me,width:j,height:ut,y:Me.dragY!==null?Me.dragY:rt,bands:[],parcatsViewModel:X},rt=rt+ut+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}}}}),TC=Ze({"src/traces/parcats/plot.js"(Z,q){"use strict";var v=lq();q.exports=function(A,M,e,t){var r=A._fullLayout,i=r._paper,a=r._size;v(A,i,M,{width:a.w,height:a.h,margin:{t:a.t,r:a.r,b:a.b,l:a.l}},e,t)}}}),uq=Ze({"src/traces/parcats/base_plot.js"(Z){"use strict";var q=Hh().getModuleCalcData,v=TC(),x="parcats";Z.name=x,Z.plot=function(A,M,e,t){var r=q(A.calcdata,x);if(r.length){var i=r[0];v(A,i,e,t)}},Z.clean=function(A,M,e,t){var r=t._has&&t._has("parcats"),i=M._has&&M._has("parcats");r&&!i&&t._paperdiv.selectAll(".parcats").remove()}}}),cq=Ze({"src/traces/parcats/index.js"(Z,q){"use strict";q.exports={attributes:wC(),supplyDefaults:oq(),calc:sq(),plot:TC(),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcats",basePlotModule:uq(),categories:["noOpacity"],meta:{}}}}),fq=Ze({"lib/parcats.js"(Z,q){"use strict";q.exports=cq()}}),am=Ze({"src/plots/mapbox/constants.js"(Z,q){"use strict";var v=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"}},i=v(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:i,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:",i.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 v=ca(),x=Yi().defaultLine,A=bc().attributes,M=tc(),e=tf().textposition,t=pc().overrideAll,r=Dl().templatedArray,i=am(),a=M({noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0});a.family.dflt="Open Sans Regular, Arial Unicode MS Regular";var n=q.exports=t({_arrayAttrRegexps:[v.counterRegex("mapbox",".layers",!0)],domain:A({name:"mapbox"}),accesstoken:{valType:"string",noBlank:!0,strict:!0},style:{valType:"any",values:i.styleValuesMapbox.concat(i.styleValuesNonMapbox),dflt:i.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:v.extendFlat({},e,{arrayOk:!1})}})},"plot","from-root");n.uirevision={valType:"any",editType:"none"}}}),AT=Ze({"src/traces/scattermapbox/attributes.js"(Z,q){"use strict";var v=Cs().hovertemplateAttrs,x=Cs().texttemplateAttrs,A=$d(),M=d0(),e=tf(),t=Mx(),r=eu(),i=Mu(),a=rs().extendFlat,n=pc().overrideAll,o=Mx(),s=M.line,c=M.marker;q.exports=n({lon:M.lon,lat:M.lat,cluster:{enabled:{valType:"boolean"},maxzoom:a({},o.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},i("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:v()},"calc","nested")}}),AC=Ze({"src/traces/scattermapbox/constants.js"(Z,q){"use strict";var v=["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 v.indexOf(x)!==-1}}}}),hq=Ze({"src/traces/scattermapbox/defaults.js"(Z,q){"use strict";var v=ca(),x=Fu(),A=md(),M=Dd(),e=zd(),t=ev(),r=AT(),i=AC().isSupportedFont;q.exports=function(o,s,c,h){function m(y,f){return v.coerce(o,s,r,y,f)}function d(y,f){return v.coerce2(o,s,r,y,f)}var T=a(o,s,m);if(!T){s.visible=!1;return}if(m("text"),m("texttemplate"),m("hovertext"),m("hovertemplate"),m("mode"),m("below"),x.hasMarkers(s)){A(o,s,c,h,m,{noLine:!0,noAngle:!0}),m("marker.allowoverlap"),m("marker.angle");var l=s.marker;l.symbol!=="circle"&&(v.isArrayOrTypedArray(l.size)&&(l.size=l.size[0]),v.isArrayOrTypedArray(l.color)&&(l.color=l.color[0]))}x.hasLines(s)&&(M(o,s,c,h,m,{noDash:!0}),m("connectgaps"));var _=d("cluster.maxzoom"),w=d("cluster.step"),S=d("cluster.color",s.marker&&s.marker.color||c),E=d("cluster.size"),g=d("cluster.opacity"),b=_!==!1||w!==!1||S!==!1||E!==!1||g!==!1,p=m("cluster.enabled",b);if(p||x.hasText(s)){var u=h.font.family;e(o,s,h,m,{noSelect:!0,noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,font:{family:i(u)?u:"Open Sans Regular",weight:h.font.weight,style:h.font.style,size:h.font.size,color:h.font.color}})}m("fill"),s.fill!=="none"&&t(o,s,c,m),v.coerceSelectionMarkerOpacity(s,m)};function a(n,o,s){var c=s("lon")||[],h=s("lat")||[],m=Math.min(c.length,h.length);return o._length=m,m}}}),SC=Ze({"src/traces/scattermapbox/format_labels.js"(Z,q){"use strict";var v=Wo();q.exports=function(A,M,e){var t={},r=e[M.subplot]._subplot,i=r.mockAxis,a=A.lonlat;return t.lonLabel=v.tickText(i,i.c2l(a[0]),!0).text,t.latLabel=v.tickText(i,i.c2l(a[1]),!0).text,t}}}),MC=Ze({"src/plots/mapbox/convert_text_opts.js"(Z,q){"use strict";var v=ca();q.exports=function(A,M){var e=A.split(" "),t=e[0],r=e[1],i=v.isArrayOrTypedArray(M)?v.mean(M):M,a=.5+i/100,n=1.5+i/100,o=["",""],s=[0,0];switch(t){case"top":o[0]="top",s[1]=-n;break;case"bottom":o[0]="bottom",s[1]=n;break}switch(r){case"left":o[1]="right",s[0]=-a;break;case"right":o[1]="left",s[0]=a;break}var c;return o[0]&&o[1]?c=o.join("-"):o[0]?c=o[0]:o[1]?c=o[1]:c="center",{anchor:c,offset:s}}}}),pq=Ze({"src/traces/scattermapbox/convert.js"(Z,q){"use strict";var v=is(),x=ca(),A=Vs().BADNUM,M=dg(),e=rc(),t=as(),r=r1(),i=Fu(),a=AC().isSupportedFont,n=MC(),o=Qp().appendArrayPointValue,s=fu().NEWLINES,c=fu().BR_TAG_ALL;q.exports=function(g,b){var p=b[0].trace,u=p.visible===!0&&p._length!==0,y=p.fill!=="none",f=i.hasLines(p),P=i.hasMarkers(p),L=i.hasText(p),z=P&&p.marker.symbol==="circle",F=P&&p.marker.symbol!=="circle",B=p.cluster&&p.cluster.enabled,O=h("fill"),I=h("line"),N=h("circle"),U=h("symbol"),W={fill:O,line:I,circle:N,symbol:U};if(!u)return W;var Q;if((y||f)&&(Q=M.calcTraceToLineCoords(b)),y&&(O.geojson=M.makePolygon(Q),O.layout.visibility="visible",x.extendFlat(O.paint,{"fill-color":p.fillcolor})),f&&(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=m(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=d(b,g),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 se=(p.marker||{}).size,he=n(p.textposition,se);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 h(E){return{type:E,geojson:M.makeBlank(),layout:{visibility:"none"},filter:null,paint:{}}}function m(E){var g=E[0].trace,b=g.marker,p=g.selectedpoints,u=x.isArrayOrTypedArray(b.color),y=x.isArrayOrTypedArray(b.size),f=x.isArrayOrTypedArray(b.opacity),P;function L(se){return g.opacity*se}function z(se){return se/2}var F;u&&(e.hasColorscale(g,"marker")?F=e.makeColorScaleFuncFromTrace(b):F=x.identity);var B;y&&(B=r(g));var O;f&&(O=function(se){var he=v(se)?+x.constrain(se,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"):y.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"):y.slice(0,3).join(" ")==="Klokantech Noto Sans"&&(P="Klokantech Noto Sans",y[3]==="CJK"&&(P+=" CJK"),P+=u>500?" Bold":" Regular")),f&&(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}}}),dq=Ze({"src/traces/scattermapbox/plot.js"(Z,q){"use strict";var v=ca(),x=pq(),A=am().traceLayerPrefix,M={cluster:["cluster","clusterCount","circle"],nonCluster:["fill","line","circle","symbol"]};function e(r,i,a,n){this.type="scattermapbox",this.subplot=r,this.uid=i,this.clusterEnabled=a,this.isHidden=n,this.sourceIds={fill:"source-"+i+"-fill",line:"source-"+i+"-line",circle:"source-"+i+"-circle",symbol:"source-"+i+"-symbol",cluster:"source-"+i+"-circle",clusterCount:"source-"+i+"-circle"},this.layerIds={fill:A+i+"-fill",line:A+i+"-line",circle:A+i+"-circle",symbol:A+i+"-symbol",cluster:A+i+"-cluster",clusterCount:A+i+"-cluster-count"},this.below=null}var t=e.prototype;t.addSource=function(r,i,a){var n={type:"geojson",data:i.geojson};a&&a.enabled&&v.extendFlat(n,{cluster:!0,clusterMaxZoom:a.maxzoom});var o=this.subplot.map.getSource(this.sourceIds[r]);o?o.setData(i.geojson):this.subplot.map.addSource(this.sourceIds[r],n)},t.setSourceData=function(r,i){this.subplot.map.getSource(this.sourceIds[r]).setData(i.geojson)},t.addLayer=function(r,i,a){var n={type:i.type,id:this.layerIds[r],source:this.sourceIds[r],layout:i.layout,paint:i.paint};i.filter&&(n.filter=i.filter);for(var o=this.layerIds[r],s,c=this.subplot.getMapLayers(),h=0;h=0;f--){var P=y[f];o.removeLayer(d.layerIds[P])}u||o.removeSource(d.sourceIds.circle)}function _(u){for(var y=M.nonCluster,f=0;f=0;f--){var P=y[f];o.removeLayer(d.layerIds[P]),u||o.removeSource(d.sourceIds[P])}}function S(u){m?l(u):w(u)}function E(u){h?T(u):_(u)}function g(){for(var u=h?M.cluster:M.nonCluster,y=0;y=0;n--){var o=a[n];i.removeLayer(this.layerIds[o]),i.removeSource(this.sourceIds[o])}},q.exports=function(i,a){var n=a[0].trace,o=n.cluster&&n.cluster.enabled,s=n.visible!==!0,c=new e(i,n.uid,o,s),h=x(i.gd,a),m=c.below=i.belowLookup["trace-"+n.uid],d,T,l;if(o)for(c.addSource("circle",h.circle,n.cluster),d=0;d=0?Math.floor((n+180)/360):Math.ceil((n-180)/360),E=S*360,g=n-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=d.project([I,N]),W=U.x-h.c2p([g,N]),Q=U.y-m.c2p([I,o]),ue=Math.max(3,B.mrc||0);return Math.max(Math.sqrt(W*W+Q*Q)-ue,1-3/ue)}if(v.getClosest(s,b,a),a.index!==!1){var p=s[a.index],u=p.lonlat,y=[x.modHalf(u[0],360)+E,u[1]],f=h.c2p(y),P=m.c2p(y),L=p.mrc||1;a.x0=f-L,a.x1=f+L,a.y0=P-L,a.y1=P+L;var z={};z[c.subplot]={_subplot:d};var F=c._module.formatLabels(p,c,z);return a.lonLabel=F.lonLabel,a.latLabel=F.latLabel,a.color=A(c,p),a.extraText=i(c,p,s[0].t.labels),a.hovertemplate=c.hovertemplate,[a]}}function i(a,n,o){if(a.hovertemplate)return;var s=n.hi||a.hoverinfo,c=s.split("+"),h=c.indexOf("all")!==-1,m=c.indexOf("lon")!==-1,d=c.indexOf("lat")!==-1,T=n.lonlat,l=[];function _(w){return w+"\xB0"}return h||m&&d?l.push("("+_(T[1])+", "+_(T[0])+")"):m?l.push(o.lon+_(T[0])):d&&l.push(o.lat+_(T[1])),(h||c.indexOf("text")!==-1)&&M(n,a,l),l.join("
")}q.exports={hoverPoints:r,getExtraText:i}}}),vq=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}}}),mq=Ze({"src/traces/scattermapbox/select.js"(Z,q){"use strict";var v=ca(),x=Fu(),A=Vs().BADNUM;q.exports=function(e,t){var r=e.cd,i=e.xaxis,a=e.yaxis,n=[],o=r[0].trace,s;if(!x.hasMarkers(o))return[];if(t===!1)for(s=0;s"u"&&(k=1e-6);var V,ie,xe,Ie,qe;for(xe=C,qe=0;qe<8;qe++){if(Ie=this.sampleCurveX(xe)-C,Math.abs(Ie)ie)return ie;for(;VIe?V=xe:ie=xe,xe=(ie-V)*.5+V}return xe},a.prototype.solve=function(C,k){return this.sampleCurveY(this.solveCurveX(C,k))};var n=o;function o(C,k){this.x=C,this.y=k}o.prototype={clone:function(){return new o(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),ie=k*this.x-V*this.y,xe=V*this.x+k*this.y;return this.x=ie,this.y=xe,this},_rotateAround:function(C,k){var V=Math.cos(C),ie=Math.sin(C),xe=k.x+V*(this.x-k.x)-ie*(this.y-k.y),Ie=k.y+ie*(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}},o.convert=function(C){return C instanceof o?C:Array.isArray(C)?new o(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 d(C,k,V,ie){var xe=new i(C,k,V,ie);return function(Ie){return xe.solve(Ie)}}var T=d(.25,.1,.25,1);function l(C,k,V){return Math.min(V,Math.max(k,C))}function _(C,k,V){var ie=V-k,xe=((C-k)%ie+ie)%ie+k;return xe===k?V:xe}function w(C,k,V){if(!C.length)return V(null,[]);var ie=C.length,xe=new Array(C.length),Ie=null;C.forEach(function(qe,ht){k(qe,function(Rt,Ht){Rt&&(Ie=Rt),xe[ht]=Ht,--ie===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 ie in C)ie in k||V.push(ie);return V}function g(C){for(var k=[],V=arguments.length-1;V-- >0;)k[V]=arguments[V+1];for(var ie=0,xe=k;ie>k/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,C)}return C()}function f(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 ie={};for(var xe in C)ie[xe]=k.call(V||this,C[xe],xe,C);return ie}function B(C,k,V){var ie={};for(var xe in C)k.call(V||this,C[xe],xe,C)&&(ie[xe]=C[xe]);return ie}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,ie=C.length,xe=ie-1,Ie=void 0,qe=void 0;V@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,V={};if(C.replace(k,function(xe,Ie,qe,ht){var Rt=qe||ht;return V[Ie]=Rt?Rt.toLowerCase():!0,""}),V["max-age"]){var ie=parseInt(V["max-age"],10);isNaN(ie)?delete V["max-age"]:V["max-age"]=ie}return V}var H=null;function $(C){if(H==null){var k=C.navigator?C.navigator.userAgent:null;H=!!C.safari||!!(k&&(/\b(iPad|iPhone|iPod)\b/.test(k)||k.match("Safari")&&!k.match("Chrome")))}return H}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 ne=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:ne,frame:function(k){var V=j(k);return{cancel:function(){return ee(V)}}},getImageData:function(k,V){V===void 0&&(V=0);var ie=s.document.createElement("canvas"),xe=ie.getContext("2d");if(!xe)throw new Error("failed to create canvas 2d context");return ie.width=k.width,ie.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,We=!1,it,ot=!1;s.document&&(it=s.document.createElement("img"),it.onload=function(){Re&&ut(Re),Re=null,ot=!0},it.onerror=function(){We=!0,Re=null},it.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");function tt(C){We||!it||(ot?ut(C):Re=C)}function ut(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),We=!0}var Me="01";function _e(){for(var C="1",k="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",V="",ie=0;ie<10;ie++)V+=k[Math.floor(Math.random()*62)];var xe=12*60*60*1e3,Ie=[C,Me,V].join(""),qe=Date.now()+xe;return{token:Ie,tokenExpiresAt:qe}}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 ie=qt(k);return ie.path="/styles/v1"+ie.path,this._makeAPIURL(ie,this._customAccessToken||V)},fe.prototype.normalizeGlyphsURL=function(k,V){if(!Fe(k))return k;var ie=qt(k);return ie.path="/fonts/v1"+ie.path,this._makeAPIURL(ie,this._customAccessToken||V)},fe.prototype.normalizeSourceURL=function(k,V){if(!Fe(k))return k;var ie=qt(k);return ie.path="/v4/"+ie.authority+".json",ie.params.push("secure"),this._makeAPIURL(ie,this._customAccessToken||V)},fe.prototype.normalizeSpriteURL=function(k,V,ie,xe){var Ie=qt(k);return Fe(k)?(Ie.path="/styles/v1"+Ie.path+"/sprite"+V+ie,this._makeAPIURL(Ie,this._customAccessToken||xe)):(Ie.path+=""+V+ie,Zt(Ie))},fe.prototype.normalizeTileURL=function(k,V){if(this._isSkuTokenExpired()&&this._createSkuToken(),k&&!Fe(k))return k;var ie=qt(k),xe=/(\.(png|jpg)\d*)(?=$)/,Ie=/^.+\/v4\//,qe=be.devicePixelRatio>=2||V===512?"@2x":"",ht=ze.supported?".webp":"$1";ie.path=ie.path.replace(xe,""+qe+ht),ie.path=ie.path.replace(Ie,"/"),ie.path="/v4"+ie.path;var Rt=this._customAccessToken||Lt(ie.params)||Ae.ACCESS_TOKEN;return Ae.REQUIRE_ACCESS_TOKEN&&Rt&&this._skuToken&&ie.params.push("sku="+this._skuToken),this._makeAPIURL(ie,Rt)},fe.prototype.canonicalizeTileURL=function(k,V){var ie="/v4/",xe=/\.[\w]+$/,Ie=qt(k);if(!Ie.path.match(/(^\/v4\/)/)||!Ie.path.match(xe))return k;var qe="mapbox://tiles/";qe+=Ie.path.replace(ie,"");var ht=Ie.params;return V&&(ht=ht.filter(function(Rt){return!Rt.match(/^access_token=/)})),ht.length&&(qe+="?"+ht.join("&")),qe},fe.prototype.canonicalizeTileset=function(k,V){for(var ie=V?Fe(V):!1,xe=[],Ie=0,qe=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. "+ie);if(V[0]==="s")throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+ie);return k.params=k.params.filter(function(qe){return qe.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,ie,xe){var Ie=this;if(Ae.EVENTS_URL){var qe=qt(Ae.EVENTS_URL);qe.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:Me,userId:this.anonId},Rt=V?g(ht,V):ht,Ht={url:Zt(qe),headers:{"Content-Type":"text/plain"},body:JSON.stringify([Rt])};this.pendingRequest=ra(Ht,function(tr){Ie.pendingRequest=null,ie(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(ie,xe,Ie,qe){this.skuToken=Ie,(Ae.EVENTS_URL&&qe||Ae.ACCESS_TOKEN&&Array.isArray(ie)&&ie.some(function(ht){return Fe(ht)||st(ht)}))&&this.queueRequest({id:xe,timestamp:Date.now()},qe)},k.prototype.processRequests=function(ie){var xe=this;if(!(this.pendingRequest||this.queue.length===0)){var Ie=this.queue.shift(),qe=Ie.id,ht=Ie.timestamp;qe&&this.success[qe]||(this.anonId||this.fetchEventData(),P(this.anonId)||(this.anonId=y()),this.postEvent(ht,{skuToken:this.skuToken},function(Rt){Rt||qe&&(xe.success[qe]=!0)},ie))}},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(ie,xe){Ae.EVENTS_URL&&Ae.ACCESS_TOKEN&&Array.isArray(ie)&&ie.some(function(Ie){return Fe(Ie)||st(Ie)})&&this.queueRequest(Date.now(),xe)},k.prototype.processRequests=function(ie){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),qe=Ie?Ie.u:Ae.ACCESS_TOKEN,ht=qe!==this.eventData.tokenU;P(this.anonId)||(this.anonId=y(),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=qe)},ie)}},k}(jr),bt=new Ir,Be=bt.postTurnstileEvent.bind(bt),Ke=new wr,Ue=Ke.postMapLoadEvent.bind(Ke),Ee="mapbox-tiles",Ve=500,Ce=50,Te=1e3*60*7,Pe;function at(){s.caches&&!Pe&&(Pe=s.caches.open(Ee))}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 ie={status:k.status,statusText:k.statusText,headers:new s.Headers};k.headers.forEach(function(qe,ht){return ie.headers.set(ht,qe)});var xe=he(k.headers.get("Cache-Control")||"");if(!xe["no-store"]){xe["max-age"]&&ie.headers.set("Expires",new Date(V+xe["max-age"]*1e3).toUTCString());var Ie=new Date(ie.headers.get("Expires")).getTime()-V;IeDate.now()&&!V["no-cache"]}var Tr=1/0;function la(C){Tr++,Tr>Ce&&(C.getActor().send("enforceCacheSizeLimit",Ve),Tr=0)}function Ua(C){at(),Pe&&Pe.then(function(k){k.keys().then(function(V){for(var ie=0;ie=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 kn(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(se()&&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(g(C,{type:"json"}),k)},ma=function(C,k){return Pr(g(C,{type:"arrayBuffer"}),k)},ra=function(C,k){return Pr(g(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 rn(C,k,V,ie){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 qe=new s.Blob([new Uint8Array(C)],{type:"image/png"});xe.cacheControl=V,xe.expires=ie,xe.src=C.byteLength?Ie.createObjectURL(qe):Ha}function nn(C,k){var V=new s.Blob([new Uint8Array(C)],{type:"image/png"});s.createImageBitmap(V).then(function(ie){k(null,ie)}).catch(function(ie){k(new Error("Could not load image because of "+ie.message+". Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))})}var yn,xt,ct=function(){yn=[],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 yn.push(V),V}xt++;var ie=!1,xe=function(){if(!ie)for(ie=!0,xt--;yn.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:"*"}},na={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"],Zn={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Pn={"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"}},fi={"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"}},Ai={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},ki={"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"}},zi={"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"}},Xi={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},to={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},go={type:"array",value:"*"},pi={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"],qi={"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"}},Vo={"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"}},jn={$version:aa,$root:da,sources:fa,source:It,source_vector:dr,source_raster:kr,source_raster_dem:na,source_geojson:Ca,source_video:Fa,source_image:Ya,layer:ha,layout:Da,layout_background:Zn,layout_fill:Pn,layout_circle:fi,layout_heatmap:Ai,"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:ki,layout_symbol:zi,layout_raster:Xi,layout_hillshade:to,filter:go,filter_operator:pi,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:qi,"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:Vo,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},Ci=function(k,V,ie,xe){this.message=(k?k+": ":"")+ie,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 Ci(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 ie=0,xe=k;ie":C.itemType.kind==="value"?"array":"array<"+k+">"}else return C.kind}var nu=[rl,Si,po,ro,As,fl,al,zl($i),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,ie=nu;V255?255:Ht}function xe(Ht){return Ht<0?0:Ht>1?1:Ht}function Ie(Ht){return Ht[Ht.length-1]==="%"?ie(parseFloat(Ht)/100*255):ie(parseInt(Ht))}function qe(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("("),Vr=tr.indexOf(")");if(Xr!==-1&&Vr+1===tr.length){var pa=tr.substr(0,Xr),ja=tr.substr(Xr+1,Vr-(Xr+1)).split(","),Cn=1;switch(pa){case"rgba":if(ja.length!==4)return null;Cn=qe(ja.pop());case"rgb":return ja.length!==3?null:[Ie(ja[0]),Ie(ja[1]),Ie(ja[2]),Cn];case"hsla":if(ja.length!==4)return null;Cn=qe(ja.pop());case"hsl":if(ja.length!==3)return null;var un=(parseFloat(ja[0])%360+360)%360/360,ti=qe(ja[1]),Un=qe(ja[2]),ei=Un<=.5?Un*(ti+1):Un+ti-Un*ti,li=Un*2-ei;return[ie(ht(li,ei,un+1/3)*255),ie(ht(li,ei,un)*255),ie(ht(li,ei,un-1/3)*255),Cn];default:return null}}return null}try{k.parseCSSColor=Rt}catch{}}),pf=Af.parseCSSColor,Us=function(k,V,ie,xe){xe===void 0&&(xe=1),this.r=k,this.g=V,this.b=ie,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],ie=k[1],xe=k[2],Ie=k[3];return"rgba("+Math.round(V)+","+Math.round(ie)+","+Math.round(xe)+","+Ie+")"},Us.prototype.toArray=function(){var k=this,V=k.r,ie=k.g,xe=k.b,Ie=k.a;return Ie===0?[0,0,0,0]:[V*255/Ie,ie*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 qc=function(k,V,ie){k?this.sensitivity=V?"variant":"case":this.sensitivity=V?"accent":"base",this.locale=ie,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};qc.prototype.compare=function(k,V){return this.collator.compare(k,V)},qc.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var Sf=function(k,V,ie,xe,Ie){this.text=k,this.image=V,this.scale=ie,this.fontStack=xe,this.textColor=Ie},iu=function(k){this.sections=k};iu.fromString=function(k){return new iu([new Sf(k,null,null,null,null)])},iu.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})},iu.factory=function(k){return k instanceof iu?k:iu.fromString(k)},iu.prototype.toString=function(){return this.sections.length===0?"":this.sections.map(function(k){return k.text}).join("")},iu.prototype.serialize=function(){for(var k=["format"],V=0,ie=this.sections;V=0&&C<=255&&typeof k=="number"&&k>=0&&k<=255&&typeof V=="number"&&V>=0&&V<=255)){var xe=typeof ie=="number"?[C,k,V,ie]:[C,k,V];return"Invalid rgba value ["+xe.join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}return typeof ie>"u"||typeof ie=="number"&&ie>=0&&ie<=1?null:"Invalid rgba value ["+[C,k,V,ie].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 qc)return!0;if(C instanceof iu)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 ic)||ht==="object")return V.error('The item type argument of "array" must be one of string, number, boolean',1);qe=ic[ht],ie++}else qe=$i;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],ie++}xe=zl(qe,Rt)}else xe=ic[Ie];for(var Ht=[];ie1)&&V.push(xe)}}return V.concat(this.args.map(function(Ie){return Ie.serialize()}))};var Vu=function(k){this.type=fl,this.sections=k};Vu.parse=function(k,V){if(k.length<2)return V.error("Expected at least one argument.");var ie=k[1];if(!Array.isArray(ie)&&typeof ie=="object")return V.error("First argument must be an image or text section.");for(var xe=[],Ie=!1,qe=1;qe<=k.length-1;++qe){var ht=k[qe];if(Ie&&typeof ht=="object"&&!Array.isArray(ht)){Ie=!1;var Rt=null;if(ht["font-scale"]&&(Rt=V.parse(ht["font-scale"],1,Si),!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[qe],1,$i);if(!Xr)return null;var Vr=Xr.type.kind;if(Vr!=="string"&&Vr!=="value"&&Vr!=="null"&&Vr!=="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 Vu(xe)},Vu.prototype.evaluate=function(k){var V=function(ie){var xe=ie.content.evaluate(k);return nl(xe)===xu?new Sf("",xe,null,null,null):new Sf(vl(xe),null,ie.scale?ie.scale.evaluate(k):null,ie.font?ie.font.evaluate(k).join(","):null,ie.textColor?ie.textColor.evaluate(k):null)};return new iu(this.sections.map(V))},Vu.prototype.eachChild=function(k){for(var V=0,ie=this.sections;V-1),ie},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":Si,"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 ie=k[0];if((ie==="to-boolean"||ie==="to-string")&&k.length!==2)return V.error("Expected one argument.");for(var xe=yh[ie],Ie=[],qe=1;qe4?ie="Invalid rbga value "+JSON.stringify(V)+": expected an array containing either three or four numeric values.":ie=nc(V[0],V[1],V[2],V[3]),!ie))return new Us(V[0]/255,V[1]/255,V[2]/255,V[3])}throw new qs(ie||"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]),ie=rf(C[1]),xe=Math.pow(2,k.z);return[Math.round(V*xe*Ul),Math.round(ie*xe*Ul)]}function zf(C,k,V){var ie=C[0]-k[0],xe=C[1]-k[1],Ie=C[0]-V[0],qe=C[1]-V[1];return ie*qe-Ie*xe===0&&ie*Ie<=0&&xe*qe<=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,ie=0,xe=k.length;ie0&&Cr<0||tr<0&&Cr>0}function Ef(C,k,V,ie){var xe=[k[0]-C[0],k[1]-C[1]],Ie=[ie[0]-V[0],ie[1]-V[1]];return Of(Ie,xe)===0?!1:!!(Gu(C,k,V,ie)&&Gu(V,ie,C,k))}function oc(C,k,V){for(var ie=0,xe=V;ieV[2]){var xe=ie*.5,Ie=C[0]-V[0]>xe?-ie:V[0]-C[0]>xe?ie:0;Ie===0&&(Ie=C[0]-V[2]>xe?-ie:V[2]-C[0]>xe?ie: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,ie){for(var xe=Math.pow(2,ie.z)*Ul,Ie=[ie.x*Ul,ie.y*Ul],qe=[],ht=0,Rt=C;ht=0)return!1;var V=!0;return C.eachChild(function(ie){V&&!Lu(ie,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 ie=k[1];return V.scope.has(ie)?new Ac(ie,V.scope.get(ie)):V.error('Unknown variable "'+ie+'". Make sure "'+ie+'" 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 il=function(k,V,ie,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(qe){return"["+qe+"]"}).join(""),this.scope=xe,this.errors=Ie,this.expectedType=ie};il.prototype.parse=function(k,V,ie,xe,Ie){return Ie===void 0&&(Ie={}),V?this.concat(V,ie,xe)._parse(k,Ie):this._parse(k,Ie)},il.prototype._parse=function(k,V){(k===null||typeof k=="string"||typeof k=="boolean"||typeof k=="number")&&(k=["literal",k]);function ie(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 qe=Ie.parse(k,this);if(!qe)return null;if(this.expectedType){var ht=this.expectedType,Rt=qe.type;if((ht.kind==="string"||ht.kind==="number"||ht.kind==="boolean"||ht.kind==="object"||ht.kind==="array")&&Rt.kind==="value")qe=ie(qe,ht,V.typeAnnotation||"assert");else if((ht.kind==="color"||ht.kind==="formatted"||ht.kind==="resolvedImage")&&(Rt.kind==="value"||Rt.kind==="string"))qe=ie(qe,ht,V.typeAnnotation||"coerce");else if(this.checkSubtype(ht,Rt))return null}if(!(qe instanceof gs)&&qe.type.kind!=="resolvedImage"&&dc(qe)){var Ht=new Ss;try{qe=new gs(qe.type,qe.evaluate(Ht))}catch(tr){return this.error(tr.message),null}}return qe}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.")},il.prototype.concat=function(k,V,ie){var xe=typeof k=="number"?this.path.concat(k):this.path,Ie=ie?this.scope.concat(ie):this.scope;return new il(this.registry,xe,V||null,Ie,this.errors)},il.prototype.error=function(k){for(var V=[],ie=arguments.length-1;ie-- >0;)V[ie]=arguments[ie+1];var xe=""+this.key+V.map(function(Ie){return"["+Ie+"]"}).join("");this.errors.push(new ms(xe,k))},il.prototype.checkSubtype=function(k,V){var ie=Eu(k,V);return ie&&this.error(ie),ie};function dc(C){if(C instanceof Ac)return dc(C.boundExpression);if(C instanceof Qi&&C.name==="error")return!1;if(C instanceof qu)return!1;if(C instanceof ku)return!1;var k=C instanceof ls||C instanceof Nl,V=!0;return C.eachChild(function(ie){k?V=V&&dc(ie):V=V&&ie 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,ie=0,xe=V,Ie=0,qe,ht;ie<=xe;)if(Ie=Math.floor((ie+xe)/2),qe=C[Ie],ht=C[Ie+1],qe<=k){if(Ie===V||kk)xe=Ie-1;else throw new qs("Input is not a number.");return 0}var bu=function(k,V,ie){this.type=k,this.input=V,this.labels=[],this.outputs=[];for(var xe=0,Ie=ie;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,ie,xe)},bu.prototype.evaluate=function(k){var V=this.labels,ie=this.outputs;if(V.length===1)return ie[0].evaluate(k);var xe=this.input.evaluate(k);if(xe<=V[0])return ie[0].evaluate(k);var Ie=V.length;if(xe>=V[Ie-1])return ie[Ie-1].evaluate(k);var qe=vu(V,xe);return ie[qe].evaluate(k)},bu.prototype.eachChild=function(k){k(this.input);for(var V=0,ie=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(ie,xe){return Ml(ie,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),ie=mu(C.b),xe=uh((.4124564*k+.3575761*V+.1804375*ie)/Sc),Ie=uh((.2126729*k+.7151522*V+.072175*ie)/vc),qe=uh((.0193339*k+.119192*V+.9503041*ie)/Lh);return{l:116*Ie-16,a:500*(xe-Ie),b:200*(Ie-qe),alpha:C.a}}function kf(C){var k=(C.l+16)/116,V=isNaN(C.a)?k:k+C.a/500,ie=isNaN(C.b)?k:k-C.b/200;return k=vc*vf(k),V=Sc*vf(V),ie=Lh*vf(ie),new Us(ol(3.2404542*V-1.5371385*k-.4985314*ie),ol(-.969266*V+1.8760108*k+.041556*ie),ol(.0556434*V-.2040259*k+1.0572252*ie),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,ie=k.a,xe=k.b,Ie=Math.atan2(xe,ie)*Xc;return{h:Ie<0?Ie+360:Ie,c:Math.sqrt(ie*ie+xe*xe),l:V,alpha:C.a}}function Mc(C){var k=C.h*tu,V=C.c,ie=C.l;return kf({l:ie,a:Math.cos(k)*V,b:Math.sin(k)*V,alpha:C.alpha})}function Hu(C,k,V){var ie=k-C;return C+V*(ie>180||ie<-180?ie-360*Math.round(ie/360):ie)}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,ie,xe,Ie){this.type=k,this.operator=V,this.interpolation=ie,this.input=xe,this.labels=[],this.outputs=[];for(var qe=0,ht=Ie;qe1}))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,Si),!Ie)return null;var Ht=[],tr=null;ie==="interpolate-hcl"||ie==="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 Cn=V.parse(Vr,ja,tr);if(!Cn)return null;tr=tr||Cn.type,Ht.push([Xr,Cn])}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,ie,xe,Ie,Ht)},ru.prototype.evaluate=function(k){var V=this.labels,ie=this.outputs;if(V.length===1)return ie[0].evaluate(k);var xe=this.input.evaluate(k);if(xe<=V[0])return ie[0].evaluate(k);var Ie=V.length;if(xe>=V[Ie-1])return ie[Ie-1].evaluate(k);var qe=vu(V,xe),ht=V[qe],Rt=V[qe+1],Ht=ru.interpolationFactor(this.interpolation,xe,ht,Rt),tr=ie[qe].evaluate(k),Cr=ie[qe+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,ie=this.outputs;V=ie.length)throw new qs("Array index out of bounds: "+V+" > "+(ie.length-1)+".");if(V!==Math.floor(V))throw new qs("Array index must be an integer, but found "+V+" instead.");return ie[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 ie=V.parse(k[1],1,$i),xe=V.parse(k[2],2,$i);return!ie||!xe?null:Bc(ie.type,[ro,po,Si,rl,$i])?new jl(ie,xe):V.error("Expected first argument to be of type boolean, string, number or null, but found "+Ns(ie.type)+" instead")},jl.prototype.evaluate=function(k){var V=this.needle.evaluate(k),ie=this.haystack.evaluate(k);if(!ie)return!1;if(!Cu(V,["boolean","string","number","null"]))throw new qs("Expected first argument to be of type boolean, string, number or null, but found "+Ns(nl(V))+" instead.");if(!Cu(ie,["string","array"]))throw new qs("Expected second argument to be of type array or string, but found "+Ns(nl(ie))+" instead.");return ie.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,ie){this.type=Si,this.needle=k,this.haystack=V,this.fromIndex=ie};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 ie=V.parse(k[1],1,$i),xe=V.parse(k[2],2,$i);if(!ie||!xe)return null;if(!Bc(ie.type,[ro,po,Si,rl,$i]))return V.error("Expected first argument to be of type boolean, string, number or null, but found "+Ns(ie.type)+" instead");if(k.length===4){var Ie=V.parse(k[3],3,Si);return Ie?new gu(ie,xe,Ie):null}else return new gu(ie,xe)},gu.prototype.evaluate=function(k){var V=this.needle.evaluate(k),ie=this.haystack.evaluate(k);if(!Cu(V,["boolean","string","number","null"]))throw new qs("Expected first argument to be of type boolean, string, number or null, but found "+Ns(nl(V))+" instead.");if(!Cu(ie,["string","array"]))throw new qs("Expected second argument to be of type array or string, but found "+Ns(nl(ie))+" instead.");if(this.fromIndex){var xe=this.fromIndex.evaluate(k);return ie.indexOf(V,xe)}return ie.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,ie,xe,Ie,qe){this.inputType=k,this.type=V,this.input=ie,this.cases=xe,this.outputs=Ie,this.otherwise=qe};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 ie,xe;V.expectedType&&V.expectedType.kind!=="value"&&(xe=V.expectedType);for(var Ie={},qe=[],ht=2;htNumber.MAX_SAFE_INTEGER)return tr.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if(typeof Vr=="number"&&Math.floor(Vr)!==Vr)return tr.error("Numeric branch labels must be integer values.");if(!ie)ie=nl(Vr);else if(tr.checkSubtype(ie,nl(Vr)))return null;if(typeof Ie[String(Vr)]<"u")return tr.error("Branch labels must be unique.");Ie[String(Vr)]=qe.length}var pa=V.parse(Ht,ht,xe);if(!pa)return null;xe=xe||pa.type,qe.push(pa)}var ja=V.parse(k[1],1,$i);if(!ja)return null;var Cn=V.parse(k[k.length-1],k.length-1,xe);return!Cn||ja.type.kind!=="value"&&V.concat(1).checkSubtype(ie,ja.type)?null:new Cc(ie,xe,ja,Ie,qe,Cn)},Cc.prototype.evaluate=function(k){var V=this.input.evaluate(k),ie=nl(V)===this.inputType&&this.outputs[this.cases[V]]||this.otherwise;return ie.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()],ie=Object.keys(this.cases).sort(),xe=[],Ie={},qe=0,ht=ie;qe=5)return V.error("Expected 3 or 4 arguments, but found "+(k.length-1)+" instead.");var ie=V.parse(k[1],1,$i),xe=V.parse(k[2],2,Si);if(!ie||!xe)return null;if(!Bc(ie.type,[zl($i),po,$i]))return V.error("Expected first argument to be of type array or string, but found "+Ns(ie.type)+" instead");if(k.length===4){var Ie=V.parse(k[3],3,Si);return Ie?new sc(ie.type,ie,xe,Ie):null}else return new sc(ie.type,ie,xe)},sc.prototype.evaluate=function(k){var V=this.input.evaluate(k),ie=this.beginIndex.evaluate(k);if(!Cu(V,["string","array"]))throw new qs("Expected first argument to be of type array or string, but found "+Ns(nl(V))+" instead.");if(this.endIndex){var xe=this.endIndex.evaluate(k);return V.slice(ie,xe)}return V.slice(ie)},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 ia(C,k,V){return kV}function La(C,k,V){return k<=V}function pn(C,k,V){return k>=V}function In(C,k,V,ie){return ie.compare(k,V)===0}function Yn(C,k,V,ie){return!In(C,k,V,ie)}function ri(C,k,V,ie){return ie.compare(k,V)<0}function di(C,k,V,ie){return ie.compare(k,V)>0}function Dn(C,k,V,ie){return ie.compare(k,V)<=0}function On(C,k,V,ie){return ie.compare(k,V)>=0}function qn(C,k,V){var ie=C!=="=="&&C!=="!=";return function(){function xe(Ie,qe,ht){this.type=ro,this.lhs=Ie,this.rhs=qe,this.collator=ht,this.hasUntypedArgument=Ie.type.kind==="value"||qe.type.kind==="value"}return xe.parse=function(qe,ht){if(qe.length!==3&&qe.length!==4)return ht.error("Expected two or three arguments.");var Rt=qe[0],Ht=ht.parse(qe[1],1,$i);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(qe[2],2,$i);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)+"'.");ie&&(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(qe.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(qe[3],3,au),!Cr)return null}return new xe(Ht,tr,Cr)},xe.prototype.evaluate=function(qe){var ht=this.lhs.evaluate(qe),Rt=this.rhs.evaluate(qe);if(ie&&this.hasUntypedArgument){var Ht=nl(ht),tr=nl(Rt);if(Ht.kind!==tr.kind||!(Ht.kind==="string"||Ht.kind==="number"))throw new qs('Expected arguments for "'+C+'" to be (string, string) or (number, number), but found ('+Ht.kind+", "+tr.kind+") instead.")}if(this.collator&&!ie&&this.hasUntypedArgument){var Cr=nl(ht),Xr=nl(Rt);if(Cr.kind!=="string"||Xr.kind!=="string")return k(qe,ht,Rt)}return this.collator?V(qe,ht,Rt,this.collator.evaluate(qe)):k(qe,ht,Rt)},xe.prototype.eachChild=function(qe){qe(this.lhs),qe(this.rhs),this.collator&&qe(this.collator)},xe.prototype.outputDefined=function(){return!0},xe.prototype.serialize=function(){var qe=[C];return this.eachChild(function(ht){qe.push(ht.serialize())}),qe},xe}()}var xn=qn("==",er,In),Mi=qn("!=",yr,Yn),Ki=qn("<",ia,ri),ao=qn(">",$r,di),Ji=qn("<=",La,Dn),co=qn(">=",pn,On),wi=function(k,V,ie,xe,Ie){this.type=po,this.number=k,this.locale=V,this.currency=ie,this.minFractionDigits=xe,this.maxFractionDigits=Ie};wi.parse=function(k,V){if(k.length!==3)return V.error("Expected two arguments.");var ie=V.parse(k[1],1,Si);if(!ie)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 qe=null;if(xe.currency&&(qe=V.parse(xe.currency,1,po),!qe))return null;var ht=null;if(xe["min-fraction-digits"]&&(ht=V.parse(xe["min-fraction-digits"],1,Si),!ht))return null;var Rt=null;return xe["max-fraction-digits"]&&(Rt=V.parse(xe["max-fraction-digits"],1,Si),!Rt)?null:new wi(ie,Ie,qe,ht,Rt)},wi.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))},wi.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)},wi.prototype.outputDefined=function(){return!1},wi.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 ui=function(k){this.type=Si,this.input=k};ui.parse=function(k,V){if(k.length!==2)return V.error("Expected 1 argument, but found "+(k.length-1)+" instead.");var ie=V.parse(k[1],1);return ie?ie.type.kind!=="array"&&ie.type.kind!=="string"&&ie.type.kind!=="value"?V.error("Expected argument of type string or array, but found "+Ns(ie.type)+" instead."):new ui(ie):null},ui.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 qs("Expected value to be of type string or array, but found "+Ns(nl(V))+" instead.")},ui.prototype.eachChild=function(k){k(this.input)},ui.prototype.outputDefined=function(){return!1},ui.prototype.serialize=function(){var k=["length"];return this.eachChild(function(V){k.push(V.serialize())}),k};var xo={"==":xn,"!=":Mi,">":ao,"<":Ki,">=":co,"<=":Ji,array:Nl,at:mc,boolean:Nl,case:Yc,coalesce:Xu,collator:qu,format:Vu,image:cl,in:jl,"index-of":gu,interpolate:ru,"interpolate-hcl":ru,"interpolate-lab":ru,length:ui,let:Ec,literal:gs,match:Cc,number:Nl,"number-format":wi,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],ie=k[1],xe=k[2],Ie=k[3];V=V.evaluate(C),ie=ie.evaluate(C),xe=xe.evaluate(C);var qe=Ie?Ie.evaluate(C):1,ht=nc(V,ie,xe,qe);if(ht)throw new qs(ht);return new Us(V/255*qe,ie/255*qe,xe/255*qe,qe)}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,ie){for(;V<=ie;){var xe=V+ie>>1;if(k[xe]===C)return!0;k[xe]>C?ie=xe-1:V=xe+1}return!1}function Ks(C){return{type:C}}Qi.register(xo,{error:[zs,[po],function(C,k){var V=k[0];throw new qs(V.evaluate(C))}],typeof:[po,[$i],function(C,k){var V=k[0];return Ns(nl(V.evaluate(C)))}],"to-rgba":[zl(Si,4),[As],function(C,k){var V=k[0];return V.evaluate(C).toArray()}],rgb:[As,[Si,Si,Si],Qo],rgba:[As,[Si,Si,Si,Si],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],ie=k[1];return xs(V.evaluate(C),ie.evaluate(C))}]]},get:{type:$i,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],ie=k[1];return Qs(V.evaluate(C),ie.evaluate(C))}]]},"feature-state":[$i,[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:[$i,[],function(C){return C.id()}],zoom:[Si,[],function(C){return C.globals.zoom}],"heatmap-density":[Si,[],function(C){return C.globals.heatmapDensity||0}],"line-progress":[Si,[],function(C){return C.globals.lineProgress||0}],accumulated:[$i,[],function(C){return C.globals.accumulated===void 0?null:C.globals.accumulated}],"+":[Si,Ks(Si),function(C,k){for(var V=0,ie=0,xe=k;ie":[ro,[po,$i],function(C,k){var V=k[0],ie=k[1],xe=C.properties()[V.value],Ie=ie.value;return typeof xe==typeof Ie&&xe>Ie}],"filter-id->":[ro,[$i],function(C,k){var V=k[0],ie=C.id(),xe=V.value;return typeof ie==typeof xe&&ie>xe}],"filter-<=":[ro,[po,$i],function(C,k){var V=k[0],ie=k[1],xe=C.properties()[V.value],Ie=ie.value;return typeof xe==typeof Ie&&xe<=Ie}],"filter-id-<=":[ro,[$i],function(C,k){var V=k[0],ie=C.id(),xe=V.value;return typeof ie==typeof xe&&ie<=xe}],"filter->=":[ro,[po,$i],function(C,k){var V=k[0],ie=k[1],xe=C.properties()[V.value],Ie=ie.value;return typeof xe==typeof Ie&&xe>=Ie}],"filter-id->=":[ro,[$i],function(C,k){var V=k[0],ie=C.id(),xe=V.value;return typeof ie==typeof xe&&ie>=xe}],"filter-has":[ro,[$i],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($i)],function(C,k){var V=k[0];return V.value.indexOf(C.id())>=0}],"filter-in-small":[ro,[po,zl($i)],function(C,k){var V=k[0],ie=k[1];return ie.value.indexOf(C.properties()[V.value])>=0}],"filter-in-large":[ro,[po,zl($i)],function(C,k){var V=k[0],ie=k[1];return Rs(C.properties()[V.value],ie.value,0,ie.value.length-1)}],all:{type:ro,overloads:[[[ro,ro],function(C,k){var V=k[0],ie=k[1];return V.evaluate(C)&&ie.evaluate(C)}],[Ks(ro),function(C,k){for(var V=0,ie=k;V-1}function Ui(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",ie=C.stops&&typeof C.stops[0][0]=="object",xe=ie||C.property!==void 0,Ie=ie||!xe,qe=C.type||(Ui(k)?"exponential":"interval");if(V&&(C=Bs({},C),C.stops&&(C.stops=C.stops.map(function(Ni){return[Ni[0],Us.parse(Ni[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(qe==="exponential")ht=yu;else if(qe==="interval")ht=Lc;else if(qe==="categorical"){ht=Zu,Rt=Object.create(null);for(var tr=0,Cr=C.stops;tr=C.stops[ie-1][0])return C.stops[ie-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 ie=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),qe=wu(V,ie,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),qe))}}return typeof ht.evaluate=="function"?{evaluate:function(){for(var Xr=[],Vr=arguments.length;Vr--;)Xr[Vr]=arguments[Vr];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,qe)}}:Ht(ht,Rt,qe)}function Pc(C,k,V){return k.type==="color"?V=Us.parse(V):k.type==="formatted"?V=iu.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,ie){var xe=ie-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,ie,xe,Ie,qe){return this._evaluator.globals=k,this._evaluator.feature=V,this._evaluator.featureState=ie,this._evaluator.canonical=xe,this._evaluator.availableImages=Ie||null,this._evaluator.formattedSection=qe,this.expression.evaluate(this._evaluator)},gc.prototype.evaluate=function(k,V,ie,xe,Ie,qe){this._evaluator.globals=k,this._evaluator.feature=V||null,this._evaluator.featureState=ie||null,this._evaluator.canonical=xe,this._evaluator.availableImages=Ie||null,this._evaluator.formattedSection=qe||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 qs("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 xo}function zo(C,k){var V=new il(xo,[],k?we(k):void 0),ie=V.parse(C,void 0,void 0,void 0,k&&k.type==="string"?{typeAnnotation:"coerce"}:void 0);return ie?ys(new gc(ie,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,ie,xe,Ie,qe){return this._styleExpression.evaluateWithoutErrorHandling(k,V,ie,xe,Ie,qe)},Ic.prototype.evaluate=function(k,V,ie,xe,Ie,qe){return this._styleExpression.evaluate(k,V,ie,xe,Ie,qe)};var lc=function(k,V,ie,xe){this.kind=k,this.zoomStops=ie,this._styleExpression=V,this.isStateDependent=k!=="camera"&&!ml(V.expression),this.interpolationType=xe};lc.prototype.evaluateWithoutErrorHandling=function(k,V,ie,xe,Ie,qe){return this._styleExpression.evaluateWithoutErrorHandling(k,V,ie,xe,Ie,qe)},lc.prototype.evaluate=function(k,V,ie,xe,Ie,qe){return this._styleExpression.evaluate(k,V,ie,xe,Ie,qe)},lc.prototype.interpolationFactor=function(k,V,ie){return this.interpolationType?ru.interpolationFactor(this.interpolationType,k,V,ie):0};function Yu(C,k){if(C=zo(C,k),C.result==="error")return C;var V=C.value.expression,ie=Nf(V);if(!ie&&!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&&!Ui(k))return Fl([new ms("",'"interpolate" expressions cannot be used with this property')]);if(!Ie)return ys(ie?new Ic("constant",C.value):new Ic("source",C.value));var qe=Ie instanceof ru?Ie.interpolation:void 0;return ys(ie?new lc("camera",C.value,Ie.labels,qe):new lc("composite",C.value,Ie.labels,qe))}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 ie=C;return typeof C=="string"&&k.type==="color"&&(ie=Us.parse(C)),{kind:"constant",evaluate:function(){return ie}}}}function ae(C){var k=null;if(C instanceof Ec)k=ae(C.result);else if(C instanceof Xu)for(var V=0,ie=C.args;Vie.maximum?[new Ci(k,V,V+" is greater than the maximum value "+ie.maximum)]:[]}function Bt(C){var k=C.valueSpec,V=uo(C.value.type),ie,xe={},Ie,qe,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 Ci(C.key,C.value,'missing required property "property"')),V!=="identity"&&!C.value.stops&&tr.push(new Ci(C.key,C.value,'missing required property "stops"')),V==="exponential"&&C.valueSpec.expression&&!Ui(C.valueSpec)&&tr.push(new Ci(C.key,C.value,"exponential functions not supported")),C.styleSpec.$version>=8&&(Rt&&!yl(C.valueSpec)?tr.push(new Ci(C.key,C.value,"property functions not supported")):ht&&!sl(C.valueSpec)&&tr.push(new Ci(C.key,C.value,"zoom functions not supported"))),(V==="categorical"||Ht)&&C.value.property===void 0&&tr.push(new Ci(C.key,C.value,'"property" property is required')),tr;function Cr(ja){if(V==="identity")return[new Ci(ja.key,ja.value,'identity function may not have a "stops" property')];var Cn=[],un=ja.value;return Cn=Cn.concat(pt({key:ja.key,value:un,valueSpec:ja.valueSpec,style:ja.style,styleSpec:ja.styleSpec,arrayElementValidator:Xr})),Io(un)==="array"&&un.length===0&&Cn.push(new Ci(ja.key,un,"array must have at least one stop")),Cn}function Xr(ja){var Cn=[],un=ja.value,ti=ja.key;if(Io(un)!=="array")return[new Ci(ti,un,"array expected, "+Io(un)+" found")];if(un.length!==2)return[new Ci(ti,un,"array length 2 expected, length "+un.length+" found")];if(Ht){if(Io(un[0])!=="object")return[new Ci(ti,un,"object expected, "+Io(un[0])+" found")];if(un[0].zoom===void 0)return[new Ci(ti,un,"object stop key must have zoom")];if(un[0].value===void 0)return[new Ci(ti,un,"object stop key must have value")];if(qe&&qe>uo(un[0].zoom))return[new Ci(ti,un[0].zoom,"stop zoom values must appear in ascending order")];uo(un[0].zoom)!==qe&&(qe=uo(un[0].zoom),Ie=void 0,xe={}),Cn=Cn.concat(Oe({key:ti+"[0]",value:un[0],valueSpec:{zoom:{}},style:ja.style,styleSpec:ja.styleSpec,objectElementValidators:{zoom:At,value:Vr}}))}else Cn=Cn.concat(Vr({key:ti+"[0]",value:un[0],valueSpec:{},style:ja.style,styleSpec:ja.styleSpec},un));return fo($s(un[1]))?Cn.concat([new Ci(ti+"[1]",un[1],"expressions are not allowed in function stops.")]):Cn.concat(So({key:ti+"[1]",value:un[1],valueSpec:k,style:ja.style,styleSpec:ja.styleSpec}))}function Vr(ja,Cn){var un=Io(ja.value),ti=uo(ja.value),Un=ja.value!==null?ja.value:Cn;if(!ie)ie=un;else if(un!==ie)return[new Ci(ja.key,Un,un+" stop domain type must match previous stop domain type "+ie)];if(un!=="number"&&un!=="string"&&un!=="boolean")return[new Ci(ja.key,Un,"stop domain value must be a number, string, or boolean")];if(un!=="number"&&V!=="categorical"){var ei="number expected, "+un+" found";return yl(k)&&V===void 0&&(ei+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Ci(ja.key,Un,ei)]}return V==="categorical"&&un==="number"&&(!isFinite(ti)||Math.floor(ti)!==ti)?[new Ci(ja.key,Un,"integer expected, found "+ti)]:V!=="categorical"&&un==="number"&&Ie!==void 0&&ti=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(lt)]]:["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 Ci(V,k,"array expected, "+Io(k)+" found")];var ie=C.styleSpec,xe,Ie=[];if(k.length<1)return[new Ci(V,k,"filter array must have at least 1 element")];switch(Ie=Ie.concat(Yr({key:V+"[0]",value:k[0],valueSpec:ie.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 Ci(V,k,'"$type" cannot be use with operator "'+k[0]+'"'));case"==":case"!=":k.length!==3&&Ie.push(new Ci(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 Ci(V+"[1]",k[1],"string expected, "+xe+" found")));for(var qe=2;qe=tr[Vr+0]&&ie>=tr[Vr+1])?(qe[Xr]=!0,Ie.push(Ht[Xr])):qe[Xr]=!1}}},su.prototype._forEachCell=function(C,k,V,ie,xe,Ie,qe,ht){for(var Rt=this._convertToCellCoord(C),Ht=this._convertToCellCoord(k),tr=this._convertToCellCoord(V),Cr=this._convertToCellCoord(ie),Xr=Rt;Xr<=tr;Xr++)for(var Vr=Ht;Vr<=Cr;Vr++){var pa=this.d*Vr+Xr;if(!(ht&&!ht(this._convertFromCellCoord(Xr),this._convertFromCellCoord(Vr),this._convertFromCellCoord(Xr+1),this._convertFromCellCoord(Vr+1)))&&xe.call(this,C,k,V,ie,pa,Ie,qe,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,ie=0;ie=0)){var Cr=C[tr];Ht[tr]=ql[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=ql[k],ie=V.klass;if(!ie)throw new Error("can't deserialize unregistered class "+k);if(ie.deserialize)return ie.deserialize(C);for(var xe=Object.create(ie.prototype),Ie=0,qe=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 ie=Math.floor(k);return this.first?(this.first=!1,this.lastIntegerZoom=ie,this.lastIntegerZoomTime=0,this.lastZoom=k,this.lastFloorZoom=ie,!0):(this.lastFloorZoom>ie?(this.lastIntegerZoom=ie+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 tn(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 on(C){return!(ya(C)||tn(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 mn(C){for(var k=0,V=C;k-1&&(ni=Pa.error),si&&si(C)};function Zi(){eo.fire(new Gr("pluginStateChange",{pluginStatus:ni,pluginURL:vi}))}var eo=new Ur,$o=function(){return ni},no=function(C){return C({pluginStatus:ni,pluginURL:vi}),eo.on("pluginStateChange",C),C},Zo=function(C,k,V){if(V===void 0&&(V=!1),ni===Pa.deferred||ni===Pa.loading||ni===Pa.loaded)throw new Error("setRTLTextPlugin cannot be called multiple times.");vi=be.resolveURL(C),ni=Pa.deferred,si=k,Zi(),V||ul()},ul=function(){if(ni!==Pa.deferred||!vi)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");ni=Pa.loading,Zi(),vi&&ma({url:vi},function(C){C?Pi(C):(ni=Pa.loaded,Zi())})},el={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return ni===Pa.loaded||el.applyArabicShaping!=null},isLoading:function(){return ni===Pa.loading},setState:function(k){ni=k.pluginStatus,vi=k.pluginURL},isParsed:function(){return el.applyArabicShaping!=null&&el.processBidirectionalText!=null&&el.processStyledBidirectionalText!=null},getPluginURL:function(){return vi}},_l=function(){!el.isLoading()&&!el.isLoaded()&&$o()==="deferred"&&ul()},gi=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={})};gi.prototype.isSupportedScript=function(k){return cn(k,el.isLoaded())},gi.prototype.crossFadingFactor=function(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)},gi.prototype.getCrossfadeParameters=function(){var k=this.zoom,V=k-Math.floor(k),ie=this.crossFadingFactor();return k>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:V+(1-V)*ie}:{fromScale:.5,toScale:1,t:1-(1-ie)*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,ie){return this.property.possiblyEvaluate(this,k,V,ie)};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,g({},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,ie=Object.keys(this._values);Vthis.end)return this.prior=null,Ie;if(this.value.isDataDriven())return this.prior=null,Ie;if(xeqe.zoomHistory.lastIntegerZoom?{from:ie,to:xe}:{from:Ie,to:xe}},k.prototype.interpolate=function(ie){return ie},k}(Yt),ua=function(k){this.specification=k};ua.prototype.possiblyEvaluate=function(k,V,ie,xe){if(k.value!==void 0)if(k.expression.kind==="constant"){var Ie=k.expression.evaluate(V,null,{},ie,xe);return this._calculate(Ie,Ie,Ie,V)}else return this._calculate(k.expression.evaluate(new gi(Math.floor(V.zoom-1),V)),k.expression.evaluate(new gi(Math.floor(V.zoom),V)),k.expression.evaluate(new gi(Math.floor(V.zoom+1),V)),V)},ua.prototype._calculate=function(k,V,ie,xe){var Ie=xe.zoom;return Ie>xe.zoomHistory.lastIntegerZoom?{from:k,to:V}:{from:ie,to:V}},ua.prototype.interpolate=function(k){return k};var Aa=function(k){this.specification=k};Aa.prototype.possiblyEvaluate=function(k,V,ie,xe){return!!k.expression.evaluate(V,null,{},ie,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 ie=k[V];ie.specification.overridable&&this.overridableProperties.push(V);var xe=this.defaultPropertyValues[V]=new vo(ie,void 0),Ie=this.defaultTransitionablePropertyValues[V]=new cs(ie);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,ie){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),ie.layout&&(this._unevaluatedLayout=new Tu(ie.layout)),ie.paint)){this._transitionablePaint=new ps(ie.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(ie.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(ie){return ie==="visibility"?this.visibility:this._unevaluatedLayout.getValue(ie)},k.prototype.setLayoutProperty=function(ie,xe,Ie){if(Ie===void 0&&(Ie={}),xe!=null){var qe="layers."+this.id+".layout."+ie;if(this._validate($l,qe,ie,xe,Ie))return}if(ie==="visibility"){this.visibility=xe;return}this._unevaluatedLayout.setValue(ie,xe)},k.prototype.getPaintProperty=function(ie){return z(ie,wa)?this._transitionablePaint.getTransition(ie.slice(0,-wa.length)):this._transitionablePaint.getValue(ie)},k.prototype.setPaintProperty=function(ie,xe,Ie){if(Ie===void 0&&(Ie={}),xe!=null){var qe="layers."+this.id+".paint."+ie;if(this._validate(Pl,qe,ie,xe,Ie))return!1}if(z(ie,wa))return this._transitionablePaint.setTransition(ie.slice(0,-wa.length),xe||void 0),!1;var ht=this._transitionablePaint._values[ie],Rt=ht.property.specification["property-type"]==="cross-faded-data-driven",Ht=ht.value.isDataDriven(),tr=ht.value;this._transitionablePaint.setValue(ie,xe),this._handleSpecialPaintPropertyUpdate(ie);var Cr=this._transitionablePaint._values[ie].value,Xr=Cr.isDataDriven();return Xr||Ht||Rt||this._handleOverridablePaintPropertyUpdate(ie,tr,Cr)},k.prototype._handleSpecialPaintPropertyUpdate=function(ie){},k.prototype._handleOverridablePaintPropertyUpdate=function(ie,xe,Ie){return!1},k.prototype.isHidden=function(ie){return this.minzoom&&ie=this.maxzoom?!0:this.visibility==="none"},k.prototype.updateTransitions=function(ie){this._transitioningPaint=this._transitionablePaint.transitioned(ie,this._transitioningPaint)},k.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},k.prototype.recalculate=function(ie,xe){ie.getCrossfadeParameters&&(this._crossfadeParameters=ie.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(ie,void 0,xe)),this.paint=this._transitioningPaint.possiblyEvaluate(ie,void 0,xe)},k.prototype.serialize=function(){var ie={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&&(ie.layout=ie.layout||{},ie.layout.visibility=this.visibility),B(ie,function(xe,Ie){return xe!==void 0&&!(Ie==="layout"&&!Object.keys(xe).length)&&!(Ie==="paint"&&!Object.keys(xe).length)})},k.prototype._validate=function(ie,xe,Ie,qe,ht){return ht===void 0&&(ht={}),ht&&ht.validate===!1?!1:Ru(this,ie.call(es,{key:xe,layerType:this.type,objectKey:Ie,value:qe,styleSpec:jn,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 ie in this.paint._values){var xe=this.paint.get(ie);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),Sn={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},wn=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},hn=128,yi=5,Bn=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};Bn.serialize=function(k,V){return k._trim(),V&&(k.isTransferred=!0,V.push(k.arrayBuffer)),{length:k.length,arrayBuffer:k.arrayBuffer}},Bn.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},Bn.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},Bn.prototype.clear=function(){this.length=0},Bn.prototype.resize=function(k){this.reserve(k),this.length=k},Bn.prototype.reserve=function(k){if(k>this.capacity){this.capacity=Math.max(k,Math.floor(this.capacity*yi),hn),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var V=this.uint8;this._refreshViews(),V&&this.uint8.set(V)}},Bn.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};function Ln(C,k){k===void 0&&(k=1);var V=0,ie=0,xe=C.map(function(qe){var ht=Va(qe.type),Rt=V=ea(V,Math.max(k,ht)),Ht=qe.components||1;return ie=Math.max(ie,ht),V+=ht*Ht,{name:qe.name,type:qe.type,components:Ht,offset:Rt}}),Ie=ea(V,Math.max(ie,k));return{members:xe,size:Ie,alignment:k}}function Va(C){return Sn[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(ie,xe){var Ie=this.length;return this.resize(Ie+1),this.emplace(Ie,ie,xe)},k.prototype.emplace=function(ie,xe,Ie){var qe=ie*2;return this.int16[qe+0]=xe,this.int16[qe+1]=Ie,ie},k}(Bn);Ea.prototype.bytesPerElement=4,de("StructArrayLayout2i4",Ea);var an=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(ie,xe,Ie,qe){var ht=this.length;return this.resize(ht+1),this.emplace(ht,ie,xe,Ie,qe)},k.prototype.emplace=function(ie,xe,Ie,qe,ht){var Rt=ie*4;return this.int16[Rt+0]=xe,this.int16[Rt+1]=Ie,this.int16[Rt+2]=qe,this.int16[Rt+3]=ht,ie},k}(Bn);an.prototype.bytesPerElement=8,de("StructArrayLayout4i8",an);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.int16=new Int16Array(this.arrayBuffer)},k.prototype.emplaceBack=function(ie,xe,Ie,qe,ht,Rt){var Ht=this.length;return this.resize(Ht+1),this.emplace(Ht,ie,xe,Ie,qe,ht,Rt)},k.prototype.emplace=function(ie,xe,Ie,qe,ht,Rt,Ht){var tr=ie*6;return this.int16[tr+0]=xe,this.int16[tr+1]=Ie,this.int16[tr+2]=qe,this.int16[tr+3]=ht,this.int16[tr+4]=Rt,this.int16[tr+5]=Ht,ie},k}(Bn);gn.prototype.bytesPerElement=12,de("StructArrayLayout2i4i12",gn);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(ie,xe,Ie,qe,ht,Rt){var Ht=this.length;return this.resize(Ht+1),this.emplace(Ht,ie,xe,Ie,qe,ht,Rt)},k.prototype.emplace=function(ie,xe,Ie,qe,ht,Rt,Ht){var tr=ie*4,Cr=ie*8;return this.int16[tr+0]=xe,this.int16[tr+1]=Ie,this.uint8[Cr+4]=qe,this.uint8[Cr+5]=ht,this.uint8[Cr+6]=Rt,this.uint8[Cr+7]=Ht,ie},k}(Bn);Wa.prototype.bytesPerElement=8,de("StructArrayLayout2i4ub8",Wa);var Vn=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(ie,xe){var Ie=this.length;return this.resize(Ie+1),this.emplace(Ie,ie,xe)},k.prototype.emplace=function(ie,xe,Ie){var qe=ie*2;return this.float32[qe+0]=xe,this.float32[qe+1]=Ie,ie},k}(Bn);Vn.prototype.bytesPerElement=8,de("StructArrayLayout2f8",Vn);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(ie,xe,Ie,qe,ht,Rt,Ht,tr,Cr,Xr){var Vr=this.length;return this.resize(Vr+1),this.emplace(Vr,ie,xe,Ie,qe,ht,Rt,Ht,tr,Cr,Xr)},k.prototype.emplace=function(ie,xe,Ie,qe,ht,Rt,Ht,tr,Cr,Xr,Vr){var pa=ie*10;return this.uint16[pa+0]=xe,this.uint16[pa+1]=Ie,this.uint16[pa+2]=qe,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]=Vr,ie},k}(Bn);Rn.prototype.bytesPerElement=20,de("StructArrayLayout10ui20",Rn);var hi=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(ie,xe,Ie,qe,ht,Rt,Ht,tr,Cr,Xr,Vr,pa){var ja=this.length;return this.resize(ja+1),this.emplace(ja,ie,xe,Ie,qe,ht,Rt,Ht,tr,Cr,Xr,Vr,pa)},k.prototype.emplace=function(ie,xe,Ie,qe,ht,Rt,Ht,tr,Cr,Xr,Vr,pa,ja){var Cn=ie*12;return this.int16[Cn+0]=xe,this.int16[Cn+1]=Ie,this.int16[Cn+2]=qe,this.int16[Cn+3]=ht,this.uint16[Cn+4]=Rt,this.uint16[Cn+5]=Ht,this.uint16[Cn+6]=tr,this.uint16[Cn+7]=Cr,this.int16[Cn+8]=Xr,this.int16[Cn+9]=Vr,this.int16[Cn+10]=pa,this.int16[Cn+11]=ja,ie},k}(Bn);hi.prototype.bytesPerElement=24,de("StructArrayLayout4i4ui4i24",hi);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(ie,xe,Ie){var qe=this.length;return this.resize(qe+1),this.emplace(qe,ie,xe,Ie)},k.prototype.emplace=function(ie,xe,Ie,qe){var ht=ie*3;return this.float32[ht+0]=xe,this.float32[ht+1]=Ie,this.float32[ht+2]=qe,ie},k}(Bn);Za.prototype.bytesPerElement=12,de("StructArrayLayout3f12",Za);var qa=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(ie){var xe=this.length;return this.resize(xe+1),this.emplace(xe,ie)},k.prototype.emplace=function(ie,xe){var Ie=ie*1;return this.uint32[Ie+0]=xe,ie},k}(Bn);qa.prototype.bytesPerElement=4,de("StructArrayLayout1ul4",qa);var Qn=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(ie,xe,Ie,qe,ht,Rt,Ht,tr,Cr){var Xr=this.length;return this.resize(Xr+1),this.emplace(Xr,ie,xe,Ie,qe,ht,Rt,Ht,tr,Cr)},k.prototype.emplace=function(ie,xe,Ie,qe,ht,Rt,Ht,tr,Cr,Xr){var Vr=ie*10,pa=ie*5;return this.int16[Vr+0]=xe,this.int16[Vr+1]=Ie,this.int16[Vr+2]=qe,this.int16[Vr+3]=ht,this.int16[Vr+4]=Rt,this.int16[Vr+5]=Ht,this.uint32[pa+3]=tr,this.uint16[Vr+8]=Cr,this.uint16[Vr+9]=Xr,ie},k}(Bn);Qn.prototype.bytesPerElement=20,de("StructArrayLayout6i1ul2ui20",Qn);var Fn=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(ie,xe,Ie,qe,ht,Rt){var Ht=this.length;return this.resize(Ht+1),this.emplace(Ht,ie,xe,Ie,qe,ht,Rt)},k.prototype.emplace=function(ie,xe,Ie,qe,ht,Rt,Ht){var tr=ie*6;return this.int16[tr+0]=xe,this.int16[tr+1]=Ie,this.int16[tr+2]=qe,this.int16[tr+3]=ht,this.int16[tr+4]=Rt,this.int16[tr+5]=Ht,ie},k}(Bn);Fn.prototype.bytesPerElement=12,de("StructArrayLayout2i2i2i12",Fn);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.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},k.prototype.emplaceBack=function(ie,xe,Ie,qe,ht){var Rt=this.length;return this.resize(Rt+1),this.emplace(Rt,ie,xe,Ie,qe,ht)},k.prototype.emplace=function(ie,xe,Ie,qe,ht,Rt){var Ht=ie*4,tr=ie*8;return this.float32[Ht+0]=xe,this.float32[Ht+1]=Ie,this.float32[Ht+2]=qe,this.int16[tr+6]=ht,this.int16[tr+7]=Rt,ie},k}(Bn);Mn.prototype.bytesPerElement=16,de("StructArrayLayout2f1f2i16",Mn);var An=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(ie,xe,Ie,qe){var ht=this.length;return this.resize(ht+1),this.emplace(ht,ie,xe,Ie,qe)},k.prototype.emplace=function(ie,xe,Ie,qe,ht){var Rt=ie*12,Ht=ie*3;return this.uint8[Rt+0]=xe,this.uint8[Rt+1]=Ie,this.float32[Ht+1]=qe,this.float32[Ht+2]=ht,ie},k}(Bn);An.prototype.bytesPerElement=12,de("StructArrayLayout2ub2f12",An);var Jn=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(ie,xe,Ie){var qe=this.length;return this.resize(qe+1),this.emplace(qe,ie,xe,Ie)},k.prototype.emplace=function(ie,xe,Ie,qe){var ht=ie*3;return this.uint16[ht+0]=xe,this.uint16[ht+1]=Ie,this.uint16[ht+2]=qe,ie},k}(Bn);Jn.prototype.bytesPerElement=6,de("StructArrayLayout3ui6",Jn);var mi=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(ie,xe,Ie,qe,ht,Rt,Ht,tr,Cr,Xr,Vr,pa,ja,Cn,un,ti,Un){var ei=this.length;return this.resize(ei+1),this.emplace(ei,ie,xe,Ie,qe,ht,Rt,Ht,tr,Cr,Xr,Vr,pa,ja,Cn,un,ti,Un)},k.prototype.emplace=function(ie,xe,Ie,qe,ht,Rt,Ht,tr,Cr,Xr,Vr,pa,ja,Cn,un,ti,Un,ei){var li=ie*24,xi=ie*12,Vi=ie*48;return this.int16[li+0]=xe,this.int16[li+1]=Ie,this.uint16[li+2]=qe,this.uint16[li+3]=ht,this.uint32[xi+2]=Rt,this.uint32[xi+3]=Ht,this.uint32[xi+4]=tr,this.uint16[li+10]=Cr,this.uint16[li+11]=Xr,this.uint16[li+12]=Vr,this.float32[xi+7]=pa,this.float32[xi+8]=ja,this.uint8[Vi+36]=Cn,this.uint8[Vi+37]=un,this.uint8[Vi+38]=ti,this.uint32[xi+10]=Un,this.int16[li+22]=ei,ie},k}(Bn);mi.prototype.bytesPerElement=48,de("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",mi);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),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},k.prototype.emplaceBack=function(ie,xe,Ie,qe,ht,Rt,Ht,tr,Cr,Xr,Vr,pa,ja,Cn,un,ti,Un,ei,li,xi,Vi,Ni,Mo,io,_o,Ms,Eo,Ro){var Zs=this.length;return this.resize(Zs+1),this.emplace(Zs,ie,xe,Ie,qe,ht,Rt,Ht,tr,Cr,Xr,Vr,pa,ja,Cn,un,ti,Un,ei,li,xi,Vi,Ni,Mo,io,_o,Ms,Eo,Ro)},k.prototype.emplace=function(ie,xe,Ie,qe,ht,Rt,Ht,tr,Cr,Xr,Vr,pa,ja,Cn,un,ti,Un,ei,li,xi,Vi,Ni,Mo,io,_o,Ms,Eo,Ro,Zs){var _s=ie*34,Wl=ie*17;return this.int16[_s+0]=xe,this.int16[_s+1]=Ie,this.int16[_s+2]=qe,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]=Vr,this.uint16[_s+10]=pa,this.uint16[_s+11]=ja,this.uint16[_s+12]=Cn,this.uint16[_s+13]=un,this.uint16[_s+14]=ti,this.uint16[_s+15]=Un,this.uint16[_s+16]=ei,this.uint16[_s+17]=li,this.uint16[_s+18]=xi,this.uint16[_s+19]=Vi,this.uint16[_s+20]=Ni,this.uint16[_s+21]=Mo,this.uint16[_s+22]=io,this.uint32[Wl+12]=_o,this.float32[Wl+13]=Ms,this.float32[Wl+14]=Eo,this.float32[Wl+15]=Ro,this.float32[Wl+16]=Zs,ie},k}(Bn);Ii.prototype.bytesPerElement=68,de("StructArrayLayout8i15ui1ul4f68",Ii);var zn=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(ie){var xe=this.length;return this.resize(xe+1),this.emplace(xe,ie)},k.prototype.emplace=function(ie,xe){var Ie=ie*1;return this.float32[Ie+0]=xe,ie},k}(Bn);zn.prototype.bytesPerElement=4,de("StructArrayLayout1f4",zn);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(ie,xe,Ie){var qe=this.length;return this.resize(qe+1),this.emplace(qe,ie,xe,Ie)},k.prototype.emplace=function(ie,xe,Ie,qe){var ht=ie*3;return this.int16[ht+0]=xe,this.int16[ht+1]=Ie,this.int16[ht+2]=qe,ie},k}(Bn);ii.prototype.bytesPerElement=6,de("StructArrayLayout3i6",ii);var Ei=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(ie,xe,Ie){var qe=this.length;return this.resize(qe+1),this.emplace(qe,ie,xe,Ie)},k.prototype.emplace=function(ie,xe,Ie,qe){var ht=ie*2,Rt=ie*4;return this.uint32[ht+0]=xe,this.uint16[Rt+2]=Ie,this.uint16[Rt+3]=qe,ie},k}(Bn);Ei.prototype.bytesPerElement=8,de("StructArrayLayout1ul2ui8",Ei);var Ri=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(ie,xe){var Ie=this.length;return this.resize(Ie+1),this.emplace(Ie,ie,xe)},k.prototype.emplace=function(ie,xe,Ie){var qe=ie*2;return this.uint16[qe+0]=xe,this.uint16[qe+1]=Ie,ie},k}(Bn);Ri.prototype.bytesPerElement=4,de("StructArrayLayout2ui4",Ri);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.uint16=new Uint16Array(this.arrayBuffer)},k.prototype.emplaceBack=function(ie){var xe=this.length;return this.resize(xe+1),this.emplace(xe,ie)},k.prototype.emplace=function(ie,xe){var Ie=ie*1;return this.uint16[Ie+0]=xe,ie},k}(Bn);Gi.prototype.bytesPerElement=2,de("StructArrayLayout1ui2",Gi);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(ie,xe,Ie,qe){var ht=this.length;return this.resize(ht+1),this.emplace(ht,ie,xe,Ie,qe)},k.prototype.emplace=function(ie,xe,Ie,qe,ht){var Rt=ie*4;return this.float32[Rt+0]=xe,this.float32[Rt+1]=Ie,this.float32[Rt+2]=qe,this.float32[Rt+3]=ht,ie},k}(Bn);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 n(this.anchorPointX,this.anchorPointY)},Object.defineProperties(k.prototype,V),k}(wn);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(ie){return new xl(this,ie)},k}(Qn);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(ie){this._structArray.uint8[this._pos1+37]=ie},V.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},V.hidden.set=function(ie){this._structArray.uint8[this._pos1+38]=ie},V.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},V.crossTileID.set=function(ie){this._structArray.uint32[this._pos4+10]=ie},V.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},Object.defineProperties(k.prototype,V),k}(wn);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(ie){return new Hl(this,ie)},k}(mi);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(ie){this._structArray.uint32[this._pos4+12]=ie},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}(wn);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(ie){return new Al(this,ie)},k}(Ii);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(ie){return this.float32[ie*1+0]},k}(zn);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(ie){return this.int16[ie*3+0]},k.prototype.gety=function(ie){return this.int16[ie*3+1]},k.prototype.gettileUnitDistanceFromAnchor=function(ie){return this.int16[ie*3+2]},k}(ii);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}(wn);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(ie){return new pl(this,ie)},k}(Ei);de("FeatureIndexArray",bl);var Hi=Ln([{name:"a_pos",components:2,type:"Int16"}],4),Cl=Hi.members,Lo=function(k){k===void 0&&(k=[]),this.segments=k};Lo.prototype.prepareSegment=function(k,V,ie,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:ie.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,qe^=tr,qe=qe<<13|qe>>>19,ht=(qe&65535)*5+(((qe>>>16)*5&65535)<<16)&4294967295,qe=(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,qe^=tr}return qe^=V.length,qe^=qe>>>16,qe=(qe&65535)*2246822507+(((qe>>>16)*2246822507&65535)<<16)&4294967295,qe^=qe>>>13,qe=(qe&65535)*3266489909+(((qe>>>16)*3266489909&65535)<<16)&4294967295,qe^=qe>>>16,qe>>>0}C.exports=k}),te=t(function(C){function k(V,ie){for(var xe=V.length,Ie=ie^xe,qe=0,ht;xe>=4;)ht=V.charCodeAt(qe)&255|(V.charCodeAt(++qe)&255)<<8|(V.charCodeAt(++qe)&255)<<16|(V.charCodeAt(++qe)&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,++qe;switch(xe){case 3:Ie^=(V.charCodeAt(qe+2)&255)<<16;case 2:Ie^=(V.charCodeAt(qe+1)&255)<<8;case 1:Ie^=V.charCodeAt(qe)&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,ie,xe){this.ids.push(jt(k)),this.positions.push(V,ie,xe)},$e.prototype.getPositions=function(k){for(var V=jt(k),ie=0,xe=this.ids.length-1;ie>1;this.ids[Ie]>=V?xe=Ie:ie=Ie+1}for(var qe=[];this.ids[ie]===V;){var ht=this.positions[3*ie],Rt=this.positions[3*ie+1],Ht=this.positions[3*ie+2];qe.push({index:ht,start:Rt,end:Ht}),ie++}return qe},$e.serialize=function(k,V){var ie=new Float64Array(k.ids),xe=new Uint32Array(k.positions);return _r(ie,xe,0,ie.length-1),V&&V.push(ie.buffer,xe.buffer),{ids:ie,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,ie){for(;V>1],Ie=V-1,qe=ie+1;;){do Ie++;while(C[Ie]xe);if(Ie>=qe)break;Fr(C,Ie,qe),Fr(k,3*Ie,3*qe),Fr(k,3*Ie+1,3*qe+1),Fr(k,3*Ie+2,3*qe+2)}qe-Vqe.x+1||Rtqe.y+1)&&U("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return V}function bo(C,k){return{type:C.type,id:C.id,properties:C.properties,geometry:k?ci(C):[]}}function jo(C,k,V,ie,xe){C.emplaceBack(k*2+(ie+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 Jn,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,ie){var xe=this.layers[0],Ie=[],qe=null;xe.type==="circle"&&(qe=xe.layout.get("circle-sort-key"));for(var ht=0,Rt=k;ht=dn||Xr<0||Xr>=dn)){var Vr=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,k.sortKey),pa=Vr.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),Vr.vertexLength+=4,Vr.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,k,ie,{},xe)},de("CircleBucket",ks,{omit:["layers"]});function Fo(C,k){for(var V=0;V=3){for(var Ie=0;Ie1){if(Sp(C,k))return!0;for(var ie=0;ie1?C.distSqr(V):C.distSqr(V.sub(k)._mult(xe)._add(k))}function td(C,k){for(var V=!1,ie,xe,Ie,qe=0;qek.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,ie=0,xe=C.length-1;iek.y!=qe.y>k.y&&k.x<(qe.x-Ie.x)*(k.y-Ie.y)/(qe.y-Ie.y)+Ie.x&&(V=!V)}return V}function rd(C,k,V,ie,xe){for(var Ie=0,qe=C;Ie=ht.x&&xe>=ht.y)return!0}var Rt=[new n(k,V),new n(k,xe),new n(ie,xe),new n(ie,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 ie=k.paint.get(C).value;return ie.kind==="constant"?ie.value:V.programConfigurations.get(k.id).getMaxValue(C)}function Mp(C){return Math.sqrt(C[0]*C[0]+C[1]*C[1])}function qp(C,k,V,ie,xe){if(!k[0]&&!k[1])return C;var Ie=n.convert(k)._mult(xe);V==="viewport"&&Ie._rotate(-ie);for(var qe=[],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 ie=k[0],xe=k[1],Ie=k[2],qe=V[0],ht=V[1],Rt=V[2];return C[0]=xe*Rt-Ie*ht,C[1]=Ie*qe-ie*Rt,C[2]=ie*ht-xe*qe,C}function VT(C,k,V){var ie=k[0],xe=k[1],Ie=k[2];return C[0]=ie*V[0]+xe*V[3]+Ie*V[6],C[1]=ie*V[1]+xe*V[4]+Ie*V[7],C[2]=ie*V[2]+xe*V[5]+Ie*V[8],C}var qT=lv,dk=function(){var C=sv();return function(k,V,ie,xe,Ie,qe){var ht,Rt;for(V||(V=3),ie||(ie=0),xe?Rt=Math.min(xe*V+ie,k.length):Rt=k.length,ht=ie;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||ie.x>k.width-xe.width||ie.y>k.height-xe.height)throw new RangeError("out of range destination coordinates for image copy");for(var qe=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);Vr=Math.max(Ht-ht,tr-Rt),Vr=Vr!==0?1/Vr:0}return Sg(Ie,qe,V,ht,Rt,Vr),qe}function S0(C,k,V,ie,xe){var Ie,qe;if(xe===U1(C,k,V,ie)>0)for(Ie=k;Ie=k;Ie-=ie)qe=Nx(Ie,C[Ie],C[Ie+1],qe);return qe&&Eg(qe,qe.next)&&(Lg(qe),qe=qe.next),qe}function uv(C,k){if(!C)return C;k||(k=C);var V=C,ie;do if(ie=!1,!V.steiner&&(Eg(V,V.next)||lf(V.prev,V,V.next)===0)){if(Lg(V),V=k=V.prev,V===V.next)break;ie=!0}else V=V.next;while(ie||V!==k);return k}function Sg(C,k,V,ie,xe,Ie,qe){if(C){!qe&&Ie&&M0(C,ie,xe,Ie);for(var ht=C,Rt,Ht;C.prev!==C.next;){if(Rt=C.prev,Ht=C.next,Ie?Fx(C,ie,xe,Ie):zx(C)){k.push(Rt.i/V),k.push(C.i/V),k.push(Ht.i/V),Lg(C),C=Ht.next,ht=Ht.next;continue}if(C=Ht,C===ht){qe?qe===1?(C=Mg(uv(C),k,V),Sg(C,k,V,ie,xe,Ie,2)):qe===2&&yd(C,k,V,ie,xe,Ie):Sg(uv(C),k,V,ie,xe,Ie,1);break}}}}function zx(C){var k=C.prev,V=C,ie=C.next;if(lf(k,V,ie)>=0)return!1;for(var xe=C.next.next;xe!==C.prev;){if(fv(k.x,k.y,V.x,V.y,ie.x,ie.y,xe.x,xe.y)&&lf(xe.prev,xe,xe.next)>=0)return!1;xe=xe.next}return!0}function Fx(C,k,V,ie){var xe=C.prev,Ie=C,qe=C.next;if(lf(xe,Ie,qe)>=0)return!1;for(var ht=xe.xIe.x?xe.x>qe.x?xe.x:qe.x:Ie.x>qe.x?Ie.x:qe.x,tr=xe.y>Ie.y?xe.y>qe.y?xe.y:qe.y:Ie.y>qe.y?Ie.y:qe.y,Cr=F1(ht,Rt,k,V,ie),Xr=F1(Ht,tr,k,V,ie),Vr=C.prevZ,pa=C.nextZ;Vr&&Vr.z>=Cr&&pa&&pa.z<=Xr;){if(Vr!==C.prev&&Vr!==C.next&&fv(xe.x,xe.y,Ie.x,Ie.y,qe.x,qe.y,Vr.x,Vr.y)&&lf(Vr.prev,Vr,Vr.next)>=0||(Vr=Vr.prevZ,pa!==C.prev&&pa!==C.next&&fv(xe.x,xe.y,Ie.x,Ie.y,qe.x,qe.y,pa.x,pa.y)&&lf(pa.prev,pa,pa.next)>=0))return!1;pa=pa.nextZ}for(;Vr&&Vr.z>=Cr;){if(Vr!==C.prev&&Vr!==C.next&&fv(xe.x,xe.y,Ie.x,Ie.y,qe.x,qe.y,Vr.x,Vr.y)&&lf(Vr.prev,Vr,Vr.next)>=0)return!1;Vr=Vr.prevZ}for(;pa&&pa.z<=Xr;){if(pa!==C.prev&&pa!==C.next&&fv(xe.x,xe.y,Ie.x,Ie.y,qe.x,qe.y,pa.x,pa.y)&&lf(pa.prev,pa,pa.next)>=0)return!1;pa=pa.nextZ}return!0}function Mg(C,k,V){var ie=C;do{var xe=ie.prev,Ie=ie.next.next;!Eg(xe,Ie)&&E0(xe,ie,ie.next,Ie)&&kg(xe,Ie)&&kg(Ie,xe)&&(k.push(xe.i/V),k.push(ie.i/V),k.push(Ie.i/V),Lg(ie),Lg(ie.next),ie=C=Ie),ie=ie.next}while(ie!==C);return uv(ie)}function yd(C,k,V,ie,xe,Ie){var qe=C;do{for(var ht=qe.next.next;ht!==qe.prev;){if(qe.i!==ht.i&&um(qe,ht)){var Rt=B1(qe,ht);qe=uv(qe,qe.next),Rt=uv(Rt,Rt.next),Sg(qe,k,V,ie,xe,Ie),Sg(Rt,k,V,ie,xe,Ie);return}ht=ht.next}qe=qe.next}while(qe!==C)}function cv(C,k,V,ie){var xe=[],Ie,qe,ht,Rt,Ht;for(Ie=0,qe=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<=ie&&ht>Ie){if(Ie=ht,ht===ie){if(xe===V.y)return V;if(xe===V.next.y)return V.next}qe=V.x=V.x&&V.x>=Ht&&ie!==V.x&&fv(xeqe.x||V.x===qe.x&&$T(qe,V)))&&(qe=V,Cr=Xr)),V=V.next;while(V!==Rt);return qe}function $T(C,k){return lf(C.prev,C,k.prev)<0&&lf(k.next,C,C.next)<0}function M0(C,k,V,ie){var xe=C;do xe.z===null&&(xe.z=F1(xe.x,xe.y,k,V,ie)),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,ie,xe,Ie,qe,ht,Rt,Ht=1;do{for(V=C,C=null,Ie=null,qe=0;V;){for(qe++,ie=V,ht=0,k=0;k0||Rt>0&&ie;)ht!==0&&(Rt===0||!ie||V.z<=ie.z)?(xe=V,V=V.nextZ,ht--):(xe=ie,ie=ie.nextZ,Rt--),Ie?Ie.nextZ=xe:C=xe,xe.prevZ=Ie,Ie=xe;V=ie}Ie.nextZ=null,Ht*=2}while(qe>1);return C}function F1(C,k,V,ie,xe){return C=32767*(C-V)*xe,k=32767*(k-ie)*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-qe)*(ie-ht)-(V-qe)*(k-ht)>=0&&(V-qe)*(Ie-ht)-(xe-qe)*(ie-ht)>=0}function um(C,k){return C.next.i!==k.i&&C.prev.i!==k.i&&!Bx(C,k)&&(kg(C,k)&&kg(k,C)&&QT(C,k)&&(lf(C.prev,C,k.prev)||lf(C,k.prev,k))||Eg(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 Eg(C,k){return C.x===k.x&&C.y===k.y}function E0(C,k,V,ie){var xe=Dv(lf(C,k,V)),Ie=Dv(lf(C,k,ie)),qe=Dv(lf(V,ie,C)),ht=Dv(lf(V,ie,k));return!!(xe!==Ie&&qe!==ht||xe===0&&Cg(C,V,k)||Ie===0&&Cg(C,ie,k)||qe===0&&Cg(V,C,ie)||ht===0&&Cg(V,k,ie))}function Cg(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&&E0(V,V.next,C,k))return!0;V=V.next}while(V!==C);return!1}function kg(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,ie=!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&&(ie=!ie),V=V.next;while(V!==C);return ie}function B1(C,k){var V=new N1(C.i,C.x,C.y),ie=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,ie.next=V,V.prev=ie,Ie.next=ie,ie.prev=Ie,ie}function Nx(C,k,V,ie){var xe=new N1(C,k,V);return ie?(xe.next=ie.next,xe.prev=ie,ie.next.prev=xe,ie.next=xe):(xe.prev=xe,xe.next=xe),xe}function Lg(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,ie){var xe=k&&k.length,Ie=xe?k[0]*V:C.length,qe=Math.abs(U1(C,0,Ie,V));if(xe)for(var ht=0,Rt=k.length;ht0&&(ie+=C[xe-1].length,V.holes.push(ie))}return V},A0.default=Dx;function j1(C,k,V,ie,xe){Hd(C,k,V||0,ie||C.length-1,xe||Ux)}function Hd(C,k,V,ie,xe){for(;ie>V;){if(ie-V>600){var Ie=ie-V+1,qe=k-V+1,ht=Math.log(Ie),Rt=.5*Math.exp(2*ht/3),Ht=.5*Math.sqrt(ht*Rt*(Ie-Rt)/Ie)*(qe-Ie/2<0?-1:1),tr=Math.max(V,Math.floor(k-qe*Rt/Ie+Ht)),Cr=Math.min(ie,Math.floor(k+(Ie-qe)*Rt/Ie+Ht));Hd(C,k,tr,Cr,xe)}var Xr=C[k],Vr=V,pa=ie;for(cm(C,V,k),xe(C[ie],Xr)>0&&cm(C,V,ie);Vr0;)pa--}xe(C[V],Xr)===0?cm(C,V,pa):(pa++,cm(C,pa,ie)),pa<=k&&(V=pa+1),k<=pa&&(ie=pa-1)}}function cm(C,k,V){var ie=C[k];C[k]=C[V],C[V]=ie}function Ux(C,k){return Ck?1:0}function C0(C,k){var V=C.length;if(V<=1)return[C];for(var ie=[],xe,Ie,qe=0;qe1)for(var Rt=0;Rt>3}if(ie--,V===1||V===2)xe+=C.readSVarint(),Ie+=C.readSVarint(),V===1&&(ht&&qe.push(ht),ht=[]),ht.push(new n(xe,Ie));else if(V===7)ht&&ht.push(ht[0].clone());else throw new Error("unknown command "+V)}return ht&&qe.push(ht),qe},zv.prototype.bbox=function(){var C=this._pbf;C.pos=this._geometry;for(var k=C.readVarint()+C.pos,V=1,ie=0,xe=0,Ie=0,qe=1/0,ht=-1/0,Rt=1/0,Ht=-1/0;C.pos>3}if(ie--,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[qe,Rt,ht,Ht]},zv.prototype.toGeoJSON=function(C,k,V){var ie=this.extent*Math.pow(2,V),xe=this.extent*C,Ie=this.extent*k,qe=this.loadGeometry(),ht=zv.types[this.type],Rt,Ht;function tr(Vr){for(var pa=0;pa>3;k=ie===1?C.readString():ie===2?C.readFloat():ie===3?C.readDouble():ie===4?C.readVarint64():ie===5?C.readVarint():ie===6?C.readSVarint():ie===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 q1(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 ie=new Wd(V,V.readVarint()+V.pos);ie.length&&(k[ie.name]=ie)}}var Jx=Kx,fm=q1,$x=Wd,Xd={VectorTile:Jx,VectorTileFeature:fm,VectorTileLayer:$x},Qx=Xd.VectorTileFeature.types,L0=500,hm=Math.pow(2,13);function hv(C,k,V,ie,xe,Ie,qe,ht){C.emplaceBack(k,V,Math.floor(ie*hm)*2+qe,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 gn,this.indexArray=new Jn,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,ie){this.features=[],this.hasPattern=k0("fill-extrusion",this.layers,V);for(var xe=0,Ie=k;xe=1){var ei=Cn[ti-1];if(!aA(Un,ei)){Vr.vertexLength+4>Lo.MAX_VERTEX_ARRAY_LENGTH&&(Vr=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var li=Un.sub(ei)._perp()._unit(),xi=ei.dist(Un);un+xi>32768&&(un=0),hv(this.layoutVertexArray,Un.x,Un.y,li.x,li.y,0,0,un),hv(this.layoutVertexArray,Un.x,Un.y,li.x,li.y,0,1,un),un+=xi,hv(this.layoutVertexArray,ei.x,ei.y,li.x,li.y,0,0,un),hv(this.layoutVertexArray,ei.x,ei.y,li.x,li.y,0,1,un);var Vi=Vr.vertexLength;this.indexArray.emplaceBack(Vi,Vi+2,Vi+1),this.indexArray.emplaceBack(Vi+1,Vi+2,Vi+3),Vr.vertexLength+=4,Vr.primitiveLength+=2}}}}if(Vr.vertexLength+Ht>Lo.MAX_VERTEX_ARRAY_LENGTH&&(Vr=this.segments.prepareSegment(Ht,this.layoutVertexArray,this.indexArray)),Qx[k.type]==="Polygon"){for(var Ni=[],Mo=[],io=Vr.vertexLength,_o=0,Ms=Rt;_odn)||C.y===k.y&&(C.y<0||C.y>dn)}function nA(C){return C.every(function(k){return k.x<0})||C.every(function(k){return k.x>dn})||C.every(function(k){return k.y<0})||C.every(function(k){return k.y>dn})}var pm=new xa({"fill-extrusion-opacity":new nt(jn["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Yt(jn["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new nt(jn["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new nt(jn["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new cr(jn["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Yt(jn["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Yt(jn["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new nt(jn["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(ie){return new fd(ie)},k.prototype.queryRadius=function(){return Mp(this.paint.get("fill-extrusion-translate"))},k.prototype.is3D=function(){return!0},k.prototype.queryIntersectsFeature=function(ie,xe,Ie,qe,ht,Rt,Ht,tr){var Cr=qp(ie,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),Vr=this.paint.get("fill-extrusion-base").evaluate(xe,Ie),pa=iA(Cr,tr,Rt,0),ja=W1(qe,Vr,Xr,tr),Cn=ja[0],un=ja[1];return eb(Cn,un,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,ie=k[V++],xe;!xe||ie.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(Ni&&ti>tr){var io=Vr.dist(pa);if(io>2*Cr){var _o=Vr.sub(Vr.sub(pa)._mult(Cr/io)._round());this.updateDistance(pa,_o),this.addCurrentVertex(_o,Cn,0,0,Xr),pa=_o}}var Ms=pa&&ja,Eo=Ms?ie:Rt?"butt":xe;if(Ms&&Eo==="round"&&(xiIe&&(Eo="bevel"),Eo==="bevel"&&(xi>2&&(Eo="flipbevel"),xi100)Un=un.mult(-1);else{var Ro=xi*Cn.add(un).mag()/Cn.sub(un).mag();Un._perp()._mult(Ro*(Mo?-1:1))}this.addCurrentVertex(Vr,Un,0,0,Xr),this.addCurrentVertex(Vr,Un.mult(-1),0,0,Xr)}else if(Eo==="bevel"||Eo==="fakeround"){var Zs=-Math.sqrt(xi*xi-1),_s=Mo?Zs:0,Wl=Mo?0:Zs;if(pa&&this.addCurrentVertex(Vr,Cn,_s,Wl,Xr),Eo==="fakeround")for(var zu=Math.round(Vi*180/Math.PI/Z1),Xl=1;Xl2*Cr){var Wf=Vr.add(ja.sub(Vr)._mult(Cr/dh)._round());this.updateDistance(Vr,Wf),this.addCurrentVertex(Wf,un,0,0,Xr),Vr=Wf}}}}},qf.prototype.addCurrentVertex=function(k,V,ie,xe,Ie,qe){qe===void 0&&(qe=!1);var ht=V.x+V.y*ie,Rt=V.y-V.x*ie,Ht=-V.x+V.y*xe,tr=-V.y-V.x*xe;this.addHalfVertex(k,ht,Rt,qe,!1,ie,Ie),this.addHalfVertex(k,Ht,tr,qe,!0,-xe,Ie),this.distance>zg/2&&this.totalDistance===0&&(this.distance=0,this.addCurrentVertex(k,V,ie,xe,Ie,qe))},qf.prototype.addHalfVertex=function(k,V,ie,xe,Ie,qe,ht){var Rt=k.x,Ht=k.y,tr=this.lineClips?this.scaledDistance*(zg-1):this.scaledDistance,Cr=tr*I0;if(this.layoutVertexArray.emplaceBack((Rt<<1)+(xe?1:0),(Ht<<1)+(Ie?1:0),Math.round(P0*V)+128,Math.round(P0*ie)+128,(qe===0?0:qe<0?-1:1)+1|(Cr&63)<<2,Cr>>6),this.lineClips){var Xr=this.scaledDistance-this.lineClips.start,Vr=this.lineClips.end-this.lineClips.start,pa=Xr/Vr;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},qf.prototype.updateScaledDistance=function(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance},qf.prototype.updateDistance=function(k,V){this.distance+=k.dist(V),this.updateScaledDistance()},de("LineBucket",qf,{omit:["layers","patternFeatures"]});var Y1=new xa({"line-cap":new nt(jn.layout_line["line-cap"]),"line-join":new Yt(jn.layout_line["line-join"]),"line-miter-limit":new nt(jn.layout_line["line-miter-limit"]),"line-round-limit":new nt(jn.layout_line["line-round-limit"]),"line-sort-key":new Yt(jn.layout_line["line-sort-key"])}),K1=new xa({"line-opacity":new Yt(jn.paint_line["line-opacity"]),"line-color":new Yt(jn.paint_line["line-color"]),"line-translate":new nt(jn.paint_line["line-translate"]),"line-translate-anchor":new nt(jn.paint_line["line-translate-anchor"]),"line-width":new Yt(jn.paint_line["line-width"]),"line-gap-width":new Yt(jn.paint_line["line-gap-width"]),"line-offset":new Yt(jn.paint_line["line-offset"]),"line-blur":new Yt(jn.paint_line["line-blur"]),"line-dasharray":new ua(jn.paint_line["line-dasharray"]),"line-pattern":new cr(jn.paint_line["line-pattern"]),"line-gradient":new Aa(jn.paint_line["line-gradient"])}),R0={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(ie,xe){return xe=new gi(Math.floor(xe.zoom),{now:xe.now,fadeDuration:xe.fadeDuration,zoomHistory:xe.zoomHistory,transition:xe.transition}),C.prototype.possiblyEvaluate.call(this,ie,xe)},k.prototype.evaluate=function(ie,xe,Ie,qe){return xe=g({},xe,{zoom:Math.floor(xe.zoom)}),C.prototype.evaluate.call(this,ie,xe,Ie,qe)},k}(Yt),G=new sA(R0.paint.properties["line-width"].specification);G.useIntegerZoom=!0;var D=function(C){function k(V){C.call(this,V,R0),this.gradientVersion=0}return C&&(k.__proto__=C),k.prototype=Object.create(C&&C.prototype),k.prototype.constructor=k,k.prototype._handleSpecialPaintPropertyUpdate=function(ie){if(ie==="line-gradient"){var xe=this._transitionablePaint._values["line-gradient"].value.expression;this.stepInterpolant=xe._styleExpression.expression instanceof bu,this.gradientVersion=(this.gradientVersion+1)%h}},k.prototype.gradientExpression=function(){return this._transitionablePaint._values["line-gradient"].value.expression},k.prototype.recalculate=function(ie,xe){C.prototype.recalculate.call(this,ie,xe),this.paint._values["line-floorwidth"]=G.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,ie)},k.prototype.createBucket=function(ie){return new qf(ie)},k.prototype.queryRadius=function(ie){var xe=ie,Ie=K(Rh("line-width",this,xe),Rh("line-gap-width",this,xe)),qe=Rh("line-offset",this,xe);return Ie/2+Math.abs(qe)+Mp(this.paint.get("line-translate"))},k.prototype.queryIntersectsFeature=function(ie,xe,Ie,qe,ht,Rt,Ht){var tr=qp(ie,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&&(qe=pe(qe,Xr*Ht)),pu(tr,qe,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=[],ie=new n(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 Wn(C){for(var k="",V=0;V>1,tr=-7,Cr=V?xe-1:0,Xr=V?-1:1,Vr=C[k+Cr];for(Cr+=Xr,Ie=Vr&(1<<-tr)-1,Vr>>=-tr,tr+=ht;tr>0;Ie=Ie*256+C[k+Cr],Cr+=Xr,tr-=8);for(qe=Ie&(1<<-tr)-1,Ie>>=-tr,tr+=ie;tr>0;qe=qe*256+C[k+Cr],Cr+=Xr,tr-=8);if(Ie===0)Ie=1-Ht;else{if(Ie===Rt)return qe?NaN:(Vr?-1:1)*(1/0);qe=qe+Math.pow(2,ie),Ie=Ie-Ht}return(Vr?-1:1)*qe*Math.pow(2,Ie-ie)},ko=function(C,k,V,ie,xe,Ie){var qe,ht,Rt,Ht=Ie*8-xe-1,tr=(1<>1,Xr=xe===23?Math.pow(2,-24)-Math.pow(2,-77):0,Vr=ie?0:Ie-1,pa=ie?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,qe=tr):(qe=Math.floor(Math.log(k)/Math.LN2),k*(Rt=Math.pow(2,-qe))<1&&(qe--,Rt*=2),qe+Cr>=1?k+=Xr/Rt:k+=Xr*Math.pow(2,1-Cr),k*Rt>=2&&(qe++,Rt/=2),qe+Cr>=tr?(ht=0,qe=tr):qe+Cr>=1?(ht=(k*Rt-1)*Math.pow(2,xe),qe=qe+Cr):(ht=k*Math.pow(2,Cr-1)*Math.pow(2,xe),qe=0));xe>=8;C[V+Vr]=ht&255,Vr+=pa,ht/=256,xe-=8);for(qe=qe<0;C[V+Vr]=qe&255,Vr+=pa,qe/=256,Ht-=8);C[V+Vr-pa]|=ja*128},vs={read:ji,write:ko},yo=Di;function Di(C){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(C)?C:new Uint8Array(C||0),this.pos=0,this.type=0,this.length=this.buf.length}Di.Varint=0,Di.Fixed64=1,Di.Bytes=2,Di.Fixed32=5;var ns=65536*65536,qo=1/ns,Bo=12,_i=typeof TextDecoder>"u"?null:new TextDecoder("utf8");Di.prototype={destroy:function(){this.buf=null},readFields:function(C,k,V){for(V=V||this.length;this.pos>3,Ie=this.pos;this.type=ie&7,C(xe,k,this),this.pos===Ie&&this.skip(ie)}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=Lp(this.buf,this.pos);return this.pos+=4,C},readFixed64:function(){var C=fh(this.buf,this.pos)+fh(this.buf,this.pos+4)*ns;return this.pos+=8,C},readSFixed64:function(){var C=fh(this.buf,this.pos)+Lp(this.buf,this.pos+4)*ns;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,ie;return ie=k[this.pos++],V=ie&127,ie<128||(ie=k[this.pos++],V|=(ie&127)<<7,ie<128)||(ie=k[this.pos++],V|=(ie&127)<<14,ie<128)||(ie=k[this.pos++],V|=(ie&127)<<21,ie<128)?V:(ie=k[this.pos],V|=(ie&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&&_i?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!==Di.Bytes)return C.push(this.readVarint(k));var V=No(this);for(C=C||[];this.pos127;);else if(k===Di.Bytes)this.pos=this.readVarint()+this.pos;else if(k===Di.Fixed32)this.pos+=4;else if(k===Di.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,ie,this),this.pos=V-1,this.writeVarint(ie),this.pos+=ie},writeMessage:function(C,k,V){this.writeTag(C,Di.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,Di.Bytes),this.writeBytes(k)},writeFixed32Field:function(C,k){this.writeTag(C,Di.Fixed32),this.writeFixed32(k)},writeSFixed32Field:function(C,k){this.writeTag(C,Di.Fixed32),this.writeSFixed32(k)},writeFixed64Field:function(C,k){this.writeTag(C,Di.Fixed64),this.writeFixed64(k)},writeSFixed64Field:function(C,k){this.writeTag(C,Di.Fixed64),this.writeSFixed64(k)},writeVarintField:function(C,k){this.writeTag(C,Di.Varint),this.writeVarint(k)},writeSVarintField:function(C,k){this.writeTag(C,Di.Varint),this.writeSVarint(k)},writeStringField:function(C,k){this.writeTag(C,Di.Bytes),this.writeString(k)},writeFloatField:function(C,k){this.writeTag(C,Di.Fixed32),this.writeFloat(k)},writeDoubleField:function(C,k){this.writeTag(C,Di.Fixed64),this.writeDouble(k)},writeBooleanField:function(C,k){this.writeVarintField(C,!!k)}};function us(C,k,V){var ie=V.buf,xe,Ie;if(Ie=ie[V.pos++],xe=(Ie&112)>>4,Ie<128||(Ie=ie[V.pos++],xe|=(Ie&127)<<3,Ie<128)||(Ie=ie[V.pos++],xe|=(Ie&127)<<10,Ie<128)||(Ie=ie[V.pos++],xe|=(Ie&127)<<17,Ie<128)||(Ie=ie[V.pos++],xe|=(Ie&127)<<24,Ie<128)||(Ie=ie[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===Di.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,ie;if(C>=0?(V=C%4294967296|0,ie=C/4294967296|0):(V=~(-C%4294967296),ie=~(-C/4294967296),V^4294967295?V=V+1|0:(V=0,ie=ie+1|0)),C>=18446744073709552e3||C<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");k.realloc(10),Uu(V,ie,k),Qf(ie,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 ie=k<=16383?1:k<=2097151?2:k<=268435455?3:Math.floor(Math.log(k)/(Math.LN2*7));V.realloc(ie);for(var xe=V.pos-1;xe>=C;xe--)V.buf[xe+ie]=V.buf[xe]}function bh(C,k){for(var V=0;V>>8,C[V+2]=k>>>16,C[V+3]=k>>>24}function Lp(C,k){return(C[k]|C[k+1]<<8|C[k+2]<<16)+(C[k+3]<<24)}function pp(C,k,V){for(var ie="",xe=k;xe239?4:Ie>223?3:Ie>191?2:1;if(xe+ht>V)break;var Rt,Ht,tr;ht===1?Ie<128&&(qe=Ie):ht===2?(Rt=C[xe+1],(Rt&192)===128&&(qe=(Ie&31)<<6|Rt&63,qe<=127&&(qe=null))):ht===3?(Rt=C[xe+1],Ht=C[xe+2],(Rt&192)===128&&(Ht&192)===128&&(qe=(Ie&15)<<12|(Rt&63)<<6|Ht&63,(qe<=2047||qe>=55296&&qe<=57343)&&(qe=null))):ht===4&&(Rt=C[xe+1],Ht=C[xe+2],tr=C[xe+3],(Rt&192)===128&&(Ht&192)===128&&(tr&192)===128&&(qe=(Ie&15)<<18|(Rt&63)<<12|(Ht&63)<<6|tr&63,(qe<=65535||qe>=1114112)&&(qe=null))),qe===null?(qe=65533,ht=1):qe>65535&&(qe-=65536,ie+=String.fromCharCode(qe>>>10&1023|55296),qe=56320|qe&1023),ie+=String.fromCharCode(qe),xe+=ht}return ie}function uu(C,k,V){return _i.decode(C.subarray(k,V))}function fc(C,k,V){for(var ie=0,xe,Ie;ie55295&&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||ie+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 Pp(C,k,V){C===1&&V.readMessage(Kc,k)}function Kc(C,k,V){if(C===3){var ie=V.readMessage(dm,{}),xe=ie.id,Ie=ie.bitmap,qe=ie.width,ht=ie.height,Rt=ie.left,Ht=ie.top,tr=ie.advance;k.push({id:xe,bitmap:new kp({width:qe+2*Ju,height:ht+2*Ju},Ie),metrics:{width:qe,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 yo(C).readFields(Pp,[])}var hd=Ju;function Wp(C){for(var k=0,V=0,ie=0,xe=C;ie=0;Vr--){var pa=ht[Vr];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();Vr=0&&xe>=k&&bd[this.text.charCodeAt(xe)];xe--)ie--;this.text=this.text.substring(k,ie),this.sectionIndex=this.sectionIndex.slice(k,ie)},hh.prototype.substring=function(k,V){var ie=new hh;return ie.text=this.text.substring(k,V),ie.sectionIndex=this.sectionIndex.slice(k,V),ie.sections=this.sections,ie},hh.prototype.toString=function(){return this.text},hh.prototype.getMaxScale=function(){var k=this;return this.sectionIndex.reduce(function(V,ie){return Math.max(V,k.sections[ie].scale)},0)},hh.prototype.addTextSection=function(k,V){this.text+=k.text,this.sections.push(Ov.forText(k.scale,k.fontStack||V));for(var ie=this.sections.length-1,xe=0;xe=xd?null:++this.imageSectionID:(this.imageSectionID=D0,this.imageSectionID)};function lA(C,k){for(var V=[],ie=C.text,xe=0,Ie=0,qe=k;Ie=0,tr=0,Cr=0;Cr0&&Wf>Mo&&(Mo=Wf)}else{var Zl=V[_o.fontStack],Ol=Zl&&Zl[Eo];if(Ol&&Ol.rect)_s=Ol.rect,Zs=Ol.metrics;else{var $u=k[_o.fontStack],hc=$u&&$u[Eo];if(!hc)continue;Zs=hc.metrics}Ro=(li-_o.scale)*ai}Xl?(C.verticalizable=!0,Ni.push({glyph:Eo,imageName:Wl,x:Xr,y:Vr+Ro,vertical:Xl,scale:_o.scale,fontStack:_o.fontStack,sectionIndex:Ms,metrics:Zs,rect:_s}),Xr+=zu*_o.scale+Ht):(Ni.push({glyph:Eo,imageName:Wl,x:Xr,y:Vr+Ro,vertical:Xl,scale:_o.scale,fontStack:_o.fontStack,sectionIndex:Ms,metrics:Zs,rect:_s}),Xr+=Zs.advance*_o.scale+Ht)}if(Ni.length!==0){var tp=Xr-Ht;pa=Math.max(tp,pa),hA(Ni,0,Ni.length-1,Cn,Mo)}Xr=0;var rp=Ie*li+Mo;Vi.lineOffset=Math.max(Mo,xi),Vr+=rp,ja=Math.max(rp,ja),++un}var vh=Vr-vm,mp=$1(qe),gp=mp.horizontalAlign,rh=mp.verticalAlign;Oh(C.positionedLines,Cn,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,ie,xe){if(!(!ie&&!xe))for(var Ie=C[V],qe=Ie.metrics.advance*Ie.scale,ht=(C[V].x+qe)*ie,Rt=k;Rt<=V;Rt++)C[Rt].x-=ht,C[Rt].y+=xe}function Oh(C,k,V,ie,xe,Ie,qe,ht,Rt){var Ht=(k-V)*xe,tr=0;Ie!==qe?tr=-ht*ie-vm:tr=(-ie*Rt+.5)*qe;for(var Cr=0,Xr=C;Cr-V/2;){if(qe--,qe<0)return!1;ht-=C[qe].dist(Ie),Ie=C[qe]}ht+=C[qe].dist(C[qe+1]),qe++;for(var Rt=[],Ht=0;htie;)Ht-=Rt.shift().angleDelta;if(Ht>xe)return!1;qe++,ht+=Cr.dist(Xr)}return!0}function _k(C){for(var k=0,V=0;VHt){var pa=(Ht-Rt)/Vr,ja=Ml(Cr.x,Xr.x,pa),Cn=Ml(Cr.y,Xr.y,pa),un=new ep(ja,Cn,Xr.angleTo(Cr),tr);return un._round(),!qe||yk(C,un,ht,qe,k)?un:void 0}Rt+=Vr}}function _W(C,k,V,ie,xe,Ie,qe,ht,Rt){var Ht=xk(ie,Ie,qe),tr=bk(ie,xe),Cr=tr*qe,Xr=C[0].x===0||C[0].x===Rt||C[0].y===0||C[0].y===Rt;k-Cr=0&&ei=0&&li=0&&Xr+Ht<=tr){var xi=new ep(ei,li,ti,pa);xi._round(),(!ie||yk(C,xi,Ie,ie,xe))&&Vr.push(xi)}}Cr+=un}return!ht&&!Vr.length&&!qe&&(Vr=wk(C,Cr/2,V,ie,xe,Ie,qe,!0,Rt)),Vr}function Tk(C,k,V,ie,xe){for(var Ie=[],qe=0;qe=ie&&Cr.x>=ie)&&(tr.x>=ie?tr=new n(ie,tr.y+(Cr.y-tr.y)*((ie-tr.x)/(Cr.x-tr.x)))._round():Cr.x>=ie&&(Cr=new n(ie,tr.y+(Cr.y-tr.y)*((ie-tr.x)/(Cr.x-tr.x)))._round()),!(tr.y>=xe&&Cr.y>=xe)&&(tr.y>=xe?tr=new n(tr.x+(Cr.x-tr.x)*((xe-tr.y)/(Cr.y-tr.y)),xe)._round():Cr.y>=xe&&(Cr=new n(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 O0=Rc;function Ak(C,k,V,ie){var xe=[],Ie=C.image,qe=Ie.pixelRatio,ht=Ie.paddedRect.w-2*O0,Rt=Ie.paddedRect.h-2*O0,Ht=C.right-C.left,tr=C.bottom-C.top,Cr=Ie.stretchX||[[0,ht]],Xr=Ie.stretchY||[[0,Rt]],Vr=function(Zl,Ol){return Zl+Ol[1]-Ol[0]},pa=Cr.reduce(Vr,0),ja=Xr.reduce(Vr,0),Cn=ht-pa,un=Rt-ja,ti=0,Un=pa,ei=0,li=ja,xi=0,Vi=Cn,Ni=0,Mo=un;if(Ie.content&&ie){var io=Ie.content;ti=lb(Cr,0,io[0]),ei=lb(Xr,0,io[1]),Un=lb(Cr,io[0],io[2]),li=lb(Xr,io[1],io[3]),xi=io[0]-ti,Ni=io[1]-ei,Vi=io[2]-io[0]-Un,Mo=io[3]-io[1]-li}var _o=function(Zl,Ol,$u,hc){var cf=ub(Zl.stretch-ti,Un,Ht,C.left),yf=cb(Zl.fixed-xi,Vi,Zl.stretch,pa),dh=ub(Ol.stretch-ei,li,tr,C.top),Wf=cb(Ol.fixed-Ni,Mo,Ol.stretch,ja),tp=ub($u.stretch-ti,Un,Ht,C.left),rp=cb($u.fixed-xi,Vi,$u.stretch,pa),vh=ub(hc.stretch-ei,li,tr,C.top),mp=cb(hc.fixed-Ni,Mo,hc.stretch,ja),gp=new n(cf,dh),rh=new n(tp,dh),yp=new n(tp,vh),od=new n(cf,vh),Uv=new n(yf/qe,Wf/qe),ym=new n(rp/qe,mp/qe),_m=k*Math.PI/180;if(_m){var xm=Math.sin(_m),H0=Math.cos(_m),wd=[H0,-xm,xm,H0];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+O0+mb,y:Ie.paddedRect.y+O0+gb,w:xA-mb,h:bA-gb},W0=Vi/qe/Ht,yb=Mo/qe/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:W0,minFontScaleY:yb,isSDF:V}};if(!ie||!Ie.stretchX&&!Ie.stretchY)xe.push(_o({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:ht+1},{fixed:0,stretch:Rt+1}));else for(var Ms=Sk(Cr,Cn,pa),Eo=Sk(Xr,un,ja),Ro=0;Ro0&&(pa=Math.max(10,pa),this.circleDiameter=pa)}else{var ja=qe.top*ht-Rt,Cn=qe.bottom*ht+Rt,un=qe.left*ht-Rt,ti=qe.right*ht+Rt,Un=qe.collisionPadding;if(Un&&(un-=Un[0]*ht,ja-=Un[1]*ht,ti+=Un[2]*ht,Cn+=Un[3]*ht),tr){var ei=new n(un,ja),li=new n(ti,ja),xi=new n(un,Cn),Vi=new n(ti,Cn),Ni=tr*Math.PI/180;ei._rotate(Ni),li._rotate(Ni),xi._rotate(Ni),Vi._rotate(Ni),un=Math.min(ei.x,li.x,xi.x,Vi.x),ti=Math.max(ei.x,li.x,xi.x,Vi.x),ja=Math.min(ei.y,li.y,xi.y,Vi.y),Cn=Math.max(ei.y,li.y,xi.y,Vi.y)}k.emplaceBack(V.x,V.y,un,ja,ti,Cn,ie,xe,Ie)}this.boxEndIndex=k.length},B0=function(k,V){if(k===void 0&&(k=[]),V===void 0&&(V=bW),this.data=k,this.length=this.data.length,this.compare=V,this.length>0)for(var ie=(this.length>>1)-1;ie>=0;ie--)this._down(ie)};B0.prototype.push=function(k){this.data.push(k),this.length++,this._up(this.length-1)},B0.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}},B0.prototype.peek=function(){return this.data[0]},B0.prototype._up=function(k){for(var V=this,ie=V.data,xe=V.compare,Ie=ie[k];k>0;){var qe=k-1>>1,ht=ie[qe];if(xe(Ie,ht)>=0)break;ie[k]=ht,k=qe}ie[k]=Ie},B0.prototype._down=function(k){for(var V=this,ie=V.data,xe=V.compare,Ie=this.length>>1,qe=ie[k];k=0)break;ie[k]=Rt,k=ht}ie[k]=qe};function bW(C,k){return Ck?1:0}function wW(C,k,V){k===void 0&&(k=1),V===void 0&&(V=!1);for(var ie=1/0,xe=1/0,Ie=-1/0,qe=-1/0,ht=C[0],Rt=0;RtIe)&&(Ie=Ht.x),(!Rt||Ht.y>qe)&&(qe=Ht.y)}var tr=Ie-ie,Cr=qe-xe,Xr=Math.min(tr,Cr),Vr=Xr/2,pa=new B0([],TW);if(Xr===0)return new n(ie,xe);for(var ja=ie;jaun.d||!un.d)&&(un=Un,V&&console.log("found best %d after %d probes",Math.round(1e4*Un.d)/1e4,ti)),!(Un.max-un.d<=k)&&(Vr=Un.h/2,pa.push(new N0(Un.p.x-Vr,Un.p.y-Vr,Vr,C)),pa.push(new N0(Un.p.x+Vr,Un.p.y-Vr,Vr,C)),pa.push(new N0(Un.p.x-Vr,Un.p.y+Vr,Vr,C)),pa.push(new N0(Un.p.x+Vr,Un.p.y+Vr,Vr,C)),ti+=4)}return V&&(console.log("num probes: "+ti),console.log("best distance: "+un.d)),un.p}function TW(C,k){return k.max-C.max}function N0(C,k,V,ie){this.p=new n(C,k),this.h=V,this.d=AW(this.p,ie),this.max=this.d+this.h*Math.SQRT2}function AW(C,k){for(var V=!1,ie=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),ie=Math.min(ie,Vd(C,Ht,tr))}return(V?1:-1)*Math.sqrt(ie)}function SW(C){for(var k=0,V=0,ie=0,xe=C[0],Ie=0,qe=xe.length,ht=qe-1;Ie=dn||wd.y<0||wd.y>=dn||CW(C,wd,H0,V,ie,xe,Eo,C.layers[0],C.collisionBoxArray,k.index,k.sourceLayerIndex,C.index,un,li,Ni,Rt,Un,xi,Mo,Vr,k,Ie,Ht,tr,qe)};if(io==="line")for(var Zs=0,_s=Tk(k.geometry,0,0,dn,dn);Zs<_s.length;Zs+=1)for(var Wl=_s[Zs],zu=_W(Wl,ei,Vi,V.vertical||pa,ie,ja,ti,C.overscaling,dn),Xl=0,Zl=zu;Xl1){var dh=yW(yf,Vi,V.vertical||pa,ie,ja,ti);dh&&Ro(yf,dh)}}else if(k.type==="Polygon")for(var Wf=0,tp=C0(k.geometry,0);Wfmm&&U(C.layerIds[0]+': Value for "text-size" is >= '+Q1+'. Reduce your "text-size".')):Cn.kind==="composite"&&(un=[Bh*Vr.compositeTextSizes[0].evaluate(qe,{},pa),Bh*Vr.compositeTextSizes[1].evaluate(qe,{},pa)],(un[0]>mm||un[1]>mm)&&U(C.layerIds[0]+': Value for "text-size" is >= '+Q1+'. Reduce your "text-size".')),C.addSymbols(C.text,ja,un,ht,Ie,qe,Ht,k,Rt.lineStartIndex,Rt.lineLength,Xr,pa);for(var ti=0,Un=tr;timm&&U(C.layerIds[0]+': Value for "icon-size" is >= '+Q1+'. Reduce your "icon-size".')):gp.kind==="composite"&&(rh=[Bh*li.compositeIconSizes[0].evaluate(ei,{},Vi),Bh*li.compositeIconSizes[1].evaluate(ei,{},Vi)],(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,Un,ti,ei,!1,k,io.lineStartIndex,io.lineLength,-1,Vi),Xl=C.icon.placedSymbolArray.length-1,mp&&(_s=mp.length*4,C.addSymbols(C.icon,mp,rh,Un,ti,ei,dp.vertical,k,io.lineStartIndex,io.lineLength,-1,Vi),Zl=C.icon.placedSymbolArray.length-1)}for(var yp in ie.horizontal){var od=ie.horizontal[yp];if(!_o){$u=me(od.text);var Uv=ht.layout.get("text-rotate").evaluate(ei,{},Vi);_o=new fb(Rt,k,Ht,tr,Cr,od,Xr,Vr,pa,Uv)}var ym=od.positionedLines.length===1;if(Wl+=Ek(C,k,od,Ie,ht,pa,ei,ja,io,ie.vertical?dp.horizontal:dp.horizontalOnly,ym?Object.keys(ie.horizontal):[yp],Ol,Xl,li,Vi),ym)break}ie.vertical&&(zu+=Ek(C,k,ie.vertical,Ie,ht,pa,ei,ja,io,dp.vertical,["vertical"],Ol,Zl,li,Vi));var _m=_o?_o.boxStartIndex:C.collisionBoxArray.length,xm=_o?_o.boxEndIndex:C.collisionBoxArray.length,H0=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,W0=function(r_,Gk){return r_&&r_.circleDiameter?Math.max(r_.circleDiameter,Gk):Gk};pd=W0(_o,pd),pd=W0(Eo,pd),pd=W0(Ms,pd),pd=W0(Ro,pd);var yb=pd>-1?1:0;yb&&(pd*=Ni/ai),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"),ei.sortKey!==void 0&&C.addToSortKeyRanges(C.symbolInstances.length,ei.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,H0,wd,mb,xA,gb,bA,Ht,Wl,zu,Zs,_s,yb,0,Xr,hc,cf,pd)}function kW(C,k,V,ie){var xe=C.compareText;if(!(k in xe))xe[k]=[];else for(var Ie=xe[k],qe=Ie.length-1;qe>=0;qe--)if(ie.dist(Ie[qe])0)&&(qe.value.kind!=="constant"||qe.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,Vr=V.glyphDependencies,pa=V.availableImages,ja=new gi(this.zoom),Cn=0,un=k;Cn=0;for(var zu=0,Xl=Mo.sections;zu=0;Rt--)qe[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 ie=k.placedSymbolArray.get(V),xe=ie.vertexStartIndex+ie.numGlyphs*4,Ie=ie.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 ie=0,xe=this.symbolInstanceIndexes;ie=0&&Ht.indexOf(ht)===Rt&&V.addIndicesForPlacedSymbol(V.text,ht)}),qe.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,qe.verticalPlacedTextSymbolIndex),qe.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,qe.placedIconSymbolIndex),qe.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,qe.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 RW(C,k){return k.replace(/{([^{}]+)}/g,function(V,ie){return ie in C?String(C[ie]):""})}var DW=new xa({"symbol-placement":new nt(jn.layout_symbol["symbol-placement"]),"symbol-spacing":new nt(jn.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new nt(jn.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Yt(jn.layout_symbol["symbol-sort-key"]),"symbol-z-order":new nt(jn.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new nt(jn.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new nt(jn.layout_symbol["icon-ignore-placement"]),"icon-optional":new nt(jn.layout_symbol["icon-optional"]),"icon-rotation-alignment":new nt(jn.layout_symbol["icon-rotation-alignment"]),"icon-size":new Yt(jn.layout_symbol["icon-size"]),"icon-text-fit":new nt(jn.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new nt(jn.layout_symbol["icon-text-fit-padding"]),"icon-image":new Yt(jn.layout_symbol["icon-image"]),"icon-rotate":new Yt(jn.layout_symbol["icon-rotate"]),"icon-padding":new nt(jn.layout_symbol["icon-padding"]),"icon-keep-upright":new nt(jn.layout_symbol["icon-keep-upright"]),"icon-offset":new Yt(jn.layout_symbol["icon-offset"]),"icon-anchor":new Yt(jn.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new nt(jn.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new nt(jn.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new nt(jn.layout_symbol["text-rotation-alignment"]),"text-field":new Yt(jn.layout_symbol["text-field"]),"text-font":new Yt(jn.layout_symbol["text-font"]),"text-size":new Yt(jn.layout_symbol["text-size"]),"text-max-width":new Yt(jn.layout_symbol["text-max-width"]),"text-line-height":new nt(jn.layout_symbol["text-line-height"]),"text-letter-spacing":new Yt(jn.layout_symbol["text-letter-spacing"]),"text-justify":new Yt(jn.layout_symbol["text-justify"]),"text-radial-offset":new Yt(jn.layout_symbol["text-radial-offset"]),"text-variable-anchor":new nt(jn.layout_symbol["text-variable-anchor"]),"text-anchor":new Yt(jn.layout_symbol["text-anchor"]),"text-max-angle":new nt(jn.layout_symbol["text-max-angle"]),"text-writing-mode":new nt(jn.layout_symbol["text-writing-mode"]),"text-rotate":new Yt(jn.layout_symbol["text-rotate"]),"text-padding":new nt(jn.layout_symbol["text-padding"]),"text-keep-upright":new nt(jn.layout_symbol["text-keep-upright"]),"text-transform":new Yt(jn.layout_symbol["text-transform"]),"text-offset":new Yt(jn.layout_symbol["text-offset"]),"text-allow-overlap":new nt(jn.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new nt(jn.layout_symbol["text-ignore-placement"]),"text-optional":new nt(jn.layout_symbol["text-optional"])}),zW=new xa({"icon-opacity":new Yt(jn.paint_symbol["icon-opacity"]),"icon-color":new Yt(jn.paint_symbol["icon-color"]),"icon-halo-color":new Yt(jn.paint_symbol["icon-halo-color"]),"icon-halo-width":new Yt(jn.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Yt(jn.paint_symbol["icon-halo-blur"]),"icon-translate":new nt(jn.paint_symbol["icon-translate"]),"icon-translate-anchor":new nt(jn.paint_symbol["icon-translate-anchor"]),"text-opacity":new Yt(jn.paint_symbol["text-opacity"]),"text-color":new Yt(jn.paint_symbol["text-color"],{runtimeType:As,getOverride:function(C){return C.textColor},hasOverride:function(C){return!!C.textColor}}),"text-halo-color":new Yt(jn.paint_symbol["text-halo-color"]),"text-halo-width":new Yt(jn.paint_symbol["text-halo-width"]),"text-halo-blur":new Yt(jn.paint_symbol["text-halo-blur"]),"text-translate":new nt(jn.paint_symbol["text-translate"]),"text-translate-anchor":new nt(jn.paint_symbol["text-translate-anchor"])}),mA={paint:zW,layout:DW},V0=function(k){this.type=k.property.overrides?k.property.overrides.runtimeType:rl,this.defaultValue=k};V0.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},V0.prototype.eachChild=function(k){if(!this.defaultValue.isConstant()){var V=this.defaultValue.value;k(V._styleExpression.expression)}},V0.prototype.outputDefined=function(){return!1},V0.prototype.serialize=function(){return null},de("FormatSectionOverride",V0,{omit:["defaultValue"]});var FW=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(ie,xe){if(C.prototype.recalculate.call(this,ie,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 qe=[],ht=0,Rt=Ie;ht",targetMapId:xe,sourceMapId:qe.mapId})}}},q0.prototype.receive=function(k){var V=k.data,ie=V.id;if(ie&&!(V.targetMapId&&this.mapId!==V.targetMapId))if(V.type===""){delete this.tasks[ie];var xe=this.cancelCallbacks[ie];delete this.cancelCallbacks[ie],xe&&xe()}else se()||V.mustQueue?(this.tasks[ie]=V,this.taskQueue.push(ie),this.invoker.trigger()):this.processTask(ie,V)},q0.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)}},q0.prototype.processTask=function(k,V){var ie=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,qe=$(this.globalScope)?void 0:[],ht=V.hasCallback?function(Xr,Vr){Ie=!0,delete ie.cancelCallbacks[k],ie.target.postMessage({id:k,type:"",sourceMapId:ie.mapId,error:Xr?_t(Xr):null,data:_t(Vr,qe)},qe)}: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)}},q0.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};function XW(C,k,V){k=Math.pow(2,V)-k-1;var ie=Rk(C*256,k*256,V),xe=Rk((C+1)*256,(k+1)*256,V);return ie[0]+","+ie[1]+","+xe[0]+","+xe[1]}function Rk(C,k,V){var ie=2*Math.PI*6378137/256/Math.pow(2,V),xe=C*ie-2*Math.PI*6378137/2,Ie=k*ie-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,ie=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 qe=k;return this.extend(Gf.convert(qe))}else{var ht=k;return this.extend(Dc.convert(ht))}return this}return!V&&!ie?(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),ie.lng=Math.max(Ie.lng,ie.lng),ie.lat=Math.max(Ie.lat,ie.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),ie=V.lng,xe=V.lat,Ie=this._sw.lat<=xe&&xe<=this._ne.lat,qe=this._sw.lng<=ie&&ie<=this._ne.lng;return this._sw.lng>this._ne.lng&&(qe=this._sw.lng>=ie&&ie>=this._ne.lng),Ie&&qe},Gf.convert=function(k){return!k||k instanceof Gf?k:new Gf(k)};var Dk=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,ie=this.lat*V,xe=k.lat*V,Ie=Math.sin(ie)*Math.sin(xe)+Math.cos(ie)*Math.cos(xe)*Math.cos((k.lng-this.lng)*V),qe=Dk*Math.acos(Math.min(Ie,1));return qe},Dc.prototype.toBounds=function(k){k===void 0&&(k=0);var V=40075017,ie=360*k/V,xe=ie/Math.cos(Math.PI/180*this.lat);return new Gf(new Dc(this.lng-xe,this.lat-ie),new Dc(this.lng+xe,this.lat+ie))},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 zk=2*Math.PI*Dk;function Fk(C){return zk*Math.cos(C*Math.PI/180)}function Ok(C){return(180+C)/360}function Bk(C){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+C*Math.PI/360)))/360}function Nk(C,k){return C/Fk(k)}function ZW(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 YW(C,k){return C*Fk(yA(k))}function KW(C){return 1/Math.cos(C*Math.PI/180)}var Bg=function(k,V,ie){ie===void 0&&(ie=0),this.x=+k,this.y=+V,this.z=+ie};Bg.fromLngLat=function(k,V){V===void 0&&(V=0);var ie=Dc.convert(k);return new Bg(Ok(ie.lng),Bk(ie.lat),Nk(V,ie.lat))},Bg.prototype.toLngLat=function(){return new Dc(ZW(this.x),yA(this.y))},Bg.prototype.toAltitude=function(){return YW(this.z,this.y)},Bg.prototype.meterInMercatorCoordinateUnits=function(){return 1/zk*KW(yA(this.y))};var Ng=function(k,V,ie){this.z=k,this.x=V,this.y=ie,this.key=t_(0,k,k,V,ie)};Ng.prototype.equals=function(k){return this.z===k.z&&this.x===k.x&&this.y===k.y},Ng.prototype.url=function(k,V){var ie=XW(this.x,this.y,this.z),xe=JW(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}",ie)},Ng.prototype.getTilePoint=function(k){var V=Math.pow(2,this.z);return new n((k.x*V-this.x)*dn,(k.y*V-this.y)*dn)},Ng.prototype.toString=function(){return this.z+"/"+this.x+"/"+this.y};var Uk=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,ie,xe,Ie){this.overscaledZ=k,this.wrap=V,this.canonical=new Ng(ie,+xe,+Ie),this.key=t_(V,k,ie,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 ie=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>>ie,this.canonical.y>>ie)},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,ie=this.canonical.x*2,xe=this.canonical.y*2;return[new Hf(V,this.wrap,V,ie,xe),new Hf(V,this.wrap,V,ie+1,xe),new Hf(V,this.wrap,V,ie,xe+1),new Hf(V,this.wrap,V,ie+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,ie){return(k*256*256+V*256+ie)/10-1e4},Bv.prototype._unpackTerrarium=function(k,V,ie){return k*256+V+ie/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,ie){if(this.dim!==k.dim)throw new Error("dem dimension mismatch");var xe=V*this.dim,Ie=V*this.dim+this.dim,qe=ie*this.dim,ht=ie*this.dim+this.dim;switch(V){case-1:xe=Ie-1;break;case 1:Ie=xe+1;break}switch(ie){case-1:qe=ht-1;break;case 1:ht=qe+1;break}for(var Rt=-V*this.dim,Ht=-ie*this.dim,tr=qe;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 yo(this.rawTileData)).layers,this.sourceLayerCoder=new db(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},Nv.prototype.query=function(k,V,ie,xe){var Ie=this;this.loadVTLayers();for(var qe=k.params||{},ht=dn/k.tileSize/k.scale,Rt=Je(qe.filter),Ht=k.queryGeometry,tr=k.queryPadding*ht,Cr=Vk(Ht),Xr=this.grid.query(Cr.minX-tr,Cr.minY-tr,Cr.maxX+tr,Cr.maxY+tr),Vr=Vk(k.cameraQueryGeometry),pa=this.grid3D.query(Vr.minX-tr,Vr.minY-tr,Vr.maxX+tr,Vr.maxY+tr,function(xi,Vi,Ni,Mo){return rd(k.cameraQueryGeometry,xi-tr,Vi-tr,Ni+tr,Mo+tr)}),ja=0,Cn=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,rn,this.tileID.canonical),Ia.bucketLayerIDs.push(Ur.map(function(ha){return ha.id}))}}}}var fa,It,dr,kr,na=e.mapObject(rn.glyphDependencies,function(ha){return Object.keys(ha).map(Number)});Object.keys(na).length?Pr.send("getGlyphs",{uid:this.uid,stacks:na},function(ha,Da){fa||(fa=ha,It=Da,Ya.call(ma))}):It={};var Ca=Object.keys(rn.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(rn.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 o(It),Da=new e.ImageAtlas(dr,kr);for(var Zn in Ha){var Pn=Ha[Zn];Pn instanceof e.SymbolBucket?(c(Pn.layers,this.zoom,Wt),e.performSymbolLayout(Pn,It,ha.positions,dr,Da.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):Pn.hasPattern&&(Pn instanceof e.LineBucket||Pn instanceof e.FillBucket||Pn instanceof e.FillExtrusionBucket)&&(c(Pn.layers,this.zoom,Wt),Pn.addFeatures(rn,this.tileID.canonical,Da.patternPositions))}this.status="done",ta(null,{buckets:e.values(Ha).filter(function(fi){return!fi.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,g=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))};g.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],rn=typeof Ha;rn!=="string"&&rn!=="boolean"&&rn!=="number"&&(Ha=JSON.stringify(Ha));var nn=rn+":"+Ha,yn=ma[nn];typeof yn>"u"&&(Pr.push(Ha),yn=Pr.length-1,ma[nn]=yn),Nt.writeVarint(yn)}}function Q(Jt,Nt){return(Nt<<3)+(Jt&7)}function ue(Jt){return Jt<<1^Jt>>31}function se(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),H(Jt,Nt,Kt,Wt,ma-1,ta+1),H(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),rn=.5*Math.sqrt(Ia*Ha*(ma-Ha)/ma)*(ra-ma/2<0?-1:1),nn=Math.max(Wt,Math.floor(Kt-ra*Ha/ma+rn)),yn=Math.min(Pr,Math.floor(Kt+(ma-ra)*Ha/ma+rn));$(Jt,Nt,Kt,nn,yn,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,rn;ra.length;){var nn=ra.pop(),yn=ra.pop(),xt=ra.pop();if(yn-xt<=ma){for(var ct=xt;ct<=yn;ct++)Ha=Nt[2*ct],rn=Nt[2*ct+1],Ha>=Kt&&Ha<=Pr&&rn>=Wt&&rn<=ta&&Ia.push(Jt[ct]);continue}var Nr=Math.floor((xt+yn)/2);Ha=Nt[2*Nr],rn=Nt[2*Nr+1],Ha>=Kt&&Ha<=Pr&&rn>=Wt&&rn<=ta&&Ia.push(Jt[Nr]);var Or=(nn+1)%2;(nn===0?Kt<=Ha:Wt<=rn)&&(ra.push(xt),ra.push(Nr-1),ra.push(Or)),(nn===0?Pr>=Ha:ta>=rn)&&(ra.push(Nr+1),ra.push(yn),ra.push(Or))}return Ia}function ne(Jt,Nt,Kt,Wt,Pr,ta){for(var ma=[0,Jt.length-1,0],ra=[],Ia=Pr*Pr;ma.length;){var Ha=ma.pop(),rn=ma.pop(),nn=ma.pop();if(rn-nn<=ta){for(var yn=nn;yn<=rn;yn++)j(Nt[2*yn],Nt[2*yn+1],Kt,Wt)<=Ia&&ra.push(Jt[yn]);continue}var xt=Math.floor((nn+rn)/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(nn),ma.push(xt-1),ma.push(Or)),(Ha===0?Kt+Pr>=ct:Wt+Pr>=Nr)&&(ma.push(xt+1),ma.push(rn),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;rn--){var nn=+Date.now();Ia=this._cluster(Ia,rn),this.trees[rn]=new ce(Ia,fe,Fe,ma,Float32Array),Wt&&console.log("z%d: %d clusters in %dms",rn,Ia.length,+Date.now()-nn)}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)],rn=Ha.range(ot(Wt),tt(ma),ot(ta),tt(Pr)),nn=[],yn=0,xt=rn;ynKt&&(Nr+=Gr.numPoints||1)}if(Nr>=Ia){for(var Kr=nn.x*ct,Ur=nn.y*ct,aa=ra&&ct>1?this._map(nn,!0):null,da=(rn<<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 We(Jt){return{type:"Feature",id:Jt.id,properties:it(Jt),geometry:{type:"Point",coordinates:[ut(Jt.x),Me(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 ut(Jt){return(Jt-.5)*360}function Me(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],rn=Jt[Kt],nn=Jt[Kt+1],yn=Nt+3;ynPr)ra=yn,Pr=xt;else if(xt===Pr){var ct=Math.abs(yn-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 rn=Nt.length-3;Nt[2]=1,rt(Nt,0,rn,Kt),Nt[rn+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(yn==="Point"||yn==="MultiPoint")Be(nn,Nr,Kt,Wt,Pr);else if(yn==="LineString")Ke(nn,Nr,Kt,Wt,Pr,!1,ra.lineMetrics);else if(yn==="MultiLineString")Ee(nn,Nr,Kt,Wt,Pr,!1);else if(yn==="Polygon")Ee(nn,Nr,Kt,Wt,Pr,!0);else if(yn==="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,rn,nn,yn=0;ynKt&&(nn=Ia(ra,xt,ct,Or,Rr,Kt),ma&&(ra.start=Ha+rn*nn)):Lr>Wt?Gr=Kt&&(nn=Ia(ra,xt,ct,Or,Rr,Kt),Kr=!0),Gr>Wt&&Lr<=Wt&&(nn=Ia(ra,xt,ct,Or,Rr,Wt),Kr=!0),!ta&&Kr&&(ma&&(ra.end=Ha+rn*nn),Nt.push(ra),ra=Ue(Jt)),ma&&(Ha+=rn)}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&&Ve(ra,xt,ct,Nr),Ur=ra.length-3,ta&&Ur>=3&&(ra[Ur]!==ra[0]||ra[Ur+1]!==ra[1])&&Ve(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 Ee(Jt,Nt,Kt,Wt,Pr,ta){for(var ma=0;mama.maxX&&(ma.maxX=rn),nn>ma.maxY&&(ma.maxY=nn)}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=qt(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 rn=1<1&&console.time("creation"),yn=this.tiles[nn]=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,yn.numFeatures,yn.numPoints,yn.numSimplified),console.timeEnd("creation"));var xt="z"+Nt;this.stats[xt]=(this.stats[xt]||0)+1,this.total++}if(yn.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,rn,Kt-Nr,Kt+Rr,0,yn.minX,yn.maxX,Ia),fa=bt(Jt,rn,Kt+Or,Kt+Lr,0,yn.minX,yn.maxX,Ia),Jt=null,da&&(Gr=bt(da,rn,Wt-Nr,Wt+Rr,1,yn.minY,yn.maxY,Ia),Kr=bt(da,rn,Wt+Or,Wt+Lr,1,yn.minY,yn.maxY,Ia),da=null),fa&&(Ur=bt(fa,rn,Wt-Nr,Wt+Rr,1,yn.minY,yn.maxY,Ia),aa=bt(fa,rn,Wt+Or,Wt+Lr,1,yn.minY,yn.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,rn=Kt,nn;!nn&&Ia>0;)Ia--,Ha=Math.floor(Ha/2),rn=Math.floor(rn/2),nn=this.tiles[Ba(Ia,Ha,rn)];return!nn||!nn.source?null:(ta>1&&console.log("found parent tile z%d-%d-%d",Ia,Ha,rn),ta>1&&console.time("drilling down"),this.splitTile(nn.source,Ia,Ha,rn,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 d(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,nr=gt.x,fr=gt.y,sr=gt.sdf,pr=gt.pixelRatio,lr=gt.stretchX,Xt=gt.stretchY,or=gt.content,Vt=new e.RGBAImage({width:Et,height:Ft});e.RGBAImage.copy(_r,Vt,{x:nr,y:fr},{x:0,y:0},{width:Et,height:Ft}),Fr[hr]={data:Vt,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 nr=gt.requests[Ft];nr||(nr=gt.requests[Ft]=[],y.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=nr;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 nr=me-Math.abs(Ft);Et=Math.sqrt(gt*gt+nr*nr)}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}]),se=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}(se),$=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=nr.children(this._source.maxzoom)[0],pr=this.getTile(sr);if(pr&&pr.hasData()){Ge[sr.key]=sr;continue}}else{var lr=nr.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=nr.overscaledZ-1;or>=$e;--or){var Vt=nr.scaledTo(or);if(Le[Vt.key]||(Le[Vt.key]=!0,fr=this.getTile(Vt),!fr&&Xt&&(fr=this._addTile(Vt)),fr&&(Ge[Vt.key]=Vt,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,nr=-1/0,fr=0,sr=Fr;fr=0&&_n[1].y+ba>=0){var Xa=_r.map(function($n){return Dr.getTilePoint($n)}),ln=Fr.map(function($n){return Dr.getTilePoint($n)});$e.push({tile:Vt,tileID:Dr,queryGeometry:Xa,cameraQueryGeometry:ln,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 rn="mapboxgl_preloaded_worker_pool",nn=function(){this.active={}};nn.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 nr=this.circleCells[Ge];if(nr!==null)for(var fr=this.circles,sr=0,pr=nr;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 Zn(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 Pn(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 fi(ve,Y){return .5+.5*(ve/Y)}function Ai(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 ki(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,nr=0;nrGe)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,nr=ve.lineOffsetY*Et,fr;if(ve.numGlyphs>1){var sr=ve.glyphStartIndex+ve.numGlyphs,pr=ve.lineStartIndex,lr=ve.lineStartIndex+ve.lineLength,Xt=zi(Et,$e,Ft,nr,ye,_r,Fr,ve,mt,Ge,hr);if(!Xt)return{notEnoughRoom:!0};var or=Pn(Xt.first.point,Le).point,Vt=Pn(Xt.last.point,Le).point;if(te&&!ye){var Dr=Xi(ve.writingMode,or,Vt,gt);if(Dr)return Dr}fr=[Xt.first];for(var Jr=ve.glyphStartIndex+1;Jr0?ln.point:go(Fr,Xa,ba,1,me),Nn=Xi(ve.writingMode,ba,$n,gt);if(Nn)return Nn}var dn=pi(Et*$e.getoffsetX(ve.glyphStartIndex),Ft,nr,ye,_r,Fr,ve.segment,ve.lineStartIndex,ve.lineStartIndex+ve.lineLength,mt,Ge,hr);if(!dn)return{notEnoughRoom:!0};fr=[dn]}for(var Tn=0,En=fr;Tn0?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,nr=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=nr,Xt.push(nr),nr=Fr[Ft],nr===void 0){var or=new e.Point(jt.getx(Ft),jt.gety(Ft)),Vt=Pn(or,_r);if(Vt.signedDistanceFromCamera>0)nr=Fr[Ft]=Vt.point;else{var Dr=Ft-gt,Jr=sr===0?Ge:new e.Point(jt.getx(Dr),jt.gety(Dr));nr=go(Jr,or,fr,lr-sr+1,_r)}}sr+=pr,pr=fr.dist(nr)}var ba=(lr-sr)/pr,_n=nr.sub(fr),Xa=_n.mult(ba)._add(fr);Xa._add(_n._unit()._perp()._mult(ye*gt));var ln=Et+Math.atan2(nr.y-fr.y,nr.x-fr.x);return Xt.push(Xa),{point:Xa,angle:ln,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;Gn--)En.push(dn.path[Gn]);for(var ci=1;ci0){for(var Fo=En[0].clone(),bs=En[0].clone(),Hs=1;Hs=ln.x&&bs.x<=$n.x&&Fo.y>=ln.y&&bs.y<=$n.y?ks=[En]:bs.x$n.x||bs.y$n.y?ks=[]:ks=e.clipLine([En],ln.x,ln.y,$n.x,$n.y)}for(var pu=0,Ap=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:nr,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,nr=$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",Vt=$e.get("symbol-z-order")==="viewport-y",Dr=sr&&(pr||!Le.hasIconData()||fr),Jr=pr&&(sr||!Le.hasTextData()||nr);!Le.collisionArrays&>&&Le.deserializeCollisionBoxes(gt);var ba=function(dn,Tn){if(!ye[dn.crossTileID]){if(hr){me.placements[dn.crossTileID]=new Oo(!1,!1,!1);return}var En=!1,Gn=!1,ci=!0,bo=null,jo={box:null,offscreen:null},ks={box:null,offscreen:null},Fo=null,bs=null,Hs=null,pu=0,Ap=0,Sp=0;Tn.textFeatureIndex?pu=Tn.textFeatureIndex:dn.useRuntimeCollisionCircles&&(pu=dn.featureIndex),Tn.verticalTextFeatureIndex&&(Ap=Tn.verticalTextFeatureIndex);var Ph=Tn.textBox;if(Ph){var Vp=function(cc){var lu=e.WritingMode.horizontal;if(Le.allowVerticalPlacement&&!cc&&me.prevPlacement){var Dh=me.prevPlacement.placedOrientations[dn.crossTileID];Dh&&(me.placedOrientations[dn.crossTileID]=Dh,lu=Dh,me.markUsedOrientation(Le,lu,dn))}return lu},Vd=function(cc,lu){if(Le.allowVerticalPlacement&&dn.numVerticalGlyphVertices>0&&Tn.verticalTextBox)for(var Dh=0,Iv=Le.writingModes;Dh0&&(Kh=Kh.filter(function(cc){return cc!==Rh.anchor}),Kh.unshift(Rh.anchor))}var Mp=function(cc,lu,Dh){for(var Iv=cc.x2-cc.x1,om=cc.y2-cc.y1,Au=dn.textBoxScale,xg=or&&!pr?lu:null,sv={box:[],offscreen:!1},_0=sr?Kh.length*2:Kh.length,Cp=0;Cp<_0;++Cp){var lv=Kh[Cp%Kh.length],x0=Cp>=Kh.length,bg=me.attemptAnchorPlacement(lv,cc,Iv,om,Au,lr,Xt,Fr,mt,Ft,x0,dn,Le,Dh,xg);if(bg&&(sv=bg.placedGlyphBoxes,sv&&sv.box&&sv.box.length)){En=!0,bo=bg.shift;break}}return sv},qp=function(){return Mp(Ph,Tn.iconBox,e.WritingMode.horizontal)},Ep=function(){var cc=Tn.verticalTextBox,lu=jo&&jo.box&&jo.box.length;return Le.allowVerticalPlacement&&!lu&&dn.numVerticalGlyphVertices>0&&cc?Mp(cc,Tn.verticalIconBox,e.WritingMode.vertical):{box:null,offscreen:null}};Vd(qp,Ep),jo&&(En=jo.box,ci=jo.offscreen);var kv=Vp(jo&&jo.box);if(!En&&me.prevPlacement){var qd=me.prevPlacement.variableOffsets[dn.crossTileID];qd&&(me.variableOffsets[dn.crossTileID]=qd,me.markUsedJustification(Le,qd.anchor,dn,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,dn),me.placedOrientations[dn.crossTileID]=lu),Dh},Ih=function(){return td(Ph,e.WritingMode.horizontal)},rd=function(){var cc=Tn.verticalTextBox;return Le.allowVerticalPlacement&&dn.numVerticalGlyphVertices>0&&cc?td(cc,e.WritingMode.vertical):{box:null,offscreen:null}};Vd(Ih,rd),Vp(jo&&jo.box&&jo.box.length)}}if(Fo=jo,En=Fo&&Fo.box&&Fo.box.length>0,ci=Fo&&Fo.offscreen,dn.useRuntimeCollisionCircles){var Vf=Le.text.placedSymbolArray.get(dn.centerJustifiedTextSymbolIndex),Gd=e.evaluateSizeForFeature(Le.textSizeData,Et,Vf),Lv=$e.get("text-padding"),ch=dn.collisionCircleDiameter;bs=me.collisionIndex.placeCollisionCircles(sr,Vf,Le.lineVertexArray,Le.glyphOffsetArray,Gd,mt,jt,_r,te,Xt,Ft.predicate,ch,Lv),En=sr||bs.circles.length>0&&!bs.collisionDetected,ci=ci&&bs.offscreen}if(Tn.iconFeatureIndex&&(Sp=Tn.iconFeatureIndex),Tn.iconBox){var nv=function(cc){var lu=or&&bo?Os(cc,bo.x,bo.y,lr,Xt,me.transform.angle):cc;return me.collisionIndex.placeCollisionBox(lu,pr,Fr,mt,Ft.predicate)};ks&&ks.box&&ks.box.length&&Tn.verticalIconBox?(Hs=nv(Tn.verticalIconBox),Gn=Hs.box.length>0):(Hs=nv(Tn.iconBox),Gn=Hs.box.length>0),ci=ci&&Hs.offscreen}var nm=nr||dn.numHorizontalGlyphVertices===0&&dn.numVerticalGlyphVertices===0,im=fr||dn.numIconVertices===0;if(!nm&&!im?Gn=En=Gn&&En:im?nm||(Gn=Gn&&En):En=Gn&&En,En&&Fo&&Fo.box&&(ks&&ks.box&&Ap?me.collisionIndex.insertCollisionBox(Fo.box,$e.get("text-ignore-placement"),Le.bucketInstanceId,Ap,Ft.ID):me.collisionIndex.insertCollisionBox(Fo.box,$e.get("text-ignore-placement"),Le.bucketInstanceId,pu,Ft.ID)),Gn&&Hs&&me.collisionIndex.insertCollisionBox(Hs.box,$e.get("icon-ignore-placement"),Le.bucketInstanceId,Sp,Ft.ID),bs&&(En&&me.collisionIndex.insertCollisionCircles(bs.circles,$e.get("text-ignore-placement"),Le.bucketInstanceId,pu,Ft.ID),te)){var Pv=Le.bucketInstanceId,iv=me.collisionCircleArrays[Pv];iv===void 0&&(iv=me.collisionCircleArrays[Pv]=new lo);for(var ov=0;ov=0;--Xa){var ln=_n[Xa];ba(Le.symbolInstances.get(ln),Le.collisionArrays[ln])}else for(var $n=Y.symbolInstanceStart;$n=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,_n=me.placedOrientations[pr.crossTileID],Xa=_n===e.WritingMode.vertical,ln=_n===e.WritingMode.horizontal||_n===e.WritingMode.horizontalOnly;if(Jr){var $n=rl(Dr.text),Nn=Xa?Si:$n;Et(Y.text,lr,Nn);var dn=ln?Si:$n;Et(Y.text,Xt,dn);var Tn=Dr.text.isHidden();[pr.rightJustifiedTextSymbolIndex,pr.centerJustifiedTextSymbolIndex,pr.leftJustifiedTextSymbolIndex].forEach(function(Sp){Sp>=0&&(Y.text.placedSymbolArray.get(Sp).hidden=Tn||Xa?1:0)}),pr.verticalPlacedTextSymbolIndex>=0&&(Y.text.placedSymbolArray.get(pr.verticalPlacedTextSymbolIndex).hidden=Tn||ln?1:0);var En=me.variableOffsets[pr.crossTileID];En&&me.markUsedJustification(Y,En.anchor,pr,_n);var Gn=me.placedOrientations[pr.crossTileID];Gn&&(me.markUsedJustification(Y,"left",pr,Gn),me.markUsedOrientation(Y,Gn,pr))}if(ba){var ci=rl(Dr.icon),bo=!(hr&&pr.verticalPlacedIconSymbolIndex&&Xa);if(pr.placedIconSymbolIndex>=0){var jo=bo?ci:Si;Et(Y.icon,pr.numIconVertices,jo),Y.icon.placedSymbolArray.get(pr.placedIconSymbolIndex).hidden=Dr.icon.isHidden()}if(pr.verticalPlacedIconSymbolIndex>=0){var ks=bo?Si:ci;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&&jn(Y.textCollisionBox.collisionVertexArray,Dr.text.placed,!Hs||Xa,bs.x,bs.y),Fo.verticalTextBox&&jn(Y.textCollisionBox.collisionVertexArray,Dr.text.placed,!Hs||ln,bs.x,bs.y)}var Ap=!!(!ln&&Fo.verticalIconBox);Fo.iconBox&&jn(Y.iconCollisionBox.collisionVertexArray,Dr.icon.placed,Ap,hr?bs.x:0,hr?bs.y:0),Fo.verticalIconBox&&jn(Y.iconCollisionBox.collisionVertexArray,Dr.icon.placed,!Ap,hr?bs.x:0,hr?bs.y:0)}}},nr=0;nrY},Yo.prototype.setStale=function(){this.stale=!0};function jn(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 Ci=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*Ci+Y*tl+ye*Bs+Y*uo+ye*$s+Y*ms+ye*Is+Y}var Si=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(ln){return me._layers[ln].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,qc),il=hl(Sf,iu),dc=hl(Ll,nc),vu=hl(Ou,nl),bu=hl(vl,gs),Ml=hl(qs,ic),Uf=hl(Nl,Vu),Jf=hl(cl,yh),Bu=hl(ls,_h),Sc=hl(Ss,Qi),vc=hl(Gc,qu),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:il,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/qi(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=qi(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}},ia=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=qi(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}},pn=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]}},In=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)}},Yn=function(ve,Y,ye){return ye===void 0&&(ye=1),{u_matrix:ve,u_color:Y,u_overlay:0,u_overlay_scale:ye}},ri=function(ve,Y){return{u_matrix:new e.UniformMatrix4f(ve,Y.u_matrix)}},di=function(ve){return{u_matrix:ve}},Dn=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)}},On=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)}},qn=function(ve,Y,ye,te){return{u_matrix:ve,u_extrude_scale:qi(Y,1,ye),u_intensity:te}},xn=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")}},Mi=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)}},Ki=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}},Ji=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 wi=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)}},ui=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)}},xo=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/qi(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/qi(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/qi(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:Ui(me.paint.get("raster-hue-rotate"))}};function Ui(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:ia,collisionCircle:$r,debug:In,clippingMask:ri,heatmap:Dn,heatmapTexture:On,hillshade:Mi,hillshadePrepare:Ki,line:wi,lineGradient:ui,linePattern:xo,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,nr.placementInvProjMatrix,ve.transform.glCoordMatrix),e.mul(lr,lr,nr.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"),Vt=new e.StructArrayLayout2f1f2i16;Vt.resize(Fr*4),Vt._trim();for(var Dr=0,Jr=0,ba=_r;Jr=0&&(Et[nr.associatedIconIndex]={shiftedAnchor:ln,angle:$n})}}if(_r){gt.clear();for(var dn=ve.icon.placedSymbolArray,Tn=0;Tn0){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 nr=ye.getCrossfadeParameters(),fr=0,sr=Ft;fr "+ye.overscaledZ);var fr=nr+" "+gt+"kb";Ao(ve,fr),Le.draw(te,me.TRIANGLES,$e,mt,Nt.alphaBlended,Pr.disabled,Yn(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":lt,hillshade:Ct,raster:ur,background:Er,debug:Wi,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,di(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 nr=Fr.pop(),fr=nr.x,sr=nr.y,pr=nr.fullyVisible;if(!pr){var lr=nr.aabb.intersects($e);if(lr===0)continue;pr=lr===2}var Xt=nr.aabb.distanceX(Le),or=nr.aabb.distanceY(Le),Vt=Math.max(Math.abs(Xt),Math.abs(or)),Dr=jt+(1<Dr&&nr.zoom>=mt){hr.push({tileID:new e.OverscaledTileID(nr.zoom===gt?Et:nr.zoom,nr.wrap,nr.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,_n=(sr<<1)+(Jr>>1);Fr.push({aabb:nr.aabb.quadrant(Jr),zoom:nr.zoom+1,x:ba,y:_n,wrap:nr.wrap,fullyVisible:pr})}}return hr.sort(function(Xa,ln){return Xa.distanceSq-ln.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-nr)}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),nr=Math.sin(this.angle),fr=$e-Math.round($e)+Ft*gt+nr*Et,sr=mt-Math.round(mt)+Ft*Et+nr*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),Vl=function(Y){this._map=Y,this.clear()};Vl.prototype.clear=function(){this._inertiaBuffer=[]},Vl.prototype.record=function(Y){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:e.browser.now(),settings:Y})},Vl.prototype._drainInertiaBuffer=function(){for(var Y=this._inertiaBuffer,ye=e.browser.now(),te=160;Y.length>0&&ye-Y[0].time>te;)Y.shift()},Vl.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 tn=function(Y){this.singleTap=new ya(Y),this.numTaps=Y.numTaps,this.reset()};tn.prototype.reset=function(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()},tn.prototype.touchstart=function(Y,ye,te){this.singleTap.touchstart(Y,ye,te)},tn.prototype.touchmove=function(Y,ye,te){this.singleTap.touchmove(Y,ye,te)},tn.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 gi=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}(Pi),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 tn({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>qr&&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},Sn=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 wn(ve){return ve.panDelta&&ve.panDelta.mag()||ve.zoomDelta||ve.bearingDelta||ve.pitchDelta}var hn=function(Y,ye){this._map=Y,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Vl(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(_n,1-Jr),ln=Le.unproject(pr.add(lr.mult(Jr*Xa)).mult(ba));Le.setLocationAtPoint(Le.renderWorldCopies?ln.wrap():ln,nr)}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,nr=$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),Vt=te.curve,Dr=Math.max($e.width,$e.height),Jr=Dr/nr,ba=or.mag();if("minZoom"in te){var _n=e.clamp(Math.min(te.minZoom,mt,hr),$e.minZoom,$e.maxZoom),Xa=Dr/$e.zoomScale(_n-mt);Vt=Math.sqrt(Xa/ba*2)}var ln=Vt*Vt;function $n(Fo){var bs=(Jr*Jr-Dr*Dr+(Fo?-1:1)*ln*ln*ba*ba)/(2*(Fo?Jr:Dr)*ln*ba);return Math.log(Math.sqrt(bs*bs+1)-bs)}function Nn(Fo){return(Math.exp(Fo)-Math.exp(-Fo))/2}function dn(Fo){return(Math.exp(Fo)+Math.exp(-Fo))/2}function Tn(Fo){return Nn(Fo)/dn(Fo)}var En=$n(0),Gn=function(Fo){return dn(En)/dn(En+Vt*Fo)},ci=function(Fo){return Dr*((dn(En)*Tn(En+Vt*Fo)-Nn(En))/ln)/ba},bo=($n(1)-En)/Vt;if(Math.abs(ba)<1e-6||!isFinite(bo)){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*bo,Hs=1/Gn(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(ci(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),Bn=function(Y){Y===void 0&&(Y={}),this.options=Y,e.bindAll(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)};Bn.prototype.getDefaultPosition=function(){return"bottom-right"},Bn.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},Bn.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},Bn.prototype._setElementTitle=function(Y,ye){var te=this._map._getUIString("AttributionControl."+ye);Y.title=te,Y.setAttribute("aria-label",te)},Bn.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"))},Bn.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)}},Bn.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")};var Ln=function(){e.bindAll(["_updateLogo"],this),e.bindAll(["_updateCompact"],this)};Ln.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},Ln.prototype.onRemove=function(){r.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},Ln.prototype.getDefaultPosition=function(){return"bottom-left"},Ln.prototype._updateLogo=function(Y){(!Y||Y.sourceDataType==="metadata")&&(this._container.style.display=this._logoRequired()?"block":"none")},Ln.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}},Ln.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 Va=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};Va.prototype.add=function(Y){var ye=++this._id,te=this._queue;return te.push({callback:Y,id:ye,cancelled:!1}),ye},Va.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.minPitchhi)throw new Error("maxPitch must be less than or equal to "+hi);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 Va,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 an)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 hn(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 Bn({customAttribution:te.customAttribution})),this.addControl(new Ln,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??Rn,me=Rn&&me<=this.transform.maxPitch)return this.transform.minPitch=me,this._update(),this.getPitch()hi)throw new Error("maxPitch must be less than or equal to "+hi);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(nr){var fr=$e.getLayer(Ge)?$e.queryRenderedFeatures(nr.point,{layers:[Ge]}):[];fr.length?jt||(jt=!0,Le.call($e,new De(me,$e,nr.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(nr){var fr=$e.getLayer(Ge)?$e.queryRenderedFeatures(nr.point,{layers:[Ge]}):[];fr.length?hr=!0:hr&&(hr=!1,Le.call($e,new De(me,$e,nr.originalEvent)))},Et=function(nr){hr&&(hr=!1,Le.call($e,new De(me,$e,nr.originalEvent)))};return{layer:Ge,listener:Le,delegates:{mousemove:gt,mouseout:Et}}}else{var Ft=function(nr){var fr=$e.getLayer(Ge)?$e.queryRenderedFeatures(nr.point,{layers:[Ge]}):[];fr.length&&(nr.features=fr,Le.call($e,nr),delete nr.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 nu(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 nu(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||gn&&Ge instanceof gn){var gt=e.browser.getImageData(Ge),Et=gt.width,Ft=gt.height,nr=gt.data;this.style.addImage(me,{data:new e.RGBAImage({width:Et,height:Ft},nr),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||gn&&Ge instanceof gn?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||gn&&Ge instanceof gn);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 nr=this._sourcesDirty||this._styleDirty||this._placementDirty;return nr||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new e.Event("idle")),this._loaded&&!this._fullyLoaded&&!nr&&(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 mi={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 Ii(ve,Y,ye){var te=ve.classList;for(var me in mi)te.remove("mapboxgl-"+ye+"-anchor-"+me);te.add("mapboxgl-"+ye+"-anchor-"+Y)}var zn=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),ii={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},Ei;function Ri(ve){Ei!==void 0?ve(Ei):e.window.navigator.permissions!==void 0?e.window.navigator.permissions.query({name:"geolocation"}).then(function(Y){Ei=Y.state!=="denied",ve(Ei)}):(Ei=!!e.window.navigator.geolocation,ve(Ei))}var Gi=0,Ps=!1,xl=function(ve){function Y(ye){ve.call(this),this.options=e.extend({},ii,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"),Ri(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,Gi=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 zn(this._dotElement),this._circleElement=r.create("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new zn({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":Gi--,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"),Gi++;var te;Gi>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(", "),Hi=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=Jn(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,mi[$e]+" translate("+hr.x+"px,"+hr.y+"px)"),Ii(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:qa,NavigationControl:Mn,GeolocateControl:xl,AttributionControl:Bn,ScaleControl:Hl,FullscreenControl:Fs,Popup:Hi,Marker:zn,Style:nu,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 nn.workerCount},set workerCount(ve){nn.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})}}),gq=Ze({"src/plots/mapbox/layers.js"(Z,q){"use strict";var v=ca(),x=fu().sanitizeHTML,A=MC(),M=am();function e(n,o){this.subplot=n,this.uid=n.uid+"-"+o,this.index=o,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(o){this.visible?this.needsNewImage(o)?this.updateImage(o):this.needsNewSource(o)?(this.removeLayer(),this.updateSource(o),this.updateLayer(o)):this.needsNewLayer(o)?this.updateLayer(o):this.updateStyle(o):(this.updateSource(o),this.updateLayer(o)),this.visible=r(o)},t.needsNewImage=function(n){var o=this.subplot.map;return o.getSource(this.idSource)&&this.sourceType==="image"&&n.sourcetype==="image"&&(this.source!==n.source||JSON.stringify(this.coordinates)!==JSON.stringify(n.coordinates))},t.needsNewSource=function(n){return this.sourceType!==n.sourcetype||JSON.stringify(this.source)!==JSON.stringify(n.source)||this.layerType!==n.type},t.needsNewLayer=function(n){return this.layerType!==n.type||this.below!==this.subplot.belowLookup["layout-"+this.index]},t.lookupBelow=function(){return this.subplot.belowLookup["layout-"+this.index]},t.updateImage=function(n){var o=this.subplot.map;o.getSource(this.idSource).updateImage({url:n.source,coordinates:n.coordinates});var s=this.findFollowingMapboxLayerId(this.lookupBelow());s!==null&&this.subplot.map.moveLayer(this.idLayer,s)},t.updateSource=function(n){var o=this.subplot.map;if(o.getSource(this.idSource)&&o.removeSource(this.idSource),this.sourceType=n.sourcetype,this.source=n.source,!!r(n)){var s=a(n);o.addSource(this.idSource,s)}},t.findFollowingMapboxLayerId=function(n){if(n==="traces")for(var o=this.subplot.getMapLayers(),s=0;s0){for(var s=0;s0}function i(n){var o={},s={};switch(n.type){case"circle":v.extendFlat(s,{"circle-radius":n.circle.radius,"circle-color":n.color,"circle-opacity":n.opacity});break;case"line":v.extendFlat(s,{"line-width":n.line.width,"line-color":n.color,"line-opacity":n.opacity,"line-dasharray":n.line.dash});break;case"fill":v.extendFlat(s,{"fill-color":n.color,"fill-outline-color":n.fill.outlinecolor,"fill-opacity":n.opacity});break;case"symbol":var c=n.symbol,h=A(c.textposition,c.iconsize);v.extendFlat(o,{"icon-image":c.icon+"-15","icon-size":c.iconsize/10,"text-field":c.text,"text-size":c.textfont.size,"text-anchor":h.anchor,"text-offset":h.offset,"symbol-placement":c.placement}),v.extendFlat(s,{"icon-color":n.color,"text-color":c.textfont.color,"text-opacity":n.opacity});break;case"raster":v.extendFlat(s,{"raster-fade-duration":0,"raster-opacity":n.opacity});break}return{layout:o,paint:s}}function a(n){var o=n.sourcetype,s=n.source,c={type:o},h;return o==="geojson"?h="data":o==="vector"?h=typeof s=="string"?"url":"tiles":o==="raster"?(h="tiles",c.tileSize=256):o==="image"&&(h="url",c.coordinates=n.coordinates),c[h]=s,n.sourceattribution&&(c.attribution=x(n.sourceattribution)),c}q.exports=function(o,s,c){var h=new e(o,s);return h.update(c),h}}}),yq=Ze({"src/plots/mapbox/mapbox.js"(Z,q){"use strict";var v=EC(),x=ca(),A=vg(),M=oo(),e=Wo(),t=bp(),r=ef(),i=Jd(),a=i.drawMode,n=i.selectMode,o=Tf().prepSelect,s=Tf().clearOutline,c=Tf().clearSelectionsCache,h=Tf().selectOnClick,m=am(),d=gq();function T(g,b){this.id=b,this.gd=g;var p=g._fullLayout,u=g._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(g,b,p){var u=this,y=b[u.id];u.map&&y.accesstoken!==u.accessToken&&(u.map.remove(),u.map=null,u.styleObj=null,u.traceHash={},u.layerList=[]);var f;u.map?f=new Promise(function(P,L){u.updateMap(g,b,P,L)}):f=new Promise(function(P,L){u.createMap(g,b,P,L)}),p.push(f)},l.createMap=function(g,b,p,u){var y=this,f=b[y.id],P=y.styleObj=w(f.style,b);y.accessToken=f.accesstoken;var L=f.bounds,z=L?[[L.west,L.south],[L.east,L.north]]:null,F=y.map=new v.Map({container:y.div,style:P.style,center:E(f.center),zoom:f.zoom,bearing:f.bearing,pitch:f.pitch,maxBounds:z,interactive:!y.isStatic,preserveDrawingBuffer:y.isStatic,doubleClickZoom:!1,boxZoom:!1,attributionControl:!1}).addControl(new v.AttributionControl({compact:!0}));F._canvas.style.left="0px",F._canvas.style.top="0px",y.rejectOnError(u),y.isStatic||y.initFx(g,b);var B=[];B.push(new Promise(function(O){F.once("load",O)})),B=B.concat(A.fetchTraceGeoData(g)),Promise.all(B).then(function(){y.fillBelowLookup(g,b),y.updateData(g),y.updateLayout(b),y.resolveOnRender(p)}).catch(u)},l.updateMap=function(g,b,p,u){var y=this,f=y.map,P=b[this.id];y.rejectOnError(u);var L=[],z=w(P.style,b);JSON.stringify(y.styleObj)!==JSON.stringify(z)&&(y.styleObj=z,f.setStyle(z.style),y.traceHash={},L.push(new Promise(function(F){f.once("styledata",F)}))),L=L.concat(A.fetchTraceGeoData(g)),Promise.all(L).then(function(){y.fillBelowLookup(g,b),y.updateData(g),y.updateLayout(b),y.resolveOnRender(p)}).catch(u)},l.fillBelowLookup=function(g,b){var p=b[this.id],u=p.layers,y,f,P=this.belowLookup={},L=!1;for(y=0;y1)for(y=0;y-1&&h(z.originalEvent,u,[p.xaxis],[p.yaxis],p.id,L),F.indexOf("event")>-1&&r.click(u,z.originalEvent)}}},l.updateFx=function(g){var b=this,p=b.map,u=b.gd;if(b.isStatic)return;function y(z){var F=b.map.unproject(z);return[F.lng,F.lat]}var f=g.dragmode,P;P=function(z,F){if(F.isRect){var B=z.range={};B[b.id]=[y([F.xmin,F.ymin]),y([F.xmax,F.ymax])]}else{var O=z.lassoPoints={};O[b.id]=F.map(y)}};var L=b.dragOptions;b.dragOptions=x.extendDeep(L||{},{dragmode:g.dragmode,element:b.div,gd:u,plotinfo:{id:b.id,domain:g[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),n(f)||a(f)?(p.dragPan.disable(),p.on("zoomstart",b.clearOutline),b.dragOptions.prepFn=function(z,F,B){o(z,F,B,b.dragOptions,f)},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(g){var b=g[this.id].domain,p=g._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(g){var b=g[this.id],p=b.layers,u=this.layerList,y;if(p.length!==u.length){for(y=0;yB/2){var O=P.split("|").join("
");z.text(O).attr("data-unformatted",O).call(i.convertToTspans,d),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 h(d,T){var l=d._fullLayout,_=d._context;if(_.mapboxAccessToken==="")return"";for(var w=[],S=[],E=!1,g=!1,b=0;b1&&v.warn(o.multipleTokensErrorMsg),w[0]):(S.length&&v.log(["Listed mapbox access token(s)",S.join(","),"but did not use a Mapbox map style, ignoring token(s)."].join(" ")),"")}function m(d){return typeof d=="string"&&(o.styleValuesMapbox.indexOf(d)!==-1||d.indexOf("mapbox://")===0||d.indexOf("stamen")===0)}Z.updateFx=function(d){for(var T=d._fullLayout,l=T._subplots[n],_=0;_=0;i--)t.removeLayer(r[i][1])},e.dispose=function(){var t=this.subplot.map;this._removeLayers(),t.removeSource(this.sourceId)},q.exports=function(r,i){var a=i[0].trace,n=new M(r,a.uid),o=n.sourceId,s=v(i),c=n.below=r.belowLookup["trace-"+a.uid];return r.map.addSource(o,{type:"geojson",data:s.geojson}),n._addLayers(s,c),i[0].trace._glTrace=n,n}}}),Aq=Ze({"src/traces/choroplethmapbox/index.js"(Z,q){"use strict";var v=["*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:CC(),supplyDefaults:wq(),colorbar:ag(),calc:lT(),plot:Tq(),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?+d[h]:0),c.push({type:"Feature",geometry:{type:"Point",coordinates:w},properties:S})}}var g=M.extractOpts(a),b=g.reversescale?M.flipScale(g.colorscale):g.colorscale,p=b[0][1],u=A.opacity(p)<1?p:A.addOpacity(p,0),y=["interpolate",["linear"],["heatmap-density"],0,u];for(h=1;h=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 i=r[0].trace,a=new A(t,i.uid),n=a.sourceId,o=v(r),s=a.below=t.belowLookup["trace-"+i.uid];return t.map.addSource(n,{type:"geojson",data:o.geojson}),a._addLayers(o,s),a}}}),Lq=Ze({"src/traces/densitymapbox/hover.js"(Z,q){"use strict";var v=Wo(),x=ST().hoverPoints,A=ST().getExtraText;q.exports=function(e,t,r){var i=x(e,t,r);if(i){var a=i[0],n=a.cd,o=n[0].trace,s=n[a.index];if(delete a.color,"z"in s){var c=a.subplot.mockAxis;a.z=s.z,a.zLabel=v.tickText(c,c.c2l(s.z),"hover").text}return a.extraText=A(o,s,n[0].t.labels),[a]}}}}),Pq=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}}}),Iq=Ze({"src/traces/densitymapbox/index.js"(Z,q){"use strict";var v=["*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:LC(),supplyDefaults:Mq(),colorbar:ag(),formatLabels:SC(),calc:Eq(),plot:kq(),hoverPoints:Lq(),eventData:Pq(),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"}}}),zq=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"}}]}}}),_g=Ze({"src/plots/map/constants.js"(Z,q){"use strict";var v=Km(),x=Dq(),A=zq(),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",i="https://basemaps.cartocdn.com/gl/positron-nolabels-gl-style/style.json",a="https://basemaps.cartocdn.com/gl/dark-matter-nolabels-gl-style/style.json",n="https://basemaps.cartocdn.com/gl/voyager-nolabels-gl-style/style.json",o={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":i,"carto-darkmatter-nolabels":a,"carto-voyager-nolabels":n},s=v(o);q.exports={styleValueDflt:"basic",stylesMap:o,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 v=ca(),x=Yi().defaultLine,A=bc().attributes,M=tc(),e=tf().textposition,t=pc().overrideAll,r=Dl().templatedArray,i=_g(),a=M({noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0});a.family.dflt="Open Sans Regular, Arial Unicode MS Regular";var n=q.exports=t({_arrayAttrRegexps:[v.counterRegex("map",".layers",!0)],domain:A({name:"map"}),style:{valType:"any",values:i.styleValuesMap,dflt:i.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:v.extendFlat({},e,{arrayOk:!1})}})},"plot","from-root");n.uirevision={valType:"any",editType:"none"}}}),ET=Ze({"src/traces/scattermap/attributes.js"(Z,q){"use strict";var v=Cs().hovertemplateAttrs,x=Cs().texttemplateAttrs,A=$d(),M=d0(),e=tf(),t=Ex(),r=eu(),i=Mu(),a=rs().extendFlat,n=pc().overrideAll,o=Ex(),s=M.line,c=M.marker;q.exports=n({lon:M.lon,lat:M.lat,cluster:{enabled:{valType:"boolean"},maxzoom:a({},o.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},i("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:v()},"calc","nested")}}),PC=Ze({"src/traces/scattermap/constants.js"(Z,q){"use strict";var v=["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 v.indexOf(x)!==-1}}}}),Fq=Ze({"src/traces/scattermap/defaults.js"(Z,q){"use strict";var v=ca(),x=Fu(),A=md(),M=Dd(),e=zd(),t=ev(),r=ET(),i=PC().isSupportedFont;q.exports=function(o,s,c,h){function m(y,f){return v.coerce(o,s,r,y,f)}function d(y,f){return v.coerce2(o,s,r,y,f)}var T=a(o,s,m);if(!T){s.visible=!1;return}if(m("text"),m("texttemplate"),m("hovertext"),m("hovertemplate"),m("mode"),m("below"),x.hasMarkers(s)){A(o,s,c,h,m,{noLine:!0,noAngle:!0}),m("marker.allowoverlap"),m("marker.angle");var l=s.marker;l.symbol!=="circle"&&(v.isArrayOrTypedArray(l.size)&&(l.size=l.size[0]),v.isArrayOrTypedArray(l.color)&&(l.color=l.color[0]))}x.hasLines(s)&&(M(o,s,c,h,m,{noDash:!0}),m("connectgaps"));var _=d("cluster.maxzoom"),w=d("cluster.step"),S=d("cluster.color",s.marker&&s.marker.color||c),E=d("cluster.size"),g=d("cluster.opacity"),b=_!==!1||w!==!1||S!==!1||E!==!1||g!==!1,p=m("cluster.enabled",b);if(p||x.hasText(s)){var u=h.font.family;e(o,s,h,m,{noSelect:!0,noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,font:{family:i(u)?u:"Open Sans Regular",weight:h.font.weight,style:h.font.style,size:h.font.size,color:h.font.color}})}m("fill"),s.fill!=="none"&&t(o,s,c,m),v.coerceSelectionMarkerOpacity(s,m)};function a(n,o,s){var c=s("lon")||[],h=s("lat")||[],m=Math.min(c.length,h.length);return o._length=m,m}}}),IC=Ze({"src/traces/scattermap/format_labels.js"(Z,q){"use strict";var v=Wo();q.exports=function(A,M,e){var t={},r=e[M.subplot]._subplot,i=r.mockAxis,a=A.lonlat;return t.lonLabel=v.tickText(i,i.c2l(a[0]),!0).text,t.latLabel=v.tickText(i,i.c2l(a[1]),!0).text,t}}}),RC=Ze({"src/plots/map/convert_text_opts.js"(Z,q){"use strict";var v=ca();q.exports=function(A,M){var e=A.split(" "),t=e[0],r=e[1],i=v.isArrayOrTypedArray(M)?v.mean(M):M,a=.5+i/100,n=1.5+i/100,o=["",""],s=[0,0];switch(t){case"top":o[0]="top",s[1]=-n;break;case"bottom":o[0]="bottom",s[1]=n;break}switch(r){case"left":o[1]="right",s[0]=-a;break;case"right":o[1]="left",s[0]=a;break}var c;return o[0]&&o[1]?c=o.join("-"):o[0]?c=o[0]:o[1]?c=o[1]:c="center",{anchor:c,offset:s}}}}),Oq=Ze({"src/traces/scattermap/convert.js"(Z,q){"use strict";var v=is(),x=ca(),A=Vs().BADNUM,M=dg(),e=rc(),t=as(),r=r1(),i=Fu(),a=PC().isSupportedFont,n=RC(),o=Qp().appendArrayPointValue,s=fu().NEWLINES,c=fu().BR_TAG_ALL;q.exports=function(g,b){var p=b[0].trace,u=p.visible===!0&&p._length!==0,y=p.fill!=="none",f=i.hasLines(p),P=i.hasMarkers(p),L=i.hasText(p),z=P&&p.marker.symbol==="circle",F=P&&p.marker.symbol!=="circle",B=p.cluster&&p.cluster.enabled,O=h("fill"),I=h("line"),N=h("circle"),U=h("symbol"),W={fill:O,line:I,circle:N,symbol:U};if(!u)return W;var Q;if((y||f)&&(Q=M.calcTraceToLineCoords(b)),y&&(O.geojson=M.makePolygon(Q),O.layout.visibility="visible",x.extendFlat(O.paint,{"fill-color":p.fillcolor})),f&&(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=m(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=d(b,g),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 se=(p.marker||{}).size,he=n(p.textposition,se);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 h(E){return{type:E,geojson:M.makeBlank(),layout:{visibility:"none"},filter:null,paint:{}}}function m(E){var g=E[0].trace,b=g.marker,p=g.selectedpoints,u=x.isArrayOrTypedArray(b.color),y=x.isArrayOrTypedArray(b.size),f=x.isArrayOrTypedArray(b.opacity),P;function L(se){return g.opacity*se}function z(se){return se/2}var F;u&&(e.hasColorscale(g,"marker")?F=e.makeColorScaleFuncFromTrace(b):F=x.identity);var B;y&&(B=r(g));var O;f&&(O=function(se){var he=v(se)?+x.constrain(se,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"):y.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"):y.slice(0,3).join(" ")==="Klokantech Noto Sans"&&(P="Klokantech Noto Sans",y[3]==="CJK"&&(P+=" CJK"),P+=u>500?" Bold":" Regular")),f&&(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}}}),Bq=Ze({"src/traces/scattermap/plot.js"(Z,q){"use strict";var v=ca(),x=Oq(),A=_g().traceLayerPrefix,M={cluster:["cluster","clusterCount","circle"],nonCluster:["fill","line","circle","symbol"]};function e(r,i,a,n){this.type="scattermap",this.subplot=r,this.uid=i,this.clusterEnabled=a,this.isHidden=n,this.sourceIds={fill:"source-"+i+"-fill",line:"source-"+i+"-line",circle:"source-"+i+"-circle",symbol:"source-"+i+"-symbol",cluster:"source-"+i+"-circle",clusterCount:"source-"+i+"-circle"},this.layerIds={fill:A+i+"-fill",line:A+i+"-line",circle:A+i+"-circle",symbol:A+i+"-symbol",cluster:A+i+"-cluster",clusterCount:A+i+"-cluster-count"},this.below=null}var t=e.prototype;t.addSource=function(r,i,a){var n={type:"geojson",data:i.geojson};a&&a.enabled&&v.extendFlat(n,{cluster:!0,clusterMaxZoom:a.maxzoom});var o=this.subplot.map.getSource(this.sourceIds[r]);o?o.setData(i.geojson):this.subplot.map.addSource(this.sourceIds[r],n)},t.setSourceData=function(r,i){this.subplot.map.getSource(this.sourceIds[r]).setData(i.geojson)},t.addLayer=function(r,i,a){var n={type:i.type,id:this.layerIds[r],source:this.sourceIds[r],layout:i.layout,paint:i.paint};i.filter&&(n.filter=i.filter);for(var o=this.layerIds[r],s,c=this.subplot.getMapLayers(),h=0;h=0;f--){var P=y[f];o.removeLayer(d.layerIds[P])}u||o.removeSource(d.sourceIds.circle)}function _(u){for(var y=M.nonCluster,f=0;f=0;f--){var P=y[f];o.removeLayer(d.layerIds[P]),u||o.removeSource(d.sourceIds[P])}}function S(u){m?l(u):w(u)}function E(u){h?T(u):_(u)}function g(){for(var u=h?M.cluster:M.nonCluster,y=0;y=0;n--){var o=a[n];i.removeLayer(this.layerIds[o]),i.removeSource(this.sourceIds[o])}},q.exports=function(i,a){var n=a[0].trace,o=n.cluster&&n.cluster.enabled,s=n.visible!==!0,c=new e(i,n.uid,o,s),h=x(i.gd,a),m=c.below=i.belowLookup["trace-"+n.uid],d,T,l;if(o)for(c.addSource("circle",h.circle,n.cluster),d=0;d=0?Math.floor((n+180)/360):Math.ceil((n-180)/360),E=S*360,g=n-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=d.project([I,N]),W=U.x-h.c2p([g,N]),Q=U.y-m.c2p([I,o]),ue=Math.max(3,B.mrc||0);return Math.max(Math.sqrt(W*W+Q*Q)-ue,1-3/ue)}if(v.getClosest(s,b,a),a.index!==!1){var p=s[a.index],u=p.lonlat,y=[x.modHalf(u[0],360)+E,u[1]],f=h.c2p(y),P=m.c2p(y),L=p.mrc||1;a.x0=f-L,a.x1=f+L,a.y0=P-L,a.y1=P+L;var z={};z[c.subplot]={_subplot:d};var F=c._module.formatLabels(p,c,z);return a.lonLabel=F.lonLabel,a.latLabel=F.latLabel,a.color=A(c,p),a.extraText=i(c,p,s[0].t.labels),a.hovertemplate=c.hovertemplate,[a]}}function i(a,n,o){if(a.hovertemplate)return;var s=n.hi||a.hoverinfo,c=s.split("+"),h=c.indexOf("all")!==-1,m=c.indexOf("lon")!==-1,d=c.indexOf("lat")!==-1,T=n.lonlat,l=[];function _(w){return w+"\xB0"}return h||m&&d?l.push("("+_(T[1])+", "+_(T[0])+")"):m?l.push(o.lon+_(T[0])):d&&l.push(o.lat+_(T[1])),(h||c.indexOf("text")!==-1)&&M(n,a,l),l.join("
")}q.exports={hoverPoints:r,getExtraText:i}}}),Nq=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}}}),Uq=Ze({"src/traces/scattermap/select.js"(Z,q){"use strict";var v=ca(),x=Fu(),A=Vs().BADNUM;q.exports=function(e,t){var r=e.cd,i=e.xaxis,a=e.yaxis,n=[],o=r[0].trace,s;if(!x.hasMarkers(o))return[];if(t===!1)for(s=0;s1)return 1;for(var K=G,pe=0;pe<8;pe++){var ke=this.sampleCurveX(K)-G;if(Math.abs(ke)ke?Xe=K:ft=K,K=.5*(ft-Xe)+Xe;return K},solve:function(G,D){return this.sampleCurveY(this.solveCurveX(G,D))}};var c=r(o);let h,m;function d(){return h==null&&(h=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),h}function T(){if(m==null&&(m=!1,d())){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){m=!0;break}}}return m||!1}function l(G,D,K,pe){let ke=new c(G,D,K,pe);return je=>ke.solve(je)}let _=l(.25,.1,.25,1);function w(G,D,K){return Math.min(K,Math.max(D,G))}function S(G,D,K){let pe=K-D,ke=((G-D)%pe+pe)%pe+D;return ke===D?K:ke}function E(G,...D){for(let K of D)for(let pe in K)G[pe]=K[pe];return G}let g=1;function b(G,D,K){let pe={};for(let ke in G)pe[ke]=D.call(this,G[ke],ke,G);return pe}function p(G,D,K){let pe={};for(let ke in G)D.call(this,G[ke],ke,G)&&(pe[ke]=G[ke]);return pe}function u(G){return Array.isArray(G)?G.map(u):typeof G=="object"&&G?b(G,u):G}let y={};function f(G){y[G]||(typeof console<"u"&&console.warn(G),y[G]=!0)}function P(G,D,K){return(K.y-G.y)*(D.x-G.x)>(D.y-G.y)*(K.x-G.x)}function L(G){return typeof WorkerGlobalScope<"u"&&G!==void 0&&G instanceof WorkerGlobalScope}let z=null;function F(G){return typeof ImageBitmap<"u"&&G instanceof ImageBitmap}let B="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function O(G,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(G,{timestamp:0});try{let Xe=je?.format;if(!Xe||!Xe.startsWith("BGR")&&!Xe.startsWith("RGB"))throw new Error(`Unrecognized format ${Xe}`);let ft=Xe.startsWith("BGR"),Mt=new Uint8ClampedArray(pe*ke*4);if(yield je.copyTo(Mt,function(Ut,ir,Mr,zr,Hr){let oa=4*Math.max(-ir,0),va=(Math.max(0,Mr)-Mr)*zr*4+oa,Ga=4*zr,$a=Math.max(0,ir),Kn=Math.max(0,Mr);return{rect:{x:$a,y:Kn,width:Math.min(Ut.width,ir+zr)-$a,height:Math.min(Ut.height,Mr+Hr)-Kn},layout:[{offset:va,stride:Ga}]}}(G,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(G,D){if(/:\/\//.test(G.url)&&!/^https?:|^file:/.test(G.url)){let pe=ue(G.url);if(pe)return pe(G,D);if(L(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:G,targetMapId:se},D)}if(!(/^file:/.test(K=G.url)||/^file:/.test(H())&&!/^\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:H(),signal:ke.signal});pe.type!=="json"||je.headers.has("Accept")||je.headers.set("Accept","application/json");let Xe=yield fetch(je);if(!Xe.ok){let Ut=yield Xe.blob();throw new he(Xe.status,Xe.statusText,pe.url,Ut)}let ft;ft=pe.type==="arrayBuffer"||pe.type==="image"?Xe.arrayBuffer():pe.type==="json"?Xe.json():Xe.text();let Mt=yield ft;if(ke.signal.aborted)throw W();return{data:Mt,cacheControl:Xe.headers.get("Cache-Control"),expires:Xe.headers.get("Expires")}})}(G,D);if(L(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:G,mustQueue:!0,targetMapId:se},D)}var K;return function(pe,ke){return new Promise((je,Xe)=>{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=()=>{Xe(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(ir){return void Xe(ir)}je({data:Ut,cacheControl:Mt.getResponseHeader("Cache-Control"),expires:Mt.getResponseHeader("Expires")})}else{let Ut=new Blob([Mt.response],{type:Mt.getResponseHeader("Content-Type")});Xe(new he(Mt.status,Mt.statusText,pe.url,Ut))}},ke.signal.addEventListener("abort",()=>{Mt.abort(),Xe(W())}),Mt.send(pe.body)})}(G,D)};function J(G){if(!G||G.indexOf("://")<=0||G.indexOf("data:image/")===0||G.indexOf("blob:")===0)return!0;let D=new URL(G),K=window.location;return D.protocol===K.protocol&&D.host===K.host}function X(G,D,K){K[G]&&K[G].indexOf(D)!==-1||(K[G]=K[G]||[],K[G].push(D))}function oe(G,D,K){if(K&&K[G]){let pe=K[G].indexOf(D);pe!==-1&&K[G].splice(pe,1)}}class ne{constructor(D,K={}){E(this,K),this.type=D}}class j extends ne{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 ne(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 Xe=this._eventedParent;Xe&&(E(D,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),Xe.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(G,D){let K={};for(let pe in G)pe!=="ref"&&(K[pe]=G[pe]);return ce.forEach(pe=>{pe in D&&(K[pe]=D[pe])}),K}function Ae(G,D){if(Array.isArray(G)){if(!Array.isArray(D)||G.length!==D.length)return!1;for(let K=0;K`:G.itemType.kind==="value"?"array":`array<${D}>`}return G.kind}let Ue=[st,Qe,Lt,kt,qt,jr,Zt,Be(Sr),wr,Ir,bt];function Ee(G,D){if(D.kind==="error")return null;if(G.kind==="array"){if(D.kind==="array"&&(D.N===0&&D.itemType.kind==="value"||!Ee(G.itemType,D.itemType))&&(typeof G.N!="number"||G.N===D.N))return null}else{if(G.kind===D.kind)return null;if(G.kind==="value"){for(let K of Ue)if(!Ee(K,D))return null}}return`Expected ${Ke(G)} but found ${Ke(D)} instead.`}function Ve(G,D){return D.some(K=>K.kind===G.kind)}function Ce(G,D){return D.some(K=>K==="null"?G===null:K==="array"?Array.isArray(G):K==="object"?G&&!Array.isArray(G)&&typeof G=="object":K===typeof G)}function Te(G,D){return G.kind==="array"&&D.kind==="array"?G.itemType.kind===D.itemType.kind&&typeof G.N=="number":G.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(G){return(G%=360)<0&&(G+=360),G}function la([G,D,K,pe]){let ke,je,Xe=Ba((.2225045*(G=Ua(G))+.7168786*(D=Ua(D))+.0606169*(K=Ua(K)))/1);G===D&&D===K?ke=je=Xe:(ke=Ba((.4360747*G+.3850649*D+.1430804*K)/Pe),je=Ba((.0139322*G+.0971045*D+.7141733*K)/at));let ft=116*Xe-16;return[ft<0?0:ft,500*(ke-Xe),200*(Xe-je),pe]}function Ua(G){return G<=.04045?G/12.92:Math.pow((G+.055)/1.055,2.4)}function Ba(G){return G>Gt?Math.pow(G,1/3):G/Ot+yt}function Ra([G,D,K,pe]){let ke=(G+16)/116,je=isNaN(D)?ke:ke+D/500,Xe=isNaN(K)?ke:ke-K/200;return ke=1*za(ke),je=Pe*za(je),Xe=at*za(Xe),[Qa(3.1338561*je-1.6168667*ke-.4906146*Xe),Qa(-.9787684*je+1.9161415*ke+.033454*Xe),Qa(.0719453*je-.2289914*ke+1.4052427*Xe),pe]}function Qa(G){return(G=G<=.00304?12.92*G:1.055*Math.pow(G,1/2.4)-.055)<0?0:G>1?1:G}function za(G){return G>Tt?G*G*G:Ot*(G-yt)}function en(G){return parseInt(G.padEnd(2,G),16)/255}function kn(G,D){return Jt(D?G/100:G,0,1)}function Jt(G,D,K){return Math.min(Math.max(D,G),K)}function Nt(G){return!G.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[Xe,ft,Mt]=ke;return[Xe/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 Xe=pe.length<6?1:2,ft=1;return[en(pe.slice(ft,ft+=Xe)),en(pe.slice(ft,ft+=Xe)),en(pe.slice(ft,ft+=Xe)),en(pe.slice(ft,ft+Xe)||"ff")]}if(pe.startsWith("rgb")){let Xe=pe.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(Xe){let[ft,Mt,Ut,ir,Mr,zr,Hr,oa,va,Ga,$a,Kn]=Xe,bn=[ir||" ",Hr||" ",Ga].join("");if(bn===" "||bn===" /"||bn===",,"||bn===",,,"){let Wn=[Ut,zr,va].join(""),ai=Wn==="%%%"?100:Wn===""?255:0;if(ai){let ji=[Jt(+Mt/ai,0,1),Jt(+Mr/ai,0,1),Jt(+oa/ai,0,1),$a?kn(+$a,Kn):1];if(Nt(ji))return ji}}return}}let je=pe.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(je){let[Xe,ft,Mt,Ut,ir,Mr,zr,Hr,oa]=je,va=[Mt||" ",ir||" ",zr].join("");if(va===" "||va===" /"||va===",,"||va===",,,"){let Ga=[+ft,Jt(+Ut,0,100),Jt(+Mr,0,100),Hr?kn(+Hr,oa):1];if(Nt(Ga))return function([$a,Kn,bn,Wn]){function ai(ji){let ko=(ji+$a/30)%12,vs=Kn*Math.min(bn,1-bn);return bn-vs*Math.max(-1,Math.min(ko-3,9-ko,1))}return $a=Tr($a),Kn/=100,bn/=100,[ai(0),ai(8),ai(4),Wn]}(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),Xe=Math.sqrt(pe*pe+ke*ke);return[Math.round(1e4*Xe)?Tr(Math.atan2(ke,pe)*Qt):NaN,Xe,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&&G<=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 [${[G,D,K,pe].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof pe=="number"?[G,D,K,pe]:[G,D,K]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function yn(G){if(G===null||typeof G=="string"||typeof G=="boolean"||typeof G=="number"||G instanceof Wt||G instanceof Pr||G instanceof ma||G instanceof ra||G instanceof Ha||G instanceof rn)return!0;if(Array.isArray(G)){for(let D of G)if(!yn(D))return!1;return!0}if(typeof G=="object"){for(let D in G)if(!yn(G[D]))return!1;return!0}return!1}function xt(G){if(G===null)return st;if(typeof G=="string")return Lt;if(typeof G=="boolean")return kt;if(typeof G=="number")return Qe;if(G instanceof Wt)return qt;if(G instanceof Pr)return xr;if(G instanceof ma)return jr;if(G instanceof ra)return wr;if(G instanceof Ha)return bt;if(G instanceof rn)return Ir;if(Array.isArray(G)){let D=G.length,K;for(let pe of G){let ke=xt(pe);if(K){if(K===ke)continue;K=Sr;break}K=ke}return Be(K||Sr,D)}return Zt}function ct(G){let D=typeof G;return G===null?"":D==="string"||D==="number"||D==="boolean"?String(G):G instanceof Wt||G instanceof ma||G instanceof ra||G instanceof Ha||G instanceof rn?G.toString():JSON.stringify(G)}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(!yn(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 Xe=[];for(;keD.outputDefined())}}let Gr={"to-boolean":kt,"to-color":qt,"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 Xe=1;Xe4?`Invalid rbga value ${JSON.stringify(K)}: expected an array containing either three or four numeric values.`:nn(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 rn.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,Xe=[]){this.registry=D,this.path=pe,this.key=pe.map(ft=>`[${ft}]`).join(""),this.scope=je,this.errors=Xe,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,Xe){return Xe==="assert"?new Lr(je,[ke]):Xe==="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 Xe=je.parse(D,this);if(!Xe)return null;if(this.expectedType){let ft=this.expectedType,Mt=Xe.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 Xe=pe(Xe,ft,K.typeAnnotation||"coerce");else Xe=pe(Xe,ft,K.typeAnnotation||"coerce");else Xe=pe(Xe,ft,K.typeAnnotation||"coerce");else Xe=pe(Xe,ft,K.typeAnnotation||"assert")}if(!(Xe instanceof Nr)&&Xe.type.kind!=="resolvedImage"&&this._isConstant(Xe)){let ft=new aa;try{Xe=new Nr(Xe.type,Xe.evaluate(ft))}catch(Mt){return this.error(Mt.message),null}}return Xe}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=Ee(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?Ve(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 na{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(!Ve(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 na(pe,ke,je):null}return new na(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,Xe){this.inputType=D,this.type=K,this.input=pe,this.cases=ke,this.outputs=je,this.otherwise=Xe}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={},Xe=[];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)]=Xe.length}let Hr=K.parse(Mr,Ut,ke);if(!Hr)return null;ke=ke||Hr.type,Xe.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,Xe,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 Xe=1;XeK.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(!Ve(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(G,D){let K=G.length-1,pe,ke,je=0,Xe=K,ft=0;for(;je<=Xe;)if(ft=Math.floor((je+Xe)/2),pe=G[ft],ke=G[ft+1],pe<=D){if(ft===K||DD))throw new Or("Input is not a number.");Xe=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 Xe=1;Xe=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,ir,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 Zn(G){return G&&G.__esModule&&Object.prototype.hasOwnProperty.call(G,"default")?G.default:G}var Pn=fi;function fi(G,D,K,pe){this.cx=3*G,this.bx=3*(K-G)-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=G,this.p1y=D,this.p2x=K,this.p2y=pe}fi.prototype={sampleCurveX:function(G){return((this.ax*G+this.bx)*G+this.cx)*G},sampleCurveY:function(G){return((this.ay*G+this.by)*G+this.cy)*G},sampleCurveDerivativeX:function(G){return(3*this.ax*G+2*this.bx)*G+this.cx},solveCurveX:function(G,D){if(D===void 0&&(D=1e-6),G<0)return 0;if(G>1)return 1;for(var K=G,pe=0;pe<8;pe++){var ke=this.sampleCurveX(K)-G;if(Math.abs(ke)ke?Xe=K:ft=K,K=.5*(ft-Xe)+Xe;return K},solve:function(G,D){return this.sampleCurveY(this.solveCurveX(G,D))}};var Ai=Zn(Pn);function ki(G,D,K){return G+K*(D-G)}function zi(G,D,K){return G.map((pe,ke)=>ki(pe,D[ke],K))}let Xi={number:ki,color:function(G,D,K,pe="rgb"){switch(pe){case"rgb":{let[ke,je,Xe,ft]=zi(G.rgb,D.rgb,K);return new Wt(ke,je,Xe,ft,!1)}case"hcl":{let[ke,je,Xe,ft]=G.hcl,[Mt,Ut,ir,Mr]=D.hcl,zr,Hr;if(isNaN(ke)||isNaN(Mt))isNaN(ke)?isNaN(Mt)?zr=NaN:(zr=Mt,Xe!==1&&Xe!==0||(Hr=Ut)):(zr=ke,ir!==1&&ir!==0||(Hr=je));else{let Kn=Mt-ke;Mt>ke&&Kn>180?Kn-=360:Mt180&&(Kn+=360),zr=ke+K*Kn}let[oa,va,Ga,$a]=function([Kn,bn,Wn,ai]){return Kn=isNaN(Kn)?0:Kn*rr,Ra([Wn,Math.cos(Kn)*bn,Math.sin(Kn)*bn,ai])}([zr,Hr??ki(je,Ut,K),ki(Xe,ir,K),ki(ft,Mr,K)]);return new Wt(oa,va,Ga,$a,!1)}case"lab":{let[ke,je,Xe,ft]=Ra(zi(G.lab,D.lab,K));return new Wt(ke,je,Xe,ft,!1)}}},array:zi,padding:function(G,D,K){return new ra(zi(G.values,D.values,K))},variableAnchorOffsetCollection:function(G,D,K){let pe=G.values,ke=D.values;if(pe.length!==ke.length)throw new Or(`Cannot interpolate values of different length. from: ${G.toString()}, to: ${D.toString()}`);let je=[];for(let Xe=0;Xetypeof ir!="number"||ir<0||ir>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=qt:K.expectedType&&K.expectedType.kind!=="value"&&(Mt=K.expectedType);for(let Ut=0;Ut=ir)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([ir,oa])}return Te(Mt,Qe)||Te(Mt,qt)||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 Xe=ha(K,ke),ft=to.interpolationFactor(this.interpolation,ke,K[Xe],K[Xe+1]),Mt=pe[Xe].evaluate(D),Ut=pe[Xe+1].evaluate(D);switch(this.operator){case"interpolate":return Xi[this.type.kind](Mt,Ut,ft);case"interpolate-hcl":return Xi.color(Mt,Ut,ft,"hcl");case"interpolate-lab":return Xi.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 go(G,D,K,pe){let ke=pe-K,je=G-K;return ke===0?0:D===1?je/ke:(Math.pow(D,je)-1)/(Math.pow(D,ke)-1)}class pi{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 Xe=ke&&je.some(ft=>Ee(ke,ft.type));return new pi(Xe?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 rn&&!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(G,D){return G==="=="||G==="!="?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(G,D,K,pe){return pe.compare(D,K)===0}function Ts(G,D,K){let pe=G!=="=="&&G!=="!=";return class eF{constructor(je,Xe,ft){this.type=kt,this.lhs=je,this.rhs=Xe,this.collator=ft,this.hasUntypedArgument=je.type.kind==="value"||Xe.type.kind==="value"}static parse(je,Xe){if(je.length!==3&&je.length!==4)return Xe.error("Expected two or three arguments.");let ft=je[0],Mt=Xe.parse(je[1],1,Sr);if(!Mt)return null;if(!Jo(ft,Mt.type))return Xe.concat(1).error(`"${ft}" comparisons are not supported for type '${Ke(Mt.type)}'.`);let Ut=Xe.parse(je[2],2,Sr);if(!Ut)return null;if(!Jo(ft,Ut.type))return Xe.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 Xe.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 ir=null;if(je.length===4){if(Mt.type.kind!=="string"&&Ut.type.kind!=="string"&&Mt.type.kind!=="value"&&Ut.type.kind!=="value")return Xe.error("Cannot use collator to compare non-string types.");if(ir=Xe.parse(je[3],3,xr),!ir)return null}return new eF(Mt,Ut,ir)}evaluate(je){let Xe=this.lhs.evaluate(je),ft=this.rhs.evaluate(je);if(pe&&this.hasUntypedArgument){let Mt=xt(Xe),Ut=xt(ft);if(Mt.kind!==Ut.kind||Mt.kind!=="string"&&Mt.kind!=="number")throw new Or(`Expected arguments for "${G}" to be (string, string) or (number, number), but found (${Mt.kind}, ${Ut.kind}) instead.`)}if(this.collator&&!pe&&this.hasUntypedArgument){let Mt=xt(Xe),Ut=xt(ft);if(Mt.kind!=="string"||Ut.kind!=="string")return D(je,Xe,ft)}return this.collator?K(je,Xe,ft,this.collator.evaluate(je)):D(je,Xe,ft)}eachChild(je){je(this.lhs),je(this.rhs),this.collator&&je(this.collator)}outputDefined(){return!0}}}let Po=Ts("==",function(G,D,K){return D===K},Xo),so=Ts("!=",function(G,D,K){return D!==K},function(G,D,K,pe){return!Xo(0,D,K,pe)}),qi=Ts("<",function(G,D,K){return D",function(G,D,K){return D>K},function(G,D,K,pe){return pe.compare(D,K)>0}),Vo=Ts("<=",function(G,D,K){return D<=K},function(G,D,K,pe){return pe.compare(D,K)<=0}),Oo=Ts(">=",function(G,D,K){return D>=K},function(G,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 Xe=null;return pe.locale&&(Xe=K.parse(pe.locale,1,Lt),!Xe)?null:new lo(ke,je,Xe)}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 Xe=null;if(ke.currency&&(Xe=K.parse(ke.currency,1,Lt),!Xe))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,Xe,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 Xe=1;Xe<=D.length-1;++Xe){let ft=D[Xe];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 ir=null;if(ft["text-color"]&&(ir=K.parse(ft["text-color"],1,qt),!ir))return null;let Mr=ke[ke.length-1];Mr.scale=Mt,Mr.font=Ut,Mr.textColor=ir}else{let Mt=K.parse(D[Xe],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=rn.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 jn(G,D){let K=(180+G[0])/360,pe=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+G[1]*Math.PI/360)))/360,ke=Math.pow(2,D.z);return[Math.round(K*ke*Yo),Math.round(pe*ke*Yo)]}function Ci(G,D){let K=Math.pow(2,D.z);return[(ke=(G[0]/Yo+D.x)/K,360*ke-180),(pe=(G[1]/Yo+D.y)/K,360/Math.PI*Math.atan(Math.exp((180-360*pe)*Math.PI/180))-90)];var pe,ke}function tl(G,D){G[0]=Math.min(G[0],D[0]),G[1]=Math.min(G[1],D[1]),G[2]=Math.max(G[2],D[0]),G[3]=Math.max(G[3],D[1])}function Bs(G,D){return!(G[0]<=D[0]||G[2]>=D[2]||G[1]<=D[1]||G[3]>=D[3])}function uo(G,D,K){let pe=G[0]-D[0],ke=G[1]-D[1],je=G[0]-K[0],Xe=G[1]-K[1];return pe*Xe-je*ke==0&&pe*je<=0&&ke*Xe<=0}function $s(G,D,K,pe){return(ke=[pe[0]-K[0],pe[1]-K[1]])[0]*(je=[D[0]-G[0],D[1]-G[1]])[1]-ke[1]*je[0]!=0&&!(!ro(G,D,K,pe)||!ro(K,pe,G,D));var ke,je}function ms(G,D,K){for(let pe of K)for(let ke=0;ke(ke=G)[1]!=(Xe=ft[Mt+1])[1]>ke[1]&&ke[0]<(Xe[0]-je[0])*(ke[1]-je[1])/(Xe[1]-je[1])+je[0]&&(pe=!pe)}var ke,je,Xe;return pe}function rl(G,D){for(let K of D)if(Is(G,K))return!0;return!1}function Si(G,D){for(let K of G)if(!Is(K,D))return!1;for(let K=0;K0&&ft<0||Xe<0&&ft>0}function As(G,D,K){let pe=[];for(let ke=0;keK[2]){let ke=.5*pe,je=G[0]-K[0]>ke?-pe:K[0]-G[0]>ke?pe:0;je===0&&(je=G[0]-K[2]>ke?-pe:K[2]-G[0]>ke?pe:0),G[0]+=je}tl(D,G)}function zs(G,D,K,pe){let ke=Math.pow(2,pe.z)*Yo,je=[pe.x*Yo,pe.y*Yo],Xe=[];for(let ft of G)for(let Mt of ft){let Ut=[Mt.x+je[0],Mt.y+je[1]];$i(Ut,D,K,ke),Xe.push(Ut)}return Xe}function au(G,D,K,pe){let ke=Math.pow(2,pe.z)*Yo,je=[pe.x*Yo,pe.y*Yo],Xe=[];for(let Mt of G){let Ut=[];for(let ir of Mt){let Mr=[ir.x+je[0],ir.y+je[1]];tl(D,Mr),Ut.push(Mr)}Xe.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 Xe)for(let Ut of Mt)$i(Ut,D,K,ke)}var ft;return Xe}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(yn(D[1])){let pe=D[1];if(pe.type==="FeatureCollection"){let ke=[];for(let je of pe.features){let{type:Xe,coordinates:ft}=je.geometry;Xe==="Polygon"&&ke.push(ft),Xe==="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],Xe=K.canonicalID();if(pe.type==="Polygon"){let ft=As(pe.coordinates,je,Xe),Mt=zs(K.geometry(),ke,je,Xe);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,Xe),Mt=zs(K.geometry(),ke,je,Xe);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],Xe=K.canonicalID();if(pe.type==="Polygon"){let ft=As(pe.coordinates,je,Xe),Mt=au(K.geometry(),ke,je,Xe);if(!Bs(ke,je))return!1;for(let Ut of Mt)if(!Si(Ut,ft))return!1}if(pe.type==="MultiPolygon"){let ft=al(pe.coordinates,je,Xe),Mt=au(K.geometry(),ke,je,Xe);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(G=[],D=(K,pe)=>Kpe?1:0){if(this.data=G,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(G){this.data.push(G),this._up(this.length++)}pop(){if(this.length===0)return;let G=this.data[0],D=this.data.pop();return--this.length>0&&(this.data[0]=D,this._down(0)),G}peek(){return this.data[0]}_up(G){let{data:D,compare:K}=this,pe=D[G];for(;G>0;){let ke=G-1>>1,je=D[ke];if(K(pe,je)>=0)break;D[G]=je,G=ke}D[G]=pe}_down(G){let{data:D,compare:K}=this,pe=this.length>>1,ke=D[G];for(;G=0)break;D[G]=D[je],G=je}D[G]=ke}};function zl(G,D,K,pe,ke){Ns(G,D,K,pe||G.length-1,ke||Eu)}function Ns(G,D,K,pe,ke){for(;pe>K;){if(pe-K>600){var je=pe-K+1,Xe=D-K+1,ft=Math.log(je),Mt=.5*Math.exp(2*ft/3),Ut=.5*Math.sqrt(ft*Mt*(je-Mt)/je)*(Xe-je/2<0?-1:1);Ns(G,D,Math.max(K,Math.floor(D-Xe*Mt/je+Ut)),Math.min(pe,Math.floor(D+(je-Xe)*Mt/je+Ut)),ke)}var ir=G[D],Mr=K,zr=pe;for(nu(G,K,D),ke(G[pe],ir)>0&&nu(G,K,pe);Mr0;)zr--}ke(G[K],ir)===0?nu(G,K,zr):nu(G,++zr,pe),zr<=D&&(K=zr+1),D<=zr&&(pe=zr-1)}}function nu(G,D,K){var pe=G[D];G[D]=G[K],G[K]=pe}function Eu(G,D){return GD?1:0}function Bc(G,D){if(G.length<=1)return[G];let K=[],pe,ke;for(let je of G){let Xe=Af(je);Xe!==0&&(je.area=Math.abs(Xe),ke===void 0&&(ke=Xe<0),ke===Xe<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],ir=D[Mt+1][1]):Hr>0&&(Ut+=Mr/this.kx*Hr,ir+=zr/this.ky*Hr)),Mr=this.wrap(K[0]-Ut)*this.kx,zr=(K[1]-ir)*this.ky;let oa=Mr*Mr+zr*zr;oa180;)D-=360;return D}}function iu(G,D){return D[0]-G[0]}function Ll(G){return G[1]-G[0]+1}function nc(G,D){return G[1]>=G[0]&&G[1]G[1])return[null,null];let K=Ll(G);if(D){if(K===2)return[G,null];let ke=Math.floor(K/2);return[[G[0],G[0]+ke],[G[0]+ke,G[1]]]}if(K===1)return[G,null];let pe=Math.floor(K/2)-1;return[[G[0],G[0]+pe],[G[0]+pe+1,G[1]]]}function nl(G,D){if(!nc(D,G.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,G[pe]);return K}function vl(G){let D=[1/0,1/0,-1/0,-1/0];for(let K of G)for(let pe of K)tl(D,pe);return D}function gs(G){return G[0]!==-1/0&&G[1]!==-1/0&&G[2]!==1/0&&G[3]!==1/0}function qs(G,D,K){if(!gs(G)||!gs(D))return NaN;let pe=0,ke=0;return G[2]D[2]&&(pe=G[0]-D[2]),G[1]>D[3]&&(ke=G[1]-D[3]),G[3]=pe)return pe;if(Bs(ke,je)){if(_h(G,D))return 0}else if(_h(D,G))return 0;let Xe=1/0;for(let ft of G)for(let Mt=0,Ut=ft.length,ir=Ut-1;Mt0;){let Mt=Xe.pop();if(Mt[0]>=je)continue;let Ut=Mt[1],ir=D?50:100;if(Ll(Ut)<=ir){if(!nc(Ut,G.length))return NaN;if(D){let Mr=ls(G,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(G[Mr],K,pe);if(je=Math.min(je,zr),je===0)return 0}}else{let Mr=Ou(Ut,D);Qi(Xe,je,pe,G,ft,Mr[0]),Qi(Xe,je,pe,G,ft,Mr[1])}}return je}function Ul(G,D,K,pe,ke,je=1/0){let Xe=Math.min(je,ke.distance(G[0],K[0]));if(Xe===0)return Xe;let ft=new xu([[0,[0,G.length-1],[0,K.length-1]]],iu);for(;ft.length>0;){let Mt=ft.pop();if(Mt[0]>=Xe)continue;let Ut=Mt[1],ir=Mt[2],Mr=D?50:100,zr=pe?50:100;if(Ll(Ut)<=Mr&&Ll(ir)<=zr){if(!nc(Ut,G.length)&&nc(ir,K.length))return NaN;let Hr;if(D&&pe)Hr=Vu(G,Ut,K,ir,ke),Xe=Math.min(Xe,Hr);else if(D&&!pe){let oa=G.slice(Ut[0],Ut[1]+1);for(let va=ir[0];va<=ir[1];++va)if(Hr=ic(K[va],oa,ke),Xe=Math.min(Xe,Hr),Xe===0)return Xe}else if(!D&&pe){let oa=K.slice(ir[0],ir[1]+1);for(let va=Ut[0];va<=Ut[1];++va)if(Hr=ic(G[va],oa,ke),Xe=Math.min(Xe,Hr),Xe===0)return Xe}else Hr=cl(G,Ut,K,ir,ke),Xe=Math.min(Xe,Hr)}else{let Hr=Ou(Ut,D),oa=Ou(ir,pe);Gc(ft,Xe,ke,G,K,Hr[0],oa[0]),Gc(ft,Xe,ke,G,K,Hr[0],oa[1]),Gc(ft,Xe,ke,G,K,Hr[1],oa[0]),Gc(ft,Xe,ke,G,K,Hr[1],oa[1])}}return Xe}function Mf(G){return G.type==="MultiPolygon"?G.coordinates.map(D=>({type:"Polygon",coordinates:D})):G.type==="MultiLineString"?G.coordinates.map(D=>({type:"LineString",coordinates:D})):G.type==="MultiPoint"?G.coordinates.map(D=>({type:"Point",coordinates:D})):[G]}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(yn(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=>Ci([Mt.x,Mt.y],K.canonical));if(ke.length===0)return NaN;let Xe=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,Xe,ft));break;case"LineString":ft=Math.min(ft,Ul(je,!1,Mt.coordinates,!0,Xe,ft));break;case"Polygon":ft=Math.min(ft,qu(je,!1,Mt.coordinates,Xe,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=>Ci([Mt.x,Mt.y],K.canonical));if(ke.length===0)return NaN;let Xe=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,Xe,ft));break;case"LineString":ft=Math.min(ft,Ul(je,!0,Mt.coordinates,!0,Xe,ft));break;case"Polygon":ft=Math.min(ft,qu(je,!0,Mt.coordinates,Xe,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(ir=>Ci([ir.x,ir.y],K.canonical)))),Xe=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,qu([Mt.coordinates],!1,Ut,Xe,ft));break;case"LineString":ft=Math.min(ft,qu(Mt.coordinates,!0,Ut,Xe,ft));break;case"Polygon":ft=Math.min(ft,Ss(Ut,Mt.coordinates,Xe,ft))}if(ft===0)return ft}return ft}(D,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}let rf={"==":Po,"!=":so,">":To,"<":qi,">=":Oo,"<=":Vo,array:Lr,at:dr,boolean:Lr,case:Fa,coalesce:pi,collator:lo,format:os,image:Ys,in:kr,"index-of":na,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,Xe=Array.isArray(ke)?[[ke[1],ke[2]]]:ke.overloads,ft=Xe.filter(([Ut])=>!Array.isArray(Ut)||Ut.length===D.length-1),Mt=null;for(let[Ut,ir]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(" | "),ir=[];for(let Mr=1;Mr{K=D?K&&Ff(pe):K&&pe instanceof Nr}),!!K&&Of(G)&&Ef(G,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function Of(G){if(G instanceof Kl&&(G.name==="get"&&G.args.length===1||G.name==="feature-state"||G.name==="has"&&G.args.length===1||G.name==="properties"||G.name==="geometry-type"||G.name==="id"||/^filter-/.test(G.name))||G instanceof fl||G instanceof wc)return!1;let D=!0;return G.eachChild(K=>{D&&!Of(K)&&(D=!1)}),D}function Gu(G){if(G instanceof Kl&&G.name==="feature-state")return!1;let D=!0;return G.eachChild(K=>{D&&!Gu(K)&&(D=!1)}),D}function Ef(G,D){if(G instanceof Kl&&D.indexOf(G.name)>=0)return!1;let K=!0;return G.eachChild(pe=>{K&&!Ef(pe,D)&&(K=!1)}),K}function oc(G){return{result:"success",value:G}}function Hc(G){return{result:"error",value:G}}function Jl(G){return G["property-type"]==="data-driven"||G["property-type"]==="cross-faded-data-driven"}function Uc(G){return!!G.expression&&G.expression.parameters.indexOf("zoom")>-1}function Tc(G){return!!G.expression&&G.expression.interpolated}function Gs(G){return G instanceof Number?"number":G instanceof String?"string":G instanceof Boolean?"boolean":Array.isArray(G)?"array":G===null?"null":typeof G}function Cf(G){return typeof G=="object"&&G!==null&&!Array.isArray(G)}function lh(G){return G}function Bf(G,D){let K=D.type==="color",pe=G.stops&&typeof G.stops[0][0]=="object",ke=pe||!(pe||G.property!==void 0),je=G.type||(Tc(D)?"exponential":"interval");if(K||D.type==="padding"){let ir=K?Wt.parse:ra.parse;(G=fe({},G)).stops&&(G.stops=G.stops.map(Mr=>[Mr[0],ir(Mr[1])])),G.default=ir(G.default?G.default:D.default)}if(G.colorSpace&&(Xe=G.colorSpace)!=="rgb"&&Xe!=="hcl"&&Xe!=="lab")throw new Error(`Unknown color space: "${G.colorSpace}"`);var Xe;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 ir of G.stops)Mt[ir[0]]=ir[1];Ut=typeof G.stops[0][0]}else{if(je!=="identity")throw new Error(`Unknown function type "${je}"`);ft=ml}if(pe){let ir={},Mr=[];for(let oa=0;oaoa[0]),evaluate:({zoom:oa},va)=>Nf({stops:zr,base:G.base},D,oa).evaluate(oa,va)}}if(ke){let ir=je==="exponential"?{name:"exponential",base:G.base!==void 0?G.base:1}:null;return{kind:"camera",interpolationType:ir,interpolationFactor:to.interpolationFactor.bind(void 0,ir),zoomStops:G.stops.map(Mr=>Mr[0]),evaluate:({zoom:Mr})=>ft(G,D,Mr,Mt,Ut)}}return{kind:"source",evaluate(ir,Mr){let zr=Mr&&Mr.properties?Mr.properties[G.property]:void 0;return zr===void 0?Wc(G.default,D.default):ft(G,D,zr,Mt,Ut)}}}function Wc(G,D,K){return G!==void 0?G:D!==void 0?D:K!==void 0?K:void 0}function Kf(G,D,K,pe,ke){return Wc(typeof K===ke?pe[K]:void 0,G.default,D.default)}function ku(G,D,K){if(Gs(K)!=="number")return Wc(G.default,D.default);let pe=G.stops.length;if(pe===1||K<=G.stops[0][0])return G.stops[0][1];if(K>=G.stops[pe-1][0])return G.stops[pe-1][1];let ke=ha(G.stops.map(je=>je[0]),K);return G.stops[ke][1]}function Nf(G,D,K){let pe=G.base!==void 0?G.base:1;if(Gs(K)!=="number")return Wc(G.default,D.default);let ke=G.stops.length;if(ke===1||K<=G.stops[0][0])return G.stops[0][1];if(K>=G.stops[ke-1][0])return G.stops[ke-1][1];let je=ha(G.stops.map(ir=>ir[0]),K),Xe=function(ir,Mr,zr,Hr){let oa=Hr-zr,va=ir-zr;return oa===0?0:Mr===1?va/oa:(Math.pow(Mr,va)-1)/(Math.pow(Mr,oa)-1)}(K,pe,G.stops[je][0],G.stops[je+1][0]),ft=G.stops[je][1],Mt=G.stops[je+1][1],Ut=Xi[D.type]||lh;return typeof ft.evaluate=="function"?{evaluate(...ir){let Mr=ft.evaluate.apply(void 0,ir),zr=Mt.evaluate.apply(void 0,ir);if(Mr!==void 0&&zr!==void 0)return Ut(Mr,zr,Xe,G.colorSpace)}}:Ut(ft,Mt,Xe,G.colorSpace)}function ml(G,D,K){switch(D.type){case"color":K=Wt.parse(K);break;case"formatted":K=ma.fromString(K.toString());break;case"resolvedImage":K=rn.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,G.default,D.default)}Kl.register(rf,{error:[{kind:"error"},[Lt],(G,[D])=>{throw new Or(D.evaluate(G))}],typeof:[Lt,[Sr],(G,[D])=>Ke(xt(D.evaluate(G)))],"to-rgba":[Be(Qe,4),[qt],(G,[D])=>{let[K,pe,ke,je]=D.evaluate(G).rgb;return[255*K,255*pe,255*ke,je]}],rgb:[qt,[Qe,Qe,Qe],Yf],rgba:[qt,[Qe,Qe,Qe,Qe],Yf],has:{type:kt,overloads:[[[Lt],(G,[D])=>zf(D.evaluate(G),G.properties())],[[Lt,Zt],(G,[D,K])=>zf(D.evaluate(G),K.evaluate(G))]]},get:{type:Sr,overloads:[[[Lt],(G,[D])=>af(D.evaluate(G),G.properties())],[[Lt,Zt],(G,[D,K])=>af(D.evaluate(G),K.evaluate(G))]]},"feature-state":[Sr,[Lt],(G,[D])=>af(D.evaluate(G),G.featureState||{})],properties:[Zt,[],G=>G.properties()],"geometry-type":[Lt,[],G=>G.geometryType()],id:[Sr,[],G=>G.id()],zoom:[Qe,[],G=>G.globals.zoom],"heatmap-density":[Qe,[],G=>G.globals.heatmapDensity||0],"line-progress":[Qe,[],G=>G.globals.lineProgress||0],accumulated:[Sr,[],G=>G.globals.accumulated===void 0?null:G.globals.accumulated],"+":[Qe,Nc(Qe),(G,D)=>{let K=0;for(let pe of D)K+=pe.evaluate(G);return K}],"*":[Qe,Nc(Qe),(G,D)=>{let K=1;for(let pe of D)K*=pe.evaluate(G);return K}],"-":{type:Qe,overloads:[[[Qe,Qe],(G,[D,K])=>D.evaluate(G)-K.evaluate(G)],[[Qe],(G,[D])=>-D.evaluate(G)]]},"/":[Qe,[Qe,Qe],(G,[D,K])=>D.evaluate(G)/K.evaluate(G)],"%":[Qe,[Qe,Qe],(G,[D,K])=>D.evaluate(G)%K.evaluate(G)],ln2:[Qe,[],()=>Math.LN2],pi:[Qe,[],()=>Math.PI],e:[Qe,[],()=>Math.E],"^":[Qe,[Qe,Qe],(G,[D,K])=>Math.pow(D.evaluate(G),K.evaluate(G))],sqrt:[Qe,[Qe],(G,[D])=>Math.sqrt(D.evaluate(G))],log10:[Qe,[Qe],(G,[D])=>Math.log(D.evaluate(G))/Math.LN10],ln:[Qe,[Qe],(G,[D])=>Math.log(D.evaluate(G))],log2:[Qe,[Qe],(G,[D])=>Math.log(D.evaluate(G))/Math.LN2],sin:[Qe,[Qe],(G,[D])=>Math.sin(D.evaluate(G))],cos:[Qe,[Qe],(G,[D])=>Math.cos(D.evaluate(G))],tan:[Qe,[Qe],(G,[D])=>Math.tan(D.evaluate(G))],asin:[Qe,[Qe],(G,[D])=>Math.asin(D.evaluate(G))],acos:[Qe,[Qe],(G,[D])=>Math.acos(D.evaluate(G))],atan:[Qe,[Qe],(G,[D])=>Math.atan(D.evaluate(G))],min:[Qe,Nc(Qe),(G,D)=>Math.min(...D.map(K=>K.evaluate(G)))],max:[Qe,Nc(Qe),(G,D)=>Math.max(...D.map(K=>K.evaluate(G)))],abs:[Qe,[Qe],(G,[D])=>Math.abs(D.evaluate(G))],round:[Qe,[Qe],(G,[D])=>{let K=D.evaluate(G);return K<0?-Math.round(-K):Math.round(K)}],floor:[Qe,[Qe],(G,[D])=>Math.floor(D.evaluate(G))],ceil:[Qe,[Qe],(G,[D])=>Math.ceil(D.evaluate(G))],"filter-==":[kt,[Lt,Sr],(G,[D,K])=>G.properties()[D.value]===K.value],"filter-id-==":[kt,[Sr],(G,[D])=>G.id()===D.value],"filter-type-==":[kt,[Lt],(G,[D])=>G.geometryType()===D.value],"filter-<":[kt,[Lt,Sr],(G,[D,K])=>{let pe=G.properties()[D.value],ke=K.value;return typeof pe==typeof ke&&pe{let K=G.id(),pe=D.value;return typeof K==typeof pe&&K":[kt,[Lt,Sr],(G,[D,K])=>{let pe=G.properties()[D.value],ke=K.value;return typeof pe==typeof ke&&pe>ke}],"filter-id->":[kt,[Sr],(G,[D])=>{let K=G.id(),pe=D.value;return typeof K==typeof pe&&K>pe}],"filter-<=":[kt,[Lt,Sr],(G,[D,K])=>{let pe=G.properties()[D.value],ke=K.value;return typeof pe==typeof ke&&pe<=ke}],"filter-id-<=":[kt,[Sr],(G,[D])=>{let K=G.id(),pe=D.value;return typeof K==typeof pe&&K<=pe}],"filter->=":[kt,[Lt,Sr],(G,[D,K])=>{let pe=G.properties()[D.value],ke=K.value;return typeof pe==typeof ke&&pe>=ke}],"filter-id->=":[kt,[Sr],(G,[D])=>{let K=G.id(),pe=D.value;return typeof K==typeof pe&&K>=pe}],"filter-has":[kt,[Sr],(G,[D])=>D.value in G.properties()],"filter-has-id":[kt,[],G=>G.id()!==null&&G.id()!==void 0],"filter-type-in":[kt,[Be(Lt)],(G,[D])=>D.value.indexOf(G.geometryType())>=0],"filter-id-in":[kt,[Be(Sr)],(G,[D])=>D.value.indexOf(G.id())>=0],"filter-in-small":[kt,[Lt,Be(Sr)],(G,[D,K])=>K.value.indexOf(G.properties()[D.value])>=0],"filter-in-large":[kt,[Lt,Be(Sr)],(G,[D,K])=>function(pe,ke,je,Xe){for(;je<=Xe;){let ft=je+Xe>>1;if(ke[ft]===pe)return!0;ke[ft]>pe?Xe=ft-1:je=ft+1}return!1}(G.properties()[D.value],K.value,0,K.value.length-1)],all:{type:kt,overloads:[[[kt,kt],(G,[D,K])=>D.evaluate(G)&&K.evaluate(G)],[Nc(kt),(G,D)=>{for(let K of D)if(!K.evaluate(G))return!1;return!0}]]},any:{type:kt,overloads:[[[kt,kt],(G,[D,K])=>D.evaluate(G)||K.evaluate(G)],[Nc(kt),(G,D)=>{for(let K of D)if(K.evaluate(G))return!0;return!1}]]},"!":[kt,[kt],(G,[D])=>!D.evaluate(G)],"is-supported-script":[kt,[Lt],(G,[D])=>{let K=G.globals&&G.globals.isSupportedScript;return!K||K(D.evaluate(G))}],upcase:[Lt,[Lt],(G,[D])=>D.evaluate(G).toUpperCase()],downcase:[Lt,[Lt],(G,[D])=>D.evaluate(G).toLowerCase()],concat:[Lt,Nc(Sr),(G,D)=>D.map(K=>ct(K.evaluate(G))).join("")],"resolved-locale":[Lt,[xr],(G,[D])=>D.evaluate(G).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,Xe){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=Xe,this.expression.evaluate(this._evaluator)}evaluate(D,K,pe,ke,je,Xe){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=Xe||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(G){return Array.isArray(G)&&G.length>0&&typeof G[0]=="string"&&G[0]in rf}function il(G,D){let K=new da(rf,Ff,[],D?function(ke){let je={color:qt,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(G,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,Xe){return this._styleExpression.evaluateWithoutErrorHandling(D,K,pe,ke,je,Xe)}evaluate(D,K,pe,ke,je,Xe){return this._styleExpression.evaluate(D,K,pe,ke,je,Xe)}}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,Xe){return this._styleExpression.evaluateWithoutErrorHandling(D,K,pe,ke,je,Xe)}evaluate(D,K,pe,ke,je,Xe){return this._styleExpression.evaluate(D,K,pe,ke,je,Xe)}interpolationFactor(D,K,pe){return this.interpolationType?to.interpolationFactor(this.interpolationType,D,K,pe):0}}function bu(G,D){let K=il(G,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 Xe=Uf(pe);return Xe||je?Xe instanceof Fe?Hc([Xe]):Xe instanceof to&&!Tc(D)?Hc([new Fe("",'"interpolate" expressions cannot be used with this property')]):oc(Xe?new vu(ke?"camera":"composite",K.value,Xe.labels,Xe instanceof to?Xe.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(G){let D=null;if(G instanceof fa)D=Uf(G.result);else if(G instanceof pi){for(let K of G.args)if(D=Uf(K),D)break}else(G instanceof Da||G instanceof to)&&G.input instanceof Kl&&G.input.name==="zoom"&&(D=G);return D instanceof Fe||G.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(G){if(G===!0||G===!1)return!0;if(!Array.isArray(G)||G.length===0)return!1;switch(G[0]){case"has":return G.length>=2&&G[1]!=="$id"&&G[1]!=="$type";case"in":return G.length>=3&&(typeof G[1]!="string"||Array.isArray(G[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return G.length!==3||Array.isArray(G[1])||Array.isArray(G[2]);case"any":case"all":for(let D of G.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(G){if(G==null)return{filter:()=>!0,needGeometry:!1};Jf(G)||(G=nf(G));let D=il(G,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(G)}}function vc(G,D){return GD?1:0}function Lh(G){if(!Array.isArray(G))return!1;if(G[0]==="within"||G[0]==="distance")return!0;for(let D=1;D"||D==="<="||D===">="?df(G[1],G[2],D):D==="any"?(K=G.slice(1),["any"].concat(K.map(nf))):D==="all"?["all"].concat(G.slice(1).map(nf)):D==="none"?["all"].concat(G.slice(1).map(nf).map(tu)):D==="in"?Nu(G[1],G.slice(2)):D==="!in"?tu(Nu(G[1],G.slice(2))):D==="has"?of(G[1]):D!=="!has"||tu(of(G[1]));var K}function df(G,D,K){switch(G){case"$type":return[`filter-type-${K}`,D];case"$id":return[`filter-id-${K}`,D];default:return[`filter-${K}`,G,D]}}function Nu(G,D){if(D.length===0)return!1;switch(G){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",G,["literal",D.sort(vc)]]:["filter-in-small",G,["literal",D]]}}function of(G){switch(G){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",G]}}function tu(G){return["!",G]}function Xc(G){let D=typeof G;if(D==="number"||D==="boolean"||D==="string"||G==null)return JSON.stringify(G);if(Array.isArray(G)){let ke="[";for(let je of G)ke+=`${Xc(je)},`;return`${ke}]`}let K=Object.keys(G).sort(),pe="{";for(let ke=0;kepe.maximum?[new _e(D,K,`${K} is greater than the maximum value ${pe.maximum}`)]:[]}function sf(G){let D=G.valueSpec,K=ol(G.value.type),pe,ke,je,Xe={},ft=K!=="categorical"&&G.value.property===void 0,Mt=!ft,Ut=Gs(G.value.stops)==="array"&&Gs(G.value.stops[0])==="array"&&Gs(G.value.stops[0][0])==="object",ir=Pu({key:G.key,value:G.value,valueSpec:G.styleSpec.function,validateSpec:G.validateSpec,style:G.style,styleSpec:G.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&&ir.push(new _e(G.key,G.value,'missing required property "property"')),K==="identity"||G.value.stops||ir.push(new _e(G.key,G.value,'missing required property "stops"')),K==="exponential"&&G.valueSpec.expression&&!Tc(G.valueSpec)&&ir.push(new _e(G.key,G.value,"exponential functions not supported")),G.styleSpec.$version>=8&&(Mt&&!Jl(G.valueSpec)?ir.push(new _e(G.key,G.value,"property functions not supported")):ft&&!Uc(G.valueSpec)&&ir.push(new _e(G.key,G.value,"zoom functions not supported"))),K!=="categorical"&&!Ut||G.value.property!==void 0||ir.push(new _e(G.key,G.value,'"property" property is required')),ir;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,Xe={}),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),$a=Hr.value!==null?Hr.value:oa;if(pe){if(va!==pe)return[new _e(Hr.key,$a,`${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,$a,"stop domain value must be a number, string, or boolean")];if(va!=="number"&&K!=="categorical"){let Kn=`number expected, ${va} found`;return Jl(D)&&K===void 0&&(Kn+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new _e(Hr.key,$a,Kn)]}return K!=="categorical"||va!=="number"||isFinite(Ga)&&Math.floor(Ga)===Ga?K!=="categorical"&&va==="number"&&ke!==void 0&&Ganew _e(`${G.key}${pe.key}`,G.value,pe.message));let K=D.value.expression||D.value._styleExpression.expression;if(G.expressionContext==="property"&&G.propertyKey==="text-font"&&!K.outputDefined())return[new _e(G.key,G.value,`Invalid data expression for "${G.propertyKey}". Output values must be contained as literals within the expression.`)];if(G.expressionContext==="property"&&G.propertyType==="layout"&&!Gu(K))return[new _e(G.key,G.value,'"feature-state" data expressions are not supported with layout properties.')];if(G.expressionContext==="filter"&&!Gu(K))return[new _e(G.key,G.value,'"feature-state" data expressions are not supported with filters.')];if(G.expressionContext&&G.expressionContext.indexOf("cluster")===0){if(!Ef(K,["zoom","feature-state"]))return[new _e(G.key,G.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(G.expressionContext==="cluster-initial"&&!Of(K))return[new _e(G.key,G.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Hu(G){let D=G.key,K=G.value,pe=G.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(G){return Jf(mu(G.value))?Mc(fe({},G,{expressionContext:"filter",valueSpec:{value:"boolean"}})):Wu(G)}function Wu(G){let D=G.value,K=G.key;if(Gs(D)!=="array")return[new _e(K,D,`array expected, ${Gs(D)} found`)];let pe=G.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:G.style,styleSpec:G.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 Xe=2;Xe{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")):Xe=ol(Mt.type):D.push(new _e(pe,K.ref,`ref layer "${ft}" not found`))}else if(Xe!=="background")if(K.source){let Mt=ke.sources&&ke.sources[K.source],Ut=Mt&&ol(Mt.type);Mt?Ut==="vector"&&Xe==="raster"?D.push(new _e(pe,K.source,`layer "${K.id}" requires a raster source`)):Ut!=="raster-dem"&&Xe==="hillshade"?D.push(new _e(pe,K.source,`layer "${K.id}" requires a raster-dem source`)):Ut==="raster"&&Xe!=="raster"?D.push(new _e(pe,K.source,`layer "${K.id}" requires a vector source`)):Ut!=="vector"||K["source-layer"]?Ut==="raster-dem"&&Xe!=="hillshade"?D.push(new _e(pe,K.source,"raster-dem source can only be used with layer type 'hillshade'.")):Xe!=="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:G.style,styleSpec:G.styleSpec,validateSpec:G.validateSpec,objectElementValidators:{"*":()=>[],type:()=>G.validateSpec({key:`${pe}.type`,value:K.type,valueSpec:je.layer.type,style:G.style,styleSpec:G.styleSpec,validateSpec:G.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:Xe},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:Xe},Ut))}})}})),D}function Xu(G){let D=G.value,K=G.key,pe=Gs(D);return pe!=="string"?[new _e(K,D,`string expected, ${pe} found`)]:[]}let Ec={promoteId:function({key:G,value:D}){if(Gs(D)==="string")return Xu({key:G,value:D});{let K=[];for(let pe in D)K.push(...Xu({key:`${G}.${pe}`,value:D[pe]}));return K}}};function mc(G){let D=G.value,K=G.key,pe=G.styleSpec,ke=G.style,je=G.validateSpec;if(!D.type)return[new _e(K,D,'"type" is required')];let Xe=ol(D.type),ft;switch(Xe){case"vector":case"raster":return ft=Pu({key:K,value:D,valueSpec:pe[`source_${Xe.replace("-","_")}`],style:G.style,styleSpec:pe,objectElementValidators:Ec,validateSpec:je}),ft;case"raster-dem":return ft=function(Mt){var Ut;let ir=(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 $a=ol(Mr.encoding)==="custom",Kn=["redFactor","greenFactor","blueFactor","baseShift"],bn=Mt.value.encoding?`"${Mt.value.encoding}"`:"Default";for(let Wn in Mr)!$a&&Kn.includes(Wn)?va.push(new _e(Wn,Mr[Wn],`In "${ir}": "${Wn}" is only valid when "encoding" is set to "custom". ${bn} encoding found`)):Hr[Wn]?va=va.concat(Mt.validateSpec({key:Wn,value:Mr[Wn],valueSpec:Hr[Wn],validateSpec:Mt.validateSpec,style:oa,styleSpec:zr})):va.push(new _e(Wn,Mr[Wn],`unknown property "${Wn}"`));return va}({sourceName:K,value:D,style:G.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,ir]=D.clusterProperties[Mt],Mr=typeof Ut=="string"?[Ut,["accumulated"],["get",Mt]]:Ut;ft.push(...Mc({key:`${K}.${Mt}.map`,value:ir,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(G){let D=G.value,K=G.styleSpec,pe=K.light,ke=G.style,je=[],Xe=Gs(D);if(D===void 0)return je;if(Xe!=="object")return je=je.concat([new _e("light",D,`object expected, ${Xe} found`)]),je;for(let ft in D){let Mt=ft.match(/^(.*)-transition$/);je=je.concat(Mt&&pe[Mt[1]]&&pe[Mt[1]].transition?G.validateSpec({key:ft,value:D[ft],valueSpec:K.transition,validateSpec:G.validateSpec,style:ke,styleSpec:K}):pe[ft]?G.validateSpec({key:ft,value:D[ft],valueSpec:pe[ft],validateSpec:G.validateSpec,style:ke,styleSpec:K}):[new _e(ft,D[ft],`unknown property "${ft}"`)])}return je}function gu(G){let D=G.value,K=G.styleSpec,pe=K.sky,ke=G.style,je=Gs(D);if(D===void 0)return[];if(je!=="object")return[new _e("sky",D,`object expected, ${je} found`)];let Xe=[];for(let ft in D)Xe=Xe.concat(pe[ft]?G.validateSpec({key:ft,value:D[ft],valueSpec:pe[ft],style:ke,styleSpec:K}):[new _e(ft,D[ft],`unknown property "${ft}"`)]);return Xe}function Cc(G){let D=G.value,K=G.styleSpec,pe=K.terrain,ke=G.style,je=[],Xe=Gs(D);if(D===void 0)return je;if(Xe!=="object")return je=je.concat([new _e("terrain",D,`object expected, ${Xe} found`)]),je;for(let ft in D)je=je.concat(pe[ft]?G.validateSpec({key:ft,value:D[ft],valueSpec:pe[ft],validateSpec:G.validateSpec,style:ke,styleSpec:K}):[new _e(ft,D[ft],`unknown property "${ft}"`)]);return je}function Yc(G){let D=[],K=G.value,pe=G.key;if(Array.isArray(K)){let ke=[],je=[];for(let Xe in K)K[Xe].id&&ke.includes(K[Xe].id)&&D.push(new _e(pe,K,`all the sprites' ids must be unique, but ${K[Xe].id} is duplicated`)),ke.push(K[Xe].id),K[Xe].url&&je.includes(K[Xe].url)&&D.push(new _e(pe,K,`all the sprites' URLs must be unique, but ${K[Xe].url} is duplicated`)),je.push(K[Xe].url),D=D.concat(Pu({key:`${pe}[${Xe}]`,value:K[Xe],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:G.validateSpec}));return D}return Xu({key:pe,value:K})}let sc={"*":()=>[],array:kf,boolean:function(G){let D=G.value,K=G.key,pe=Gs(D);return pe!=="boolean"?[new _e(K,D,`boolean expected, ${pe} found`)]:[]},number:hl,color:function(G){let D=G.key,K=G.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(G){let D=G.value,K=G.styleSpec,pe=K.projection,ke=G.style,je=Gs(D);if(D===void 0)return[];if(je!=="object")return[new _e("projection",D,`object expected, ${je} found`)];let Xe=[];for(let ft in D)Xe=Xe.concat(pe[ft]?G.validateSpec({key:ft,value:D[ft],valueSpec:pe[ft],style:ke,styleSpec:K}):[new _e(ft,D[ft],`unknown property "${ft}"`)]);return Xe},string:Xu,formatted:function(G){return Xu(G).length===0?[]:Mc(G)},resolvedImage:function(G){return Xu(G).length===0?[]:Mc(G)},padding:function(G){let D=G.key,K=G.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[]}})),G.constants&&(K=K.concat(vf({key:"constants",value:G.constants,style:G,styleSpec:D,validateSpec:kc}))),$r(K)}function ia(G){return function(D){return G(ws(Uo({},D),{validateSpec:kc}))}}function $r(G){return[].concat(G).sort((D,K)=>D.line-K.line)}function La(G){return function(...D){return $r(G.apply(this,D))}}yr.source=La(ia(mc)),yr.sprite=La(ia(Yc)),yr.glyphs=La(ia(er)),yr.light=La(ia(jl)),yr.sky=La(ia(gu)),yr.terrain=La(ia(Cc)),yr.layer=La(ia(jf)),yr.filter=La(ia(mf)),yr.paintProperty=La(ia(Lf)),yr.layoutProperty=La(ia(ru));let pn=yr,In=pn.light,Yn=pn.sky,ri=pn.paintProperty,di=pn.layoutProperty;function Dn(G,D){let K=!1;if(D&&D.length)for(let pe of D)G.fire(new j(new Error(pe.message))),K=!0;return K}class On{constructor(D,K,pe){let ke=this.cells=[];if(D instanceof ArrayBuffer){this.arrayBuffer=D;let Xe=new Int32Array(this.arrayBuffer);D=Xe[0],this.d=(K=Xe[1])+2*(pe=Xe[2]);for(let Mt=0;Mt=Mr[oa+0]&&ke>=Mr[oa+1])?(ft[Hr]=!0,Xe.push(ir[Hr])):ft[Hr]=!1}}}}_forEachCell(D,K,pe,ke,je,Xe,ft,Mt){let Ut=this._convertToCellCoord(D),ir=this._convertToCellCoord(K),Mr=this._convertToCellCoord(pe),zr=this._convertToCellCoord(ke);for(let Hr=Ut;Hr<=Mr;Hr++)for(let oa=ir;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,Xe,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 Xe=0;Xe=0)continue;let Xe=G[je];ke[je]=qn[K].shallow.indexOf(je)>=0?Xe:Ji(Xe,D)}G instanceof Error&&(ke.message=G.message)}if(ke.$name)throw new Error("$name property is reserved for worker serialization logic.");return K!=="Object"&&(ke.$name=K),ke}function co(G){if(ao(G))return G;if(Array.isArray(G))return G.map(co);if(typeof G!="object")throw new Error("can't deserialize object of type "+typeof G);let D=Ki(G)||"Object";if(!qn[D])throw new Error(`can't deserialize unregistered class ${D}`);let{klass:K}=qn[D];if(!K)throw new Error(`can't deserialize unregistered class ${D}`);if(K.deserialize)return K.deserialize(G);let pe=Object.create(K.prototype);for(let ke of Object.keys(G)){if(ke==="$name")continue;let je=G[ke];pe[ke]=qn[D].shallow.indexOf(ke)>=0?je:co(je)}return pe}class wi{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.lastFloorZoomG>=128&&G<=255,"Hangul Jamo":G=>G>=4352&&G<=4607,Khmer:G=>G>=6016&&G<=6143,"General Punctuation":G=>G>=8192&&G<=8303,"Letterlike Symbols":G=>G>=8448&&G<=8527,"Number Forms":G=>G>=8528&&G<=8591,"Miscellaneous Technical":G=>G>=8960&&G<=9215,"Control Pictures":G=>G>=9216&&G<=9279,"Optical Character Recognition":G=>G>=9280&&G<=9311,"Enclosed Alphanumerics":G=>G>=9312&&G<=9471,"Geometric Shapes":G=>G>=9632&&G<=9727,"Miscellaneous Symbols":G=>G>=9728&&G<=9983,"Miscellaneous Symbols and Arrows":G=>G>=11008&&G<=11263,"Ideographic Description Characters":G=>G>=12272&&G<=12287,"CJK Symbols and Punctuation":G=>G>=12288&&G<=12351,Katakana:G=>G>=12448&&G<=12543,Kanbun:G=>G>=12688&&G<=12703,"CJK Strokes":G=>G>=12736&&G<=12783,"Enclosed CJK Letters and Months":G=>G>=12800&&G<=13055,"CJK Compatibility":G=>G>=13056&&G<=13311,"Yijing Hexagram Symbols":G=>G>=19904&&G<=19967,"Private Use Area":G=>G>=57344&&G<=63743,"Vertical Forms":G=>G>=65040&&G<=65055,"CJK Compatibility Forms":G=>G>=65072&&G<=65103,"Small Form Variants":G=>G>=65104&&G<=65135,"Halfwidth and Fullwidth Forms":G=>G>=65280&&G<=65519};function xo(G){for(let D of G)if(ys(D.charCodeAt(0)))return!0;return!1}function Qo(G){for(let D of G)if(!Rs(D.charCodeAt(0)))return!1;return!0}function xs(G){let D=G.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(G){return!Qs.test(String.fromCodePoint(G))}let Ks=xs(["Bopo","Hani","Hira","Kana","Kits","Nshu","Tang","Yiii"]);function ys(G){return!(G!==746&&G!==747&&(G<4352||!(ui["CJK Compatibility Forms"](G)&&!(G>=65097&&G<=65103)||ui["CJK Compatibility"](G)||ui["CJK Strokes"](G)||!(!ui["CJK Symbols and Punctuation"](G)||G>=12296&&G<=12305||G>=12308&&G<=12319||G===12336)||ui["Enclosed CJK Letters and Months"](G)||ui["Ideographic Description Characters"](G)||ui.Kanbun(G)||ui.Katakana(G)&&G!==12540||!(!ui["Halfwidth and Fullwidth Forms"](G)||G===65288||G===65289||G===65293||G>=65306&&G<=65310||G===65339||G===65341||G===65343||G>=65371&&G<=65503||G===65507||G>=65512&&G<=65519)||!(!ui["Small Form Variants"](G)||G>=65112&&G<=65118||G>=65123&&G<=65126)||ui["Vertical Forms"](G)||ui["Yijing Hexagram Symbols"](G)||new RegExp("\\p{sc=Cans}","u").test(String.fromCodePoint(G))||new RegExp("\\p{sc=Hang}","u").test(String.fromCodePoint(G))||Ks.test(String.fromCodePoint(G)))))}function Fl(G){return!(ys(G)||function(D){return!!(ui["Latin-1 Supplement"](D)&&(D===167||D===169||D===174||D===177||D===188||D===189||D===190||D===215||D===247)||ui["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)||ui["Letterlike Symbols"](D)||ui["Number Forms"](D)||ui["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)||ui["Control Pictures"](D)&&D!==9251||ui["Optical Character Recognition"](D)||ui["Enclosed Alphanumerics"](D)||ui["Geometric Shapes"](D)||ui["Miscellaneous Symbols"](D)&&!(D>=9754&&D<=9759)||ui["Miscellaneous Symbols and Arrows"](D)&&(D>=11026&&D<=11055||D>=11088&&D<=11097||D>=11192&&D<=11243)||ui["CJK Symbols and Punctuation"](D)||ui.Katakana(D)||ui["Private Use Area"](D)||ui["CJK Compatibility Forms"](D)||ui["Small Form Variants"](D)||ui["Halfwidth and Fullwidth Forms"](D)||D===8734||D===8756||D===8757||D>=9984&&D<=10087||D>=10102&&D<=10131||D===65532||D===65533)}(G))}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(G){return yl.test(String.fromCodePoint(G))}function Ui(G,D){return!(!D&&sl(G)||G>=2304&&G<=3583||G>=3840&&G<=4255||ui.Khmer(G))}function Io(G){for(let D of G)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(G){this.pluginStatus=G.pluginStatus,this.pluginURL=G.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(G){this.applyArabicShaping=G.applyArabicShaping,this.processBidirectionalText=G.processBidirectionalText,this.processStyledBidirectionalText=G.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 wi,this.transition={})}isSupportedScript(D){return function(K,pe){for(let ke of K)if(!Ui(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(Xe=>`${Xe.key}: ${Xe.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),Xe=this.prior;if(Xe){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,ir=Ut*Mt;return 4*(Mt<.5?ir:3*(Mt-Ut)+ir-.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=Xi[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=Xi[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,Xe){return D.kind==="constant"?D.value:D.evaluate(K,pe,ke,je,Xe)}}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),Xe=D.property.specification.type==="resolvedImage"&&typeof je!="string"?je.name:je,ft=this._calculate(Xe,Xe,Xe,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,Xe){if(D.kind==="source"){let ft=D.evaluate(K,pe,ke,je,Xe);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({})}}}xn("DataDrivenProperty",zo),xn("DataConstantProperty",fo),xn("CrossFadedDataDrivenProperty",Ic),xn("CrossFadedProperty",lc),xn("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(di,`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(ri,`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",Xe=ke.value.isDataDriven(),ft=ke.value;this._transitionablePaint.setValue(D,K),this._handleSpecialPaintPropertyUpdate(D);let Mt=this._transitionablePaint._values[D].value;return Mt.isDataDriven()||Xe||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)&&Dn(this,D.call(pn,{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(G,D=1){let K=0,pe=0;return{members:G.map(ke=>{let je=we[ke.type].BYTES_PER_ELEMENT,Xe=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:Xe}}),size:At(K,Math.max(pe,D)),alignment:D}}function At(G,D){return Math.ceil(G/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,xn("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,xn("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 Xe=4*D;return this.int16[Xe+0]=K,this.int16[Xe+1]=pe,this.int16[Xe+2]=ke,this.int16[Xe+3]=je,D}}br.prototype.bytesPerElement=8,xn("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,Xe){let ft=this.length;return this.resize(ft+1),this.emplace(ft,D,K,pe,ke,je,Xe)}emplace(D,K,pe,ke,je,Xe,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]=Xe,this.int16[Mt+5]=ft,D}}Ar.prototype.bytesPerElement=12,xn("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,Xe){let ft=this.length;return this.resize(ft+1),this.emplace(ft,D,K,pe,ke,je,Xe)}emplace(D,K,pe,ke,je,Xe,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]=Xe,this.uint8[Ut+7]=ft,D}}Yr.prototype.bytesPerElement=8,xn("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,xn("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,Xe,ft,Mt,Ut,ir){let Mr=this.length;return this.resize(Mr+1),this.emplace(Mr,D,K,pe,ke,je,Xe,ft,Mt,Ut,ir)}emplace(D,K,pe,ke,je,Xe,ft,Mt,Ut,ir,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]=Xe,this.uint16[zr+5]=ft,this.uint16[zr+6]=Mt,this.uint16[zr+7]=Ut,this.uint16[zr+8]=ir,this.uint16[zr+9]=Mr,D}}He.prototype.bytesPerElement=20,xn("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,Xe,ft,Mt,Ut,ir,Mr,zr){let Hr=this.length;return this.resize(Hr+1),this.emplace(Hr,D,K,pe,ke,je,Xe,ft,Mt,Ut,ir,Mr,zr)}emplace(D,K,pe,ke,je,Xe,ft,Mt,Ut,ir,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]=Xe,this.uint16[oa+5]=ft,this.uint16[oa+6]=Mt,this.uint16[oa+7]=Ut,this.int16[oa+8]=ir,this.int16[oa+9]=Mr,this.int16[oa+10]=zr,this.int16[oa+11]=Hr,D}}Je.prototype.bytesPerElement=24,xn("StructArrayLayout4i4ui4i24",Je);class lt 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}}lt.prototype.bytesPerElement=12,xn("StructArrayLayout3f12",lt);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,xn("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,Xe,ft,Mt,Ut){let ir=this.length;return this.resize(ir+1),this.emplace(ir,D,K,pe,ke,je,Xe,ft,Mt,Ut)}emplace(D,K,pe,ke,je,Xe,ft,Mt,Ut,ir){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]=Xe,this.int16[Mr+5]=ft,this.uint32[zr+3]=Mt,this.uint16[Mr+8]=Ut,this.uint16[Mr+9]=ir,D}}Ct.prototype.bytesPerElement=20,xn("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,Xe){let ft=this.length;return this.resize(ft+1),this.emplace(ft,D,K,pe,ke,je,Xe)}emplace(D,K,pe,ke,je,Xe,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]=Xe,this.int16[Mt+5]=ft,D}}wt.prototype.bytesPerElement=12,xn("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 Xe=this.length;return this.resize(Xe+1),this.emplace(Xe,D,K,pe,ke,je)}emplace(D,K,pe,ke,je,Xe){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]=Xe,D}}Dt.prototype.bytesPerElement=16,xn("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,Xe){let ft=this.length;return this.resize(ft+1),this.emplace(ft,D,K,pe,ke,je,Xe)}emplace(D,K,pe,ke,je,Xe,ft){let Mt=16*D,Ut=4*D,ir=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[ir+6]=Xe,this.int16[ir+7]=ft,D}}ur.prototype.bytesPerElement=16,xn("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,xn("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,Xe,ft,Mt,Ut,ir,Mr,zr,Hr,oa,va,Ga,$a){let Kn=this.length;return this.resize(Kn+1),this.emplace(Kn,D,K,pe,ke,je,Xe,ft,Mt,Ut,ir,Mr,zr,Hr,oa,va,Ga,$a)}emplace(D,K,pe,ke,je,Xe,ft,Mt,Ut,ir,Mr,zr,Hr,oa,va,Ga,$a,Kn){let bn=24*D,Wn=12*D,ai=48*D;return this.int16[bn+0]=K,this.int16[bn+1]=pe,this.uint16[bn+2]=ke,this.uint16[bn+3]=je,this.uint32[Wn+2]=Xe,this.uint32[Wn+3]=ft,this.uint32[Wn+4]=Mt,this.uint16[bn+10]=Ut,this.uint16[bn+11]=ir,this.uint16[bn+12]=Mr,this.float32[Wn+7]=zr,this.float32[Wn+8]=Hr,this.uint8[ai+36]=oa,this.uint8[ai+37]=va,this.uint8[ai+38]=Ga,this.uint32[Wn+10]=$a,this.int16[bn+22]=Kn,D}}Er.prototype.bytesPerElement=48,xn("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,Xe,ft,Mt,Ut,ir,Mr,zr,Hr,oa,va,Ga,$a,Kn,bn,Wn,ai,ji,ko,vs,yo,Di,ns,qo){let Bo=this.length;return this.resize(Bo+1),this.emplace(Bo,D,K,pe,ke,je,Xe,ft,Mt,Ut,ir,Mr,zr,Hr,oa,va,Ga,$a,Kn,bn,Wn,ai,ji,ko,vs,yo,Di,ns,qo)}emplace(D,K,pe,ke,je,Xe,ft,Mt,Ut,ir,Mr,zr,Hr,oa,va,Ga,$a,Kn,bn,Wn,ai,ji,ko,vs,yo,Di,ns,qo,Bo){let _i=32*D,us=16*D;return this.int16[_i+0]=K,this.int16[_i+1]=pe,this.int16[_i+2]=ke,this.int16[_i+3]=je,this.int16[_i+4]=Xe,this.int16[_i+5]=ft,this.int16[_i+6]=Mt,this.int16[_i+7]=Ut,this.uint16[_i+8]=ir,this.uint16[_i+9]=Mr,this.uint16[_i+10]=zr,this.uint16[_i+11]=Hr,this.uint16[_i+12]=oa,this.uint16[_i+13]=va,this.uint16[_i+14]=Ga,this.uint16[_i+15]=$a,this.uint16[_i+16]=Kn,this.uint16[_i+17]=bn,this.uint16[_i+18]=Wn,this.uint16[_i+19]=ai,this.uint16[_i+20]=ji,this.uint16[_i+21]=ko,this.uint16[_i+22]=vs,this.uint32[us+12]=yo,this.float32[us+13]=Di,this.float32[us+14]=ns,this.uint16[_i+30]=qo,this.uint16[_i+31]=Bo,D}}Br.prototype.bytesPerElement=64,xn("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,xn("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,xn("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,xn("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,xn("StructArrayLayout2ui4",Oa);class vn 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}}vn.prototype.bytesPerElement=2,xn("StructArrayLayout1ui2",vn);class Xn 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 Xe=4*D;return this.float32[Xe+0]=K,this.float32[Xe+1]=pe,this.float32[Xe+2]=ke,this.float32[Xe+3]=je,D}}Xn.prototype.bytesPerElement=16,xn("StructArrayLayout4f16",Xn);class Hn 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 n(this.anchorPointX,this.anchorPointY)}}Hn.prototype.size=20;class oi extends Ct{get(D){return new Hn(this,D)}}xn("CollisionBoxArray",oi);class Ti 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]}}Ti.prototype.size=48;class Wi extends Er{get(D){return new Ti(this,D)}}xn("PlacedSymbolArray",Wi);class Bi 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]}}Bi.prototype.size=64;class Ao extends Br{get(D){return new Bi(this,D)}}xn("SymbolInstanceArray",Ao);class ss extends Qr{getoffsetX(D){return this.float32[1*D+0]}}xn("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]}}xn("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)}}xn("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)}}xn("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 lt{}class Vl extends dt{}class ql 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&&f(`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(G,D){return 256*(G=w(Math.floor(G),0,255))+w(Math.floor(D),0,255)}St.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,xn("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:{}},qr={exports:{}};qr.exports=function(G,D){var K,pe,ke,je,Xe,ft,Mt,Ut;for(pe=G.length-(K=3&G.length),ke=D,Xe=3432918353,ft=461845907,Ut=0;Ut>>16)*Xe&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&G.charCodeAt(Ut+2))<<16;case 2:Mt^=(255&G.charCodeAt(Ut+1))<<8;case 1:ke^=Mt=(65535&(Mt=(Mt=(65535&(Mt^=255&G.charCodeAt(Ut)))*Xe+(((Mt>>>16)*Xe&65535)<<16)&4294967295)<<15|Mt>>>17))*ft+(((Mt>>>16)*ft&65535)<<16)&4294967295}return ke^=G.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=qr.exports,Ta={exports:{}};Ta.exports=function(G,D){for(var K,pe=G.length,ke=D^pe,je=0;pe>=4;)K=1540483477*(65535&(K=255&G.charCodeAt(je)|(255&G.charCodeAt(++je))<<8|(255&G.charCodeAt(++je))<<16|(255&G.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&G.charCodeAt(je+2))<<16;case 2:ke^=(255&G.charCodeAt(je+1))<<8;case 1:ke=1540483477*(65535&(ke^=255&G.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,tn=Ta.exports;gr.exports=ya,gr.exports.murmur3=ya,gr.exports.murmur2=tn;var on=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[Xe]>=K?ke=Xe:pe=Xe+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(G){let D=+G;return!isNaN(D)&&D<=Number.MAX_SAFE_INTEGER?D:on(String(G))}function Ka(G,D,K,pe){for(;K>1],je=K-1,Xe=pe+1;for(;;){do je++;while(G[je]ke);if(je>=Xe)break;mn(G,je,Xe),mn(D,3*je,3*Xe),mn(D,3*je+1,3*Xe+1),mn(D,3*je+2,3*Xe+2)}Xe-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 ni(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 si(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 Xe=this.paintVertexArray.length,ft=this.expression.evaluate(new Ls(0),K,{},ke,[],je);this.paintVertexArray.resize(D),this._setPaintValue(Xe,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=Pi(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 Xe}populatePaintArray(D,K,pe,ke,je){let Xe=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,Xe,ft)}updatePaintArray(D,K,pe,ke){let je=this.expression.evaluate({zoom:this.zoom},pe,ke),Xe=this.expression.evaluate({zoom:this.zoom+1},pe,ke);this._setPaintValue(D,K,je,Xe)}_setPaintValue(D,K,pe,ke){if(this.type==="color"){let je=Pi(pe),Xe=Pi(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 no)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,Xe){for(let ft in this.programConfigurations)this.programConfigurations[ft].populatePaintArrays(D,K,ke,je,Xe);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(G,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"]}[G]||[G.replace(`${D}-`,"").replace(/-/g,"_")]}function gi(G,D,K){let pe={color:{source:sa,composite:Xn},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]}(G);return ke&&ke[K]||pe[D][K]}xn("ConstantBinder",Zi),xn("CrossFadedConstantBinder",eo),xn("SourceExpressionBinder",$o),xn("CrossFadedCompositeBinder",Zo),xn("CompositeExpressionBinder",no),xn("ProgramConfiguration",ul,{omit:["_buffers"]}),xn("ProgramConfigurationSet",el);let vo=8192,cs=Math.pow(2,14)-1,ps=-cs-1;function Tl(G){let D=vo/G.extent,K=G.loadGeometry();for(let pe=0;peXe.x+1||MtXe.y+1)&&f("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return K}function Gl(G,D){return{type:G.type,id:G.id,properties:G.properties,geometry:D?Tl(G):[]}}function Tu(G,D,K,pe,ke){G.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=[],Xe=null,ft=!1;ke.type==="circle"&&(Xe=ke.layout.get("circle-sort-key"),ft=!Xe.isConstant());for(let{feature:Mt,id:Ut,index:ir,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?Xe.evaluate(Hr,{},pe):void 0,va={id:Ut,properties:Mt.properties,type:Mt.type,sourceLayerIndex:Mr,index:ir,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:ir,sourceLayerIndex:Mr}=Mt,zr=D[ir].feature;this.addFeature(Mt,Ut,ir,pe),K.featureIndex.insert(zr,Ut,ir,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 Xe of je){let ft=Xe.x,Mt=Xe.y;if(ft<0||ft>=vo||Mt<0||Mt>=vo)continue;let Ut=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,D.sortKey),ir=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(ir,ir+1,ir+2),this.indexArray.emplaceBack(ir,ir+3,ir+2),Ut.vertexLength+=4,Ut.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,D,pe,{},ke)}}function yc(G,D){for(let K=0;K1){if(ua(G,D))return!0;for(let pe=0;pe1?K:K.sub(D)._mult(ke)._add(D))}function Ja(G,D){let K,pe,ke,je=!1;for(let Xe=0;XeD.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 Sn(G,D){let K=!1;for(let pe=0,ke=G.length-1;peD.y!=Xe.y>D.y&&D.x<(Xe.x-je.x)*(D.y-je.y)/(Xe.y-je.y)+je.x&&(K=!K)}return K}function wn(G,D,K){let pe=K[0],ke=K[2];if(G.xke.x&&D.x>ke.x||G.yke.y&&D.y>ke.y)return!1;let je=P(G,D,K[0]);return je!==P(G,D,K[1])||je!==P(G,D,K[2])||je!==P(G,D,K[3])}function hn(G,D,K){let pe=D.paint.get(G).value;return pe.kind==="constant"?pe.value:K.programConfigurations.get(D.id).getMaxValue(G)}function yi(G){return Math.sqrt(G[0]*G[0]+G[1]*G[1])}function Bn(G,D,K,pe,ke){if(!D[0]&&!D[1])return G;let je=n.convert(D)._mult(ke);K==="viewport"&&je._rotate(-pe);let Xe=[];for(let ft=0;ftqa(Ga,va))}(Ut,Mt),Hr=Mr?ir*ft:ir;for(let oa of ke)for(let va of oa){let Ga=Mr?va:qa(va,Mt),$a=Hr,Kn=hi([],[va.x,va.y,0,1],Mt);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?$a*=Kn[3]/Xe.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&($a*=Xe.cameraToCenterDistance/Kn[3]),nt(zr,Ga,$a))return!0}return!1}}function qa(G,D){let K=hi([],[G.x,G.y,0,1],D);return new n(K[0]/K[3],K[1]/K[3])}class Qn extends Il{}let Fn;xn("HeatmapBucket",Qn,{omit:["layers"]});var Mn={get paint(){return Fn=Fn||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 An(G,{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 G.width=D,G.height=K,G.data=ke,G}function Jn(G,{width:D,height:K},pe){if(D===G.width&&K===G.height)return;let ke=An({},{width:D,height:K},pe);mi(G,ke,{x:0,y:0},{x:0,y:0},{width:Math.min(G.width,D),height:Math.min(G.height,K)},pe),G.width=D,G.height=K,G.data=ke.data}function mi(G,D,K,pe,ke,je){if(ke.width===0||ke.height===0)return D;if(ke.width>G.width||ke.height>G.height||K.x>G.width-ke.width||K.y>G.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 Xe=G.data,ft=D.data;if(Xe===ft)throw new Error("srcData equals dstData, so image is already copied");for(let Mt=0;Mt{D[G.evaluationKey]=Mt;let Ut=G.expression.evaluate(D);ke.data[Xe+ft+0]=Math.floor(255*Ut.r/Ut.a),ke.data[Xe+ft+1]=Math.floor(255*Ut.g/Ut.a),ke.data[Xe+ft+2]=Math.floor(255*Ut.b/Ut.a),ke.data[Xe+ft+3]=Math.floor(255*Ut.a)};if(G.clips)for(let Xe=0,ft=0;Xe80*K){ft=1/0,Mt=1/0;let ir=-1/0,Mr=-1/0;for(let zr=K;zrir&&(ir=Hr),oa>Mr&&(Mr=oa)}Ut=Math.max(ir-ft,Mr-Mt),Ut=Ut!==0?32767/Ut:0}return Ql(je,Xe,K,ft,Mt,Ut,0),Xe}function Al(G,D,K,pe,ke){let je;if(ke===function(Xe,ft,Mt,Ut){let ir=0;for(let Mr=ft,zr=Mt-Ut;Mr0)for(let Xe=D;Xe=D;Xe-=pe)je=hr(Xe/pe|0,G[Xe],G[Xe+1],je);return je&&Le(je,je.next)&&(gt(je),je=je.next),je}function El(G,D){if(!G)return G;D||(D=G);let K,pe=G;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(G,D,K,pe,ke,je,Xe){if(!G)return;!Xe&&je&&function(Mt,Ut,ir,Mr){let zr=Mt;do zr.z===0&&(zr.z=Y(zr.x,zr.y,Ut,ir,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,$a=Hr;Hr=null;let Kn=null;for(oa=0;$a;){oa++;let bn=$a,Wn=0;for(let ji=0;ji0||ai>0&&bn;)Wn!==0&&(ai===0||!bn||$a.z<=bn.z)?(Ga=$a,$a=$a.nextZ,Wn--):(Ga=bn,bn=bn.nextZ,ai--),Kn?Kn.nextZ=Ga:Hr=Ga,Ga.prevZ=Kn,Kn=Ga;$a=bn}Kn.nextZ=null,va*=2}while(oa>1)}(zr)}(G,pe,ke,je);let ft=G;for(;G.prev!==G.next;){let Mt=G.prev,Ut=G.next;if(je?pl(G,pe,ke,je):Fs(G))D.push(Mt.i,G.i,Ut.i),gt(G),G=Ut.next,ft=Ut.next;else if((G=Ut)===ft){Xe?Xe===1?Ql(G=bl(El(G),D),D,K,pe,ke,je,2):Xe===2&&Hi(G,D,K,pe,ke,je):Ql(El(G),D,K,pe,ke,je,1);break}}}function Fs(G){let D=G.prev,K=G,pe=G.next;if(Ge(D,K,pe)>=0)return!1;let ke=D.x,je=K.x,Xe=pe.x,ft=D.y,Mt=K.y,Ut=pe.y,ir=keje?ke>Xe?ke:Xe:je>Xe?je:Xe,Hr=ft>Mt?ft>Ut?ft:Ut:Mt>Ut?Mt:Ut,oa=pe.next;for(;oa!==D;){if(oa.x>=ir&&oa.x<=zr&&oa.y>=Mr&&oa.y<=Hr&&te(ke,ft,je,Mt,Xe,Ut,oa.x,oa.y)&&Ge(oa.prev,oa,oa.next)>=0)return!1;oa=oa.next}return!0}function pl(G,D,K,pe){let ke=G.prev,je=G,Xe=G.next;if(Ge(ke,je,Xe)>=0)return!1;let ft=ke.x,Mt=je.x,Ut=Xe.x,ir=ke.y,Mr=je.y,zr=Xe.y,Hr=ftMt?ft>Ut?ft:Ut:Mt>Ut?Mt:Ut,Ga=ir>Mr?ir>zr?ir:zr:Mr>zr?Mr:zr,$a=Y(Hr,oa,D,K,pe),Kn=Y(va,Ga,D,K,pe),bn=G.prevZ,Wn=G.nextZ;for(;bn&&bn.z>=$a&&Wn&&Wn.z<=Kn;){if(bn.x>=Hr&&bn.x<=va&&bn.y>=oa&&bn.y<=Ga&&bn!==ke&&bn!==Xe&&te(ft,ir,Mt,Mr,Ut,zr,bn.x,bn.y)&&Ge(bn.prev,bn,bn.next)>=0||(bn=bn.prevZ,Wn.x>=Hr&&Wn.x<=va&&Wn.y>=oa&&Wn.y<=Ga&&Wn!==ke&&Wn!==Xe&&te(ft,ir,Mt,Mr,Ut,zr,Wn.x,Wn.y)&&Ge(Wn.prev,Wn,Wn.next)>=0))return!1;Wn=Wn.nextZ}for(;bn&&bn.z>=$a;){if(bn.x>=Hr&&bn.x<=va&&bn.y>=oa&&bn.y<=Ga&&bn!==ke&&bn!==Xe&&te(ft,ir,Mt,Mr,Ut,zr,bn.x,bn.y)&&Ge(bn.prev,bn,bn.next)>=0)return!1;bn=bn.prevZ}for(;Wn&&Wn.z<=Kn;){if(Wn.x>=Hr&&Wn.x<=va&&Wn.y>=oa&&Wn.y<=Ga&&Wn!==ke&&Wn!==Xe&&te(ft,ir,Mt,Mr,Ut,zr,Wn.x,Wn.y)&&Ge(Wn.prev,Wn,Wn.next)>=0)return!1;Wn=Wn.nextZ}return!0}function bl(G,D){let K=G;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=G=ke),K=K.next}while(K!==G);return El(K)}function Hi(G,D,K,pe,ke,je){let Xe=G;do{let ft=Xe.next.next;for(;ft!==Xe.prev;){if(Xe.i!==ft.i&&me(Xe,ft)){let Mt=Fr(Xe,ft);return Xe=El(Xe,Xe.next),Mt=El(Mt,Mt.next),Ql(Xe,D,K,pe,ke,je,0),void Ql(Mt,D,K,pe,ke,je,0)}ft=ft.next}Xe=Xe.next}while(Xe!==G)}function Cl(G,D){return G.x-D.x}function Lo(G,D){let K=function(ke,je){let Xe=je,ft=ke.x,Mt=ke.y,Ut,ir=-1/0;do{if(Mt<=Xe.y&&Mt>=Xe.next.y&&Xe.next.y!==Xe.y){let va=Xe.x+(Mt-Xe.y)*(Xe.next.x-Xe.x)/(Xe.next.y-Xe.y);if(va<=ft&&va>ir&&(ir=va,Ut=Xe.x=Xe.x&&Xe.x>=zr&&ft!==Xe.x&&te(MtUt.x||Xe.x===Ut.x&&ve(Ut,Xe)))&&(Ut=Xe,oa=va)}Xe=Xe.next}while(Xe!==Mr);return Ut}(G,D);if(!K)return D;let pe=Fr(K,G);return El(pe,pe.next),El(K,K.next)}function ve(G,D){return Ge(G.prev,G,D.prev)<0&&Ge(D.next,G,G.next)<0}function Y(G,D,K,pe,ke){return(G=1431655765&((G=858993459&((G=252645135&((G=16711935&((G=(G-K)*ke|0)|G<<8))|G<<4))|G<<2))|G<<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(G){let D=G,K=G;do(D.x=(G-Xe)*(je-ft)&&(G-Xe)*(pe-ft)>=(K-Xe)*(D-ft)&&(K-Xe)*(je-ft)>=(ke-Xe)*(pe-ft)}function me(G,D){return G.next.i!==D.i&&G.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}(G,D)&&(_r(G,D)&&_r(D,G)&&function(K,pe){let ke=K,je=!1,Xe=(K.x+pe.x)/2,ft=(K.y+pe.y)/2;do ke.y>ft!=ke.next.y>ft&&ke.next.y!==ke.y&&Xe<(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}(G,D)&&(Ge(G.prev,G,D.prev)||Ge(G,D.prev,D))||Le(G,D)&&Ge(G.prev,G,G.next)>0&&Ge(D.prev,D,D.next)>0)}function Ge(G,D,K){return(D.y-G.y)*(K.x-D.x)-(D.x-G.x)*(K.y-D.y)}function Le(G,D){return G.x===D.x&&G.y===D.y}function $e(G,D,K,pe){let ke=jt(Ge(G,D,K)),je=jt(Ge(G,D,pe)),Xe=jt(Ge(K,pe,G)),ft=jt(Ge(K,pe,D));return ke!==je&&Xe!==ft||!(ke!==0||!mt(G,K,D))||!(je!==0||!mt(G,pe,D))||!(Xe!==0||!mt(K,G,pe))||!(ft!==0||!mt(K,D,pe))}function mt(G,D,K){return D.x<=Math.max(G.x,K.x)&&D.x>=Math.min(G.x,K.x)&&D.y<=Math.max(G.y,K.y)&&D.y>=Math.min(G.y,K.y)}function jt(G){return G>0?1:G<0?-1:0}function _r(G,D){return Ge(G.prev,G,G.next)<0?Ge(G,D,G.next)>=0&&Ge(G,G.prev,D)>=0:Ge(G,D,G.prev)<0||Ge(G,G.next,D)<0}function Fr(G,D){let K=Et(G.i,G.x,G.y),pe=Et(D.i,D.x,D.y),ke=G.next,je=D.prev;return G.next=D,D.prev=G,K.next=ke,ke.prev=K,pe.next=K,K.prev=pe,je.next=pe,pe.prev=je,pe}function hr(G,D,K,pe){let ke=Et(G,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(G){G.next.prev=G.prev,G.prev.next=G.next,G.prevZ&&(G.prevZ.nextZ=G.nextZ),G.nextZ&&(G.nextZ.prevZ=G.prevZ)}function Et(G,D,K){return{i:G,x:D,y:K,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function Ft(G,D,K){let pe=K.patternDependencies,ke=!1;for(let je of D){let Xe=je.paint.get(`${G}-pattern`);Xe.isConstant()||(ke=!0);let ft=Xe.constantOr(null);ft&&(ke=!0,pe[ft.to]=!0,pe[ft.from]=!0)}return ke}function nr(G,D,K,pe,ke){let je=ke.patternDependencies;for(let Xe of D){let ft=Xe.paint.get(`${G}-pattern`).value;if(ft.kind!=="constant"){let Mt=ft.evaluate({zoom:pe-1},K,{},ke.availableImages),Ut=ft.evaluate({zoom:pe},K,{},ke.availableImages),ir=ft.evaluate({zoom:pe+1},K,{},ke.availableImages);Mt=Mt&&Mt.name?Mt.name:Mt,Ut=Ut&&Ut.name?Ut.name:Ut,ir=ir&&ir.name?ir.name:ir,je[Mt]=!0,je[Ut]=!0,je[ir]=!0,K.patterns[Xe.id]={min:Mt,mid:Ut,max:ir}}}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(),Xe=[];for(let{feature:ft,id:Mt,index:Ut,sourceLayerIndex:ir}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:ir,index:Ut,geometry:Mr?zr.geometry:Tl(ft),patterns:{},sortKey:Hr};Xe.push(oa)}je&&Xe.sort((ft,Mt)=>ft.sortKey-Mt.sortKey);for(let ft of Xe){let{geometry:Mt,index:Ut,sourceLayerIndex:ir}=ft;if(this.hasPattern){let Mr=nr("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,ir,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 Xe of Bc(K,500)){let ft=0;for(let Hr of Xe)ft+=Hr.length;let Mt=this.segments.prepareSegment(ft,this.layoutVertexArray,this.indexArray),Ut=Mt.vertexLength,ir=[],Mr=[];for(let Hr of Xe){if(Hr.length===0)continue;Hr!==Xe[0]&&Mr.push(ir.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),ir.push(Hr[0].x),ir.push(Hr[0].y);for(let Ga=1;Ga>3}if(ke--,pe===1||pe===2)je+=G.readSVarint(),Xe+=G.readSVarint(),pe===1&&(D&&ft.push(D),D=[]),D.push(new ba(je,Xe));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 G=this._pbf;G.pos=this._geometry;for(var D=G.readVarint()+G.pos,K=1,pe=0,ke=0,je=0,Xe=1/0,ft=-1/0,Mt=1/0,Ut=-1/0;G.pos>3}if(pe--,K===1||K===2)(ke+=G.readSVarint())ft&&(ft=ke),(je+=G.readSVarint())Ut&&(Ut=je);else if(K!==7)throw new Error("unknown command "+K)}return[Xe,Mt,ft,Ut]},Xa.prototype.toGeoJSON=function(G,D,K){var pe,ke,je=this.extent*Math.pow(2,K),Xe=this.extent*G,ft=this.extent*D,Mt=this.loadGeometry(),Ut=Xa.types[this.type];function ir(Hr){for(var oa=0;oa>3;ke=Xe===1?pe.readString():Xe===2?pe.readFloat():Xe===3?pe.readDouble():Xe===4?pe.readVarint64():Xe===5?pe.readVarint():Xe===6?pe.readSVarint():Xe===7?pe.readBoolean():null}return ke}(K))}Tn.prototype.feature=function(G){if(G<0||G>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[G];var D=this._pbf.readVarint()+this._pbf.pos;return new Nn(this._pbf,D,this.extent,this._keys,this._values)};var Gn=dn;function ci(G,D,K){if(G===3){var pe=new Gn(K,K.readVarint()+K.pos);pe.length&&(D[pe.name]=pe)}}Jr.VectorTile=function(G,D){this.layers=G.readFields(ci,{},D)},Jr.VectorTileFeature=_n,Jr.VectorTileLayer=dn;let bo=Jr.VectorTileFeature.types,jo=Math.pow(2,13);function ks(G,D,K,pe,ke,je,Xe,ft){G.emplaceBack(D,K,2*Math.floor(pe*jo)+Xe,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:Xe,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 ir={id:je,sourceLayerIndex:ft,index:Xe,geometry:Mt?Ut.geometry:Tl(ke),properties:ke.properties,type:ke.type,patterns:{}};this.hasPattern?this.features.push(nr("fill-extrusion",this.layers,ir,this.zoom,K)):this.addFeature(ir,ir.geometry,Xe,pe,{}),K.featureIndex.insert(ke,ir.geometry,Xe,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,Vt.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 Xe of Bc(K,500)){let ft={x:0,y:0,vertexCount:0},Mt=0;for(let oa of Xe)Mt+=oa.length;let Ut=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(let oa of Xe){if(oa.length===0||Hs(oa))continue;let va=0;for(let Ga=0;Ga=1){let Kn=oa[Ga-1];if(!bs($a,Kn)){Ut.vertexLength+4>St.MAX_VERTEX_ARRAY_LENGTH&&(Ut=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));let bn=$a.sub(Kn)._perp()._unit(),Wn=Kn.dist($a);va+Wn>32768&&(va=0),ks(this.layoutVertexArray,$a.x,$a.y,bn.x,bn.y,0,0,va),ks(this.layoutVertexArray,$a.x,$a.y,bn.x,bn.y,0,1,va),ft.x+=2*$a.x,ft.y+=2*$a.y,ft.vertexCount+=2,va+=Wn,ks(this.layoutVertexArray,Kn.x,Kn.y,bn.x,bn.y,0,0,va),ks(this.layoutVertexArray,Kn.x,Kn.y,bn.x,bn.y,0,1,va),ft.x+=2*Kn.x,ft.y+=2*Kn.y,ft.vertexCount+=2;let ai=Ut.vertexLength;this.indexArray.emplaceBack(ai,ai+2,ai+1),this.indexArray.emplaceBack(ai+1,ai+2,ai+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)),bo[D.type]!=="Polygon")continue;let ir=[],Mr=[],zr=Ut.vertexLength;for(let oa of Xe)if(oa.length!==0){oa!==Xe[0]&&Mr.push(ir.length/2);for(let va=0;vavo)||G.y===D.y&&(G.y<0||G.y>vo)}function Hs(G){return G.every(D=>D.x<0)||G.every(D=>D.x>vo)||G.every(D=>D.y<0)||G.every(D=>D.y>vo)}let pu;xn("FillExtrusionBucket",Fo,{omit:["layers","features"]});var Ap={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 Sp extends ae{constructor(D){super(D,Ap)}createBucket(D){return new Fo(D)}queryRadius(){return yi(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(D,K,pe,ke,je,Xe,ft,Mt){let Ut=Bn(D,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),Xe.angle,ft),ir=this.paint.get("fill-extrusion-height").evaluate(K,pe),Mr=this.paint.get("fill-extrusion-base").evaluate(K,pe),zr=function(oa,va,Ga,$a){let Kn=[];for(let bn of oa){let Wn=[bn.x,bn.y,0,1];hi(Wn,Wn,va),Kn.push(new n(Wn[0]/Wn[3],Wn[1]/Wn[3]))}return Kn}(Ut,Mt),Hr=function(oa,va,Ga,$a){let Kn=[],bn=[],Wn=$a[8]*va,ai=$a[9]*va,ji=$a[10]*va,ko=$a[11]*va,vs=$a[8]*Ga,yo=$a[9]*Ga,Di=$a[10]*Ga,ns=$a[11]*Ga;for(let qo of oa){let Bo=[],_i=[];for(let us of qo){let No=us.x,Es=us.y,Ku=$a[0]*No+$a[4]*Es+$a[12],Uu=$a[1]*No+$a[5]*Es+$a[13],Qf=$a[2]*No+$a[6]*Es+$a[14],Hp=$a[3]*No+$a[7]*Es+$a[15],bh=Qf+ji,eh=Hp+ko,Jh=Ku+vs,$h=Uu+yo,Qh=Qf+Di,uf=Hp+ns,th=new n((Ku+Wn)/eh,(Uu+ai)/eh);th.z=bh/eh,Bo.push(th);let Fh=new n(Jh/uf,$h/uf);Fh.z=Qh/uf,_i.push(Fh)}Kn.push(Bo),bn.push(_i)}return[Kn,bn]}(ke,Mr,ir,Mt);return function(oa,va,Ga){let $a=1/0;Yt(Ga,va)&&($a=Vp(Ga,va[0]));for(let Kn=0;KnK.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(),Xe=[];for(let{feature:ft,id:Mt,index:Ut,sourceLayerIndex:ir}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:ir,index:Ut,geometry:Mr?zr.geometry:Tl(ft),patterns:{},sortKey:Hr};Xe.push(oa)}je&&Xe.sort((ft,Mt)=>ft.sortKey-Mt.sortKey);for(let ft of Xe){let{geometry:Mt,index:Ut,sourceLayerIndex:ir}=ft;if(this.hasPattern){let Mr=nr("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,ir,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 Xe=this.layers[0].layout,ft=Xe.get("line-join").evaluate(D,{}),Mt=Xe.get("line-cap"),Ut=Xe.get("line-miter-limit"),ir=Xe.get("line-round-limit");this.lineClips=this.lineFeatureClips(D);for(let Mr of K)this.addLine(Mr,D,ft,Mt,Ut,ir);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,D,pe,je,ke)}addLine(D,K,pe,ke,je,Xe){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let $a=0;$a=2&&D[Mt-1].equals(D[Mt-2]);)Mt--;let Ut=0;for(;Ut0;if(ko&&$a>Ut){let ns=zr.dist(Hr);if(ns>2*ir){let qo=zr.sub(zr.sub(Hr)._mult(ir/ns)._round());this.updateDistance(Hr,qo),this.addCurrentVertex(qo,va,0,0,Mr),Hr=qo}}let yo=Hr&&oa,Di=yo?pe:ft?"butt":ke;if(yo&&Di==="round"&&(aije&&(Di="bevel"),Di==="bevel"&&(ai>2&&(Di="flipbevel"),ai100)Kn=Ga.mult(-1);else{let ns=ai*va.add(Ga).mag()/va.sub(Ga).mag();Kn._perp()._mult(ns*(vs?-1:1))}this.addCurrentVertex(zr,Kn,0,0,Mr),this.addCurrentVertex(zr,Kn.mult(-1),0,0,Mr)}else if(Di==="bevel"||Di==="fakeround"){let ns=-Math.sqrt(ai*ai-1),qo=vs?ns:0,Bo=vs?0:ns;if(Hr&&this.addCurrentVertex(zr,va,qo,Bo,Mr),Di==="fakeround"){let _i=Math.round(180*ji/Math.PI/20);for(let us=1;us<_i;us++){let No=us/_i;if(No!==.5){let Ku=No-.5;No+=No*Ku*(No-1)*((1.0904+bn*(bn*(3.55645-1.43519*bn)-3.2452))*Ku*Ku+(.848013+bn*(.215638*bn-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,-qo,-Bo,Mr)}else if(Di==="butt")this.addCurrentVertex(zr,Kn,0,0,Mr);else if(Di==="square"){let ns=Hr?1:-1;this.addCurrentVertex(zr,Kn,ns,ns,Mr)}else Di==="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&&$a2*ir){let qo=zr.add(oa.sub(zr)._mult(ir/ns)._round());this.updateDistance(zr,qo),this.addCurrentVertex(qo,Ga,0,0,Mr),zr=qo}}}}addCurrentVertex(D,K,pe,ke,je,Xe=!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,Xe,!1,pe,je),this.addHalfVertex(D,ft,Mt,Xe,!0,-ke,je),this.distance>Mp/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(D,K,pe,ke,je,Xe))}addHalfVertex({x:D,y:K},pe,ke,je,Xe,ft,Mt){let Ut=.5*(this.lineClips?this.scaledDistance*(Mp-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((D<<1)+(je?1:0),(K<<1)+(Xe?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 ir=Mt.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,ir),Mt.primitiveLength++),Xe?this.e2=ir:this.e1=ir}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 Ep,kv;xn("LineBucket",qp,{omit:["layers","patternFeatures"]});var qd={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 Ep=Ep||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 Vf 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,qd),this.gradientVersion=0,Gd||(Gd=new Vf(qd.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 qp(D)}queryRadius(D){let K=D,pe=ch(hn("line-width",this,K),hn("line-gap-width",this,K)),ke=hn("line-offset",this,K);return pe/2+Math.abs(ke)+yi(this.paint.get("line-translate"))}queryIntersectsFeature(D,K,pe,ke,je,Xe,ft){let Mt=Bn(D,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),Xe.angle,ft),Ut=ft/2*ch(this.paint.get("line-width").evaluate(K,pe),this.paint.get("line-gap-width").evaluate(K,pe)),ir=this.paint.get("line-offset").evaluate(K,pe);return ir&&(ke=function(Mr,zr){let Hr=[];for(let oa=0;oa=3){for(let Ga=0;Ga0?D+2*G:G}let nv=pt([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),nm=pt([{name:"a_projected_pos",components:3,type:"Float32"}],4);pt([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);let im=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),iv=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(G,D,K){return G.sections.forEach(pe=>{pe.text=function(ke,je,Xe){let ft=je.layout.get("text-transform").evaluate(Xe,{});return ft==="uppercase"?ke=ke.toLocaleUpperCase():ft==="lowercase"&&(ke=ke.toLocaleLowerCase()),Xs.applyArabicShaping&&(ke=Xs.applyArabicShaping(ke)),ke}(pe.text,D,K)}),G}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(G,D,K,pe,ke){var je,Xe,ft=8*ke-pe-1,Mt=(1<>1,ir=-7,Mr=K?ke-1:0,zr=K?-1:1,Hr=G[D+Mr];for(Mr+=zr,je=Hr&(1<<-ir)-1,Hr>>=-ir,ir+=ft;ir>0;je=256*je+G[D+Mr],Mr+=zr,ir-=8);for(Xe=je&(1<<-ir)-1,je>>=-ir,ir+=pe;ir>0;Xe=256*Xe+G[D+Mr],Mr+=zr,ir-=8);if(je===0)je=1-Ut;else{if(je===Mt)return Xe?NaN:1/0*(Hr?-1:1);Xe+=Math.pow(2,pe),je-=Ut}return(Hr?-1:1)*Xe*Math.pow(2,je-pe)},om=function(G,D,K,pe,ke,je){var Xe,ft,Mt,Ut=8*je-ke-1,ir=(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,Xe=ir):(Xe=Math.floor(Math.log(D)/Math.LN2),D*(Mt=Math.pow(2,-Xe))<1&&(Xe--,Mt*=2),(D+=Xe+Mr>=1?zr/Mt:zr*Math.pow(2,1-Mr))*Mt>=2&&(Xe++,Mt/=2),Xe+Mr>=ir?(ft=0,Xe=ir):Xe+Mr>=1?(ft=(D*Mt-1)*Math.pow(2,ke),Xe+=Mr):(ft=D*Math.pow(2,Mr-1)*Math.pow(2,ke),Xe=0));ke>=8;G[K+Hr]=255&ft,Hr+=oa,ft/=256,ke-=8);for(Xe=Xe<0;G[K+Hr]=255&Xe,Hr+=oa,Xe/=256,Ut-=8);G[K+Hr-oa]|=128*va};function Au(G){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(G)?G:new Uint8Array(G||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 xg=4294967296,sv=1/xg,_0=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");function Cp(G){return G.type===Au.Bytes?G.readVarint()+G.pos:G.pos+1}function lv(G,D,K){return K?4294967296*D+(G>>>0):4294967296*(D>>>0)+(G>>>0)}function x0(G,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>=G;ke--)K.buf[ke+pe]=K.buf[ke]}function bg(G,D){for(var K=0;K>>8,G[K+2]=D>>>16,G[K+3]=D>>>24}function kx(G,D){return(G[D]|G[D+1]<<8|G[D+2]<<16)+(G[D+3]<<24)}Au.prototype={destroy:function(){this.buf=null},readFields:function(G,D,K){for(K=K||this.length;this.pos>3,je=this.pos;this.type=7&pe,G(ke,D,this),this.pos===je&&this.skip(pe)}return D},readMessage:function(G,D){return this.readFields(G,D,this.readVarint()+this.pos)},readFixed32:function(){var G=Rv(this.buf,this.pos);return this.pos+=4,G},readSFixed32:function(){var G=kx(this.buf,this.pos);return this.pos+=4,G},readFixed64:function(){var G=Rv(this.buf,this.pos)+Rv(this.buf,this.pos+4)*xg;return this.pos+=8,G},readSFixed64:function(){var G=Rv(this.buf,this.pos)+kx(this.buf,this.pos+4)*xg;return this.pos+=8,G},readFloat:function(){var G=Iv(this.buf,this.pos,!0,23,4);return this.pos+=4,G},readDouble:function(){var G=Iv(this.buf,this.pos,!0,52,8);return this.pos+=8,G},readVarint:function(G){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,Xe){var ft,Mt,Ut=Xe.buf;if(ft=(112&(Mt=Ut[Xe.pos++]))>>4,Mt<128||(ft|=(127&(Mt=Ut[Xe.pos++]))<<3,Mt<128)||(ft|=(127&(Mt=Ut[Xe.pos++]))<<10,Mt<128)||(ft|=(127&(Mt=Ut[Xe.pos++]))<<17,Mt<128)||(ft|=(127&(Mt=Ut[Xe.pos++]))<<24,Mt<128)||(ft|=(1&(Mt=Ut[Xe.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,G,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var G=this.readVarint();return G%2==1?(G+1)/-2:G/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var G=this.readVarint()+this.pos,D=this.pos;return this.pos=G,G-D>=12&&_0?function(K,pe,ke){return _0.decode(K.subarray(pe,ke))}(this.buf,D,G):function(K,pe,ke){for(var je="",Xe=pe;Xe239?4:ir>223?3:ir>191?2:1;if(Xe+zr>ke)break;zr===1?ir<128&&(Mr=ir):zr===2?(192&(ft=K[Xe+1]))==128&&(Mr=(31&ir)<<6|63&ft)<=127&&(Mr=null):zr===3?(Mt=K[Xe+2],(192&(ft=K[Xe+1]))==128&&(192&Mt)==128&&((Mr=(15&ir)<<12|(63&ft)<<6|63&Mt)<=2047||Mr>=55296&&Mr<=57343)&&(Mr=null)):zr===4&&(Mt=K[Xe+2],Ut=K[Xe+3],(192&(ft=K[Xe+1]))==128&&(192&Mt)==128&&(192&Ut)==128&&((Mr=(15&ir)<<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),Xe+=zr}return je}(this.buf,D,G)},readBytes:function(){var G=this.readVarint()+this.pos,D=this.buf.subarray(this.pos,G);return this.pos=G,D},readPackedVarint:function(G,D){if(this.type!==Au.Bytes)return G.push(this.readVarint(D));var K=Cp(this);for(G=G||[];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(G,D){this.writeVarint(G<<3|D)},realloc:function(G){for(var D=this.length||16;D268435455||G<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,Xe,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,Xe){var ft=(7&je)<<4;Xe.buf[Xe.pos++]|=ft|((je>>>=3)?128:0),je&&(Xe.buf[Xe.pos++]=127&je|((je>>>=7)?128:0),je&&(Xe.buf[Xe.pos++]=127&je|((je>>>=7)?128:0),je&&(Xe.buf[Xe.pos++]=127&je|((je>>>=7)?128:0),je&&(Xe.buf[Xe.pos++]=127&je|((je>>>=7)?128:0),je&&(Xe.buf[Xe.pos++]=127&je)))))}(ke,K)}(G,this):(this.realloc(4),this.buf[this.pos++]=127&G|(G>127?128:0),G<=127||(this.buf[this.pos++]=127&(G>>>=7)|(G>127?128:0),G<=127||(this.buf[this.pos++]=127&(G>>>=7)|(G>127?128:0),G<=127||(this.buf[this.pos++]=G>>>7&127))))},writeSVarint:function(G){this.writeVarint(G<0?2*-G-1:2*G)},writeBoolean:function(G){this.writeVarint(!!G)},writeString:function(G){G=String(G),this.realloc(4*G.length),this.pos++;var D=this.pos;this.pos=function(pe,ke,je){for(var Xe,ft,Mt=0;Mt55295&&Xe<57344){if(!ft){Xe>56319||Mt+1===ke.length?(pe[je++]=239,pe[je++]=191,pe[je++]=189):ft=Xe;continue}if(Xe<56320){pe[je++]=239,pe[je++]=191,pe[je++]=189,ft=Xe;continue}Xe=ft-55296<<10|Xe-56320|65536,ft=null}else ft&&(pe[je++]=239,pe[je++]=191,pe[je++]=189,ft=null);Xe<128?pe[je++]=Xe:(Xe<2048?pe[je++]=Xe>>6|192:(Xe<65536?pe[je++]=Xe>>12|224:(pe[je++]=Xe>>18|240,pe[je++]=Xe>>12&63|128),pe[je++]=Xe>>6&63|128),pe[je++]=63&Xe|128)}return je}(this.buf,G,this.pos);var K=this.pos-D;K>=128&&x0(D,K,this),this.pos=D-1,this.writeVarint(K),this.pos+=K},writeFloat:function(G){this.realloc(4),om(this.buf,G,this.pos,!0,23,4),this.pos+=4},writeDouble:function(G){this.realloc(8),om(this.buf,G,this.pos,!0,52,8),this.pos+=8},writeBytes:function(G){var D=G.length;this.writeVarint(D),this.realloc(D);for(var K=0;K=128&&x0(K,pe,this),this.pos=K-1,this.writeVarint(pe),this.pos+=pe},writeMessage:function(G,D,K){this.writeTag(G,Au.Bytes),this.writeRawMessage(D,K)},writePackedVarint:function(G,D){D.length&&this.writeMessage(G,bg,D)},writePackedSVarint:function(G,D){D.length&&this.writeMessage(G,UT,D)},writePackedBoolean:function(G,D){D.length&&this.writeMessage(G,qT,D)},writePackedFloat:function(G,D){D.length&&this.writeMessage(G,jT,D)},writePackedDouble:function(G,D){D.length&&this.writeMessage(G,VT,D)},writePackedFixed32:function(G,D){D.length&&this.writeMessage(G,dk,D)},writePackedSFixed32:function(G,D){D.length&&this.writeMessage(G,GT,D)},writePackedFixed64:function(G,D){D.length&&this.writeMessage(G,HT,D)},writePackedSFixed64:function(G,D){D.length&&this.writeMessage(G,WT,D)},writeBytesField:function(G,D){this.writeTag(G,Au.Bytes),this.writeBytes(D)},writeFixed32Field:function(G,D){this.writeTag(G,Au.Fixed32),this.writeFixed32(D)},writeSFixed32Field:function(G,D){this.writeTag(G,Au.Fixed32),this.writeSFixed32(D)},writeFixed64Field:function(G,D){this.writeTag(G,Au.Fixed64),this.writeFixed64(D)},writeSFixed64Field:function(G,D){this.writeTag(G,Au.Fixed64),this.writeSFixed64(D)},writeVarintField:function(G,D){this.writeTag(G,Au.Varint),this.writeVarint(D)},writeSVarintField:function(G,D){this.writeTag(G,Au.Varint),this.writeSVarint(D)},writeStringField:function(G,D){this.writeTag(G,Au.Bytes),this.writeString(D)},writeFloatField:function(G,D){this.writeTag(G,Au.Fixed32),this.writeFloat(D)},writeDoubleField:function(G,D){this.writeTag(G,Au.Fixed64),this.writeDouble(D)},writeBooleanField:function(G,D){this.writeVarintField(G,!!D)}};var P1=r(Dh);let I1=3;function vk(G,D,K){G===1&&K.readMessage(XT,D)}function XT(G,D,K){if(G===3){let{id:pe,bitmap:ke,width:je,height:Xe,left:ft,top:Mt,advance:Ut}=K.readMessage(Lx,{});D.push({id:pe,bitmap:new Ii({width:je+2*I1,height:Xe+2*I1},ke),metrics:{width:je,height:Xe,left:ft,top:Mt,advance:Ut}})}}function Lx(G,D,K){G===1?D.id=K.readVarint():G===2?D.bitmap=K.readBytes():G===3?D.width=K.readVarint():G===4?D.height=K.readVarint():G===5?D.left=K.readSVarint():G===6?D.top=K.readSVarint():G===7&&(D.advance=K.readVarint())}let Px=I1;function R1(G){let D=0,K=0;for(let Xe of G)D+=Xe.w*Xe.h,K=Math.max(K,Xe.w);G.sort((Xe,ft)=>ft.h-Xe.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 Xe of G)for(let ft=pe.length-1;ft>=0;ft--){let Mt=pe[ft];if(!(Xe.w>Mt.w||Xe.h>Mt.h)){if(Xe.x=Mt.x,Xe.y=Mt.y,je=Math.max(je,Xe.y+Xe.h),ke=Math.max(ke,Xe.x+Xe.w),Xe.w===Mt.w&&Xe.h===Mt.h){let Ut=pe.pop();ft=0&&pe>=D&&T0[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(Tg.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 Ag(G,D,K,pe,ke,je,Xe,ft,Mt,Ut,ir,Mr,zr,Hr,oa){let va=sm.fromFeature(G,ke),Ga;Mr===e.ah.vertical&&va.verticalizePunctuation();let{processBidirectionalText:$a,processStyledBidirectionalText:Kn}=Xs;if($a&&va.sections.length===1){Ga=[];let ai=$a(va.toString(),lm(va,Ut,je,D,pe,Hr));for(let ji of ai){let ko=new sm;ko.text=ji,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=ji[uu.fontStack],Zd=Xp&&Xp[Ju];if(!Zd)continue;Kc=Zd.metrics}Pp=(th-uu.scale)*lu}Wp?(ai.verticalizable=!0,fh.push({glyph:Ju,imageName:_d,x:Es,y:Ku+Pp,vertical:Wp,scale:uu.scale,fontStack:uu.fontStack,sectionIndex:fc,metrics:Kc,rect:dm}),Es+=hd*uu.scale+_i):(fh.push({glyph:Ju,imageName:_d,x:Es,y:Ku+Pp,vertical:Wp,scale:uu.scale,fontStack:uu.fontStack,sectionIndex:fc,metrics:Kc,rect:dm}),Es+=Kc.advance*uu.scale+_i)}fh.length!==0&&(Uu=Math.max(Es-_i,Uu),uv(fh,0,fh.length-1,Hp,gf)),Es=0;let Lp=Di*th+gf;wh.lineOffset=Math.max(gf,Fh),Ku+=Lp,Qf=Math.max(Lp,Qf),++bh}var eh;let Jh=Ku-$f,{horizontalAlign:$h,verticalAlign:Qh}=S0(ns);(function(uf,th,Fh,wh,fh,gf,Lp,pp,uu){let fc=(th-Fh)*fh,Ju=0;Ju=gf!==Lp?-pp*wh-$f:(-wh*uu+.5)*Lp;for(let Pp of uf)for(let Kc of Pp.positionedGlyphs)Kc.x+=fc,Kc.y+=Ju})(ai.positionedLines,Hp,$h,Qh,Uu,Qf,Di,Jh,yo.length),ai.top+=-Qh*Jh,ai.bottom=ai.top+Jh,ai.left+=-$h*Uu,ai.right=ai.left+Uu}(Wn,D,K,pe,Ga,Xe,ft,Mt,Mr,Ut,zr,oa),!function(ai){for(let ji of ai)if(ji.positionedGlyphs.length!==0)return!1;return!0}(bn)&&Wn}let T0={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(G,D,K,pe,ke,je){if(D.imageName){let Xe=pe[D.imageName];return Xe?Xe.displaySize[0]*D.scale*lu/je+ke:0}{let Xe=K[D.fontStack],ft=Xe&&Xe[G];return ft?ft.metrics.advance*D.scale+ke:0}}function Rx(G,D,K,pe){let ke=Math.pow(G-D,2);return pe?G=0,Ut=0;for(let Mr=0;MrUt){let ir=Math.ceil(je/Ut);ke*=ir/Xe,Xe=ir}return{x1:pe,y1:ke,x2:pe+je,y2:ke+Xe}}function Fx(G,D,K,pe,ke,je){let Xe=G.image,ft;if(Xe.content){let Ga=Xe.content,$a=Xe.pixelRatio||1;ft=[Ga[0]/$a,Ga[1]/$a,Xe.displaySize[0]-Ga[2]/$a,Xe.displaySize[1]-Ga[3]/$a]}let Mt=D.left*je,Ut=D.right*je,ir,Mr,zr,Hr;K==="width"||K==="both"?(Hr=ke[0]+Mt-pe[3],Mr=ke[0]+Ut+pe[1]):(Hr=ke[0]+(Mt+Ut-Xe.displaySize[0])/2,Mr=Hr+Xe.displaySize[0]);let oa=D.top*je,va=D.bottom*je;return K==="height"||K==="both"?(ir=ke[1]+oa-pe[0],zr=ke[1]+va+pe[2]):(ir=ke[1]+(oa+va-Xe.displaySize[1])/2,zr=ir+Xe.displaySize[1]),{image:Xe,top:ir,right:Mr,bottom:zr,left:Hr,collisionPadding:ft}}let Mg=255,yd=128,cv=Mg*yd;function Ox(G,D){let{expression:K}=D;if(K.kind==="constant")return{kind:"constant",layoutSize:K.evaluate(new Ls(G+1))};if(K.kind==="source")return{kind:"source"};{let{zoomStops:pe,interpolationType:ke}=K,je=0;for(;jeXe.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=gn([]),this.placementViewportMatrix=gn([]);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(Xe=>e.ah[Xe])),this.stateDependentLayerIds=this.layers.filter(Xe=>Xe.isStateDependent()).map(Xe=>Xe.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 Xe=0;Xe0)&&(Xe.value.kind!=="constant"||Xe.value.value.length>0),ir=Mt.value.kind!=="constant"||!!Mt.value.value||Object.keys(Mt.parameters).length>0,Mr=je.get("symbol-sort-key");if(this.features=[],!Ut&&!ir)return;let zr=K.iconDependencies,Hr=K.glyphDependencies,oa=K.availableImages,va=new Ls(this.zoom);for(let{feature:Ga,id:$a,index:Kn,sourceLayerIndex:bn}of D){let Wn=ke._featureFilter.needGeometry,ai=Gl(Ga,Wn);if(!ke._featureFilter.filter(va,ai,pe))continue;let ji,ko;if(Wn||(ai.geometry=Tl(Ga)),Ut){let yo=ke.getValueAndResolveTokens("text-field",ai,pe,oa),Di=ma.factory(yo),ns=this.hasRTLText=this.hasRTLText||F1(Di);(!ns||Xs.getRTLTextPluginStatus()==="unavailable"||ns&&Xs.isParsed())&&(ji=ov(Di,ke,ai))}if(ir){let yo=ke.getValueAndResolveTokens("icon-image",ai,pe,oa);ko=yo instanceof rn?yo:rn.fromString(yo)}if(!ji&&!ko)continue;let vs=this.sortFeaturesByKey?Mr.evaluate(ai,{},pe):void 0;if(this.features.push({id:$a,text:ji,icon:ko,index:Kn,sourceLayerIndex:bn,geometry:ai.geometry,properties:Ga.properties,type:JT[Ga.type],sortKey:vs}),ko&&(zr[ko.name]=!0),ji){let yo=Xe.evaluate(ai,{},pe).join(","),Di=je.get("text-rotation-alignment")!=="viewport"&&je.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(e.ah.vertical)>=0;for(let ns of ji.sections)if(ns.image)zr[ns.image.name]=!0;else{let qo=xo(ji.toString()),Bo=ns.fontStack||yo,_i=Hr[Bo]=Hr[Bo]||{};this.calculateGlyphDependencies(ns.text,_i,Di,this.allowVerticalPlacement,qo)}}}je.get("symbol-placement")==="line"&&(this.features=function(Ga){let $a={},Kn={},bn=[],Wn=0;function ai(yo){bn.push(Ga[yo]),Wn++}function ji(yo,Di,ns){let qo=Kn[yo];return delete Kn[yo],Kn[Di]=qo,bn[qo].geometry[0].pop(),bn[qo].geometry[0]=bn[qo].geometry[0].concat(ns[0]),qo}function ko(yo,Di,ns){let qo=$a[Di];return delete $a[Di],$a[yo]=qo,bn[qo].geometry[0].shift(),bn[qo].geometry[0]=ns[0].concat(bn[qo].geometry[0]),qo}function vs(yo,Di,ns){let qo=ns?Di[0][Di[0].length-1]:Di[0][0];return`${yo}:${qo.x}:${qo.y}`}for(let yo=0;yoyo.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((Ga,$a)=>Ga.sortKey-$a.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]),Xe={};for(let ft=D.segment+1;ft=0;ft--)Xe[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]),Xe}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,Xe)=>{ke>=0&&Xe.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,Eg;xn("SymbolBucket",um,{omit:["layers","collisionBoxArray","features","compareText"]}),um.MAX_GLYPHS=65535,um.addDynamicAttributes=z1;var E0={get paint(){return Eg=Eg||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:qt,getOverride:G=>G.textColor,hasOverride:G=>!!G.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 Cg{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}}xn("FormatSectionOverride",Cg,{omit:["defaultValue"]});class Dv extends ae{constructor(D){super(D,E0)}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),Xe=this._unevaluatedLayout._values[D];return Xe.isDataDriven()||Ac(Xe.value)||!je?je:function(ft,Mt){return Mt.replace(/{([^{}]+)}/g,(Ut,ir)=>ft&&ir in ft?String(ft[ir]):"")}(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 E0.paint.overridableProperties){if(!Dv.hasPaintOverride(this.layout,D))continue;let K=this.paint.get(D),pe=new Cg(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=E0.paint.properties[K],je=!1,Xe=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)Xe(pe.value.value.sections);else if(pe.value.kind==="source"){let ft=Ut=>{je||(Ut instanceof Nr&&xt(Ut.value)===jr?Xe(Ut.value.sections):Ut instanceof os?Xe(Ut.sections):Ut.eachChild(ft))},Mt=pe.value;Mt._styleExpression&&ft(Mt._styleExpression.expression)}return je}}let Bx;var kg={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,kg)}}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 Lg 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(G){return cm*Math.cos(G*Math.PI/180)}function C0(G){return(180+G)/360}function jx(G){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+G*Math.PI/360)))/360}function k0(G,D){return G/Ux(D)}function Pg(G){return 360/Math.PI*Math.atan(Math.exp((180-360*G)*Math.PI/180))-90}class Ig{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 Ig(C0(pe.lng),jx(pe.lat),k0(K,pe.lat))}toLngLat(){return new Hd(360*this.x-180,Pg(this.y))}toAltitude(){return this.z*Ux(Pg(this.y))}meterInMercatorCoordinateUnits(){return 1/cm*(D=Pg(this.y),1/Math.cos(D*Math.PI/180));var D}}function ad(G,D,K){var pe=2*Math.PI*6378137/256/Math.pow(2,K);return[G*pe-2*Math.PI*6378137/2,D*pe-2*Math.PI*6378137/2]}class V1{constructor(D,K,pe){if(!function(ke,je,Xe){return!(ke<0||ke>25||Xe<0||Xe>=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=Rg(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=(Xe=this.y,ft=this.z,Mt=ad(256*(je=this.x),256*(Xe=Math.pow(2,ft)-Xe-1),ft),Ut=ad(256*(je+1),256*(Xe+1),ft),Mt[0]+","+Mt[1]+","+Ut[0]+","+Ut[1]);var je,Xe,ft,Mt,Ut;let ir=function(Mr,zr,Hr){let oa,va="";for(let Ga=Mr;Ga>0;Ga--)oa=1<1?"@2x":"").replace(/{quadkey}/g,ir).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 n((D.x*K-this.x)*vo,(D.y*K-this.y)*vo)}toString(){return`${this.z}/${this.x}/${this.y}`}}class Vx{constructor(D,K){this.wrap=D,this.canonical=K,this.key=Rg(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 V1(pe,+ke,+je),this.key=Rg(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?Rg(this.wrap*+K,D,this.canonical.z,this.canonical.x,this.canonical.y):Rg(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 zn({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,Xe=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:Xe=ft-1;break;case 1:ft=Xe+1}let Mt=-K*this.dim,Ut=-pe*this.dim;for(let ir=Xe;ir=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 q1{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 On(vo,16,0),this.grid3D=new On(vo,16,0),this.featureIndexArray=new Js,this.promoteId=K}insert(D,K,pe,ke,je,Xe){let ft=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(pe,ke,je);let Mt=Xe?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||{},Xe=vo/D.tileSize/D.scale,ft=Sc(je.filter),Mt=D.queryGeometry,Ut=D.queryPadding*Xe,ir=Wx(Mt),Mr=this.grid.query(ir.minX-Ut,ir.minY-Ut,ir.maxX+Ut,ir.maxY+Ut),zr=Wx(D.cameraQueryGeometry),Hr=this.grid3D.query(zr.minX-Ut,zr.minY-Ut,zr.maxX+Ut,zr.maxY+Ut,(Ga,$a,Kn,bn)=>function(Wn,ai,ji,ko,vs){for(let Di of Wn)if(ai<=Di.x&&ji<=Di.y&&ko>=Di.x&&vs>=Di.y)return!0;let yo=[new n(ai,ji),new n(ai,vs),new n(ko,vs),new n(ko,ji)];if(Wn.length>2){for(let Di of yo)if(Sn(Wn,Di))return!0}for(let Di=0;Di(bn||(bn=Tl(Wn)),ai.queryIntersectsFeature(Mt,Wn,ji,bn,this.z,D.transform,Xe,D.pixelPosMatrix)))}return oa}loadMatchingFeature(D,K,pe,ke,je,Xe,ft,Mt,Ut,ir,Mr){let zr=this.bucketLayerIDs[K];if(Xe&&!function(Ga,$a){for(let Kn=0;Kn=0)return!0;return!1}(Xe,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(Xe):null;return ft&&ft.evaluate?ft.evaluate(K,pe,ke):ft})}function Wx(G){let D=1/0,K=1/0,pe=-1/0,ke=-1/0;for(let je of G)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(G,D){return D-G}function Xx(G,D,K,pe,ke){let je=[];for(let Xe=0;Xe=pe&&Mr.x>=pe||(ir.x>=pe?ir=new n(pe,ir.y+(pe-ir.x)/(Mr.x-ir.x)*(Mr.y-ir.y))._round():Mr.x>=pe&&(Mr=new n(pe,ir.y+(pe-ir.x)/(Mr.x-ir.x)*(Mr.y-ir.y))._round()),ir.y>=ke&&Mr.y>=ke||(ir.y>=ke?ir=new n(ir.x+(ke-ir.y)/(Mr.y-ir.y)*(Mr.x-ir.x),ke)._round():Mr.y>=ke&&(Mr=new n(ir.x+(ke-ir.y)/(Mr.y-ir.y)*(Mr.x-ir.x),ke)._round()),Mt&&ir.equals(Mt[Mt.length-1])||(Mt=[ir],je.push(Mt)),Mt.push(Mr)))))}}return je}xn("FeatureIndex",zv,{omit:["rawTileData","sourceLayerCoder"]});class Wd extends n{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(G,D,K,pe,ke){if(D.segment===void 0||K===0)return!0;let je=D,Xe=D.segment+1,ft=0;for(;ft>-K/2;){if(Xe--,Xe<0)return!1;ft-=G[Xe].dist(je),je=G[Xe]}ft+=G[Xe].dist(G[Xe+1]),Xe++;let Mt=[],Ut=0;for(;ftpe;)Ut-=Mt.shift().angleDelta;if(Ut>ke)return!1;Xe++,ft+=ir.dist(Mr)}return!0}function Zx(G){let D=0;for(let K=0;KUt){let oa=(Ut-Mt)/Hr,va=Xi.number(Mr.x,zr.x,oa),Ga=Xi.number(Mr.y,zr.y,oa),$a=new Wd(va,Ga,zr.angleTo(Mr),ir);return $a._round(),!Xe||G1(G,$a,ft,Xe,D)?$a:void 0}Mt+=Hr}}function rA(G,D,K,pe,ke,je,Xe,ft,Mt){let Ut=Yx(pe,je,Xe),ir=Kx(pe,ke),Mr=ir*Xe,zr=G[0].x===0||G[0].x===Mt||G[0].y===0||G[0].y===Mt;return D-Mr=0&&Wn=0&&ai=0&&zr+Ut<=ir){let ji=new Wd(Wn,ai,Kn,oa);ji._round(),pe&&!G1(G,ji,je,pe,ke)||Hr.push(ji)}}Mr+=$a}return ft||Hr.length||Xe||(Hr=Jx(G,Mr/2,K,pe,ke,je,Xe,!0,Mt)),Hr}xn("Anchor",Wd);let fm=zh;function $x(G,D,K,pe){let ke=[],je=G.image,Xe=je.pixelRatio,ft=je.paddedRect.w-2*fm,Mt=je.paddedRect.h-2*fm,Ut={x1:G.left,y1:G.top,x2:G.right,y2:G.bottom},ir=je.stretchX||[[0,ft]],Mr=je.stretchY||[[0,Mt]],zr=(_i,us)=>_i+us[1]-us[0],Hr=ir.reduce(zr,0),oa=Mr.reduce(zr,0),va=ft-Hr,Ga=Mt-oa,$a=0,Kn=Hr,bn=0,Wn=oa,ai=0,ji=va,ko=0,vs=Ga;if(je.content&&pe){let _i=je.content,us=_i[2]-_i[0],No=_i[3]-_i[1];(je.textFitWidth||je.textFitHeight)&&(Ut=zx(G)),$a=Xd(ir,0,_i[0]),bn=Xd(Mr,0,_i[1]),Kn=Xd(ir,_i[0],_i[2]),Wn=Xd(Mr,_i[1],_i[3]),ai=_i[0]-$a,ko=_i[1]-bn,ji=us-Kn,vs=No-Wn}let yo=Ut.x1,Di=Ut.y1,ns=Ut.x2-yo,qo=Ut.y2-Di,Bo=(_i,us,No,Es)=>{let Ku=L0(_i.stretch-$a,Kn,ns,yo),Uu=hm(_i.fixed-ai,ji,_i.stretch,Hr),Qf=L0(us.stretch-bn,Wn,qo,Di),Hp=hm(us.fixed-ko,vs,us.stretch,oa),bh=L0(No.stretch-$a,Kn,ns,yo),eh=hm(No.fixed-ai,ji,No.stretch,Hr),Jh=L0(Es.stretch-bn,Wn,qo,Di),$h=hm(Es.fixed-ko,vs,Es.stretch,oa),Qh=new n(Ku,Qf),uf=new n(bh,Qf),th=new n(bh,Jh),Fh=new n(Ku,Jh),wh=new n(Uu/Xe,Hp/Xe),fh=new n(eh/Xe,$h/Xe),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 Lp=_i.stretch+_i.fixed,pp=us.stretch+us.fixed;return{tl:Qh,tr:uf,bl:Fh,br:th,tex:{x:je.paddedRect.x+fm+Lp,y:je.paddedRect.y+fm+pp,w:No.stretch+No.fixed-Lp,h:Es.stretch+Es.fixed-pp},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:wh,pixelOffsetBR:fh,minFontScaleX:ji/Xe/ns,minFontScaleY:vs/Xe/qo,isSDF:K}};if(pe&&(je.stretchX||je.stretchY)){let _i=Qx(ir,va,Hr),us=Qx(Mr,Ga,oa);for(let No=0;No<_i.length-1;No++){let Es=_i[No],Ku=_i[No+1];for(let Uu=0;Uu0&&(va=Math.max(10,va),this.circleDiameter=va)}else{let zr=!((Mr=Xe.image)===null||Mr===void 0)&&Mr.content&&(Xe.image.textFitWidth||Xe.image.textFitHeight)?zx(Xe):{x1:Xe.left,y1:Xe.top,x2:Xe.right,y2:Xe.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=Xe.collisionPadding;if(Hr&&(zr.x1-=Hr[0]*ft,zr.y1-=Hr[1]*ft,zr.x2+=Hr[2]*ft,zr.y2+=Hr[3]*ft),ir){let oa=new n(zr.x1,zr.y1),va=new n(zr.x2,zr.y1),Ga=new n(zr.x1,zr.y2),$a=new n(zr.x2,zr.y2),Kn=ir*Math.PI/180;oa._rotate(Kn),va._rotate(Kn),Ga._rotate(Kn),$a._rotate(Kn),zr.x1=Math.min(oa.x,va.x,Ga.x,$a.x),zr.x2=Math.max(oa.x,va.x,Ga.x,$a.x),zr.y1=Math.min(oa.y,va.y,Ga.y,$a.y),zr.y2=Math.max(oa.y,va.y,Ga.y,$a.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,Xe=K[je];if(pe(ke,Xe)>=0)break;K[D]=Xe,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[Xe],D=Xe}K[D]=je}}function aA(G,D=1,K=!1){let pe=1/0,ke=1/0,je=-1/0,Xe=-1/0,ft=G[0];for(let Hr=0;Hrje)&&(je=oa.x),(!Hr||oa.y>Xe)&&(Xe=oa.y)}let Mt=Math.min(je-pe,Xe-ke),Ut=Mt/2,ir=new fd([],nA);if(Mt===0)return new n(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,ir.push(new pm(Hr.p.x-Ut,Hr.p.y-Ut,Ut,G)),ir.push(new pm(Hr.p.x+Ut,Hr.p.y-Ut,Ut,G)),ir.push(new pm(Hr.p.x-Ut,Hr.p.y+Ut,Ut,G)),ir.push(new pm(Hr.p.x+Ut,Hr.p.y+Ut,Ut,G)),zr+=4)}return K&&(console.log(`num probes: ${zr}`),console.log(`best distance: ${Mr.d}`)),Mr.p}function nA(G,D){return D.max-G.max}function pm(G,D,K,pe){this.p=new n(G,D),this.h=K,this.d=function(ke,je){let Xe=!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&&(Xe=!Xe),ft=Math.min(ft,wa(ke,Hr,oa))}}return(Xe?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(G,D){return D[1]!==Fv?function(K,pe,ke){let je=0,Xe=0;switch(pe=Math.abs(pe),ke=Math.abs(ke),K){case"top-right":case"top-left":case"top":Xe=ke-pv;break;case"bottom-right":case"bottom-left":case"bottom":Xe=-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,Xe]}(G,D[0],D[1]):function(K,pe){let ke=0,je=0;pe<0&&(pe=0);let Xe=pe/Math.SQRT2;switch(K){case"top-right":case"top-left":je=Xe-pv;break;case"bottom-right":case"bottom-left":je=-Xe+pv;break;case"bottom":je=-pe+pv;break;case"top":je=pe-pv}switch(K){case"top-right":case"bottom-right":ke=-Xe;break;case"top-left":case"bottom-left":ke=Xe;break;case"left":ke=pe;break;case"right":ke=-pe}return[ke,je]}(G,D[0])}function eb(G,D,K){var pe;let ke=G.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);ir.startsWith("top")?Mr[1]-=pv:ir.startsWith("bottom")&&(Mr[1]+=pv),Mt[Ut+1]=Mr}return new Ha(Mt)}let Xe=ke.get("text-variable-anchor");if(Xe){let ft;ft=G._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 Xe)Mt.push(Ut,H1(Ut,ft));return new Ha(Mt)}return null}function W1(G){switch(G){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function iA(G,D,K,pe,ke,je,Xe,ft,Mt,Ut,ir){let Mr=je.textMaxSize.evaluate(D,{});Mr===void 0&&(Mr=Xe);let zr=G.layers[0].layout,Hr=zr.get("icon-offset").evaluate(D,{},ir),oa=rb(K.horizontal),va=Xe/24,Ga=G.tilePixelRatio*va,$a=G.tilePixelRatio*Mr/24,Kn=G.tilePixelRatio*ft,bn=G.tilePixelRatio*zr.get("symbol-spacing"),Wn=zr.get("text-padding")*G.tilePixelRatio,ai=function(_i,us,No,Es=1){let Ku=_i.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,ir,G.tilePixelRatio),ji=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",yo=zr.get("symbol-placement"),Di=bn/2,ns=zr.get("icon-text-fit"),qo;pe&&ns!=="none"&&(G.allowVerticalPlacement&&K.vertical&&(qo=Fx(pe,K.vertical,ns,zr.get("icon-text-fit-padding"),Hr,va)),oa&&(pe=Fx(pe,oa,ns,zr.get("icon-text-fit-padding"),Hr,va)));let Bo=(_i,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,Lp,pp,uu,fc,Ju,Pp,Kc,dm){let _d=No.addToLineVertexArray(Es,Ku),hd,Wp,Rc,Pf,Xp=0,Zd=0,dp=0,vm=0,J1=-1,D0=-1,xd={},Ov=on("");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,Lp,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,Pp,Zp),ep=bh?$x(bh,Oh,Pp,Zp):void 0;Wp=new hv(Jh,Es,$h,Qh,uf,Qf,gf,Lp,!1,Oh),Xp=4*dv.length;let Bh=No.iconSizeData,id=null;Bh.kind==="source"?(id=[yd*eh.layout.get("icon-size").evaluate(fc,{})],id[0]>cv&&f(`${No.layerIds[0]}: Value for "icon-size" is >= ${Mg}. Reduce your "icon-size".`)):Bh.kind==="composite"&&(id=[yd*Ju.compositeIconSizes[0].evaluate(fc,{},Kc),yd*Ju.compositeIconSizes[1].evaluate(fc,{},Kc)],(id[0]>cv||id[1]>cv)&&f(`${No.layerIds[0]}: Value for "icon-size" is >= ${Mg}. Reduce your "icon-size".`)),No.addSymbols(No.icon,dv,id,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,id,uu,pp,fc,e.ah.vertical,Es,_d.lineStartIndex,_d.lineLength,-1,Kc),D0=No.icon.placedSymbolArray.length-1)}let hh=Object.keys(Uu.horizontal);for(let Oh of hh){let Zp=Uu.horizontal[Oh];if(!hd){Ov=on(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,D0,Ju,Kc));let lA=hd?hd.boxStartIndex:No.collisionBoxArray.length,z0=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,nd=-1,Fg=(Oh,Zp)=>Oh&&Oh.circleDiameter?Math.max(Oh.circleDiameter,Zp):Zp;nd=Fg(hd,nd),nd=Fg(Rc,nd),nd=Fg(Wp,nd),nd=Fg(Pf,nd);let F0=nd>-1?1:0;F0&&(nd*=dm/lu),No.glyphOffsetArray.length>=um.MAX_GLYPHS&&f("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,D0,Ov,lA,z0,bd,vp,ob,uA,sb,cA,$h,dp,vm,Xp,Zd,F0,0,th,nd,fA,hA)}(G,us,_i,K,pe,ke,qo,G.layers[0],G.collisionBoxArray,D.index,D.sourceLayerIndex,G.index,Ga,[Wn,Wn,Wn,Wn],ko,Mt,Kn,ai,vs,Hr,D,je,Ut,ir,Xe)};if(yo==="line")for(let _i of Xx(D.geometry,0,0,vo,vo)){let us=rA(_i,bn,ji,K.vertical||oa,pe,24,$a,G.overscaling,vo);for(let No of us)oa&&oA(G,oa.text,Di,No)||Bo(_i,No)}else if(yo==="line-center"){for(let _i of D.geometry)if(_i.length>1){let us=tA(_i,ji,K.vertical||oa,pe,24,$a);us&&Bo(_i,us)}}else if(D.type==="Polygon")for(let _i of Bc(D.geometry,0)){let us=aA(_i,16);Bo(_i[0],new Wd(us.x,us.y,0))}else if(D.type==="LineString")for(let _i of D.geometry)Bo(_i,new Wd(_i[0].x,_i[0].y,0));else if(D.type==="Point")for(let _i of D.geometry)for(let us of _i)Bo([us],new Wd(us.x,us.y,0))}function tb(G,D,K,pe,ke,je,Xe,ft,Mt,Ut,ir,Mr,zr,Hr,oa){let va=function(Kn,bn,Wn,ai,ji,ko,vs,yo){let Di=ai.layout.get("text-rotate").evaluate(ko,{})*Math.PI/180,ns=[];for(let qo of bn.positionedLines)for(let Bo of qo.positionedGlyphs){if(!Bo.rect)continue;let _i=Bo.rect||{},us=Px+1,No=!0,Es=1,Ku=0,Uu=(ji||yo)&&Bo.vertical,Qf=Bo.metrics.advance*Bo.scale/2;if(yo&&bn.verticalizable&&(Ku=qo.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=ji?[Bo.x+Qf,Bo.y]:[0,0],bh=ji?[0,0]:[Bo.x+Qf+Wn[0],Bo.y+Wn[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+_i.w/Jh*Bo.scale/Es,th=Qh+_i.h/Jh*Bo.scale/Es,Fh=new n($h,Qh),wh=new n(uf,Qh),fh=new n($h,th),gf=new n(uf,th);if(Uu){let uu=new n(-Qf,Qf-$f),fc=-Math.PI/2,Ju=lu/2-Qf,Pp=new n(5-$f-Ju,-(Bo.imageName?Ju:0)),Kc=new n(...eh);Fh._rotateAround(fc,uu)._add(Pp)._add(Kc),wh._rotateAround(fc,uu)._add(Pp)._add(Kc),fh._rotateAround(fc,uu)._add(Pp)._add(Kc),gf._rotateAround(fc,uu)._add(Pp)._add(Kc)}if(Di){let uu=Math.sin(Di),fc=Math.cos(Di),Ju=[fc,-uu,uu,fc];Fh._matMult(Ju),wh._matMult(Ju),fh._matMult(Ju),gf._matMult(Ju)}let Lp=new n(0,0),pp=new n(0,0);ns.push({tl:Fh,tr:wh,bl:fh,br:gf,tex:_i,writingMode:bn.writingMode,glyphOffset:Hp,sectionIndex:Bo.sectionIndex,isSDF:No,pixelOffsetTL:Lp,pixelOffsetBR:pp,minFontScaleX:0,minFontScaleY:0})}return ns}(0,K,ft,ke,je,Xe,pe,G.allowVerticalPlacement),Ga=G.textSizeData,$a=null;Ga.kind==="source"?($a=[yd*ke.layout.get("text-size").evaluate(Xe,{})],$a[0]>cv&&f(`${G.layerIds[0]}: Value for "text-size" is >= ${Mg}. Reduce your "text-size".`)):Ga.kind==="composite"&&($a=[yd*Hr.compositeTextSizes[0].evaluate(Xe,{},oa),yd*Hr.compositeTextSizes[1].evaluate(Xe,{},oa)],($a[0]>cv||$a[1]>cv)&&f(`${G.layerIds[0]}: Value for "text-size" is >= ${Mg}. Reduce your "text-size".`)),G.addSymbols(G.text,va,$a,ft,je,Xe,Ut,D,Mt.lineStartIndex,Mt.lineLength,zr,oa);for(let Kn of ir)Mr[Kn]=G.text.placedSymbolArray.length-1;return 4*va.length}function rb(G){for(let D in G)return G[D];return null}function oA(G,D,K,pe){let ke=G.compareText;if(D in ke){let je=ke[D];for(let Xe=je.length-1;Xe>=0;Xe--)if(pe.dist(je[Xe])>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[Xe]=new Uint16Array(D,2,1),[ft]=new Uint32Array(D,4,1);return new X1(ft,Xe,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),Xe=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+Xe+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 P0(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:Xe,nodeSize:ft}=this,Mt=[0,je.length-1,0],Ut=[];for(;Mt.length;){let ir=Mt.pop()||0,Mr=Mt.pop()||0,zr=Mt.pop()||0;if(Mr-zr<=ft){for(let Ga=zr;Ga<=Mr;Ga++){let $a=Xe[2*Ga],Kn=Xe[2*Ga+1];$a>=D&&$a<=pe&&Kn>=K&&Kn<=ke&&Ut.push(je[Ga])}continue}let Hr=zr+Mr>>1,oa=Xe[2*Hr],va=Xe[2*Hr+1];oa>=D&&oa<=pe&&va>=K&&va<=ke&&Ut.push(je[Hr]),(ir===0?D<=oa:K<=va)&&(Mt.push(zr),Mt.push(Hr-1),Mt.push(1-ir)),(ir===0?pe>=oa:ke>=va)&&(Mt.push(Hr+1),Mt.push(Mr),Mt.push(1-ir))}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:Xe}=this,ft=[0,ke.length-1,0],Mt=[],Ut=pe*pe;for(;ft.length;){let ir=ft.pop()||0,Mr=ft.pop()||0,zr=ft.pop()||0;if(Mr-zr<=Xe){for(let Ga=zr;Ga<=Mr;Ga++)ib(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];ib(oa,va,D,K)<=Ut&&Mt.push(ke[Hr]),(ir===0?D-pe<=oa:K-pe<=va)&&(ft.push(zr),ft.push(Hr-1),ft.push(1-ir)),(ir===0?D+pe>=oa:K+pe>=va)&&(ft.push(Hr+1),ft.push(Mr),ft.push(1-ir))}return Mt}}function P0(G,D,K,pe,ke,je){if(ke-pe<=K)return;let Xe=pe+ke>>1;nb(G,D,Xe,pe,ke,je),P0(G,D,K,pe,Xe-1,1-je),P0(G,D,K,Xe+1,ke,1-je)}function nb(G,D,K,pe,ke,je){for(;ke>pe;){if(ke-pe>600){let Ut=ke-pe+1,ir=K-pe+1,Mr=Math.log(Ut),zr=.5*Math.exp(2*Mr/3),Hr=.5*Math.sqrt(Mr*zr*(Ut-zr)/Ut)*(ir-Ut/2<0?-1:1);nb(G,D,K,Math.max(pe,Math.floor(K-ir*zr/Ut+Hr)),Math.min(ke,Math.floor(K+(Ut-ir)*zr/Ut+Hr)),je)}let Xe=D[2*K+je],ft=pe,Mt=ke;for(Dg(G,D,pe,K),D[2*ke+je]>Xe&&Dg(G,D,pe,ke);ftXe;)Mt--}D[2*pe+je]===Xe?Dg(G,D,pe,Mt):(Mt++,Dg(G,D,Mt,ke)),Mt<=K&&(pe=Mt+1),K<=Mt&&(ke=Mt-1)}}function Dg(G,D,K,pe){Z1(G,K,pe),Z1(D,2*K,2*pe),Z1(D,2*K+1,2*pe+1)}function Z1(G,D,K){let pe=G[D];G[D]=G[K],G[K]=pe}function ib(G,D,K,pe){let ke=G-K,je=D-pe;return ke*ke+je*je}var I0;e.bg=void 0,(I0=e.bg||(e.bg={})).create="create",I0.load="load",I0.fullLoad="fullLoad";let zg=null,qf=[],Y1=1e3/60,K1="loadTime",R0="fullLoadTime",sA={mark(G){performance.mark(G)},frame(G){let D=G;zg!=null&&qf.push(D-zg),zg=D},clearMetrics(){zg=null,qf=[],performance.clearMeasures(K1),performance.clearMeasures(R0);for(let G in e.bg)performance.clearMarks(e.bg[G])},getPerformanceMetrics(){performance.measure(K1,e.bg.create,e.bg.load),performance.measure(R0,e.bg.create,e.bg.fullLoad);let G=performance.getEntriesByName(K1)[0].duration,D=performance.getEntriesByName(R0)[0].duration,K=qf.length,pe=1/(qf.reduce((je,Xe)=>je+Xe,0)/K/1e3),ke=qf.filter(je=>je>Y1).reduce((je,Xe)=>je+(Xe-Y1)/Y1,0);return{loadTime:G,fullLoadTime:D,fps:pe,percentDroppedFrames:ke/(K+ke)*100,totalFrames:K}}};e.$=class extends br{},e.A=an,e.B=Yn,e.C=function(G){if(z==null){let D=G.navigator?G.navigator.userAgent:null;z=!!G.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(G,D){this.target=G,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)?G:window}registerMessageHandler(G,D){this.messageHandlers[G]=D}sendAsync(G,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:G.targetMapId,sourceMapId:this.mapId};this.target.postMessage(ft)},{once:!0});let je=[],Xe=Object.assign(Object.assign({},G),{id:ke,sourceMapId:this.mapId,origin:location.origin,data:Ji(G.data,je)});this.target.postMessage(Xe,{transfer:je})})}receive(G){let D=G.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 G=this.taskQueue.shift(),D=this.tasks[G];delete this.tasks[G],this.taskQueue.length>0&&this.invoker.trigger(),D&&this.processTask(G,D)}processTask(G,D){return t(this,void 0,void 0,function*(){if(D.type===""){let ke=this.resolveRejects[G];return delete this.resolveRejects[G],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(G,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[G]=pe;try{let ke=yield this.messageHandlers[D.type](D.sourceMapId,K,pe);this.completeTask(G,null,ke)}catch(ke){this.completeTask(G,ke)}})}completeTask(G,D,K){let pe=[];delete this.abortControllers[G];let ke={id:G,type:"",sourceMapId:this.mapId,origin:location.origin,error:D?Ji(D):null,data:Ji(K,pe)};this.target.postMessage(ke,{transfer:pe})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}},e.G=se,e.H=function(){var G=new an(16);return an!=Float32Array&&(G[1]=0,G[2]=0,G[3]=0,G[4]=0,G[6]=0,G[7]=0,G[8]=0,G[9]=0,G[11]=0,G[12]=0,G[13]=0,G[14]=0),G[0]=1,G[5]=1,G[10]=1,G[15]=1,G},e.I=b0,e.J=function(G,D,K){var pe,ke,je,Xe,ft,Mt,Ut,ir,Mr,zr,Hr,oa,va=K[0],Ga=K[1],$a=K[2];return D===G?(G[12]=D[0]*va+D[4]*Ga+D[8]*$a+D[12],G[13]=D[1]*va+D[5]*Ga+D[9]*$a+D[13],G[14]=D[2]*va+D[6]*Ga+D[10]*$a+D[14],G[15]=D[3]*va+D[7]*Ga+D[11]*$a+D[15]):(ke=D[1],je=D[2],Xe=D[3],ft=D[4],Mt=D[5],Ut=D[6],ir=D[7],Mr=D[8],zr=D[9],Hr=D[10],oa=D[11],G[0]=pe=D[0],G[1]=ke,G[2]=je,G[3]=Xe,G[4]=ft,G[5]=Mt,G[6]=Ut,G[7]=ir,G[8]=Mr,G[9]=zr,G[10]=Hr,G[11]=oa,G[12]=pe*va+ft*Ga+Mr*$a+D[12],G[13]=ke*va+Mt*Ga+zr*$a+D[13],G[14]=je*va+Ut*Ga+Hr*$a+D[14],G[15]=Xe*va+ir*Ga+oa*$a+D[15]),G},e.K=function(G,D,K){var pe=K[0],ke=K[1],je=K[2];return G[0]=D[0]*pe,G[1]=D[1]*pe,G[2]=D[2]*pe,G[3]=D[3]*pe,G[4]=D[4]*ke,G[5]=D[5]*ke,G[6]=D[6]*ke,G[7]=D[7]*ke,G[8]=D[8]*je,G[9]=D[9]*je,G[10]=D[10]*je,G[11]=D[11]*je,G[12]=D[12],G[13]=D[13],G[14]=D[14],G[15]=D[15],G},e.L=Wa,e.M=function(G,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 G){let ke=window.document.createElement("source");J(pe)||(D.crossOrigin="Anonymous"),ke.src=pe,D.appendChild(ke)}})},e.a4=function(){return g++},e.a5=oi,e.a6=um,e.a7=Sc,e.a8=Gl,e.a9=q1,e.aA=function(G){if(G.type==="custom")return new N1(G);switch(G.type){case"background":return new QT(G);case"circle":return new Za(G);case"fill":return new Xt(G);case"fill-extrusion":return new Sp(G);case"heatmap":return new Ri(G);case"hillshade":return new xl(G);case"line":return new Lv(G);case"raster":return new Lg(G);case"symbol":return new Dv(G)}},e.aB=u,e.aC=function(G,D){if(!G)return[{command:"setStyle",args:[D]}];let K=[];try{if(!Ae(G.version,D.version))return[{command:"setStyle",args:[D]}];Ae(G.center,D.center)||K.push({command:"setCenter",args:[D.center]}),Ae(G.zoom,D.zoom)||K.push({command:"setZoom",args:[D.zoom]}),Ae(G.bearing,D.bearing)||K.push({command:"setBearing",args:[D.bearing]}),Ae(G.pitch,D.pitch)||K.push({command:"setPitch",args:[D.pitch]}),Ae(G.sprite,D.sprite)||K.push({command:"setSprite",args:[D.sprite]}),Ae(G.glyphs,D.glyphs)||K.push({command:"setGlyphs",args:[D.glyphs]}),Ae(G.transition,D.transition)||K.push({command:"setTransition",args:[D.transition]}),Ae(G.light,D.light)||K.push({command:"setLight",args:[D.light]}),Ae(G.terrain,D.terrain)||K.push({command:"setTerrain",args:[D.terrain]}),Ae(G.sky,D.sky)||K.push({command:"setSky",args:[D.sky]}),Ae(G.projection,D.projection)||K.push({command:"setProjection",args:[D.projection]});let pe={},ke=[];(function(Xe,ft,Mt,Ut){let ir;for(ir in ft=ft||{},Xe=Xe||{})Object.prototype.hasOwnProperty.call(Xe,ir)&&(Object.prototype.hasOwnProperty.call(ft,ir)||We(ir,Mt,Ut));for(ir in ft)Object.prototype.hasOwnProperty.call(ft,ir)&&(Object.prototype.hasOwnProperty.call(Xe,ir)?Ae(Xe[ir],ft[ir])||(Xe[ir].type==="geojson"&&ft[ir].type==="geojson"&&ot(Xe,ft,ir)?ze(Mt,{command:"setGeoJSONSourceData",args:[ir,ft[ir].data]}):it(ir,ft,Mt,Ut)):Re(ir,ft,Mt))})(G.sources,D.sources,ke,pe);let je=[];G.layers&&G.layers.forEach(Xe=>{"source"in Xe&&pe[Xe.source]?K.push({command:"removeLayer",args:[Xe.id]}):je.push(Xe)}),K=K.concat(ke),function(Xe,ft,Mt){ft=ft||[];let Ut=(Xe=Xe||[]).map(ut),ir=ft.map(ut),Mr=Xe.reduce(Me,{}),zr=ft.reduce(Me,{}),Hr=Ut.slice(),oa=Object.create(null),va,Ga,$a,Kn,bn;for(let Wn=0,ai=0;Wn@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(K,pe,ke,je)=>{let Xe=ke||je;return D[pe]=!Xe||Xe.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(G,D){let K=[];for(let pe in G)pe in D||K.push(pe);return K},e.ac=w,e.ad=function(G,D,K){var pe=Math.sin(K),ke=Math.cos(K),je=D[0],Xe=D[1],ft=D[2],Mt=D[3],Ut=D[4],ir=D[5],Mr=D[6],zr=D[7];return D!==G&&(G[8]=D[8],G[9]=D[9],G[10]=D[10],G[11]=D[11],G[12]=D[12],G[13]=D[13],G[14]=D[14],G[15]=D[15]),G[0]=je*ke+Ut*pe,G[1]=Xe*ke+ir*pe,G[2]=ft*ke+Mr*pe,G[3]=Mt*ke+zr*pe,G[4]=Ut*ke-je*pe,G[5]=ir*ke-Xe*pe,G[6]=Mr*ke-ft*pe,G[7]=zr*ke-Mt*pe,G},e.ae=function(G){var D=new an(16);return D[0]=G[0],D[1]=G[1],D[2]=G[2],D[3]=G[3],D[4]=G[4],D[5]=G[5],D[6]=G[6],D[7]=G[7],D[8]=G[8],D[9]=G[9],D[10]=G[10],D[11]=G[11],D[12]=G[12],D[13]=G[13],D[14]=G[14],D[15]=G[15],D},e.af=hi,e.ag=function(G,D){let K=0,pe=0;if(G.kind==="constant")pe=G.layoutSize;else if(G.kind!=="source"){let{interpolationType:ke,minZoom:je,maxZoom:Xe}=G,ft=ke?w(to.interpolationFactor(ke,D,je,Xe),0,1):0;G.kind==="camera"?pe=Xi.number(G.minSize,G.maxSize,ft):K=ft}return{uSizeT:K,uSize:pe}},e.ai=function(G,{uSize:D,uSizeT:K},{lowerSize:pe,upperSize:ke}){return G.kind==="source"?pe/yd:G.kind==="composite"?Xi.number(pe/yd,ke/yd,K):D},e.aj=z1,e.ak=function(G,D,K,pe){let ke=D.y-G.y,je=D.x-G.x,Xe=pe.y-K.y,ft=pe.x-K.x,Mt=Xe*je-ft*ke;if(Mt===0)return null;let Ut=(ft*(G.y-K.y)-Xe*(G.x-K.x))/Mt;return new n(G.x+Ut*je,G.y+Ut*ke)},e.al=Xx,e.am=yc,e.an=gn,e.ao=function(G){let D=1/0,K=1/0,pe=-1/0,ke=-1/0;for(let je of G)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(G,D){var K=D[0],pe=D[1],ke=D[2],je=D[3],Xe=D[4],ft=D[5],Mt=D[6],Ut=D[7],ir=D[8],Mr=D[9],zr=D[10],Hr=D[11],oa=D[12],va=D[13],Ga=D[14],$a=D[15],Kn=K*ft-pe*Xe,bn=K*Mt-ke*Xe,Wn=K*Ut-je*Xe,ai=pe*Mt-ke*ft,ji=pe*Ut-je*ft,ko=ke*Ut-je*Mt,vs=ir*va-Mr*oa,yo=ir*Ga-zr*oa,Di=ir*$a-Hr*oa,ns=Mr*Ga-zr*va,qo=Mr*$a-Hr*va,Bo=zr*$a-Hr*Ga,_i=Kn*Bo-bn*qo+Wn*ns+ai*Di-ji*yo+ko*vs;return _i?(G[0]=(ft*Bo-Mt*qo+Ut*ns)*(_i=1/_i),G[1]=(ke*qo-pe*Bo-je*ns)*_i,G[2]=(va*ko-Ga*ji+$a*ai)*_i,G[3]=(zr*ji-Mr*ko-Hr*ai)*_i,G[4]=(Mt*Di-Xe*Bo-Ut*yo)*_i,G[5]=(K*Bo-ke*Di+je*yo)*_i,G[6]=(Ga*Wn-oa*ko-$a*bn)*_i,G[7]=(ir*ko-zr*Wn+Hr*bn)*_i,G[8]=(Xe*qo-ft*Di+Ut*vs)*_i,G[9]=(pe*Di-K*qo-je*vs)*_i,G[10]=(oa*ji-va*Wn+$a*Kn)*_i,G[11]=(Mr*Wn-ir*ji-Hr*Kn)*_i,G[12]=(ft*yo-Xe*ns-Mt*vs)*_i,G[13]=(K*ns-pe*yo+ke*vs)*_i,G[14]=(va*bn-oa*ai-Ga*Kn)*_i,G[15]=(ir*ai-Mr*bn+zr*Kn)*_i,G):null},e.at=W1,e.au=S0,e.av=X1,e.aw=function(){let G={},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&&(G[K]=ke)}}return G},e.ax=wi,e.ay=H,e.az=function(G){G=G.slice();let D=Object.create(null);for(let K=0;K25||pe<0||pe>=1||K<0||K>=1)},e.bc=function(G,D){return G[0]=D[0],G[1]=0,G[2]=0,G[3]=0,G[4]=0,G[5]=D[1],G[6]=0,G[7]=0,G[8]=0,G[9]=0,G[10]=D[2],G[11]=0,G[12]=0,G[13]=0,G[14]=0,G[15]=1,G},e.bd=class extends $t{},e.be=j1,e.bf=sA,e.bh=he,e.bi=function(G,D){Q.REGISTERED_PROTOCOLS[G]=D},e.bj=function(G){delete Q.REGISTERED_PROTOCOLS[G]},e.bk=function(G,D){let K={};for(let ke=0;keBo*lu)}let yo=Xe?"center":K.get("text-justify").evaluate(Ut,{},G.canonical),Di=K.get("symbol-placement")==="point"?K.get("text-max-width").evaluate(Ut,{},G.canonical)*lu:1/0,ns=()=>{G.bucket.allowVerticalPlacement&&xo(Wn)&&(oa.vertical=Ag(va,G.glyphMap,G.glyphPositions,G.imagePositions,ir,Di,je,ko,"left",ji,$a,e.ah.vertical,!0,zr,Mr))};if(!Xe&&vs){let qo=new Set;if(yo==="auto")for(let _i=0;_it(void 0,void 0,void 0,function*(){if(G.byteLength===0)return createImageBitmap(new ImageData(1,1));let D=new Blob([new Uint8Array(G)],{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=G=>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(G)],{type:"image/png"});pe.src=G.byteLength?URL.createObjectURL(ke):B}),e.g=ue,e.h=(G,D)=>$(E(G,{type:"json"}),D),e.i=L,e.j=j,e.k=ne,e.l=(G,D)=>$(E(G,{type:"arrayBuffer"}),D),e.m=$,e.n=function(G){return new P1(G).readFields(vk,[])},e.o=Ii,e.p=R1,e.q=Ne,e.r=In,e.s=J,e.t=Dn,e.u=pn,e.v=re,e.w=f,e.x=function([G,D,K]){return D+=90,D*=Math.PI/180,K*=Math.PI/180,{x:G*Math.cos(D)*Math.sin(K),y:G*Math.sin(D)*Math.sin(K),z:G*Math.cos(K)}},e.y=Xi,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 Ee of Be){this._layerConfigs[Ee.id]=Ee;let Ve=this._layers[Ee.id]=e.aA(Ee);Ve._featureFilter=e.a7(Ve.filter),this.keyCache[Ee.id]&&delete this.keyCache[Ee.id]}for(let Ee of Ke)delete this.keyCache[Ee],delete this._layerConfigs[Ee],delete this._layers[Ee];this.familiesBySource={};let Ue=e.bk(Object.values(this._layerConfigs),this.keyCache);for(let Ee of Ue){let Ve=Ee.map(Tt=>this._layers[Tt.id]),Ce=Ve[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(Ve)}}}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:Ee,h:Ve}=e.p(Ue),Ce=new e.o({width:Ee||1,height:Ve||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 i{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,Ee){return e._(this,void 0,void 0,function*(){this.status="parsing",this.data=Be,this.collisionBoxArray=new e.a5;let Ve=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 Qa in at){let za=Be.layers[Qa];if(!za)continue;za.version===1&&e.w(`Vector tile source "${this.source}" layer "${Qa}" does not use vector tile spec v2 and therefore may have some rendering errors.`);let en=Ve.encode(Qa),kn=[];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:en,sourceID:this.source})).populate(kn,Pe,this.tileID.canonical),Ce.bucketLayerIDs.push(Jt.map(Kt=>Kt.id)))}}let yt=e.aF(Pe.glyphDependencies,Qa=>Object.keys(Qa).map(Number));this.inFlightDependencies.forEach(Qa=>Qa?.abort()),this.inFlightDependencies=[];let Tt=Promise.resolve({});if(Object.keys(yt).length){let Qa=new AbortController;this.inFlightDependencies.push(Qa),Tt=Ee.sendAsync({type:"GG",data:{stacks:yt,source:this.source,tileID:this.tileID,type:"glyphs"}},Qa)}let Ot=Object.keys(Pe.iconDependencies),Gt=Promise.resolve({});if(Ot.length){let Qa=new AbortController;this.inFlightDependencies.push(Qa),Gt=Ee.sendAsync({type:"GI",data:{icons:Ot,source:this.source,tileID:this.tileID,type:"icons"}},Qa)}let rr=Object.keys(Pe.patternDependencies),Qt=Promise.resolve({});if(rr.length){let Qa=new AbortController;this.inFlightDependencies.push(Qa),Qt=Ee.sendAsync({type:"GI",data:{icons:rr,source:this.source,tileID:this.tileID,type:"patterns"}},Qa)}let[Tr,la,Ua]=yield Promise.all([Tt,Gt,Qt]),Ba=new r(Tr),Ra=new e.bo(la,Ua);for(let Qa in Te){let za=Te[Qa];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(Qa=>!Qa.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 Ee of bt)Ee.recalculate(Ue,Ke)}class n{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(Ee){let Ve=new Uint8Array(Ue.data),Ce=`Unable to parse the tile at ${Be.request.url}, `;throw Ce+=Ve[0]===31&&Ve[1]===139?"please make sure the data is not gzipped and that you have configured the relevant header in the server":`got error: ${Ee.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),Ee=new i(Be);this.loading[Ke]=Ee;let Ve=new AbortController;Ee.abort=Ve;try{let Ce=yield this.loadVectorTile(Be,Ve);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)))}Ee.vectorTile=Ce.vectorTile;let yt=Ee.parse(Ce.vectorTile,this.layerIndex,this.availableImages,this.actor);this.loaded[Ke]=Ee,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],Ee.status="done",this.loaded[Ke]=Ee,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 Ee=yield Ue.parse(Ue.vectorTile,this.layerIndex,this.availableImages,this.actor),Ve;if(this.fetching[Ke]){let{rawTileData:Ce,cacheControl:Te,resourceTiming:Pe}=this.fetching[Ke];delete this.fetching[Ke],Ve=e.e({rawTileData:Ce.slice(0)},Ee,Te,Pe)}else Ve=Ee;return Ve}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 o{constructor(){this.loaded={}}loadTile(Be){return e._(this,void 0,void 0,function*(){let{uid:Ke,encoding:Ue,rawImageData:Ee,redFactor:Ve,greenFactor:Ce,blueFactor:Te,baseShift:Pe}=Be,at=Ee.width+2,yt=Ee.height+2,Tt=e.b(Ee)?new e.R({width:at,height:yt},yield e.bw(Ee,-1,-1,at,yt)):Ee,Ot=new e.bx(Ke,Tt,Ue,Ve,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 h=e.by(function bt(Be,Ke){var Ue,Ee=Be&&Be.type;if(Ee==="FeatureCollection")for(Ue=0;Ue>31}function L(bt,Be){for(var Ke=bt.loadGeometry(),Ue=bt.type,Ee=0,Ve=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:Ee}=this.options;Ke&&console.time("total time");let Ve=`prepare ${Be.length} points`;Ke&&console.time(Ve),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,Ee=Math.max(-90,Math.min(90,Be[1])),Ve=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,Ve=180;else if(Ue>Ve){let Tt=this.getClusters([Ue,Ee,180,Ce],Ke),Ot=this.getClusters([-180,Ee,Ve,Ce],Ke);return Tt.concat(Ot)}let Te=this.trees[this._limitZoom(Ke)],Pe=Te.range(he(Ue),H(Ce),he(Ve),H(Ee)),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),Ee="No cluster with the specified id.",Ve=this.trees[Ue];if(!Ve)throw new Error(Ee);let Ce=Ve.data;if(Ke*this.stride>=Ce.length)throw new Error(Ee);let Te=this.options.radius/(this.options.extent*Math.pow(2,Ue-1)),Pe=Ve.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(Ee);return at}getLeaves(Be,Ke,Ue){let Ee=[];return this._appendLeaves(Ee,Be,Ke=Ke||10,Ue=Ue||0,0),Ee}getTile(Be,Ke,Ue){let Ee=this.trees[this._limitZoom(Be)],Ve=Math.pow(2,Be),{extent:Ce,radius:Te}=this.options,Pe=Te/Ce,at=(Ue-Pe)/Ve,yt=(Ue+1+Pe)/Ve,Tt={features:[]};return this._addTileFeatures(Ee.range((Ke-Pe)/Ve,at,(Ke+1+Pe)/Ve,yt),Ee.data,Ke,Ue,Ve,Tt),Ke===0&&this._addTileFeatures(Ee.range(1-Pe/Ve,at,1,yt),Ee.data,Ve,Ue,Ve,Tt),Ke===Ve-1&&this._addTileFeatures(Ee.range(0,at,Pe/Ve,yt),Ee.data,-1,Ue,Ve,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,Ee,Ve){let Ce=this.getChildren(Ke);for(let Te of Ce){let Pe=Te.properties;if(Pe&&Pe.cluster?Ve+Pe.point_count<=Ee?Ve+=Pe.point_count:Ve=this._appendLeaves(Be,Pe.cluster_id,Ue,Ee,Ve):Ve1,yt,Tt,Ot;if(at)yt=se(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=H(la)}let Gt={type:1,geometry:[[Math.round(this.options.extent*(Tt*Ve-Ue)),Math.round(this.options.extent*(Ot*Ve-Ee))]],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:Ee,reduce:Ve,minPoints:Ce}=this.options,Te=Ue/(Ee*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,Qa=((Tt/yt|0)<<5)+(Ke+1)+this.points.length;for(let za of rr){let en=za*yt;if(Pe[en+2]<=Ke)continue;Pe[en+2]=Ke;let kn=Pe[en+U];Ua+=Pe[en]*kn,Ba+=Pe[en+1]*kn,Pe[en+4]=Qa,Ve&&(la||(la=this._map(Pe,Tt,!0),Ra=this.clusterProps.length,this.clusterProps.push(la)),Ve(la,this._map(Pe,en)))}Pe[Tt+4]=Qa,at.push(Ua/Tr,Ba/Tr,1/0,Qa,-1,Tr),Ve&&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 Ee=this.points[Be[Ke+N]].properties,Ve=this.options.map(Ee);return Ue&&Ve===Ee?Object.assign({},Ve):Ve}}function ue(bt,Be,Ke){return{type:"Feature",id:bt[Be+N],properties:se(bt,Be,Ke),geometry:{type:"Point",coordinates:[(Ue=bt[Be],360*(Ue-.5)),$(bt[Be+1])]}};var Ue}function se(bt,Be,Ke){let Ue=bt[Be+U],Ee=Ue>=1e4?`${Math.round(Ue/1e3)}k`:Ue>=1e3?Math.round(Ue/100)/10+"k":Ue,Ve=bt[Be+W],Ce=Ve===-1?{}:Object.assign({},Ke[Ve]);return Object.assign(Ce,{cluster:!0,cluster_id:bt[Be+N],point_count:Ue,point_count_abbreviated:Ee})}function he(bt){return bt/360+.5}function H(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 Ee=Ue,Ve=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;OtEe)Ce=Ot,Ee=Gt;else if(Gt===Ee){let rr=Math.abs(Ot-Ve);rrUe&&(Ce-Be>3&&J(bt,Be,Ce,Ue),bt[Ce+2]=Ee,Ke-Ce>3&&J(bt,Ce,Ke,Ue))}function X(bt,Be,Ke,Ue,Ee,Ve){let Ce=Ee-Ke,Te=Ve-Ue;if(Ce!==0||Te!==0){let Pe=((bt-Ke)*Ce+(Be-Ue)*Te)/(Ce*Ce+Te*Te);Pe>1?(Ke=Ee,Ue=Ve):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 Ee={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")ne(Ee,Ke);else if(Be==="Polygon")ne(Ee,Ke[0]);else if(Be==="MultiLineString")for(let Ve of Ke)ne(Ee,Ve);else if(Be==="MultiPolygon")for(let Ve of Ke)ne(Ee,Ve[0]);return Ee}function ne(bt,Be){for(let Ke=0;Ke0&&(Ce+=Ue?(Ee*yt-at*Ve)/2:Math.sqrt(Math.pow(at-Ee,2)+Math.pow(yt-Ve,2))),Ee=at,Ve=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 Ee=0;Ee1?1:Ke}function ze(bt,Be,Ke,Ue,Ee,Ve,Ce,Te){if(Ue/=Be,Ve>=(Ke/=Be)&&Ce=Ue)return null;let Pe=[];for(let at of bt){let yt=at.geometry,Tt=at.type,Ot=Ee===0?at.minX:at.minY,Gt=Ee===0?at.maxX:at.maxY;if(Ot>=Ke&&Gt=Ue)continue;let rr=[];if(Tt==="Point"||Tt==="MultiPoint")Re(yt,rr,Ke,Ue,Ee);else if(Tt==="LineString")We(yt,rr,Ke,Ue,Ee,!1,Te.lineMetrics);else if(Tt==="MultiLineString")ot(yt,rr,Ke,Ue,Ee,!1);else if(Tt==="Polygon")ot(yt,rr,Ke,Ue,Ee,!0);else if(Tt==="MultiPolygon")for(let Qt of yt){let Tr=[];ot(Qt,Tr,Ke,Ue,Ee,!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,Ee){for(let Ve=0;Ve=Ke&&Ce<=Ue&&tt(Be,bt[Ve],bt[Ve+1],bt[Ve+2])}}function We(bt,Be,Ke,Ue,Ee,Ve,Ce){let Te=it(bt),Pe=Ee===0?ut:Me,at,yt,Tt=bt.start;for(let Tr=0;TrKe&&(yt=Pe(Te,la,Ua,Ra,Qa,Ke),Ce&&(Te.start=Tt+at*yt)):za>Ue?en=Ke&&(yt=Pe(Te,la,Ua,Ra,Qa,Ke),kn=!0),en>Ue&&za<=Ue&&(yt=Pe(Te,la,Ua,Ra,Qa,Ue),kn=!0),!Ve&&kn&&(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=Ee===0?Gt:rr;Qt>=Ke&&Qt<=Ue&&tt(Te,Gt,rr,bt[Ot+2]),Ot=Te.length-3,Ve&&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,Ee,Ve){for(let Ce of bt)We(Ce,Be,Ke,Ue,Ee,Ve,!1)}function tt(bt,Be,Ke,Ue){bt.push(Be,Ke,Ue)}function ut(bt,Be,Ke,Ue,Ee,Ve){let Ce=(Ve-Be)/(Ue-Be);return tt(bt,Ve,Ke+(Ee-Ke)*Ce,1),Ce}function Me(bt,Be,Ke,Ue,Ee,Ve){let Ce=(Ve-Ke)/(Ee-Ke);return tt(bt,Be+(Ue-Be)*Ce,Ve,1),Ce}function _e(bt,Be){let Ke=[];for(let Ue=0;Ue0&&Be.size<(Ee?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++;Ee&&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 Ee=function(Ve,Ce){let Te=[];if(Ve.type==="FeatureCollection")for(let Pe=0;Pe1&&console.time("creation"),Gt=this.tiles[Ot]=st(Be,Ke,Ue,Ee,at),this.tileCoords.push({z:Ke,x:Ue,y:Ee}),yt)){yt>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",Ke,Ue,Ee,Gt.numFeatures,Gt.numPoints,Gt.numSimplified),console.timeEnd("creation"));let kn=`z${Ke}`;this.stats[kn]=(this.stats[kn]||0)+1,this.total++}if(Gt.source=Be,Ve==null){if(Ke===at.indexMaxZoom||Gt.numPoints<=at.indexMaxPoints)continue}else{if(Ke===at.maxZoom||Ke===Ve)continue;if(Ve!=null){let kn=Ve-Ke;if(Ue!==Ce>>kn||Ee!==Te>>kn)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,Qa=null,za=ze(Be,Tt,Ue-rr,Ue+Tr,0,Gt.minX,Gt.maxX,at),en=ze(Be,Tt,Ue+Qt,Ue+la,0,Gt.minX,Gt.maxX,at);Be=null,za&&(Ua=ze(za,Tt,Ee-rr,Ee+Tr,1,Gt.minY,Gt.maxY,at),Ba=ze(za,Tt,Ee+Qt,Ee+la,1,Gt.minY,Gt.maxY,at),za=null),en&&(Ra=ze(en,Tt,Ee-rr,Ee+Tr,1,Gt.minY,Gt.maxY,at),Qa=ze(en,Tt,Ee+Qt,Ee+la,1,Gt.minY,Gt.maxY,at),en=null),yt>1&&console.timeEnd("clipping"),Pe.push(Ua||[],Ke+1,2*Ue,2*Ee),Pe.push(Ba||[],Ke+1,2*Ue,2*Ee+1),Pe.push(Ra||[],Ke+1,2*Ue+1,2*Ee),Pe.push(Qa||[],Ke+1,2*Ue+1,2*Ee+1)}}getTile(Be,Ke,Ue){Be=+Be,Ke=+Ke,Ue=+Ue;let Ee=this.options,{extent:Ve,debug:Ce}=Ee;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],Ve):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):(Ee=yield this._pendingData,new qt(Ee,Be.geojsonVtOptions)),this.loaded={};let Ve={};if(Ue){let Ce=Ue.finish();Ce&&(Ve.resourceTiming={},Ve.resourceTiming[Be.source]=JSON.parse(JSON.stringify(Ce)))}return Ve}catch(Ve){if(delete this._pendingRequest,e.bB(Ve))return{abandoned:!0};throw Ve}var Ee})}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(h(Ue,!0),Be.filter){let Ee=e.bC(Be.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(Ee.result==="error")throw new Error(Ee.value.map(Ce=>`${Ce.key}: ${Ce.message}`).join(", "));Ue={type:"FeatureCollection",features:Ue.features.filter(Ce=>Ee.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 Ee=yield e.h(Be.request,Ke);return this._dataUpdateable=xr(Ee.data,Ue)?jr(Ee.data,Ue):void 0,Ee.data}if(typeof Be.data=="string")try{let Ee=JSON.parse(Be.data);return this._dataUpdateable=xr(Ee,Ue)?jr(Ee,Ue):void 0,Ee}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(Ee,Ve,Ce){var Te,Pe,at,yt;if(Ve.removeAll&&Ee.clear(),Ve.remove)for(let Tt of Ve.remove)Ee.delete(Tt);if(Ve.add)for(let Tt of Ve.add){let Ot=Sr(Tt,Ce);Ot!=null&&Ee.set(Ot,Tt)}if(Ve.update)for(let Tt of Ve.update){let Ot=Ee.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),Ee.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 Ee=this.workerSources[Ke][Ue.type][Ue.source];delete this.workerSources[Ke][Ue.type][Ue.source],Ee.removeSource!==void 0&&Ee.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 Ee=this.workerSources[Be][Ue];for(let Ve in Ee)Ee[Ve].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 Ee={pluginStatus:"loaded",pluginURL:Ue};return e.bD.setState(Ee),Ee}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 Ee={sendAsync:(Ve,Ce)=>(Ve.targetMapId=Be,this.actor.sendAsync(Ve,Ce))};switch(Ke){case"vector":this.workerSources[Be][Ke][Ue]=new n(Ee,this._getLayerIndex(Be),this._getAvailableImages(Be));break;case"geojson":this.workerSources[Be][Ke][Ue]=new wr(Ee,this._getLayerIndex(Be),this._getAvailableImages(Be));break;default:this.workerSources[Be][Ke][Ue]=new this.externalWorkerSourceTypes[Ke](Ee,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 o),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 i,a,n={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=>(i||(i=document.createElement("a")),i.href=Ne,i.href),hardwareConcurrency:typeof navigator<"u"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(a==null&&(a=matchMedia("(prefers-reduced-motion: reduce)")),a.matches)}};class o{static testProp(R){if(!o.docStyle)return R[0];for(let ae=0;ae{window.removeEventListener("click",o.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=o.getScale(R);return o.getPoint(R,we,ae)}static touchPos(R,ae){let we=[],Se=o.getScale(R);for(let Oe=0;Oe{c&&T(c),c=null,d=!0},h.onerror=()=>{m=!0,c=null},h.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(lt=dt.data,typeof createImageBitmap=="function"?t.d(lt):t.f(lt)),cacheControl:dt.cacheControl,expires:dt.expires})}catch(dt){delete Bt.abortController,Ar(dt)}finally{ae--,pt()}var lt}),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 g=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 y(Ne){let{userImage:R}=Ne;return!!(R&&R.render&&R.render())&&(Ne.data.replace(new Uint8Array(R.data.buffer)),!0)}class f 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`),y(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:lt,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),lt.fill(0,0,Ar);for(let wt=0;wt0?Er*Er:0,lt[mr]=Er<0?Er*Er:0}}L(dt,0,0,$t,br,$t,this.f,this.v,this.z),L(lt,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 se=Math.floor(n.hardwareConcurrency/2),he,H;function $(){return he||(he=new ue),he}ue.workerCount=t.C(globalThis)?Math.max(Math.min(se,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 H||(H=new J($(),t.G),H.registerMessageHandler("GR",(Ne,R,ae)=>t.m(R,ae))),H}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 ne(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,lt=He.wrappedTileID,dt=sa[lt]=sa[lt]||{};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 n.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 n.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 We=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,We.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,We.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,We.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 ut={},Me=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 ut[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=n.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(Me(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(qt).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(qt).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=n.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=n.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),lt=He||Je||null;lt&&(this._addTile(lt.tileID),At[lt.tileID.key]=lt.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),lt=this.findLoadedSibling(He),dt=Je||lt||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 lt=Je.tileID,dt=Math.pow(2,Oe.zoom-Je.tileID.overscaledZ),Ct=ae*Je.queryPadding*t.X/Je.tileSize/dt,wt=[lt.getTilePoint(new t.Z(br,Ar)),lt.getTilePoint(new t.Z(Yr,sa))];if(wt[0].x-Ct=0&&wt[1].y+Ct>=0){let Dt=At.map(mr=>lt.getTilePoint(mr)),ur=Bt.map(mr=>lt.getTilePoint(mr));Se.push({tile:Je,tileID:lt,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=n.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 qt(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 lt=4*Je,dt=this.boxKeys[Je];if(R<=He[lt+2]&&ae<=He[lt+3]&&we>=He[lt+0]&&Se>=He[lt+1]&&(!Bt||Bt(dt))&&(!br||!xr(Ar,dt.overlapMode))&&(pt.push({key:dt,x1:He[lt],y1:He[lt+1],x2:He[lt+2],y2:He[lt+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 lt=3*Je,dt=this.circleKeys[Je];if(this._circleAndRectCollide(He[lt],He[lt+1],He[lt+2],R,ae,we,Se)&&(!Bt||Bt(dt))&&(!br||!xr(Ar,dt.overlapMode))){let Ct=He[lt],wt=He[lt+1],Dt=He[lt+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 lt=4*Je,dt=this.boxKeys[Je];if(this._circleAndRectCollide($t.x,$t.y,$t.radius,He[lt+0],He[lt+1],He[lt+2],He[lt+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 lt=3*Je,dt=this.circleKeys[Je];if(this._circlesCollide(He[lt],He[lt+1],He[lt+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,lt=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,lt=R.lineStartIndex,dt=R.lineStartIndex+R.lineLength,Ct=Ee(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=Ve(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,lt,0,Oe,Ne),ur=Ve(R.writingMode,lt,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,lt=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=lt,Je=He;let Qr={absOffsetX:Dt,direction:br,distanceFromAnchor:Ct,previousVertex:dt};if(lt=Pe(sa,At,Qr),ae===0)ur.push(dt),mr=lt.sub(dt);else{let ga,Sa=lt.sub(dt);ga=Sa.mag()===0?yt(Pe(sa+br,At,Qr).sub(lt),ae,br):yt(Sa,ae,br),Je||(Je=dt.add(ga)),He=Tt(sa,ga,lt,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(lt.y-dt.y,lt.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;Bi--)oi.push(Xn.path[Bi]);for(let Bi=1;BiAo.signedDistanceFromCamera<=0)?[]:Bi.map(Ao=>Ao.point)}let Wi=[];if(oi.length>0){let Bi=oi[0].clone(),Ao=oi[0].clone();for(let ss=1;ss=Sa.x&&Ao.x<=Oa.x&&Bi.y>=Sa.y&&Ao.y<=Oa.y?[oi]:Ao.xOa.x||Ao.yOa.y?[]:t.al([oi],Sa.x,Sa.y,Oa.x,Oa.y)}for(let Bi of Wi){vn.reset(Bi,.25*ga);let Ao=0;Ao=vn.length<=.5*ga?1:Math.ceil(vn.paddedLength/Ti)+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 Qa{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 en{constructor(R,ae,we,Se,Oe){this.bucketInstanceId=R,this.featureIndex=ae,this.sourceLayerIndex=we,this.bucketIndex=Se,this.tileID=Oe}}class kn{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 kn(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",lt=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,lt),Dt=null;if(He){let mr=Ir(sa,He,Je,this.transform,lt);Dt=t.L([],this.transform.labelPlaneMatrix,mr)}this.retainedQueryData[Oe.bucketInstanceId]=new en(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,lt,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,lt,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:lt}=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 vn=this._getTerrainElevationFunc(this.retainedQueryData[Se.bucketInstanceId].tileID),Xn=(Hn,oi,Ti)=>{var Wi,Bi;if(ae[Hn.crossTileID])return;if(sa)return void(this.placements[Hn.crossTileID]=new Qa(!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;oi.textFeatureIndex?Pl=oi.textFeatureIndex:Hn.useRuntimeCollisionCircles&&(Pl=Hn.featureIndex),oi.verticalTextFeatureIndex&&($l=oi.verticalTextFeatureIndex);let hu=oi.textBox;if(hu){let Vl=et=>{let vt=t.ah.horizontal;if(Se.allowVerticalPlacement&&!et&&this.prevPlacement){let _t=this.prevPlacement.placedOrientations[Hn.crossTileID];_t&&(this.placedOrientations[Hn.crossTileID]=_t,vt=_t,this.markUsedOrientation(Se,vt,Hn))}return vt},ql=(et,vt)=>{if(Se.allowVerticalPlacement&&Hn.numVerticalGlyphVertices>0&&oi.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=Hn.textAnchorOffsetStartIndex,De=Hn.textAnchorOffsetEndIndex;if(De===de){let et=(vt,_t)=>{let St=this.collisionIndex.placeCollisionBox(vt,wt,Yr,Bt,$t,Br,Er,pt,lt.predicate,vn);return St&&St.placeable&&(this.markUsedOrientation(Se,_t,Hn),this.placedOrientations[Hn.crossTileID]=_t),St};ql(()=>et(hu,t.ah.horizontal),()=>{let vt=oi.verticalTextBox;return Se.allowVerticalPlacement&&Hn.numVerticalGlyphVertices>0&&vt?et(vt,t.ah.vertical):{box:null,offscreen:null}}),Vl(hs&&hs.placeable)}else{let et=t.aq[(Bi=(Wi=this.prevPlacement)===null||Wi===void 0?void 0:Wi.variableOffsets[Hn.crossTileID])===null||Bi===void 0?void 0:Bi.anchor],vt=(St,ar,zt)=>{let gr=St.x2-St.x1,qr=St.y2-St.y1,Wr=Hn.textBoxScale,Ta=Qr&&ur==="never"?ar:null,ya=null,tn=wt==="never"?1:2,on="never";et&&tn++;for(let Ma=0;Mavt(hu,oi.iconBox,t.ah.horizontal),()=>{let St=oi.verticalTextBox;return Se.allowVerticalPlacement&&(!hs||!hs.placeable)&&Hn.numVerticalGlyphVertices>0&&St?vt(St,oi.verticalIconBox,t.ah.vertical):{box:null,occluded:!0,offscreen:null}}),hs&&(Ao=hs.placeable,So=hs.offscreen);let _t=Vl(hs&&hs.placeable);if(!Ao&&this.prevPlacement){let St=this.prevPlacement.variableOffsets[Hn.crossTileID];St&&(this.variableOffsets[Hn.crossTileID]=St,this.markUsedJustification(Se,St.anchor,Hn,_t))}}}if(Js=hs,Ao=Js&&Js.placeable,So=Js&&Js.offscreen,Hn.useRuntimeCollisionCircles){let Vl=Se.text.placedSymbolArray.get(Hn.centerJustifiedTextSymbolIndex),ql=t.ai(Se.textSizeData,Je,Vl),de=Oe.get("text-padding");es=this.collisionIndex.placeCollisionCircles(wt,Vl,Se.lineVertexArray,Se.glyphOffsetArray,ql,Bt,$t,br,Ar,we,Br,lt.predicate,Hn.collisionCircleDiameter,de,pt,vn),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(oi.iconFeatureIndex&&(Ru=oi.iconFeatureIndex),oi.iconBox){let Vl=ql=>this.collisionIndex.placeCollisionBox(ql,ur,Yr,Bt,$t,Br,Er,At,lt.predicate,vn,Qr&&Ko?Ko:void 0);ll&&ll.placeable&&oi.verticalIconBox?(ts=Vl(oi.verticalIconBox),ss=ts.placeable):(ts=Vl(oi.iconBox),ss=ts.placeable),So=So&&ts.offscreen}let wl=dt||Hn.numHorizontalGlyphVertices===0&&Hn.numVerticalGlyphVertices===0,su=Ct||Hn.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,lt.ID),uc&&this.collisionIndex.insertCollisionBox(ts.box,ur,Oe.get("icon-ignore-placement"),Se.bucketInstanceId,Ru,lt.ID),es&&Ao&&this.collisionIndex.insertCollisionCircles(es.circles,wt,Oe.get("text-ignore-placement"),Se.bucketInstanceId,Pl,lt.ID),we&&this.storeCollisionData(Se.bucketInstanceId,Ti,oi,Js,ts,es),Hn.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[Hn.crossTileID]=new Qa(Ao||Sa,ss||Oa,So||Se.justReloaded),ae[Hn.crossTileID]=!0};if(ga){if(R.symbolInstanceStart!==0)throw new Error("bucket.bucketInstanceId should be 0");let Hn=Se.getSortedSymbolIndexes(this.transform.angle);for(let oi=Hn.length-1;oi>=0;--oi){let Ti=Hn[oi];Xn(Se.symbolInstances.get(Ti),Se.collisionArrays[Ti],Ti)}}else for(let Hn=R.symbolInstanceStart;Hn=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=rn(mr.text);Je(R.text,wt,Qr?nn:Oa),Je(R.text,Dt,ga?nn:Oa);let vn=mr.text.isHidden();[Ct.rightJustifiedTextSymbolIndex,Ct.centerJustifiedTextSymbolIndex,Ct.leftJustifiedTextSymbolIndex].forEach(oi=>{oi>=0&&(R.text.placedSymbolArray.get(oi).hidden=vn||Qr?1:0)}),Ct.verticalPlacedTextSymbolIndex>=0&&(R.text.placedSymbolArray.get(Ct.verticalPlacedTextSymbolIndex).hidden=vn||ga?1:0);let Xn=this.variableOffsets[Ct.crossTileID];Xn&&this.markUsedJustification(R,Xn.anchor,Ct,Br);let Hn=this.placedOrientations[Ct.crossTileID];Hn&&(this.markUsedJustification(R,"left",Ct,Hn),this.markUsedOrientation(R,Hn,Ct))}if(Er){let Oa=rn(mr.icon),vn=!(sa&&Ct.verticalPlacedIconSymbolIndex&&Qr);Ct.placedIconSymbolIndex>=0&&(Je(R.icon,Ct.numIconVertices,vn?Oa:nn),R.icon.placedSymbolArray.get(Ct.placedIconSymbolIndex).hidden=mr.icon.isHidden()),Ct.verticalPlacedIconSymbolIndex>=0&&(Je(R.icon,Ct.numVerticalIconVertices,vn?nn:Oa),R.icon.placedSymbolArray.get(Ct.verticalPlacedIconSymbolIndex).hidden=mr.icon.isHidden())}let Sa=lt&<.has(dt)?lt.get(dt):{text:null,icon:null};if(R.hasIconCollisionBoxData()||R.hasTextCollisionBoxData()){let Oa=R.collisionArrays[dt];if(Oa){let vn=new t.P(0,0);if(Oa.textBox||Oa.verticalTextBox){let Xn=!0;if(br){let Hn=this.variableOffsets[ur];Hn?(vn=Jt(Hn.anchor,Hn.width,Hn.height,Hn.textOffset,Hn.textBoxScale),Ar&&vn._rotate(Yr?this.transform.angle:-this.transform.angle)):Xn=!1}if(Oa.textBox||Oa.verticalTextBox){let Hn;Oa.textBox&&(Hn=Qr),Oa.verticalTextBox&&(Hn=ga),Kt(R.textCollisionBox.collisionVertexArray,mr.text.placed,!Xn||Hn,Sa.text,vn.x,vn.y)}}if(Oa.iconBox||Oa.verticalIconBox){let Xn=!!(!ga&&Oa.verticalIconBox),Hn;Oa.iconBox&&(Hn=Xn),Oa.verticalIconBox&&(Hn=!Xn),Kt(R.iconCollisionBox.collisionVertexArray,mr.icon.placed,Hn,Sa.icon,sa?vn.x:0,sa?vn.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 rn(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 nn=0;function yn(){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&&n.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 f,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,n.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 lt=pt.transformRequest(p(He,br,".png"),"SpriteImage");Yr[sa]=l.getImage(lt,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 lt in sa){Je[lt]={};let dt=n.getImageCanvasContext((yield He[lt]).data),Ct=(yield sa[lt]).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:vn,textFitHeight:Xn}=Ct[wt];Je[lt][wt]={data:null,pixelRatio:Qr,sdf:Br,stretchX:ga,stretchY:Sa,content:Oa,textFitWidth:vn,textFitHeight:Xn,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(n.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(n.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(n.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 na(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,lt,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,lt,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}),Zn=(Ne,R,ae,we)=>t.e(Da(Ne),Fa(ae,R,we)),Pn=(Ne,R)=>({u_matrix:Ne,u_world:R}),fi=(Ne,R,ae,we,Se)=>t.e(Zn(Ne,R,ae,we),{u_world:Se}),Ai=(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}},ki=(Ne,R,ae)=>({u_matrix:Ne,u_inv_matrix:R,u_camera_to_center_distance:ae.cameraToCenterDistance,u_viewport_size:[ae.width,ae.height]}),zi=(Ne,R,ae=1)=>({u_matrix:Ne,u_color:R,u_overlay:0,u_overlay_scale:ae}),Xi=Ne=>({u_matrix:Ne}),to=(Ne,R,ae,we)=>({u_matrix:Ne,u_extrude_scale:Ua(R,1,ae),u_intensity:we}),go=(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 pi(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:qi(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:qi(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 qi(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:Vo(Se.paint.get("raster-hue-rotate"))};var Oe,pt};function Vo(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,lt=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:[lt>>16,dt>>16],u_pixel_coord_lower:[65535<,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 jn={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class Ci{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(),Qi.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:Ti,angle:Wi})}else rr(wt.numGlyphs,Je)}if($t){lt.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(vn,Sa.posMatrix,Ne,Se,$l,hu,dt,$t,ar,Je,Sa.toUnwrapped(),He.width,He.height,wl,St)}let Vl=Sa.posMatrix,ql=Se&&Br||uc,de=Ct||ql?Ul:$l,De=Ru,et=oi&&ae.paint.get(Se?"text-halo-width":"icon-halo-width").constantOr(1)!==0,vt;vt=oi?vn.iconsInText?Co(Ti.kind,Ao,wt,dt,Ct,ql,Ne,Vl,de,De,wl,So,Js,ga):lo(Ti.kind,Ao,wt,dt,Ct,ql,Ne,Vl,de,De,wl,Se,So,!0,ga):Oo(Ti.kind,Ao,wt,dt,Ct,ql,Ne,Vl,de,De,wl,Se,So,ga);let _t={program:Bi,buffers:Xn,uniformValues:vt,atlasTexture:Ko,atlasTextureIcon:es,atlasInterpolation:hs,atlasInterpolationIcon:ll,isSDF:oi,hasHalo:et};if(ur&&vn.canOverlap){mr=!0;let St=Xn.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:Xn.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 vn=Oa.uniformValues;Oa.hasHalo&&(vn.u_is_halo=1,zf(Oa.buffers,Sa.segments,ae,Ne,Oa.program,Er,br,Ar,vn,Sa.terrainData)),vn.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,Qi.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,Qi.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(),Qi.disabled,go(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,lt;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,lt=Dt.segments2;let ga=[At.drawingBufferWidth,At.drawingBufferHeight];He=sa==="fillOutlinePattern"&&br?fi(Qr,Ne,Ar,wt,ga):Pn(Qr,ga)}else Je=Dt.indexBuffer,lt=Dt.segments,He=br?Zn(Qr,Ne,Ar,wt):Da(Qr);mr.draw(Ne.context,Yr,Se,Ne.stencilModeForClipping(Ct),Oe,Qi.disabled,He,Er,ae.id,Dt.layoutVertexBuffer,Je,lt,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 lt=R.getTile(Je),dt=lt.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),lt.imageAtlasTexture.bind(Bt.LINEAR,Bt.CLAMP_TO_EDGE),wt.updatePaintBuffers(Yr)),Gu(wt,$t,He,lt,ae);let ur=Ne.translatePosMatrix(Je.posMatrix,lt,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,lt):Ya(ur,Ne,mr,sa);Dt.draw(At,At.gl.TRIANGLES,Se,Oe,pt,Qi.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,Qi.disabled,((Yr,sa,He,Je)=>{let lt=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:pi(0,sa.tileID),u_light:[He.paint.get("hillshade-exaggeration"),wt],u_shadow:lt,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,Qi.disabled,((sa,He)=>{let Je=He.stride,lt=t.H();return t.aP(lt,0,t.X,-t.X,0,0,1),t.J(lt,lt,[0,-t.X,0]),{u_matrix:lt,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=n.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,lt=ae.canonical.toString();ae.overscaledZ!==ae.canonical.z&&(lt+=` => ${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,`${lt} ${sa}kB`),pt.draw(we,Se.TRIANGLES,At,Bt,cl.alphaBlended,Qi.disabled,zi(Oe,t.aM.transparent,Je),null,br,Ne.debugBuffer,Ne.quadTriangleIndexBuffer,Ne.debugSegments),pt.draw(we,Se.LINE_STRIP,At,Bt,$t,Qi.disabled,zi(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,Qi.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,We.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,Qi.disabled,Xi(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,Qi.disabled,Xi(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(),lt=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))}lt.draw(br,Ar.TRIANGLES,sa,He,Je,Qi.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.currentLayerlt.source&&!lt.isHidden(br)?[$t.sourceCaches[lt.source]]:[]),sa=Yr.filter(lt=>lt.getSource().type==="vector"),He=Yr.filter(lt=>lt.getSource().type!=="vector"),Je=lt=>{(!Ar||Ar.getSource().maxzoomJe(lt)),Ar||He.forEach(lt=>Je(lt)),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),lt={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,Qi.backCCW,lt,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 lt=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,Qi.backCCW,dt,lt,"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,lt,dt,Ct,wt,Dt){let ur=sa.transform,mr=yn(),Er=lt==="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),vn=Ua(ga,1,sa.transform.zoom),Xn=wr(Qr.posMatrix,Br,Er,sa.transform,vn),Hn=He.layout.get("icon-text-fit")!=="none"&&Sa.hasIconData();if(Oa){let oi=Math.pow(2,ur.zoom-ga.tileID.overscaledZ),Ti=sa.style.map.terrain?(Bi,Ao)=>sa.style.map.terrain.getElevation(Qr,Bi,Ao):null,Wi=mr.translatePosition(ur,ga,Ct,wt);rf(Sa,Er,Br,Dt,ur,Xn,Qr.posMatrix,oi,Oa,Hn,mr,Wi,Qr.toUnwrapped(),Ti)}}}(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&&(qu(Oe,pt,At,Bt,!0),qu(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),lt=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,lt,dt,Qi.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,lt=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,vn=Oa?Oa.posMatrix:Oe.transform.calculatePosMatrix(Ct.toUnwrapped(),dt),Xn=To(vn,Qr||[0,0],Br||1,Er,At);Ar instanceof it?Yr.draw($t,br.TRIANGLES,wt,Ss.disabled,sa,Qi.disabled,Xn,Sa,At.id,Ar.boundsBuffer,Oe.quadTriangleIndexBuffer,Ar.boundsSegments):Yr.draw($t,br.TRIANGLES,wt,He[Ct.overscaledZ],sa,Qi.disabled,Xn,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 lt=!Je&&$t.a===1&&br===1&&Oe.opaquePassEnabledForLayer()?"opaque":"translucent";if(Oe.renderPass!==lt)return;let dt=Ss.disabled,Ct=Oe.depthModeForSublayer(0,lt==="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,Qi.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 il{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],lt=sa[2],dt=He*He+Je*Je+lt*lt;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],lt=sa[1],dt=sa[2],Ct=He[0],wt=He[1],Dt=He[2];return Yr[0]=lt*Dt-dt*wt,Yr[1]=dt*Ct-Je*Dt,Yr[2]=Je*wt-lt*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 il(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=il.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=[],lt=[],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),Xn=wt.zoom+1,Hn=wt.aabb.quadrant(Sa);if(R.terrain){let oi=new t.S(Xn,wt.wrap,Xn,Oa,vn),Ti=R.terrain.getMinMaxElevation(oi),Wi=(ae=Ti.minElevation)!==null&&ae!==void 0?ae:this.elevation,Bi=(we=Ti.maxElevation)!==null&&we!==void 0?we:this.elevation;Hn=new dc([Hn.min[0],Hn.min[1],Wi],[Hn.max[0],Hn.max[1],Bi])}Je.push({aabb:Hn,zoom:Xn,x:Oa,y:vn,wrap:wt.wrap,fullyVisible:mr})}}return lt.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&&(lt=$t-ur)}if(lt!==void 0||dt!==void 0){let wt=new t.P(lt??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 lt=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*lt+wt*dt,ur=we-Math.round(we)+Ct*dt+wt*lt,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:n.now(),settings:R})}_drainInertiaBuffer(){let R=this._inertiaBuffer,ae=n.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&&(o.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&&(o.remove(this._box),this._box=null),o.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=>o.mouseButton(Se)===0&&Se.ctrlKey||o.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=>o.mouseButton(Se)===0&&Se.ctrlKey||o.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:ia,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 ia(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=n.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=o.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=n.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=(n.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:n.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 pn{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 In{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 Yn{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 ri{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 di{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 Dn{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 On{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=o.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&&(o.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 qn=Ne=>Ne.zoom||Ne.drag||Ne.pitch||Ne.rotate;class xn extends t.k{}function Mi(Ne){return Ne.panDelta&&Ne.panDelta.mag()||Ne.zoomDelta||Ne.bearingDelta||Ne.pitchDelta}class Ki{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?o.touchPos(this._map.getCanvas(),Ar):o.mousePos(this._map.getCanvas(),Se);for(let{handlerName:Je,handler:lt,allowed:dt}of this._handlers){if(!lt.isEnabled())continue;let Ct;this._blockedByActive($t,dt,Je)?lt.reset():lt[Oe||Se.type]&&(Ct=lt[Oe||Se.type](Se,Yr,Ar),this.mergeHandlerResult(At,Bt,Ct,Je,pt),Ct&&Ct.needsRenderFrame&&this._triggerRenderFrame()),(Ct||lt.isActive())&&($t[Je]=lt)}let sa={};for(let Je in this._previousActiveHandlers)$t[Je]||(sa[Je]=pt);this._previousActiveHandlers=$t,(Object.keys(sa).length||Mi(At))&&(this._changes.push([At,Bt,sa]),this._triggerRenderFrame()),(Object.keys($t).length||Mi(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)o.addEventListener(Se,Oe,Se===document?this.handleWindowEvent:this.handleEvent,pt)}destroy(){for(let[R,ae,we]of this._listeners)o.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 On(ae,R.cooperativeGestures);this._add("cooperativeGestures",Oe),R.cooperativeGestures&&Oe.enable();let pt=new Mc(ae),At=new In(ae);ae.doubleClickZoom=new pn(At,pt),this._add("tapZoom",pt),this._add("clickZoom",At),R.interactive&&R.doubleClickZoom&&ae.doubleClickZoom.enable();let Bt=new Yn;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 di(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=>o.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 ri(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 Dn(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 lt=ae.scrollZoom=new La(ae,()=>this._triggerRenderFrame());this._add("scrollZoom",lt,["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!!qn(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(!(Mi(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=qn(this._eventsInProgress),Oe=qn(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=qn(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 xn("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((n.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,lt,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=lt>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&&n.prefersReducedMotion){let oi=t.M(R,["center","zoom","bearing","pitch","around"]);return this.jumpTo(oi,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:lt}=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(lt-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 oi=t.ac(Math.min(R.minZoom,Oe,lt),Se.minZoom,Se.maxZoom),Ti=ur/Se.zoomScale(oi-Oe);Dt=Math.sqrt(Ti/Er*2)}let Br=Dt*Dt;function Qr(oi){let Ti=(mr*mr-ur*ur+(oi?-1:1)*Br*Br*Er*Er)/(2*(oi?mr:ur)*Br*Er);return Math.log(Math.sqrt(Ti*Ti+1)-Ti)}function ga(oi){return(Math.exp(oi)-Math.exp(-oi))/2}function Sa(oi){return(Math.exp(oi)+Math.exp(-oi))/2}let Oa=Qr(!1),vn=function(oi){return Sa(Oa)/Sa(Oa+Dt*oi)},Xn=function(oi){return ur*((Sa(Oa)*(ga(Ti=Oa+Dt*oi)/Sa(Ti))-ga(Oa))/Br)/Er;var Ti},Hn=(Qr(!0)-Oa)/Dt;if(Math.abs(Er)<1e-6||!isFinite(Hn)){if(Math.abs(ur-mr)<1e-6)return this.easeTo(R,ae);let oi=mr0,vn=Ti=>Math.exp(oi*Dt*Ti)}return R.duration="duration"in R?+R.duration:1e3*Hn/("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(oi=>{let Ti=oi*Hn,Wi=1/vn(Ti);Se.zoom=oi===1?lt:Oe+Se.scaleZoom(Wi),this._rotating&&(Se.bearing=t.y.number(pt,$t,oi)),this._pitching&&(Se.pitch=t.y.number(At,br,oi)),this._padding&&(Se.interpolatePadding(Bt,Ar,oi),sa=Se.centerPoint.add(Yr)),this.terrain&&!R.freezeElevation&&this._updateElevation(oi);let Bi=oi===1?Je:Se.unproject(Ct.add(wt.mult(Xn(Ti))).mult(Wi));Se.setLocationAtPoint(Se.renderWorldCopies?Bi.wrap():Bi,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=n.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 Ji={compact:!0,customAttribution:'MapLibre'};class co{constructor(R=Ji){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=o.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=o.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=o.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(){o.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 wi{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=o.create("div","maplibregl-ctrl");let ae=o.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(){o.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}}class ui{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 xo=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},Ui={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()}),o.mousePos(this.element,pt)),o.addEventListener(window,"mousemove",this.mousemove),o.addEventListener(window,"mouseup",this.mouseup)},this.mousemove=pt=>{this.moveMouse(pt,o.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=o.touchPos(this.element,pt.targetTouches)[0],this.startTouch(pt,this._startPos),o.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),o.addEventListener(window,"touchend",this.touchend))},this.touchmove=pt=>{pt.targetTouches.length!==1?this.reset():(this._lastPos=o.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})),o.addEventListener(ae,"mousedown",this.mousedown),o.addEventListener(ae,"touchstart",this.touchstart,{passive:!1}),o.addEventListener(ae,"touchcancel",this.reset)}startMouse(R,ae){this.mouseRotate.dragStart(R,ae),this.mousePitch&&this.mousePitch.dragStart(R,ae),o.disableDrag()}startTouch(R,ae){this.touchRotate.dragStart(R,ae),this.touchPitch&&this.touchPitch.dragStart(R,ae),o.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;o.removeEventListener(R,"mousedown",this.mousedown),o.removeEventListener(R,"touchstart",this.touchstart,{passive:!1}),o.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),o.removeEventListener(window,"touchend",this.touchend),o.removeEventListener(R,"touchcancel",this.reset),this.offTemp()}offTemp(){o.enableDrag(),o.removeEventListener(window,"mousemove",this.mousemove),o.removeEventListener(window,"mouseup",this.mouseup),o.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),o.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()),o.setTransform(this._element,`${ou[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${pt} ${Oe}`),n.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=o.create("div");let ae=o.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=o.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=o.createNS("http://www.w3.org/2000/svg","g");pt.setAttributeNS(null,"fill-rule","nonzero");let At=o.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=o.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=o.createNS("http://www.w3.org/2000/svg","g");$t.setAttributeNS(null,"fill",this._color);let br=o.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=o.createNS("http://www.w3.org/2000/svg","g");Ar.setAttributeNS(null,"opacity","0.25"),Ar.setAttributeNS(null,"fill","#000000");let Yr=o.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=o.createNS("http://www.w3.org/2000/svg","g");sa.setAttributeNS(null,"transform","translate(6.0, 7.0)"),sa.setAttributeNS(null,"fill","#FFFFFF");let He=o.createNS("http://www.w3.org/2000/svg","g");He.setAttributeNS(null,"transform","translate(8.0, 8.0)");let Je=o.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 lt=o.createNS("http://www.w3.org/2000/svg","circle");lt.setAttributeNS(null,"fill","#FFFFFF"),lt.setAttributeNS(null,"cx","5.5"),lt.setAttributeNS(null,"cy","5.5"),lt.setAttributeNS(null,"r","5.4999962"),He.appendChild(Je),He.appendChild(lt),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),o.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=On,e.DoubleClickZoomHandler=pn,e.DragPanHandler=ri,e.DragRotateHandler=di,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=o.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){o.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){let Ne=this._fullscreenButton=o.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);o.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=o.create("button","maplibregl-ctrl-geolocate",this._container),o.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=o.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new Zu({element:this._dotElement}),this._circleElement=o.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=o.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(),o.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=wi,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 ui,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 Ki(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 wi,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}=n.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)?n.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=o.create("div","maplibregl-canvas-container",Ne);this._interactive&&R.classList.add("maplibregl-interactive"),this._canvas=o.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=o.create("div","maplibregl-control-container",Ne),Oe=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(pt=>{Oe[pt]=o.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=n.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),o.remove(this._canvasContainer),o.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,n.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({},Ui,Ne),this._container=o.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})),o.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})),o.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=o.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(){o.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=o.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&&o.remove(this._content),this._container&&(o.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=o.create("div","maplibregl-popup",this._map.getContainer()),this._tip=o.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()),o.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=o.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=o.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=o.create("div","maplibregl-ctrl maplibregl-ctrl-scale",Ne.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){o.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=o.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=o.create("button","maplibregl-ctrl-terrain",this._container),o.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(){o.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},e.TwoFingersTouchPitchHandler=kc,e.TwoFingersTouchRotateHandler=Yc,e.TwoFingersTouchZoomHandler=gu,e.TwoFingersTouchZoomRotateHandler=Dn,e.VectorTileSource=be,e.VideoSource=ot,e.addSourceType=(Ne,R)=>t._(void 0,void 0,void 0,function*(){if(Me(Ne))throw new Error(`A source type called "${Ne}" already exists.`);((ae,we)=>{ut[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=v;return M})}}),Vq=Ze({"src/plots/map/layers.js"(Z,q){"use strict";var v=ca(),x=fu().sanitizeHTML,A=RC(),M=_g();function e(n,o){this.subplot=n,this.uid=n.uid+"-"+o,this.index=o,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(o){this.visible?this.needsNewImage(o)?this.updateImage(o):this.needsNewSource(o)?(this.removeLayer(),this.updateSource(o),this.updateLayer(o)):this.needsNewLayer(o)?this.updateLayer(o):this.updateStyle(o):(this.updateSource(o),this.updateLayer(o)),this.visible=r(o)},t.needsNewImage=function(n){var o=this.subplot.map;return o.getSource(this.idSource)&&this.sourceType==="image"&&n.sourcetype==="image"&&(this.source!==n.source||JSON.stringify(this.coordinates)!==JSON.stringify(n.coordinates))},t.needsNewSource=function(n){return this.sourceType!==n.sourcetype||JSON.stringify(this.source)!==JSON.stringify(n.source)||this.layerType!==n.type},t.needsNewLayer=function(n){return this.layerType!==n.type||this.below!==this.subplot.belowLookup["layout-"+this.index]},t.lookupBelow=function(){return this.subplot.belowLookup["layout-"+this.index]},t.updateImage=function(n){var o=this.subplot.map;o.getSource(this.idSource).updateImage({url:n.source,coordinates:n.coordinates});var s=this.findFollowingMapLayerId(this.lookupBelow());s!==null&&this.subplot.map.moveLayer(this.idLayer,s)},t.updateSource=function(n){var o=this.subplot.map;if(o.getSource(this.idSource)&&o.removeSource(this.idSource),this.sourceType=n.sourcetype,this.source=n.source,!!r(n)){var s=a(n);o.addSource(this.idSource,s)}},t.findFollowingMapLayerId=function(n){if(n==="traces")for(var o=this.subplot.getMapLayers(),s=0;s0){for(var s=0;s0}function i(n){var o={},s={};switch(n.type){case"circle":v.extendFlat(s,{"circle-radius":n.circle.radius,"circle-color":n.color,"circle-opacity":n.opacity});break;case"line":v.extendFlat(s,{"line-width":n.line.width,"line-color":n.color,"line-opacity":n.opacity,"line-dasharray":n.line.dash});break;case"fill":v.extendFlat(s,{"fill-color":n.color,"fill-outline-color":n.fill.outlinecolor,"fill-opacity":n.opacity});break;case"symbol":var c=n.symbol,h=A(c.textposition,c.iconsize);v.extendFlat(o,{"icon-image":c.icon+"-15","icon-size":c.iconsize/10,"text-field":c.text,"text-size":c.textfont.size,"text-anchor":h.anchor,"text-offset":h.offset,"symbol-placement":c.placement}),v.extendFlat(s,{"icon-color":n.color,"text-color":c.textfont.color,"text-opacity":n.opacity});break;case"raster":v.extendFlat(s,{"raster-fade-duration":0,"raster-opacity":n.opacity});break}return{layout:o,paint:s}}function a(n){var o=n.sourcetype,s=n.source,c={type:o},h;return o==="geojson"?h="data":o==="vector"?h=typeof s=="string"?"url":"tiles":o==="raster"?(h="tiles",c.tileSize=256):o==="image"&&(h="url",c.coordinates=n.coordinates),c[h]=s,n.sourceattribution&&(c.attribution=x(n.sourceattribution)),c}q.exports=function(o,s,c){var h=new e(o,s);return h.update(c),h}}}),qq=Ze({"src/plots/map/map.js"(Z,q){"use strict";var v=jq(),x=ca(),A=vg(),M=oo(),e=Wo(),t=bp(),r=ef(),i=Jd(),a=i.drawMode,n=i.selectMode,o=Tf().prepSelect,s=Tf().clearOutline,c=Tf().clearSelectionsCache,h=Tf().selectOnClick,m=_g(),d=Vq();function T(g,b){this.id=b,this.gd=g;var p=g._fullLayout,u=g._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(g,b,p){var u=this,y;u.map?y=new Promise(function(f,P){u.updateMap(g,b,f,P)}):y=new Promise(function(f,P){u.createMap(g,b,f,P)}),p.push(y)},l.createMap=function(g,b,p,u){var y=this,f=b[y.id],P=y.styleObj=w(f.style),L=f.bounds,z=L?[[L.west,L.south],[L.east,L.north]]:null,F=y.map=new v.Map({container:y.div,style:P.style,center:E(f.center),zoom:f.zoom,bearing:f.bearing,pitch:f.pitch,maxBounds:z,interactive:!y.isStatic,preserveDrawingBuffer:y.isStatic,doubleClickZoom:!1,boxZoom:!1,attributionControl:!1}).addControl(new v.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",y.rejectOnError(u),y.isStatic||y.initFx(g,b);var O=[];O.push(new Promise(function(I){F.once("load",I)})),O=O.concat(A.fetchTraceGeoData(g)),Promise.all(O).then(function(){y.fillBelowLookup(g,b),y.updateData(g),y.updateLayout(b),y.resolveOnRender(p)}).catch(u)},l.updateMap=function(g,b,p,u){var y=this,f=y.map,P=b[this.id];y.rejectOnError(u);var L=[],z=w(P.style);JSON.stringify(y.styleObj)!==JSON.stringify(z)&&(y.styleObj=z,f.setStyle(z.style),y.traceHash={},L.push(new Promise(function(F){f.once("styledata",F)}))),L=L.concat(A.fetchTraceGeoData(g)),Promise.all(L).then(function(){y.fillBelowLookup(g,b),y.updateData(g),y.updateLayout(b),y.resolveOnRender(p)}).catch(u)},l.fillBelowLookup=function(g,b){var p=b[this.id],u=p.layers,y,f,P=this.belowLookup={},L=!1;for(y=0;y1)for(y=0;y-1&&h(z.originalEvent,u,[p.xaxis],[p.yaxis],p.id,L),F.indexOf("event")>-1&&r.click(u,z.originalEvent)}}},l.updateFx=function(g){var b=this,p=b.map,u=b.gd;if(b.isStatic)return;function y(z){var F=b.map.unproject(z);return[F.lng,F.lat]}var f=g.dragmode,P;P=function(z,F){if(F.isRect){var B=z.range={};B[b.id]=[y([F.xmin,F.ymin]),y([F.xmax,F.ymax])]}else{var O=z.lassoPoints={};O[b.id]=F.map(y)}};var L=b.dragOptions;b.dragOptions=x.extendDeep(L||{},{dragmode:g.dragmode,element:b.div,gd:u,plotinfo:{id:b.id,domain:g[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),n(f)||a(f)?(p.dragPan.disable(),p.on("zoomstart",b.clearOutline),b.dragOptions.prepFn=function(z,F,B){o(z,F,B,b.dragOptions,f)},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(g){var b=g[this.id].domain,p=g._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(g){var b=g[this.id],p=b.layers,u=this.layerList,y;if(p.length!==u.length){for(y=0;yp/2){var u=S.split("|").join("
");g.text(u).attr("data-unformatted",u).call(r.convertToTspans,n),b=t.bBox(g.node())}g.attr("transform",v(-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 y=1;b.width+6>p&&(y=p/(b.width+6));var f=[c.l+c.w*d.x[1],c.t+c.h*(1-d.y[0])];E.attr("transform",v(f[0],f[1])+x(y))}},Z.updateFx=function(n){for(var o=n._fullLayout,s=o._subplots[a],c=0;c=0;i--)t.removeLayer(r[i][1])},e.dispose=function(){var t=this.subplot.map;this._removeLayers(),t.removeSource(this.sourceId)},q.exports=function(r,i){var a=i[0].trace,n=new M(r,a.uid),o=n.sourceId,s=v(i),c=n.below=r.belowLookup["trace-"+a.uid];return r.map.addSource(o,{type:"geojson",data:s.geojson}),n._addLayers(s,c),i[0].trace._glTrace=n,n}}}),Yq=Ze({"src/traces/choroplethmap/index.js"(Z,q){"use strict";q.exports={attributes:DC(),supplyDefaults:Xq(),colorbar:ag(),calc:lT(),plot:Zq(),hoverPoints:cT(),eventData:fT(),selectPoints:hT(),styleOnSelect:function(v,x){if(x){var A=x[0].trace;A._glTrace.updateOnSelect(x)}},getBelow:function(v,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?+d[h]:0),c.push({type:"Feature",geometry:{type:"Point",coordinates:w},properties:S})}}var g=M.extractOpts(a),b=g.reversescale?M.flipScale(g.colorscale):g.colorscale,p=b[0][1],u=A.opacity(p)<1?p:A.addOpacity(p,0),y=["interpolate",["linear"],["heatmap-density"],0,u];for(h=1;h=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 i=r[0].trace,a=new A(t,i.uid),n=a.sourceId,o=v(r),s=a.below=t.belowLookup["trace-"+i.uid];return t.map.addSource(n,{type:"geojson",data:o.geojson}),a._addLayers(o,s),a}}}),tG=Ze({"src/traces/densitymap/hover.js"(Z,q){"use strict";var v=Wo(),x=CT().hoverPoints,A=CT().getExtraText;q.exports=function(e,t,r){var i=x(e,t,r);if(i){var a=i[0],n=a.cd,o=n[0].trace,s=n[a.index];if(delete a.color,"z"in s){var c=a.subplot.mockAxis;a.z=s.z,a.zLabel=v.tickText(c,c.c2l(s.z),"hover").text}return a.extraText=A(o,s,n[0].t.labels),[a]}}}}),rG=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}}}),aG=Ze({"src/traces/densitymap/index.js"(Z,q){"use strict";q.exports={attributes:FC(),supplyDefaults:Jq(),colorbar:ag(),formatLabels:IC(),calc:$q(),plot:eG(),hoverPoints:tG(),eventData:rG(),getBelow:function(v,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(i[g])}r[l]=E}else{if(e[l]===M[l]){for(var b=[],p=[],u=0,E=_.length-1;E>=0;--E){var y=_[E];if(t[y]=!1,b.push(y),p.push(a[y]),u+=a[y].length,i[y]=s.length,y===l){_.length=E;break}}s.push(b);for(var f=new Array(u),E=0;Eg&&(g=o.source[_]),o.target[_]>g&&(g=o.target[_]);var b=g+1;a.node._count=b;var p,u=a.node.groups,y={};for(_=0;_0&&e(B,b)&&e(O,b)&&!(y.hasOwnProperty(B)&&y.hasOwnProperty(O)&&y[B]===y[O])){y.hasOwnProperty(O)&&(O=y[O]),y.hasOwnProperty(B)&&(B=y[B]),B=+B,O=+O,d[B]=d[O]=!0;var I="";o.label&&o.label[_]&&(I=o.label[_]);var N=null;I&&T.hasOwnProperty(I)&&(N=T[I]),s.push({pointNumber:_,label:I,color:c?o.color[_]:o.color,hovercolor:h?o.hovercolor[_]:o.hovercolor,customdata:m?o.customdata[_]:o.customdata,concentrationscale:N,source:B,target:O,value:+F}),z.source.push(B),z.target.push(O)}}var U=b+u.length,W=M(n.color),Q=M(n.customdata),ue=[];for(_=0;_b-1,childrenNodes:[],pointNumber:_,label:se,color:W?n.color[_]:n.color,customdata:Q?n.customdata[_]:n.customdata})}var he=!1;return i(U,z.source,z.target)&&(he=!0),{circular:he,links:s,nodes:ue,groups:u,groupLookup:y}}function i(a,n,o){for(var s=x.init2dArray(a,0),c=0;c1})}q.exports=function(n,o){var s=r(o);return A({circular:s.circular,_nodes:s.nodes,_links:s.links,_groups:s.groups,_groupLookup:s.groupLookup})}}}),sG=Ze({"node_modules/d3-quadtree/dist/d3-quadtree.js"(Z,q){(function(v,x){typeof Z=="object"&&typeof q<"u"?x(Z):(v=v||self,x(v.d3=v.d3||{}))})(Z,function(v){"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,y){if(isNaN(p)||isNaN(u))return b;var f,P=b._root,L={data:y},z=b._x0,F=b._y0,B=b._x1,O=b._y1,I,N,U,W,Q,ue,se,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,f=P,!(P=P[se=ue<<1|Q]))return f[se]=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,f?f[se]=L:b._root=L,b;do f=f?f[se]=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((se=ue<<1|Q)===(he=(W>=N)<<1|U>=I));return f[he]=P,f[se]=L,b}function M(b){var p,u,y=b.length,f,P,L=new Array(y),z=new Array(y),F=1/0,B=1/0,O=-1/0,I=-1/0;for(u=0;uO&&(O=f),PI&&(I=P));if(F>O||B>I)return this;for(this.cover(F,B).cover(O,I),u=0;ub||b>=f||y>p||p>=P;)switch(B=(pO||(z=W.y0)>I||(F=W.x1)=se)<<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),H=p-+this._y.call(null,U.data),$=he*he+H*H;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])&&(y=p,se=ue)}for(;u.data!==b;)if(f=u,!(u=u.next))return this;return(P=u.next)&&delete u.next,f?(P?f.next=P:delete f.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&&(y?y[se]=u:this._root=u),this):(this._root=P,this)}function o(b){for(var p=0,u=b.length;p=d.length)return l!=null&&g.sort(l),_!=null?_(g):g;for(var y=-1,f=g.length,P=d[b++],L,z,F=M(),B,O=p();++yd.length)return g;var p,u=T[b-1];return _!=null&&b>=d.length?p=g.entries():(p=[],g.each(function(y,f){p.push({key:f,values:E(y,b)})})),u!=null?p.sort(function(y,f){return u(y.key,f.key)}):p}return w={object:function(g){return S(g,0,t,r)},map:function(g){return S(g,0,i,a)},entries:function(g){return E(S(g,0,i,a),0)},key:function(g){return d.push(g),w},sortKeys:function(g){return T[d.length-1]=g,w},sortValues:function(g){return l=g,w},rollup:function(g){return _=g,w}}}function t(){return{}}function r(d,T,l){d[T]=l}function i(){return M()}function a(d,T,l){d.set(T,l)}function n(){}var o=M.prototype;n.prototype=s.prototype={constructor:n,has:o.has,add:function(d){return d+="",this[x+d]=d,this},remove:o.remove,clear:o.clear,values:o.keys,size:o.size,empty:o.empty,each:o.each};function s(d,T){var l=new n;if(d instanceof n)d.each(function(S){l.add(S)});else if(d){var _=-1,w=d.length;if(T==null)for(;++_=0&&(o=n.slice(s+1),n=n.slice(0,s)),n&&!a.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:o}})}M.prototype=A.prototype={constructor:M,on:function(i,a){var n=this._,o=e(i+"",n),s,c=-1,h=o.length;if(arguments.length<2){for(;++c0)for(var n=new Array(s),o=0,s,c;o=0&&b._call.call(null,p),b=b._next;--x}function l(){a=(i=o.now())+n,x=A=0;try{T()}finally{x=0,w(),a=0}}function _(){var b=o.now(),p=b-i;p>e&&(n-=p,i=b)}function w(){for(var b,p=t,u,y=1/0;p;)p._call?(y>p._time&&(y=p._time),b=p,p=p._next):(u=p._next,p._next=null,p=b?b._next=u:t=u);r=b,S(y)}function S(b){if(!x){A&&(A=clearTimeout(A));var p=b-a;p>24?(b<1/0&&(A=setTimeout(l,b-o.now()-n)),M&&(M=clearInterval(M))):(M||(i=o.now(),M=setInterval(_,e)),x=1,s(l))}}function E(b,p,u){var y=new m;return p=p==null?0:+p,y.restart(function(f){y.stop(),b(f+p)},p,u),y}function g(b,p,u){var y=new m,f=p;return p==null?(y.restart(b,p,u),y):(p=+p,u=u==null?c():+u,y.restart(function P(L){L+=f,y.restart(P,f+=p,u),b(L)},p,u),y)}v.interval=g,v.now=c,v.timeout=E,v.timer=d,v.timerFlush=T,Object.defineProperty(v,"__esModule",{value:!0})})}}),cG=Ze({"node_modules/d3-force/dist/d3-force.js"(Z,q){(function(v,x){typeof Z=="object"&&typeof q<"u"?x(Z,sG(),LT(),lG(),uG()):x(v.d3=v.d3||{},v.d3,v.d3,v.d3,v.d3)})(Z,function(v,x,A,M,e){"use strict";function t(b,p){var u;b==null&&(b=0),p==null&&(p=0);function y(){var f,P=u.length,L,z=0,F=0;for(f=0;fI.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 se=0,he=b.length,H,$,J,X,oe;for(ue==null?ue=1/0:ue*=ue,se=0;se1?(B.on(W,Q),p):B.on(W)}}}function w(){var b,p,u,y=r(-30),f,P=1,L=1/0,z=.81;function F(N){var U,W=b.length,Q=x.quadtree(b,m,d).visitAfter(O);for(u=N,U=0;U=L)return;(N.data!==p||N.next)&&(ue===0&&(ue=i(),H+=ue*ue),se===0&&(se=i(),H+=se*se),HM)if(!(Math.abs(l*m-d*T)>M)||!s)this._+="L"+(this._x1=i)+","+(this._y1=a);else{var w=n-c,S=o-h,E=m*m+d*d,g=w*w+S*S,b=Math.sqrt(E),p=Math.sqrt(_),u=s*Math.tan((x-Math.acos((E+_-g)/(2*b*p)))/2),y=u/p,f=u/b;Math.abs(y-1)>M&&(this._+="L"+(i+y*T)+","+(a+y*l)),this._+="A"+s+","+s+",0,0,"+ +(l*w>T*S)+","+(this._x1=i+f*m)+","+(this._y1=a+f*d)}},arc:function(i,a,n,o,s,c){i=+i,a=+a,n=+n,c=!!c;var h=n*Math.cos(o),m=n*Math.sin(o),d=i+h,T=a+m,l=1^c,_=c?o-s:s-o;if(n<0)throw new Error("negative radius: "+n);this._x1===null?this._+="M"+d+","+T:(Math.abs(this._x1-d)>M||Math.abs(this._y1-T)>M)&&(this._+="L"+d+","+T),n&&(_<0&&(_=_%A+A),_>e?this._+="A"+n+","+n+",0,1,"+l+","+(i-h)+","+(a-m)+"A"+n+","+n+",0,1,"+l+","+(this._x1=d)+","+(this._y1=T):_>M&&(this._+="A"+n+","+n+",0,"+ +(_>=x)+","+l+","+(this._x1=i+n*Math.cos(s))+","+(this._y1=a+n*Math.sin(s))))},rect:function(i,a,n,o){this._+="M"+(this._x0=this._x1=+i)+","+(this._y0=this._y1=+a)+"h"+ +n+"v"+ +o+"h"+-n+"Z"},toString:function(){return this._}},v.path=r,Object.defineProperty(v,"__esModule",{value:!0})})}}),NC=Ze({"node_modules/d3-shape/dist/d3-shape.js"(Z,q){(function(v,x){typeof Z=="object"&&typeof q<"u"?x(Z,fG()):(v=v||self,x(v.d3=v.d3||{},v.d3))})(Z,function(v,x){"use strict";function A(It){return function(){return It}}var M=Math.abs,e=Math.atan2,t=Math.cos,r=Math.max,i=Math.min,a=Math.sin,n=Math.sqrt,o=1e-12,s=Math.PI,c=s/2,h=2*s;function m(It){return It>1?0:It<-1?s:Math.acos(It)}function d(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,na,Ca,Fa,Ya,ha){var Da=kr-It,Zn=na-dr,Pn=Ya-Ca,fi=ha-Fa,Ai=fi*Da-Pn*Zn;if(!(Ai*Aios*os+Ys*Ys&&(qi=Vo,To=Oo),{cx:qi,cy:To,x01:-Pn,y01:-fi,x11:qi*(Ca/Ts-1),y11:To*(Ca/Ts-1)}}function b(){var It=T,dr=l,kr=A(0),na=null,Ca=_,Fa=w,Ya=S,ha=null;function Da(){var Zn,Pn,fi=+It.apply(this,arguments),Ai=+dr.apply(this,arguments),ki=Ca.apply(this,arguments)-c,zi=Fa.apply(this,arguments)-c,Xi=M(zi-ki),to=zi>ki;if(ha||(ha=Zn=x.path()),Aio))ha.moveTo(0,0);else if(Xi>h-o)ha.moveTo(Ai*t(ki),Ai*a(ki)),ha.arc(0,0,Ai,ki,zi,!to),fi>o&&(ha.moveTo(fi*t(zi),fi*a(zi)),ha.arc(0,0,fi,zi,ki,to));else{var go=ki,pi=zi,Jo=ki,Xo=zi,Ts=Xi,Po=Xi,so=Ya.apply(this,arguments)/2,qi=so>o&&(na?+na.apply(this,arguments):n(fi*fi+Ai*Ai)),To=i(M(Ai-fi)/2,+kr.apply(this,arguments)),Vo=To,Oo=To,lo,Co;if(qi>o){var os=d(qi/fi*a(so)),Ys=d(qi/Ai*a(so));(Ts-=os*2)>o?(os*=to?1:-1,Jo+=os,Xo-=os):(Ts=0,Jo=Xo=(ki+zi)/2),(Po-=Ys*2)>o?(Ys*=to?1:-1,go+=Ys,pi-=Ys):(Po=0,go=pi=(ki+zi)/2)}var Os=Ai*t(go),Yo=Ai*a(go),jn=fi*t(Xo),Ci=fi*a(Xo);if(To>o){var tl=Ai*t(pi),Bs=Ai*a(pi),uo=fi*t(Jo),$s=fi*a(Jo),ms;if(Xio?Oo>o?(lo=g(uo,$s,Os,Yo,Ai,Oo,to),Co=g(tl,Bs,jn,Ci,Ai,Oo,to),ha.moveTo(lo.cx+lo.x01,lo.cy+lo.y01),Ooo)||!(Ts>o)?ha.lineTo(jn,Ci):Vo>o?(lo=g(jn,Ci,tl,Bs,fi,-Vo,to),Co=g(Os,Yo,uo,$s,fi,-Vo,to),ha.lineTo(lo.cx+lo.x01,lo.cy+lo.y01),Vo=Ai;--ki)ha.point(pi[ki],Jo[ki]);ha.lineEnd(),ha.areaEnd()}to&&(pi[fi]=+It(Xi,fi,Pn),Jo[fi]=+kr(Xi,fi,Pn),ha.point(dr?+dr(Xi,fi,Pn):pi[fi],na?+na(Xi,fi,Pn):Jo[fi]))}if(go)return ha=null,go+""||null}function Zn(){return P().defined(Ca).curve(Ya).context(Fa)}return Da.x=function(Pn){return arguments.length?(It=typeof Pn=="function"?Pn:A(+Pn),dr=null,Da):It},Da.x0=function(Pn){return arguments.length?(It=typeof Pn=="function"?Pn:A(+Pn),Da):It},Da.x1=function(Pn){return arguments.length?(dr=Pn==null?null:typeof Pn=="function"?Pn:A(+Pn),Da):dr},Da.y=function(Pn){return arguments.length?(kr=typeof Pn=="function"?Pn:A(+Pn),na=null,Da):kr},Da.y0=function(Pn){return arguments.length?(kr=typeof Pn=="function"?Pn:A(+Pn),Da):kr},Da.y1=function(Pn){return arguments.length?(na=Pn==null?null:typeof Pn=="function"?Pn:A(+Pn),Da):na},Da.lineX0=Da.lineY0=function(){return Zn().x(It).y(kr)},Da.lineY1=function(){return Zn().x(It).y(na)},Da.lineX1=function(){return Zn().x(dr).y(kr)},Da.defined=function(Pn){return arguments.length?(Ca=typeof Pn=="function"?Pn:A(!!Pn),Da):Ca},Da.curve=function(Pn){return arguments.length?(Ya=Pn,Fa!=null&&(ha=Ya(Fa)),Da):Ya},Da.context=function(Pn){return arguments.length?(Pn==null?Fa=ha=null:ha=Ya(Fa=Pn),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,na=A(0),Ca=A(h),Fa=A(0);function Ya(ha){var Da,Zn=ha.length,Pn,fi,Ai=0,ki=new Array(Zn),zi=new Array(Zn),Xi=+na.apply(this,arguments),to=Math.min(h,Math.max(-h,Ca.apply(this,arguments)-Xi)),go,pi=Math.min(Math.abs(to)/Zn,Fa.apply(this,arguments)),Jo=pi*(to<0?-1:1),Xo;for(Da=0;Da0&&(Ai+=Xo);for(dr!=null?ki.sort(function(Ts,Po){return dr(zi[Ts],zi[Po])}):kr!=null&&ki.sort(function(Ts,Po){return kr(ha[Ts],ha[Po])}),Da=0,fi=Ai?(to-Zn*Jo)/Ai:0;Da0?Xo*fi:0)+Jo,zi[Pn]={data:ha[Pn],index:Da,value:Xo,startAngle:Xi,endAngle:go,padAngle:pi};return zi}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?(na=typeof ha=="function"?ha:A(+ha),Ya):na},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,na=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(na())},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 se=Array.prototype.slice;function he(It){return It.source}function H(It){return It.target}function $(It){var dr=he,kr=H,na=y,Ca=f,Fa=null;function Ya(){var ha,Da=se.call(arguments),Zn=dr.apply(this,Da),Pn=kr.apply(this,Da);if(Fa||(Fa=ha=x.path()),It(Fa,+na.apply(this,(Da[0]=Zn,Da)),+Ca.apply(this,Da),+na.apply(this,(Da[0]=Pn,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?(na=typeof ha=="function"?ha:A(+ha),Ya):na},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,na,Ca){It.moveTo(dr,kr),It.bezierCurveTo(dr=(dr+na)/2,kr,dr,Ca,na,Ca)}function X(It,dr,kr,na,Ca){It.moveTo(dr,kr),It.bezierCurveTo(dr,kr=(kr+Ca)/2,na,kr,na,Ca)}function oe(It,dr,kr,na,Ca){var Fa=ue(dr,kr),Ya=ue(dr,kr=(kr+Ca)/2),ha=ue(na,kr),Da=ue(na,Ca);It.moveTo(Fa[0],Fa[1]),It.bezierCurveTo(Ya[0],Ya[1],ha[0],ha[1],Da[0],Da[1])}function ne(){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,h)}},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),na=kr*be;It.moveTo(0,-kr),It.lineTo(na,0),It.lineTo(0,kr),It.lineTo(-na,0),It.closePath()}},Re=.8908130915292852,We=Math.sin(s/10)/Math.sin(7*s/10),it=Math.sin(h/10)*We,ot=-Math.cos(h/10)*We,tt={draw:function(It,dr){var kr=Math.sqrt(dr*Re),na=it*kr,Ca=ot*kr;It.moveTo(0,-kr),It.lineTo(na,Ca);for(var Fa=1;Fa<5;++Fa){var Ya=h*Fa/5,ha=Math.cos(Ya),Da=Math.sin(Ya);It.lineTo(Da*kr,-ha*kr),It.lineTo(ha*na-Da*Ca,Da*na+ha*Ca)}It.closePath()}},ut={draw:function(It,dr){var kr=Math.sqrt(dr),na=-kr/2;It.rect(na,na,kr,kr)}},Me=Math.sqrt(3),_e={draw:function(It,dr){var kr=-Math.sqrt(dr/(Me*3));It.moveTo(0,kr*2),It.lineTo(-Me*kr,-kr),It.lineTo(Me*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),na=kr/2,Ca=kr*rt,Fa=na,Ya=kr*rt+kr,ha=-Fa,Da=Ya;It.moveTo(na,Ca),It.lineTo(Fa,Ya),It.lineTo(ha,Da),It.lineTo(fe*na-Fe*Ca,Fe*na+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*na+Fe*Ca,fe*Ca-Fe*na),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,ut,tt,_e,Qe];function kt(){var It=A(re),dr=A(64),kr=null;function na(){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 na.type=function(Ca){return arguments.length?(It=typeof Ca=="function"?Ca:A(Ca),na):It},na.size=function(Ca){return arguments.length?(dr=typeof Ca=="function"?Ca:A(+Ca),na):dr},na.context=function(Ca){return arguments.length?(kr=Ca??null,na):kr},na}function qt(){}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:qt,areaEnd:qt,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,na=(this._y0+4*this._y1+dr)/6;this._line?this._context.lineTo(kr,na):this._context.moveTo(kr,na);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 na=It[0],Ca=dr[0],Fa=It[kr]-na,Ya=dr[kr]-Ca,ha=-1,Da;++ha<=kr;)Da=ha/kr,this._basis.point(this._beta*It[ha]+(1-this._beta)*(na+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(na){return dr===1?new Sr(na):new Be(na,dr)}return kr.beta=function(na){return It(+na)},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 Ee(It,dr){this._context=It,this._k=(1-dr)/6}Ee.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 Ve=function It(dr){function kr(na){return new Ee(na,dr)}return kr.tension=function(na){return It(+na)},kr}(0);function Ce(It,dr){this._context=It,this._k=(1-dr)/6}Ce.prototype={areaStart:qt,areaEnd:qt,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(na){return new Ce(na,dr)}return kr.tension=function(na){return It(+na)},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(na){return new Pe(na,dr)}return kr.tension=function(na){return It(+na)},kr}(0);function yt(It,dr,kr){var na=It._x1,Ca=It._y1,Fa=It._x2,Ya=It._y2;if(It._l01_a>o){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);na=(na*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>o){var Zn=2*It._l23_2a+3*It._l23_a*It._l12_a+It._l12_2a,Pn=3*It._l23_a*(It._l23_a+It._l12_a);Fa=(Fa*Zn+It._x1*It._l23_2a-dr*It._l12_2a)/Pn,Ya=(Ya*Zn+It._y1*It._l23_2a-kr*It._l12_2a)/Pn}It._context.bezierCurveTo(na,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,na=this._y2-dr;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(kr*kr+na*na,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(na){return dr?new Tt(na,dr):new Ee(na,0)}return kr.alpha=function(na){return It(+na)},kr}(.5);function Gt(It,dr){this._context=It,this._alpha=dr}Gt.prototype={areaStart:qt,areaEnd:qt,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,na=this._y2-dr;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(kr*kr+na*na,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(na){return dr?new Gt(na,dr):new Ce(na,0)}return kr.alpha=function(na){return It(+na)},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,na=this._y2-dr;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(kr*kr+na*na,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(na){return dr?new Qt(na,dr):new Pe(na,0)}return kr.alpha=function(na){return It(+na)},kr}(.5);function la(It){this._context=It}la.prototype={areaStart:qt,areaEnd:qt,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 na=It._x1-It._x0,Ca=dr-It._x1,Fa=(It._y1-It._y0)/(na||Ca<0&&-0),Ya=(kr-It._y1)/(Ca||na<0&&-0),ha=(Fa*Ca+Ya*na)/(na+Ca);return(Ba(Fa)+Ba(Ya))*Math.min(Math.abs(Fa),Math.abs(Ya),.5*Math.abs(ha))||0}function Qa(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 na=It._x0,Ca=It._y0,Fa=It._x1,Ya=It._y1,ha=(Fa-na)/3;It._context.bezierCurveTo(na+ha,Ca+ha*dr,Fa-ha,Ya-ha*kr,Fa,Ya)}function en(It){this._context=It}en.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,Qa(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,Qa(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 kn(It){this._context=new Jt(It)}(kn.prototype=Object.create(en.prototype)).point=function(It,dr){en.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,na,Ca,Fa){this._context.bezierCurveTo(dr,It,na,kr,Fa,Ca)}};function Nt(It){return new en(It)}function Kt(It){return new kn(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 na=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 rn(It,dr){if((Ya=It.length)>1)for(var kr=1,na,Ca,Fa=It[dr[0]],Ya,ha=Fa.length;kr=0;)kr[dr]=dr;return kr}function yn(It,dr){return It[dr]}function xt(){var It=A([]),dr=nn,kr=rn,na=yn;function Ca(Fa){var Ya=It.apply(this,arguments),ha,Da=Fa.length,Zn=Ya.length,Pn=new Array(Zn),fi;for(ha=0;ha0){for(var kr,na,Ca=0,Fa=It[0].length,Ya;Ca0)for(var kr,na=0,Ca,Fa,Ya,ha,Da,Zn=It[dr[0]].length;na0?(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,na=It[dr[0]],Ca,Fa=na.length;kr0)||!((Fa=(Ca=It[dr[0]]).length)>0))){for(var kr=0,na=1,Ca,Fa,Ya;naFa&&(Fa=Ca,kr=dr);return kr}function Kr(It){var dr=It.map(Ur);return nn(It).sort(function(kr,na){return dr[kr]-dr[na]})}function Ur(It){for(var dr=0,kr=-1,na=It.length,Ca;++kr0;--oe)ee(X*=.99),re(),j(X),re();function ne(){var ce=x.max(J,function(ze){return ze.length}),be=U*(P-y)/(ce-1);z>be&&(z=be);var Ae=x.min(J,function(ze){return(P-y-(ze.length-1)*z)/x.sum(ze,h)});J.forEach(function(ze){ze.forEach(function(Re,We){Re.y1=(Re.y0=We)+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,d)/x.sum(Ae.targetLinks,h)-m(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,h)-m(Ae))*ce;Ae.y0+=ze,Ae.y1+=ze}})})}function re(){J.forEach(function(ce){var be,Ae,ze=y,Re=ce.length,We;for(ce.sort(c),We=0;We0&&(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,We=Re-2;We>=0;--We)be=ce[We],Ae=be.y1+z-ze,Ae>0&&(be.y0-=Ae,be.y1-=Ae),ze=be.y0})}}function H($){$.nodes.forEach(function(J){J.sourceLinks.sort(s),J.targetLinks.sort(o)}),$.nodes.forEach(function(J){var X=J.y0,oe=X;J.sourceLinks.forEach(function(ne){ne.y0=X+ne.width/2,X+=ne.width}),J.targetLinks.forEach(function(ne){ne.y1=oe+ne.width/2,oe+=ne.width})})}return W};function g(u){return[u.source.x1,u.y0]}function b(u){return[u.target.x0,u.y1]}var p=function(){return M.linkHorizontal().source(g).target(b)};v.sankey=E,v.sankeyCenter=a,v.sankeyLeft=t,v.sankeyRight=r,v.sankeyJustify=i,v.sankeyLinkHorizontal=p,Object.defineProperty(v,"__esModule",{value:!0})})}}),pG=Ze({"node_modules/elementary-circuits-directed-graph/johnson.js"(Z,q){var v=BC();q.exports=function(A,M){var e=[],t=[],r=[],i={},a=[],n;function o(S){r[S]=!1,i.hasOwnProperty(S)&&Object.keys(i[S]).forEach(function(E){delete i[S][E],r[E]&&o(E)})}function s(S){var E=!1;t.push(S),r[S]=!0;var g,b;for(g=0;g=S})}function m(S){h(S);for(var E=A,g=v(E),b=g.components.filter(function(z){return z.length>1}),p=1/0,u,y=0;y"u"?"undefined":s(Ee))!=="object"&&(Ee=Ke.source=g(Be,Ee)),(typeof Ve>"u"?"undefined":s(Ve))!=="object"&&(Ve=Ke.target=g(Be,Ve)),Ee.sourceLinks.push(Ke),Ve.targetLinks.push(Ke)}),bt}function Zt(bt){bt.nodes.forEach(function(Be){Be.partOfCycle=!1,Be.value=Math.max(x.sum(Be.sourceLinks,d),x.sum(Be.targetLinks,d)),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,Ee=0,Ve=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&&(Ee=Ee+Ce.width),Ce.source.column==Ve&&(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,Ee=Ee>0?Ee+p+u:Ee,{top:Be,bottom:Ke,left:Ee,right:Ue}}function xr(bt,Be){var Ke=x.max(bt.nodes,function(at){return at.column}),Ue=it-Re,Ee=ot-We,Ve=Ue+Be.right+Be.left,Ce=Ee+Be.top+Be.bottom,Te=Ue/Ve,Pe=Ee/Ce;return Re=Re*Te+Be.left,it=Be.right==0?it:it*Te,We=We*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(Ee){Ee.depth=Ue,Ee.sourceLinks.forEach(function(Ve){Ke.indexOf(Ve.target)<0&&!Ve.circular&&Ke.push(Ve.target)})});for(Be=bt.nodes,Ke=[],Ue=0;Be.length;++Ue,Be=Ke,Ke=[])Be.forEach(function(Ee){Ee.height=Ue,Ee.targetLinks.forEach(function(Ve){Ke.indexOf(Ve.source)<0&&!Ve.circular&&Ke.push(Ve.source)})});bt.nodes.forEach(function(Ee){Ee.column=Math.floor(_e.call(null,Ee,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 Ee=1,Ve=Be;Ve>0;--Ve)Te(Ee*=.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=We,Gt=at.length,rr;for(at.sort(m),rr=0;rr0&&(yt.y0+=Tt,yt.y1+=Tt),Ot=yt.y1+ut;if(Tt=Ot-ut-ot,Tt>0)for(Ot=yt.y0-=Tt,yt.y1-=Tt,rr=Gt-2;rr>=0;--rr)yt=at[rr],Tt=yt.y1+ut-Ot,Tt>0&&(yt.y0-=Tt,yt.y1-=Tt),Ot=yt.y0})}}function Ir(bt){bt.nodes.forEach(function(Be){Be.sourceLinks.sort(h),Be.targetLinks.sort(c)}),bt.nodes.forEach(function(Be){var Ke=Be.y0,Ue=Ke,Ee=Be.y1,Ve=Ee;Be.sourceLinks.forEach(function(Ce){Ce.circular?(Ce.y0=Ee-Ce.width/2,Ee=Ee-Ce.width):(Ce.y0=Ke+Ce.width/2,Ke+=Ce.width)}),Be.targetLinks.forEach(function(Ce){Ce.circular?(Ce.y1=Ve-Ce.width/2,Ve=Ve-Ce.width):(Ce.y1=Ue+Ce.width/2,Ue+=Ce.width)})})}return kt}function P(Re,We,it){var ot=0;if(it===null){for(var tt=[],ut=0;utWe.source.column)}function B(Re,We){var it=0;Re.sourceLinks.forEach(function(tt){it=tt.circular&&!Ae(tt,We)?it+1:it});var ot=0;return Re.targetLinks.forEach(function(tt){ot=tt.circular&&!Ae(tt,We)?ot+1:ot}),it+ot}function O(Re){var We=Re.source.sourceLinks,it=0;We.forEach(function(ut){it=ut.circular?it+1:it});var ot=Re.target.targetLinks,tt=0;return ot.forEach(function(ut){tt=ut.circular?tt+1:tt}),!(it>1||tt>1)}function I(Re,We,it){return Re.sort(W),Re.forEach(function(ot,tt){var ut=0;if(Ae(ot,it)&&O(ot))ot.circularPathData.verticalBuffer=ut+ot.width/2;else{var Me=0;for(Me;Meut?_e:ut}ot.circularPathData.verticalBuffer=ut+ot.width/2}}),Re}function N(Re,We,it,ot){var tt=5,ut=x.min(Re.links,function(fe){return fe.source.y0});Re.links.forEach(function(fe){fe.circular&&(fe.circularPathData={})});var Me=Re.links.filter(function(fe){return fe.circularLinkType=="top"});I(Me,We,ot);var _e=Re.links.filter(function(fe){return fe.circularLinkType=="bottom"});I(_e,We,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,qt){kt.circularLinkID==fe.circularLinkID&&(fe.circularPathData.leftSmallArcRadius=u+fe.width/2+Qe,fe.circularPathData.leftLargeArcRadius=u+fe.width/2+qt*We+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(se),Qe=0,st.forEach(function(kt,qt){kt.circularLinkID==fe.circularLinkID&&(fe.circularPathData.rightSmallArcRadius=u+fe.width/2+Qe,fe.circularPathData.rightLargeArcRadius=u+fe.width/2+qt*We+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=ut-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 qt=kt.source.x0+(kt.source.x1-kt.source.x0),Zt=kt.y0;return[qt,Zt]}).target(function(kt){var qt=kt.target.x0,Zt=kt.y1;return[qt,Zt]});fe.path=Lt(fe)}})}function U(Re){var We="";return Re.circularLinkType=="top"?We="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:We="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,We}function W(Re,We){return H(Re)==H(We)?Re.circularLinkType=="bottom"?ue(Re,We):Q(Re,We):H(We)-H(Re)}function Q(Re,We){return Re.y0-We.y0}function ue(Re,We){return We.y0-Re.y0}function se(Re,We){return Re.y1-We.y1}function he(Re,We){return We.y1-Re.y1}function H(Re){return Re.target.column-Re.source.column}function $(Re){return Re.target.x0-Re.source.x1}function J(Re,We){var it=z(Re),ot=$(We)/Math.tan(it),tt=be(Re)=="up"?Re.y1+ot:Re.y1-ot;return tt}function X(Re,We){var it=z(Re),ot=$(We)/Math.tan(it),tt=be(Re)=="up"?Re.y1-ot:Re.y1+ot;return tt}function oe(Re,We,it,ot){Re.links.forEach(function(tt){if(!tt.circular&&tt.target.column-tt.source.column>1){var ut=tt.source.column+1,Me=tt.target.column-1,_e=1,fe=Me-ut+1;for(_e=1;ut<=Me;ut++,_e++)Re.nodes.forEach(function(Fe){if(Fe.column==ut){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),qt=st*tt.y0+Qe*tt.y0+Lt*tt.y1+kt*tt.y1,Zt=qt-tt.width/2,Sr=qt+tt.width/2,xr;Zt>Fe.y0&&ZtFe.y0&&SrFe.y1&&j(jr,xr,We,it)})):ZtFe.y1&&(xr=Sr-Fe.y0+10,Fe=j(Fe,xr,We,it),Re.nodes.forEach(function(jr){b(jr,ot)==b(Fe,ot)||jr.column!=Fe.column||jr.y0Fe.y1&&j(jr,xr,We,it)}))}})}})}function ne(Re,We){return Re.y0>We.y0&&Re.y0We.y0&&Re.y1We.y1}function j(Re,We,it,ot){return Re.y0+We>=it&&Re.y1+We<=ot&&(Re.y0=Re.y0+We,Re.y1=Re.y1+We,Re.targetLinks.forEach(function(tt){tt.y1=tt.y1+We}),Re.sourceLinks.forEach(function(tt){tt.y0=tt.y0+We})),Re}function ee(Re,We,it,ot){Re.nodes.forEach(function(tt){ot&&tt.y+(tt.y1-tt.y0)>We&&(tt.y=tt.y-(tt.y+(tt.y1-tt.y0)-We));var ut=Re.links.filter(function(fe){return b(fe.source,it)==b(tt,it)}),Me=ut.length;Me>1&&ut.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;ut.forEach(function(fe){fe.y0=_e+fe.width/2,_e=_e+fe.width}),ut.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,We){return b(Re.source,We)==b(Re.target,We)}function ze(Re,We,it){var ot=Re.nodes,tt=Re.links,ut=!1,Me=!1;if(tt.forEach(function(Qe){Qe.circularLinkType=="top"?ut=!0:Qe.circularLinkType=="bottom"&&(Me=!0)}),ut==!1||Me==!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-We,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})}}v.sankeyCircular=f,v.sankeyCenter=n,v.sankeyLeft=r,v.sankeyRight=i,v.sankeyJustify=a,Object.defineProperty(v,"__esModule",{value:!0})})}}),UC=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"}}}}),vG=Ze({"src/traces/sankey/render.js"(Z,q){"use strict";var v=cG(),x=(h0(),ih(fg)).interpolateNumber,A=Oi(),M=hG(),e=dG(),t=UC(),r=Ch(),i=Yi(),a=as(),n=ca(),o=n.strTranslate,s=n.strRotate,c=Cv(),h=c.keyFun,m=c.repeat,d=c.unwrap,T=fu(),l=oo(),_=mh(),w=_.CAP_SHIFT,S=_.LINE_SPACING,E=3;function g(J,X,oe){var ne=d(X),j=ne.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]),We=ne._nodes,it=ne._links,ot=ne.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(We).links(it);var ut=tt();tt.nodePadding()=Be||(bt=Be-Ir.y0,bt>1e-6&&(Ir.y0+=bt,Ir.y1+=bt)),Be=Ir.y1+ce})}function qt(jr){var wr=jr.map(function(Ve,Ce){return{x0:Ve.x0,index:Ce}}).sort(function(Ve,Ce){return Ve.x0-Ce.x0}),Ir=[],bt=-1,Be,Ke=-1/0,Ue;for(Me=0;MeKe+be&&(bt+=1,Be=Ee.x0),Ke=Ee.x0,Ir[bt]||(Ir[bt]=[]),Ir[bt].push(Ee),Ue=Be-Ee.x0,Ee.x0+=Ue,Ee.x1+=Ue}return Ir}if(j.node.x.length&&j.node.y.length){for(Me=0;Me0?" L "+j.targetX+" "+j.targetY:"")+"Z"):(oe="M "+(j.targetX-X)+" "+(j.targetY-ne)+" L "+(j.rightInnerExtent-X)+" "+(j.targetY-ne)+" A "+(j.rightLargeArcRadius+ne)+" "+(j.rightSmallArcRadius+ne)+" 0 0 0 "+(j.rightFullExtent-ne-X)+" "+(j.targetY+j.rightSmallArcRadius)+" L "+(j.rightFullExtent-ne-X)+" "+j.verticalRightInnerExtent,ee&&re?oe+=" A "+(j.rightLargeArcRadius+ne)+" "+(j.rightLargeArcRadius+ne)+" 0 0 0 "+(j.rightInnerExtent-ne-X)+" "+(j.verticalFullExtent+ne)+" L "+(j.rightFullExtent+ne-X-(j.rightLargeArcRadius-ne))+" "+(j.verticalFullExtent+ne)+" A "+(j.rightLargeArcRadius+ne)+" "+(j.rightLargeArcRadius+ne)+" 0 0 0 "+(j.leftFullExtent+ne)+" "+j.verticalLeftInnerExtent:ee?oe+=" A "+(j.rightLargeArcRadius-ne)+" "+(j.rightSmallArcRadius-ne)+" 0 0 1 "+(j.rightFullExtent-X-ne-(j.rightLargeArcRadius-ne))+" "+(j.verticalFullExtent-ne)+" L "+(j.leftFullExtent+ne+(j.rightLargeArcRadius-ne))+" "+(j.verticalFullExtent-ne)+" A "+(j.rightLargeArcRadius-ne)+" "+(j.rightSmallArcRadius-ne)+" 0 0 1 "+(j.leftFullExtent+ne)+" "+j.verticalLeftInnerExtent:oe+=" A "+(j.rightLargeArcRadius+ne)+" "+(j.rightLargeArcRadius+ne)+" 0 0 0 "+(j.rightInnerExtent-X)+" "+(j.verticalFullExtent+ne)+" L "+j.leftInnerExtent+" "+(j.verticalFullExtent+ne)+" A "+(j.leftLargeArcRadius+ne)+" "+(j.leftLargeArcRadius+ne)+" 0 0 0 "+(j.leftFullExtent+ne)+" "+j.verticalLeftInnerExtent,oe+=" L "+(j.leftFullExtent+ne)+" "+(j.sourceY+j.leftSmallArcRadius)+" A "+(j.leftLargeArcRadius+ne)+" "+(j.leftSmallArcRadius+ne)+" 0 0 0 "+j.leftInnerExtent+" "+(j.sourceY-ne)+" L "+j.sourceX+" "+(j.sourceY-ne)+" L "+j.sourceX+" "+(j.sourceY+ne)+" L "+j.leftInnerExtent+" "+(j.sourceY+ne)+" A "+(j.leftLargeArcRadius-ne)+" "+(j.leftSmallArcRadius-ne)+" 0 0 1 "+(j.leftFullExtent-ne)+" "+(j.sourceY+j.leftSmallArcRadius)+" L "+(j.leftFullExtent-ne)+" "+j.verticalLeftInnerExtent,ee&&re?oe+=" A "+(j.rightLargeArcRadius-ne)+" "+(j.rightSmallArcRadius-ne)+" 0 0 1 "+(j.leftFullExtent-ne-(j.rightLargeArcRadius-ne))+" "+(j.verticalFullExtent-ne)+" L "+(j.rightFullExtent+ne-X+(j.rightLargeArcRadius-ne))+" "+(j.verticalFullExtent-ne)+" A "+(j.rightLargeArcRadius-ne)+" "+(j.rightSmallArcRadius-ne)+" 0 0 1 "+(j.rightFullExtent+ne-X)+" "+j.verticalRightInnerExtent:ee?oe+=" A "+(j.rightLargeArcRadius+ne)+" "+(j.rightLargeArcRadius+ne)+" 0 0 0 "+(j.leftFullExtent+ne)+" "+(j.verticalFullExtent+ne)+" L "+(j.rightFullExtent-X-ne)+" "+(j.verticalFullExtent+ne)+" A "+(j.rightLargeArcRadius+ne)+" "+(j.rightLargeArcRadius+ne)+" 0 0 0 "+(j.rightFullExtent+ne-X)+" "+j.verticalRightInnerExtent:oe+=" A "+(j.leftLargeArcRadius-ne)+" "+(j.leftLargeArcRadius-ne)+" 0 0 1 "+j.leftInnerExtent+" "+(j.verticalFullExtent-ne)+" L "+(j.rightInnerExtent-X)+" "+(j.verticalFullExtent-ne)+" A "+(j.rightLargeArcRadius-ne)+" "+(j.rightLargeArcRadius-ne)+" 0 0 1 "+(j.rightFullExtent+ne-X)+" "+j.verticalRightInnerExtent,oe+=" L "+(j.rightFullExtent+ne-X)+" "+(j.targetY+j.rightSmallArcRadius)+" A "+(j.rightLargeArcRadius-ne)+" "+(j.rightSmallArcRadius-ne)+" 0 0 1 "+(j.rightInnerExtent-X)+" "+(j.targetY+ne)+" L "+(j.targetX-X)+" "+(j.targetY+ne)+(X>0?" L "+j.targetX+" "+j.targetY:"")+"Z"),oe}function u(){var J=.5;function X(oe){var ne=oe.linkArrowLength;if(oe.link.circular)return p(oe.link,ne);var j=Math.abs((oe.link.target.x0-oe.link.source.x1)/2);ne>j&&(ne=j);var ee=oe.link.source.x1,re=oe.link.target.x0-ne,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,We=oe.link.y1-oe.link.width/2,it=oe.link.y1+oe.link.width/2,ot="M"+ee+","+ze,tt="C"+be+","+ze+" "+Ae+","+We+" "+re+","+We,ut="C"+Ae+","+it+" "+be+","+Re+" "+ee+","+Re,Me=ne>0?"L"+(re+ne)+","+(We+oe.link.width/2):"";return Me+="L"+re+","+it,ot+tt+Me+ut+"Z"}return X}function y(J,X){var oe=r(X.color),ne=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=n.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:-ne,zoneY:-j,zoneWidth:ee+2*ne,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:i.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 f(J){J.attr("transform",function(X){return o(X.node.x0.toFixed(3),X.node.y0.toFixed(3))})}function P(J){J.call(f)}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=o(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(ne){!ne.interactionState.dragInProgress&&!ne.partOfGroup&&(oe.hover(this,ne,X),ne.interactionState.hovered=[this,ne])}).on("mousemove.basic",function(ne){!ne.interactionState.dragInProgress&&!ne.partOfGroup&&(oe.follow(this,ne),ne.interactionState.hovered=[this,ne])}).on("mouseout.basic",function(ne){!ne.interactionState.dragInProgress&&!ne.partOfGroup&&(oe.unhover(this,ne,X),ne.interactionState.hovered=!1)}).on("click.basic",function(ne){ne.interactionState.hovered&&(oe.unhover(this,ne,X),ne.interactionState.hovered=!1),!ne.interactionState.dragInProgress&&!ne.partOfGroup&&oe.select(this,ne,X)})}function I(J,X,oe,ne){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"&&(n.ensureSingle(ne._fullLayout._infolayer,"g","dragcover",function(ce){ne._fullLayout._dragCover=ce}),n.raiseToTop(this),ee.interactionState.dragInProgress=ee.node,se(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,ne),U(J,X,ee,re,ne)}}).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),se(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,ne){return function(){for(var ee=0,re=0;re0&&ne.forceLayouts[X].alpha(0)}}function Q(J,X){for(var oe=[],ne=[],j=0;j"),color:_(H,"bgcolor")||t.addOpacity(ne.color,1),borderColor:_(H,"bordercolor"),fontFamily:_(H,"font.family"),fontSize:_(H,"font.size"),fontColor:_(H,"font.color"),fontWeight:_(H,"font.weight"),fontStyle:_(H,"font.style"),fontVariant:_(H,"font.variant"),fontTextcase:_(H,"font.textcase"),fontLineposition:_(H,"font.lineposition"),fontShadow:_(H,"font.shadow"),nameLength:_(H,"namelength"),textAlign:_(H,"align"),idealAlign:v.event.x"),color:_(H,"bgcolor")||he.tinyColorHue,borderColor:_(H,"bordercolor"),fontFamily:_(H,"font.family"),fontSize:_(H,"font.size"),fontColor:_(H,"font.color"),fontWeight:_(H,"font.weight"),fontStyle:_(H,"font.style"),fontVariant:_(H,"font.variant"),fontTextcase:_(H,"font.textcase"),fontLineposition:_(H,"font.lineposition"),fontShadow:_(H,"font.shadow"),nameLength:_(H,"namelength"),textAlign:_(H,"align"),idealAlign:"left",hovertemplate:H.hovertemplate,hovertemplateLabels:ee,eventData:[he.node]},{container:g._hoverlayer.node(),outerContainer:g._paper.node(),gd:S});o(be,.85),s(be)}}},ue=function(se,he,H){S._fullLayout.hovermode!==!1&&(v.select(se).call(d,he,H),he.node.trace.node.hoverinfo!=="skip"&&(he.node.fullData=he.node.trace,S.emit("plotly_unhover",{event:v.event,points:[he.node]})),e.loneUnhover(g._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:f},nodeEvents:{hover:W,follow:Q,unhover:ue,select:U}})}}}),mG=Ze({"src/traces/sankey/base_plot.js"(Z){"use strict";var q=pc().overrideAll,v=Hh().getModuleCalcData,x=jC(),A=Xm(),M=Kd(),e=bp(),t=Tf().prepSelect,r=ca(),i=oo(),a="sankey";Z.name=a,Z.baseLayoutAttrOverrides=q({hoverlabel:A.hoverlabel},"plot","nested"),Z.plot=function(o){var s=v(o.calcdata,a)[0];x(o,s),Z.updateFx(o)},Z.clean=function(o,s,c,h){var m=h._has&&h._has(a),d=s._has&&s._has(a);m&&!d&&(h._paperdiv.selectAll(".sankey").remove(),h._paperdiv.selectAll(".bgsankey").remove())},Z.updateFx=function(o){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,se=v.select(this),he=ue._hasGauge,H=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,ne=X.t+X.h/2,j=Math.min(X.w/2,X.h),ee=n.innerRadius*j,re,ce,be,Ae=ue.align||"center";if(ce=ne,!he)re=X.l+l[Ae]*X.w,be=function(fe){return y(fe,X.w,X.h)};else if(H&&(re=oe,ce=ne+j/2,be=function(fe){return f(fe,.9*ee)}),$){var ze=n.bulletPadding,Re=1-n.bulletNumberDomainSize+ze;re=X.l+(Re+(1-Re)*l[Ae])*X.w,be=function(fe){return y(fe,(n.bulletNumberDomainSize-ze)*X.w,X.h)}}g(F,se,W,{numbersX:re,numbersY:ce,numbersScaler:be,transitionOpts:O,onComplete:U});var We,it;he&&(We={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=se.selectAll("g.angular").data(H?W:[]);ot.exit().remove();var tt=se.selectAll("g.angularaxis").data(H?W:[]);tt.exit().remove(),H&&E(F,se,W,{radius:j,innerRadius:ee,gauge:ot,layer:tt,size:X,gaugeBg:We,gaugeOutline:it,transitionOpts:O,onComplete:U});var ut=se.selectAll("g.bullet").data($?W:[]);ut.exit().remove();var Me=se.selectAll("g.bulletaxis").data($?W:[]);Me.exit().remove(),$&&S(F,se,W,{gauge:ut,layer:Me,size:X,gaugeBg:We,gaugeOutline:it,transitionOpts:O,onComplete:U});var _e=se.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(o.convertToTspans,F),_e.attr("transform",function(){var fe=X.l+X.w*l[ue.title.align],Fe,rt=n.titlePadding,st=a.bBox(_e.node());if(he){if(H)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-n.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,se=I.domain,he=O.transitionOpts,H=O.onComplete,$,J,X,oe,ne;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=se.x[0],ce=se.x[0]+(se.x[1]-se.x[0])*(I._hasNumber||I._hasDelta?1-n.bulletNumberDomainSize:1);$=u(z,I.gauge.axis),$._id="xbulletaxis",$.domain=[re,ce],$.setScale(),J=s.calcTicks($),X=s.makeTransTickFn($),oe=s.getTickSigns($)[2],ne=ue.t+ue.h,$.visible&&(s.drawTicks(z,$,{vals:$.ticks==="inside"?s.clipEnds($,J):J,layer:U,path:s.makeTickPath($,ne,oe),transFn:X}),s.drawLabels(z,$,{vals:J,layer:U,transFn:X,labelFns:s.makeLabelFns($,ne)}));function be(tt){tt.attr("width",function(ut){return Math.max(0,$.c2p(ut.range[1])-$.c2p(ut.range[0]))}).attr("x",function(ut){return $.c2p(ut.range[0])}).attr("y",function(ut){return .5*(1-ut.thickness)*j}).attr("height",function(ut){return ut.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(){H&&H()}).each("interrupt",function(){H&&H()}).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 We=B.filter(function(){return I.gauge.threshold.value||I.gauge.threshold.value===0}),it=N.selectAll("g.threshold-bullet").data(We);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(d.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,se=[N.l+N.w/2,N.t+N.h/2+U/2],he=O.gauge,H=O.layer,$=O.transitionOpts,J=O.onComplete,X=Math.PI/2;function oe(Lt){var kt=I.gauge.axis.range[0],qt=I.gauge.axis.range[1],Zt=(Lt-kt)/(qt-kt)*Math.PI-X;return Zt<-X?-X:Zt>X?X:Zt}function ne(Lt){return v.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 ne(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(se[0],se[1])),H.enter().append("g").classed("angularaxis",!0).classed("crisp",!0),H.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),We=Re.labelStandoff;ze.xFn=function(Lt){var kt=Ae(Lt);return Math.cos(kt)*We},ze.yFn=function(Lt){var kt=Ae(Lt),qt=Math.sin(kt)>0?.2:1;return-Math.sin(kt)*(We+Lt.fontSize*qt)+Math.abs(Math.cos(kt))*(Lt.fontSize*i)},ze.anchorFn=function(Lt){var kt=Ae(Lt),qt=Math.cos(kt);return Math.abs(qt)<.1?"middle":qt>0?"start":"end"},ze.heightFn=function(Lt,kt,qt){var Zt=Ae(Lt);return-.5*(1+Math.sin(Zt))*qt};var it=function(Lt){return t(se[0]+U*Math.cos(Lt),se[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:H,path:"M"+be*tt+",0h"+be*ee.ticklen,transFn:ot}),s.drawLabels(z,ee,{vals:re,layer:H,transFn:ce,labelFns:ze})}var ut=[Q].concat(I.gauge.steps),Me=he.selectAll("g.bg-arc").data(ut);Me.enter().append("g").classed("bg-arc",!0).append("path"),Me.select("path").call(j).call(b),Me.exit().remove();var _e=ne(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(),ut=[];var rt=I.gauge.threshold.value;(rt||rt===0)&&ut.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(ut);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 g(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,se=O.onComplete,he=M.ensureSingle(F,"g","numbers"),H,$,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 ne(it,ot,tt,ut){if(it.match("s")&&tt>=0!=ut>=0&&!ot(tt).slice(-1).match(_)&&!ot(ut).slice(-1).match(_)){var Me=it.slice().replace("s","f").replace(/\d+/,function(fe){return parseInt(fe)-1}),_e=u(z,{tickformat:Me});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,ut=I.number.prefix,Me=he.select("text.number");function _e(){var fe=typeof B[0].y=="number"?ut+ot(B[0].y)+tt:"-";Me.text(fe).call(a.font,I.number.font).call(o.convertToTspans,z)}return w(ue)?Me.transition().duration(ue.duration).ease(ue.easing).each("end",function(){_e(),se&&se()}).each("interrupt",function(){_e(),se&&se()}).attrTween("text",function(){var fe=v.select(this),Fe=A(B[0].lastY,B[0].y);I._lastValue=B[0].y;var rt=ne(I.number.valueformat,ot,B[0].lastY,B[0].y);return function(st){fe.text(ut+rt(Fe(st))+tt)}}):_e(),H=P(ut+ot(B[0].y)+tt,I.number.font,Q,z),Me}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,ut=I.delta.prefix,Me=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)+ut+Qe(st)+tt},fe=function(st){return st.delta>=0?I.delta.increasing.color:I.delta.decreasing.color};I._deltaLastValue===void 0&&(I._deltaLastValue=Me(B[0]));var Fe=he.select("text.delta");Fe.call(a.font,I.delta.font).call(d.fill,fe({delta:I._deltaLastValue}));function rt(){Fe.text(_e(Me(B[0]),ot)).call(d.fill,fe(B[0])).call(o.convertToTspans,z)}return w(ue)?Fe.transition().duration(ue.duration).ease(ue.easing).tween("text",function(){var st=v.select(this),Qe=Me(B[0]),Lt=I._deltaLastValue,kt=ne(I.delta.valueformat,ot,Lt,Qe),qt=A(Lt,Qe);return I._deltaLastValue=Qe,function(Zt){st.text(_e(qt(Zt),kt)),st.call(d.fill,fe({delta:qt(Zt)}))}}).each("end",function(){rt(),se&&se()}).each("interrupt",function(){rt(),se&&se()}):rt(),$=P(_e(Me(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=H),I._hasDelta&&I._hasNumber){var be=[(H.left+H.right)/2,(H.top+H.bottom)/2],Ae=[($.left+$.right)/2,($.top+$.bottom)/2],ze,Re,We=.75*I.delta.font.size;I.delta.position==="left"&&(ze=L(I,"deltaPos",0,-1*(H.width*l[I.align]+$.width*(1-l[I.align])+We),re,Math.min),Re=be[1]-Ae[1],J={width:H.width+$.width+We,height:Math.max(H.height,$.height),left:$.left+ze,right:H.right,top:Math.min(H.top,$.top+Re),bottom:Math.max(H.bottom,$.bottom+Re)}),I.delta.position==="right"&&(ze=L(I,"deltaPos",0,H.width*(1-l[I.align])+$.width*l[I.align]+We,re,Math.max),Re=be[1]-Ae[1],J={width:H.width+$.width+We,height:Math.max(H.height,$.height),left:H.left,right:$.right+ze,top:Math.min(H.top,$.top+Re),bottom:Math.max(H.bottom,$.bottom+Re)}),I.delta.position==="bottom"&&(ze=null,Re=$.height,J={width:Math.max(H.width,$.width),height:H.height+$.height,left:Math.min(H.left,$.left),right:Math.max(H.right,$.right),top:H.bottom-H.height,bottom:H.bottom+$.height}),I.delta.position==="top"&&(ze=null,Re=H.top,J={width:Math.max(H.width,$.width),height:H.height+$.height,left:Math.min(H.left,$.left),right:Math.max(H.right,$.right),top:H.bottom-H.height-$.height,bottom:H.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 ut=J[W];W==="center"&&(ut=(J.left+J.right)/2);var Me=N-ot*ut;return Me=L(I,"numbersTranslate",0,Me,re,Math.max),t(Me,tt)+e(ot)})}function b(z){z.each(function(F){d.stroke(v.select(this),F.line.color)}).each(function(F){d.fill(v.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,m,Q,ue)}return c(I,N,W,U,O),h(I,N,W,U),N}function y(z,F,B){var O=Math.min(F/z.width,B/z.height);return[O,z,F+"x"+B]}function f(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=v.select(I);return N.text(z).attr("x",0).attr("y",0).attr("text-anchor",B).attr("data-unformatted",z).call(o.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}}}),AG=Ze({"src/traces/indicator/index.js"(Z,q){"use strict";q.exports={moduleType:"trace",name:"indicator",basePlotModule:xG(),categories:["svg","noOpacity","noHover"],animatable:!0,attributes:VC(),supplyDefaults:bG().supplyDefaults,calc:wG().calc,plot:TG(),meta:{}}}}),SG=Ze({"lib/indicator.js"(Z,q){"use strict";q.exports=AG()}}),GC=Ze({"src/traces/table/attributes.js"(Z,q){"use strict";var v=Kg(),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({},v.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({},v.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")}}),MG=Ze({"src/traces/table/defaults.js"(Z,q){"use strict";var v=ca(),x=GC(),A=bc().defaults;function M(e,t){for(var r=e.columnorder||[],i=e.header.values.length,a=r.slice(0,i),n=a.slice().sort(function(c,h){return c-h}),o=a.map(function(c){return n.indexOf(c)}),s=o.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"}}}}),CG=Ze({"src/traces/table/data_preparation_helper.js"(Z,q){"use strict";var v=HC(),x=rs().extendFlat,A=is(),M=xp().isTypedArray,e=xp().isArrayOrTypedArray;q.exports=function(m,d){var T=i(d.cells.values),l=function(Q){return Q.slice(d.header.values.length,Q.length)},_=i(d.header.values);_.length&&!_[0].length&&(_[0]=[""],_=i(_));var w=_.concat(l(T).map(function(){return a((_[0]||[""]).length)})),S=d.domain,E=Math.floor(m._fullLayout._size.w*(S.x[1]-S.x[0])),g=Math.floor(m._fullLayout._size.h*(S.y[1]-S.y[0])),b=d.header.values.length?w[0].map(function(){return d.header.height}):[v.emptyHeaderHeight],p=T.length?T[0].map(function(){return d.cells.height}):[],u=b.reduce(r,0),y=g-u,f=y+v.uplift,P=s(p,f),L=s(b,u),z=o(L,[]),F=o(P,z),B={},O=d._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 se=e(d.columnwidth)?d.columnwidth[Math.min(ue,d.columnwidth.length-1)]:d.columnwidth;return A(se)?Number(se):1}),N=I.reduce(r,0);I=I.map(function(Q){return Q/N*E});var U=Math.max(t(d.header.line.width),t(d.cells.line.width)),W={key:d.uid+m._context.staticPlot,translateX:S.x[0]*m._fullLayout._size.w,translateY:m._fullLayout._size.h*(1-S.y[1]),size:m._fullLayout._size,width:E,maxLineWidth:U,height:g,columnOrder:O,groupHeight:g,rowBlocks:F,headerRowBlocks:z,scrollY:0,cells:x({},d.cells,{values:T}),headerCells:x({},d.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 se=B[Q];B[Q]=(se||0)+1;var he=Q+"__"+B[Q];return{key:he,label:Q,specIndex:ue,xIndex:O[ue],xScale:n,x:void 0,calcdata:void 0,columnWidth:I[ue]}})};return W.columns.forEach(function(Q){Q.calcdata=W,Q.x=n(Q)}),W};function t(h){if(e(h)){for(var m=0,d=0;d=m||g===h.length-1)&&(d[l]=w,w.key=E++,w.firstRowIndex=S,w.lastRowIndex=g,w=c(),l+=_,S=g+1,_=0);return d}function c(){return{firstRowIndex:null,lastRowIndex:null,rows:[]}}}}),kG=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=v(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 v(x){var A=x.rowBlocks[x.page],M=A?A.rows[0].rowIndex:0,e=A?M+A.rows.length:0;return[M,e]}}}),WC=Ze({"src/traces/table/plot.js"(Z,q){"use strict";var v=HC(),x=Oi(),A=ca(),M=A.numberFormat,e=Cv(),t=as(),r=fu(),i=ca().raiseToTop,a=ca().strTranslate,n=ca().cancelTransition,o=CG(),s=kG(),c=Yi();q.exports=function(re,ce){var be=!re._context.staticPlot,Ae=re._fullLayout._paper.selectAll("."+v.cn.table).data(ce.map(function(Qe){var Lt=e.unwrap(Qe),kt=Lt.trace;return o(re,kt)}),e.keyFun);Ae.exit().remove(),Ae.enter().append("g").classed(v.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("."+v.cn.tableControlView).data(e.repeat,e.keyFun),Re=ze.enter().append("g").classed(v.cn.tableControlView,!0).style("box-sizing","content-box");if(be){var We="onwheel"in document?"wheel":"mousewheel";Re.on("mousemove",function(Qe){ze.filter(function(Lt){return Qe===Lt}).call(l,re)}).on(We,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("."+v.cn.scrollBackground).data(e.repeat,e.keyFun);it.enter().append("rect").classed(v.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),m(re,Qe),re)});var ot=ze.selectAll("."+v.cn.yColumn).data(function(Qe){return Qe.columns},e.keyFun);ot.enter().append("g").classed(v.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,-v.uplift),i(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(-v.overdrag,Math.min(Qe.calcdata.width+v.overdrag-Qe.columnWidth,x.event.x));var qt=T(ot).filter(function(Sr){return Sr.calcdata.key===Qe.calcdata.key}),Zt=qt.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(v.transitionEase).duration(v.transitionDuration).attr("transform",function(Sr){return a(Sr.x,0)}),Lt.call(n).attr("transform",a(Qe.x,-v.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(qt){return qt.xIndex}))})),ot.each(function(Qe){t.setClipUrl(x.select(this),d(re,Qe),re)});var tt=ot.selectAll("."+v.cn.columnBlock).data(s.splitToPanels,e.keyFun);tt.enter().append("g").classed(v.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 ut=tt.filter(I),Me=tt.filter(O);be&&Me.call(x.behavior.drag().origin(function(Qe){return x.event.stopPropagation(),Qe}).on("drag",Q(re,ze,-1)).on("dragend",function(){})),_(re,ze,ut,tt),_(re,ze,Me,tt);var _e=ze.selectAll("."+v.cn.scrollAreaClip).data(e.repeat,e.keyFun);_e.enter().append("clipPath").classed(v.cn.scrollAreaClip,!0).attr("id",function(Qe){return m(re,Qe)});var fe=_e.selectAll("."+v.cn.scrollAreaClipRect).data(e.repeat,e.keyFun);fe.enter().append("rect").classed(v.cn.scrollAreaClipRect,!0).attr("x",-v.overdrag).attr("y",-v.uplift).attr("fill","none"),fe.attr("width",function(Qe){return Qe.width+2*v.overdrag}).attr("height",function(Qe){return Qe.height+v.uplift});var Fe=ot.selectAll("."+v.cn.columnBoundary).data(e.repeat,e.keyFun);Fe.enter().append("g").classed(v.cn.columnBoundary,!0);var rt=ot.selectAll("."+v.cn.columnBoundaryClippath).data(e.repeat,e.keyFun);rt.enter().append("clipPath").classed(v.cn.columnBoundaryClippath,!0),rt.attr("id",function(Qe){return d(re,Qe)});var st=rt.selectAll("."+v.cn.columnBoundaryRect).data(e.repeat,e.keyFun);st.enter().append("rect").classed(v.cn.columnBoundaryRect,!0).attr("fill","none"),st.attr("width",function(Qe){return Qe.columnWidth+2*h(Qe)}).attr("height",function(Qe){return Qe.calcdata.height+2*h(Qe)+v.uplift}).attr("x",function(Qe){return-h(Qe)}).attr("y",function(Qe){return-h(Qe)}),W(null,Me,ze)};function h(ee){return Math.ceil(ee.calcdata.maxLineWidth/2)}function m(ee,re){return"clip"+ee._fullLayout._uid+"_scrollAreaBottomClip_"+re.key}function d(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("."+v.cn.scrollbarKit).data(e.repeat,e.keyFun);Ae.enter().append("g").classed(v.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,v.goldenRatio*v.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+v.scrollbarWidth/2+v.scrollbarOffset;return a(tt,N(ot))});var ze=Ae.selectAll("."+v.cn.scrollbar).data(e.repeat,e.keyFun);ze.enter().append("g").classed(v.cn.scrollbar,!0);var Re=ze.selectAll("."+v.cn.scrollbarSlider).data(e.repeat,e.keyFun);Re.enter().append("g").classed(v.cn.scrollbarSlider,!0),Re.attr("transform",function(ot){return a(0,ot.scrollbarState.topY||0)});var We=Re.selectAll("."+v.cn.scrollbarGlyph).data(e.repeat,e.keyFun);We.enter().append("line").classed(v.cn.scrollbarGlyph,!0).attr("stroke","black").attr("stroke-width",v.scrollbarWidth).attr("stroke-linecap","round").attr("y1",v.scrollbarWidth/2),We.attr("y2",function(ot){return ot.scrollbarState.barLength-v.scrollbarWidth/2}).attr("stroke-opacity",function(ot){return ot.columnDragInProgress||!ot.scrollbarState.barWiggleRoom||ce?0:.4}),We.transition().delay(0).duration(0),We.transition().delay(v.scrollbarHideDelay).duration(v.scrollbarHideDuration).attr("stroke-opacity",0);var it=ze.selectAll("."+v.cn.scrollbarCaptureZone).data(e.repeat,e.keyFun);it.enter().append("line").classed(v.cn.scrollbarCaptureZone,!0).attr("stroke","white").attr("stroke-opacity",.01).attr("stroke-width",v.scrollbarCaptureWidth).attr("stroke-linecap","butt").attr("y1",0).on("mousedown",function(ot){var tt=x.event.y,ut=this.getBoundingClientRect(),Me=ot.scrollbarState,_e=tt-ut.top,fe=x.scale.linear().domain([0,Me.scrollableAreaHeight]).range([0,Me.totalHeight]).clamp(!0);Me.topY<=_e&&_e<=Me.bottomY||Q(re,ee,null,fe(_e-Me.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&&(We.remove(),it.remove())}function _(ee,re,ce,be){var Ae=w(ce),ze=S(Ae);p(ze);var Re=E(ze);y(Re);var We=b(ze),it=g(We);u(it),f(it,re,be,ee),$(ze)}function w(ee){var re=ee.selectAll("."+v.cn.columnCells).data(e.repeat,e.keyFun);return re.enter().append("g").classed(v.cn.columnCells,!0),re.exit().remove(),re}function S(ee){var re=ee.selectAll("."+v.cn.columnCell).data(s.splitToCells,function(ce){return ce.keyWithinBlock});return re.enter().append("g").classed(v.cn.columnCell,!0),re.exit().remove(),re}function E(ee){var re=ee.selectAll("."+v.cn.cellRect).data(e.repeat,function(ce){return ce.keyWithinBlock});return re.enter().append("rect").classed(v.cn.cellRect,!0),re}function g(ee){var re=ee.selectAll("."+v.cn.cellText).data(e.repeat,function(ce){return ce.keyWithinBlock});return re.enter().append("text").classed(v.cn.cellText,!0).style("cursor",function(){return"auto"}).on("mousedown",function(){x.event.stopPropagation()}),re}function b(ee){var re=ee.selectAll("."+v.cn.cellTextHolder).data(e.repeat,function(ce){return ce.keyWithinBlock});return re.enter().append("g").classed(v.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 y(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 f(ee,re,ce,be){ee.text(function(Ae){var ze=Ae.column.specIndex,Re=Ae.rowNumber,We=Ae.value,it=typeof We=="string",ot=it&&We.match(/
/i),tt=!it||ot;Ae.mayHaveMarkup=it&&We.match(/[<&>]/);var ut=P(We);Ae.latex=ut;var Me=ut?"":F(Ae.calcdata.cells.prefix,ze,Re)||"",_e=ut?"":F(Ae.calcdata.cells.suffix,ze,Re)||"",fe=ut?null:F(Ae.calcdata.cells.format,ze,Re)||null,Fe=Me+(fe?M(fe)(Ae.value):Ae.value)+_e,rt;Ae.wrappingNeeded=!Ae.wrapped&&!tt&&!ut&&(rt=L(Fe)),Ae.cellHeightMayIncrease=ot||ut||Ae.mayHaveMarkup||(rt===void 0?L(Fe):rt),Ae.needsConvertToTspans=Ae.mayHaveMarkup||Ae.wrappingNeeded||Ae.latex;var st;if(Ae.wrappingNeeded){var Qe=v.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),We=be.calcdata.groupHeight-N(be),it=ze.scrollY=Math.max(0,Math.min(Re-We,ze.scrollY)),ot=U(Ae,it,We);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,ut){tt.page=ot[ut],tt.scrollY=it}),re.attr("transform",function(tt){var ut=J(tt.rowBlocks,tt.page)-tt.scrollY;return a(0,ut)}),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,We=re.filter(function(ut){return Re.key===ut.key}),it=ce||Re.scrollbarState.dragMultiplier,ot=Re.scrollY;Re.scrollY=be===void 0?Re.scrollY+it*x.event.dy:be;var tt=We.selectAll("."+v.cn.yColumn).selectAll("."+v.cn.columnBlock).filter(O);return W(ee,tt,We),Re.scrollY===ot}}function ue(ee,re,ce,be,Ae,ze,Re){var We=be[Re]!==Ae[Re];We&&(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 se(ee,re,ce,be){return function(){var ze=x.select(re.parentNode);ze.each(function(Re){var We=Re.fragments;ze.selectAll("tspan.line").each(function(Fe,rt){We[rt].width=this.getComputedTextLength()});var it=We[We.length-1].width,ot=We.slice(0,-1),tt=[],ut,Me,_e=0,fe=Re.column.columnWidth-2*v.cellPad;for(Re.value="";ot.length;)ut=ot.shift(),Me=ut.width+it,_e+Me>fe&&(Re.value+=tt.join(v.wrapSpacer)+v.lineBreaker,tt=[],_e=0),tt.push(ut.text),_e+=Me;_e&&(Re.value+=tt.join(v.wrapSpacer)),Re.wrapped=!0}),ze.selectAll("tspan.line").remove(),f(ze.select("."+v.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),We=ne(Ae),it=Ae.key-We.firstRowIndex,ot=We.rows[it].rowHeight,tt=Ae.cellHeightMayIncrease?re.parentNode.getBoundingClientRect().height+2*v.cellPad:ot,ut=Math.max(tt,ot),Me=ut-We.rows[it].rowHeight;Me&&(We.rows[it].rowHeight=ut,ee.selectAll("."+v.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("."+v.cn.cellRect).node().getBoundingClientRect(),st=_e.transform.baseVal.consolidate(),Qe=rt.top-Fe.top+(st?st.matrix.f:v.cellPad);return a(H(Ae,x.select(_e.parentNode).select("."+v.cn.cellTextHolder).node().getBoundingClientRect().width),Qe)}),Ae.settledY=!0}}}function H(ee,re){switch(ee.align){case"left":return v.cellPad;case"right":return ee.column.columnWidth-(re||0)-v.cellPad;case"center":return(ee.column.columnWidth-(re||0))/2;default:return v.cellPad}}function $(ee){ee.attr("transform",function(re){var ce=re.rowBlocks[0].auxiliaryBlocks.reduce(function(Re,We){return Re+X(We,1/0)},0),be=ne(re),Ae=X(be,re.key),ze=Ae+ce;return a(0,ze)}).selectAll("."+v.cn.cellRect).attr("height",function(re){return j(ne(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&&(m-=180,n=-n),{angle:m,flip:n,p:x.c2p(e,A,M),offsetMultplier:o}}}}),NG=Ze({"src/traces/carpet/plot.js"(Z,q){"use strict";var v=Oi(),x=as(),A=XC(),M=ZC(),e=BG(),t=fu(),r=ca(),i=r.strRotate,a=r.strTranslate,n=mh();q.exports=function(_,w,S,E){var g=_._context.staticPlot,b=w.xaxis,p=w.yaxis,u=_._fullLayout,y=u._clips;r.makeTraceGroups(E,S,"trace").each(function(f){var P=v.select(this),L=f[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,g),s(b,p,I,B,"b",B._gridlines,!0,g),s(b,p,O,F,"a",F._minorgridlines,!0,g),s(b,p,O,B,"b",B._minorgridlines,!0,g),s(b,p,N,F,"a-boundary",F._boundarylines,g),s(b,p,N,B,"b-boundary",B._boundarylines,g);var W=c(_,b,p,z,L,U,F._labels,"a-label"),Q=c(_,b,p,z,L,U,B._labels,"b-label");h(_,U,z,L,b,p,W,Q),o(z,L,y,b,p)})};function o(l,_,w,S,E){var g,b,p,u,y=w.select("#"+l._clipPathId);y.size()||(y=w.append("clipPath").classed("carpetclip",!0));var f=r.ensureSingle(y,"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])+i(z.angle)+a(P.axis.labelpadding*B,I.height*.3)),y=Math.max(y,I.width+P.axis.labelpadding)}),u.exit().remove(),f.maxExtent=y,f}function h(l,_,w,S,E,g,b,p){var u,y,f,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),y=F,f=w.ab2xy(u,y,!0),P=w.dxyda_rough(u,y),b.angle===void 0&&r.extendFlat(b,e(w,E,g,f,w.dxydb_rough(u,y))),T(l,_,w,S,f,P,w.aaxis,E,g,b,"a-title"),u=L,y=.5*(F+B),f=w.ab2xy(u,y,!0),P=w.dxydb_rough(u,y),p.angle===void 0&&r.extendFlat(p,e(w,E,g,f,w.dxyda_rough(u,y))),T(l,_,w,S,f,P,w.baxis,E,g,p,"b-title")}var m=n.LINE_SPACING,d=(1-n.MID_SHIFT)/m+1;function T(l,_,w,S,E,g,b,p,u,y,f){var P=[];b.title.text&&P.push(b.title.text);var L=_.selectAll("text."+f).data(P),z=y.maxExtent;L.enter().append("text").classed(f,!0),L.each(function(){var F=e(w,p,u,E,g);["start","both"].indexOf(b.showticklabels)===-1&&(z=0);var B=b.title.font.size;z+=B+b.title.offset;var O=y.angle+(y.flip<0?180:0),I=(O-F.angle+450)%360,N=I>90&&I<270,U=v.select(this);U.text(b.title.text).call(t.convertToTspans,l),N&&(z=(-t.lineCount(U)+d)*m*B-z),U.attr("transform",a(F.p[0],F.p[1])+i(F.angle)+a(0,z)).attr("text-anchor","middle").call(x.font,b.title.font)}),L.exit().remove()}}}),UG=Ze({"src/traces/carpet/cheater_basis.js"(Z,q){"use strict";var v=ca().isArrayOrTypedArray;q.exports=function(x,A,M){var e,t,r,i,a,n,o=[],s=v(x)?x.length:x,c=v(A)?A.length:A,h=v(x)?x:null,m=v(A)?A:null;h&&(r=(h.length-1)/(h[h.length-1]-h[0])/(s-1)),m&&(i=(m.length-1)/(m[m.length-1]-m[0])/(c-1));var d,T=1/0,l=-1/0;for(t=0;t=10)return null;for(var e=1/0,t=-1/0,r=A.length,i=0;i0&&(X=M.dxydi([],W-1,ue,0,se),ee.push(he[0]+X[0]/3),re.push(he[1]+X[1]/3),oe=M.dxydi([],W-1,ue,1,se),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),H=Math.floor(Math.max(0,Math.min(F-2,W))),$=W-H,ce.length=F,ce.crossLength=B,ce.xy=function(be){return M.evalxy([],W,be)},ce.dxy=function(be,Ae){return M.dxydj([],H,be,$,Ae)},Q=0;Q0&&(ne=M.dxydj([],H,Q-1,$,0),ee.push(he[0]+ne[0]/3),re.push(he[1]+ne[1]/3),j=M.dxydj([],H,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=y,ce.value=U,ce.constvar=t,ce.index=h,ce.x=ee,ce.y=re,ce.smoothing=y.smoothing,ce}function N(U){var W,Q,ue,se,he,H=[],$=[],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)&&g.push(x(N(i),{color:E.gridcolor,width:E.gridwidth,dash:E.griddash}));for(h=s;hS.length-1)&&!(T<0||T>S.length-1))for(l=S[a],_=S[T],r=0;rS[S.length-1])&&b.push(x(I(d),{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(n=5e-15,o=[Math.floor((S[S.length-1]-E.tick0)/E.dtick*(1+n)),Math.ceil((S[0]-E.tick0)/E.dtick/(1+n))].sort(function(U,W){return U-W}),s=o[0],c=o[1],h=s;h<=c;h++)m=E.tick0+E.dtick*h,g.push(x(I(m),{color:E.gridcolor,width:E.gridwidth,dash:E.griddash}));for(h=s-1;hS[S.length-1])&&b.push(x(I(d),{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 v=Wo(),x=rs().extendFlat;q.exports=function(M,e){var t,r,i,a,n,o=e._labels=[],s=e._gridlines;for(t=0;t=0;t--)r[s-t]=x[c][t],i[s-t]=A[c][t];for(a.push({x:r,y:i,bicubic:n}),t=c,r=[],i=[];t>=0;t--)r[c-t]=x[t][0],i[c-t]=A[t][0];return a.push({x:r,y:i,bicubic:o}),a}}}),HG=Ze({"src/traces/carpet/smooth_fill_2d_array.js"(Z,q){"use strict";var v=ca();q.exports=function(A,M,e){var t,r,i,a=[],n=[],o=A[0].length,s=A.length;function c(Q,ue){var se=0,he,H=0;return Q>0&&(he=A[ue][Q-1])!==void 0&&(H++,se+=he),Q0&&(he=A[ue-1][Q])!==void 0&&(H++,se+=he),ue0&&r0&&tu);return v.log("Smoother converged to",y,"after",P,"iterations"),A}}}),WG=Ze({"src/traces/carpet/constants.js"(Z,q){"use strict";q.exports={RELATIVE_CULL_TOLERANCE:1e-6}}}),XG=Ze({"src/traces/carpet/catmull_rom.js"(Z,q){"use strict";var v=.5;q.exports=function(A,M,e,t){var r=A[0]-M[0],i=A[1]-M[1],a=e[0]-M[0],n=e[1]-M[1],o=Math.pow(r*r+i*i,v/2),s=Math.pow(a*a+n*n,v/2),c=(s*s*r-o*o*a)*t,h=(s*s*i-o*o*n)*t,m=s*(o+s)*3,d=o*(o+s)*3;return[[M[0]+(m&&c/m),M[1]+(m&&h/m)],[M[0]-(d&&c/d),M[1]-(d&&h/d)]]}}}),ZG=Ze({"src/traces/carpet/compute_control_points.js"(Z,q){"use strict";var v=XG(),x=ca().ensureArray;function A(M,e,t){var r=-.5*t[0]+1.5*e[0],i=-.5*t[1]+1.5*e[1];return[(2*r+M[0])/3,(2*i+M[1])/3]}q.exports=function(e,t,r,i,a,n){var o,s,c,h,m,d,T,l,_,w,S=r[0].length,E=r.length,g=a?3*S-2:S,b=n?3*E-2:E;for(e=x(e,b),t=x(t,b),c=0;cm&&gT&&bd||bl},i.setScale=function(){var g=i._x,b=i._y,p=A(i._xctrl,i._yctrl,g,b,c.smoothing,h.smoothing);i._xctrl=p[0],i._yctrl=p[1],i.evalxy=M([i._xctrl,i._yctrl],o,s,c.smoothing,h.smoothing),i.dxydi=e([i._xctrl,i._yctrl],c.smoothing,h.smoothing),i.dxydj=t([i._xctrl,i._yctrl],c.smoothing,h.smoothing)},i.i2a=function(g){var b=Math.max(0,Math.floor(g[0]),o-2),p=g[0]-b;return(1-p)*a[b]+p*a[b+1]},i.j2b=function(g){var b=Math.max(0,Math.floor(g[1]),o-2),p=g[1]-b;return(1-p)*n[b]+p*n[b+1]},i.ij2ab=function(g){return[i.i2a(g[0]),i.j2b(g[1])]},i.a2i=function(g){var b=Math.max(0,Math.min(x(g,a),o-2)),p=a[b],u=a[b+1];return Math.max(0,Math.min(o-1,b+(g-p)/(u-p)))},i.b2j=function(g){var b=Math.max(0,Math.min(x(g,n),s-2)),p=n[b],u=n[b+1];return Math.max(0,Math.min(s-1,b+(g-p)/(u-p)))},i.ab2ij=function(g){return[i.a2i(g[0]),i.b2j(g[1])]},i.i2c=function(g,b){return i.evalxy([],g,b)},i.ab2xy=function(g,b,p){if(!p&&(ga[o-1]|bn[s-1]))return[!1,!1];var u=i.a2i(g),y=i.b2j(b),f=i.evalxy([],u,y);if(p){var P=0,L=0,z=[],F,B,O,I;ga[o-1]?(F=o-2,B=1,P=(g-a[o-1])/(a[o-1]-a[o-2])):(F=Math.max(0,Math.min(o-2,Math.floor(u))),B=u-F),bn[s-1]?(O=s-2,I=1,L=(b-n[s-1])/(n[s-1]-n[s-2])):(O=Math.max(0,Math.min(s-2,Math.floor(y))),I=y-O),P&&(i.dxydi(z,F,O,B,I),f[0]+=z[0]*P,f[1]+=z[1]*P),L&&(i.dxydj(z,F,O,B,I),f[0]+=z[0]*L,f[1]+=z[1]*L)}return f},i.c2p=function(g,b,p){return[b.c2p(g[0]),p.c2p(g[1])]},i.p2x=function(g,b,p){return[b.p2c(g[0]),p.p2c(g[1])]},i.dadi=function(g){var b=Math.max(0,Math.min(a.length-2,g));return a[b+1]-a[b]},i.dbdj=function(g){var b=Math.max(0,Math.min(n.length-2,g));return n[b+1]-n[b]},i.dxyda=function(g,b,p,u){var y=i.dxydi(null,g,b,p,u),f=i.dadi(g,p);return[y[0]/f,y[1]/f]},i.dxydb=function(g,b,p,u){var y=i.dxydj(null,g,b,p,u),f=i.dbdj(b,u);return[y[0]/f,y[1]/f]},i.dxyda_rough=function(g,b,p){var u=_*(p||.1),y=i.ab2xy(g+u,b,!0),f=i.ab2xy(g-u,b,!0);return[(y[0]-f[0])*.5/u,(y[1]-f[1])*.5/u]},i.dxydb_rough=function(g,b,p){var u=w*(p||.1),y=i.ab2xy(g,b+u,!0),f=i.ab2xy(g,b-u,!0);return[(y[0]-f[0])*.5/u,(y[1]-f[1])*.5/u]},i.dpdx=function(g){return g._m},i.dpdy=function(g){return g._m}}}}),QG=Ze({"src/traces/carpet/calc.js"(Z,q){"use strict";var v=Wo(),x=ca().isArray1D,A=UG(),M=jG(),e=VG(),t=qG(),r=GG(),i=Y2(),a=HG(),n=Z2(),o=$G();q.exports=function(c,h){var m=v.getFromId(c,h.xaxis),d=v.getFromId(c,h.yaxis),T=h.aaxis,l=h.baxis,_=h.x,w=h.y,S=[];_&&x(_)&&S.push("x"),w&&x(w)&&S.push("y"),S.length&&n(h,T,l,"a","b",S);var E=h._a=h._a||h.a,g=h._b=h._b||h.b;_=h._x||h.x,w=h._y||h.y;var b={};if(h._cheater){var p=T.cheatertype==="index"?E.length:E,u=l.cheatertype==="index"?g.length:g;_=A(p,u,h.cheaterslope)}h._x=_=i(_),h._y=w=i(w),a(_,E,g),a(w,E,g),o(h),h.setScale();var y=M(_),f=M(w),P=.5*(y[1]-y[0]),L=.5*(y[1]+y[0]),z=.5*(f[1]-f[0]),F=.5*(f[1]+f[0]),B=1.3;return y=[L-P*B,L+P*B],f=[F-z*B,F+z*B],h._extremes[m._id]=v.findExtremes(m,y,{padded:!0}),h._extremes[d._id]=v.findExtremes(d,f,{padded:!0}),e(h,"a","b"),e(h,"b","a"),t(h,T),t(h,l),b.clipsegments=r(h._xctrl,h._yctrl,T,l),b.x=_,b.y=w,b.a=E,b.b=g,[b]}}}),eH=Ze({"src/traces/carpet/index.js"(Z,q){"use strict";q.exports={attributes:PT(),supplyDefaults:OG(),plot:NG(),calc:QG(),animatable:!0,isContainer:!0,moduleType:"trace",name:"carpet",basePlotModule:Zf(),categories:["cartesian","svg","carpet","carpetAxis","notLegendIsolatable","noMultiCategory","noHover","noSortingByValue"],meta:{}}}}),tH=Ze({"lib/carpet.js"(Z,q){"use strict";q.exports=eH()}}),YC=Ze({"src/traces/scattercarpet/attributes.js"(Z,q){"use strict";var v=$d(),x=tf(),A=eu(),M=Cs().hovertemplateAttrs,e=Cs().texttemplateAttrs,t=Mu(),r=rs().extendFlat,i=x.marker,a=x.line,n=i.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:v(),marker:r({symbol:i.symbol,opacity:i.opacity,maxdisplayed:i.maxdisplayed,angle:i.angle,angleref:i.angleref,standoff:i.standoff,size:i.size,sizeref:i.sizeref,sizemin:i.sizemin,sizemode:i.sizemode,line:r({width:n.width,editType:"calc"},t("marker.line")),gradient:i.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}}}),rH=Ze({"src/traces/scattercarpet/defaults.js"(Z,q){"use strict";var v=ca(),x=Tv(),A=Fu(),M=md(),e=Dd(),t=o1(),r=zd(),i=ev(),a=YC();q.exports=function(o,s,c,h){function m(E,g){return v.coerce(o,s,a,E,g)}m("carpet"),s.xaxis="x",s.yaxis="y";var d=m("a"),T=m("b"),l=Math.min(d.length,T.length);if(!l){s.visible=!1;return}s._length=l,m("text"),m("texttemplate"),m("hovertext");var _=l0?b=E.labelprefix.replace(/ = $/,""):b=E._hovertitle,l.push(b+": "+g.toFixed(3)+E.labelsuffix)}if(!m.hovertemplate){var w=h.hi||m.hoverinfo,S=w.split("+");S.indexOf("all")!==-1&&(S=["a","b","text"]),S.indexOf("a")!==-1&&_(d.aaxis,h.a),S.indexOf("b")!==-1&&_(d.baxis,h.b),l.push("y: "+a.yLabel),S.indexOf("text")!==-1&&x(h,m,l),a.extraText=l.join("
")}return i}}}),sH=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}}}),lH=Ze({"src/traces/scattercarpet/index.js"(Z,q){"use strict";q.exports={attributes:YC(),supplyDefaults:rH(),colorbar:hp(),formatLabels:aH(),calc:nH(),plot:iH(),style:ed().style,styleOnSelect:ed().styleOnSelect,hoverPoints:oH(),selectPoints:c1(),eventData:sH(),moduleType:"trace",name:"scattercarpet",basePlotModule:Zf(),categories:["svg","carpet","symbols","showLegend","carpetDependent","zoomScale"],meta:{}}}}),uH=Ze({"lib/scattercarpet.js"(Z,q){"use strict";q.exports=lH()}}),KC=Ze({"src/traces/contourcarpet/attributes.js"(Z,q){"use strict";var v=p1(),x=V_(),A=Mu(),M=rs().extendFlat,e=x.contours;q.exports=M({carpet:{valType:"string",editType:"calc"},z:v.z,a:v.x,a0:v.x0,da:v.dx,b:v.y,b0:v.y0,db:v.dy,text:v.text,hovertext:v.hovertext,transpose:v.transpose,atype:v.xtype,btype:v.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}))}}),JC=Ze({"src/traces/contourcarpet/defaults.js"(Z,q){"use strict";var v=ca(),x=X2(),A=KC(),M=wM(),e=s3(),t=l3();q.exports=function(i,a,n,o){function s(d,T){return v.coerce(i,a,A,d,T)}function c(d){return v.coerce2(i,a,A,d)}if(s("carpet"),i.a&&i.b){var h=x(i,a,s,o,"a","b");if(!h){a.visible=!1;return}s("text");var m=s("contours.type")==="constraint";m?M(i,a,s,o,n,{hasHover:!1}):(e(i,a,s,c),t(i,a,s,o,{hasHover:!1}))}else a._defaultColor=n,a._length=null;s("zorder")}}}),cH=Ze({"src/traces/contourcarpet/calc.js"(Z,q){"use strict";var v=jp(),x=ca(),A=Z2(),M=Y2(),e=K2(),t=J2(),r=oM(),i=JC(),a=IT(),n=pM();q.exports=function(c,h){var m=h._carpetTrace=a(c,h);if(!(!m||!m.visible||m.visible==="legendonly")){if(!h.a||!h.b){var d=c.data[m.index],T=c.data[h.index];T.a||(T.a=d.a),T.b||(T.b=d.b),i(T,h,h._defaultColor,c._fullLayout)}var l=o(c,h);return n(h,h._z),l}};function o(s,c){var h=c._carpetTrace,m=h.aaxis,d=h.baxis,T,l,_,w,S,E,g;m._minDtick=0,d._minDtick=0,x.isArray1D(c.z)&&A(c,m,d,"a","b",["z"]),T=c._a=c._a||c.a,w=c._b=c._b||c.b,T=T?m.makeCalcdata(c,"_a"):[],w=w?d.makeCalcdata(c,"_b"):[],l=c.a0||0,_=c.da||1,S=c.b0||0,E=c.db||1,g=c._z=M(c._z||c.z,c.transpose),c._emptypoints=t(g),e(g,c._emptypoints);var b=x.maxRowLength(g),p=c.xtype==="scaled"?"":T,u=r(c,p,l,_,b,m),y=c.ytype==="scaled"?"":w,f=r(c,y,S,E,g.length,d),P={a:u,b:f,z:g};return c.contours.type==="levels"&&c.contours.coloring!=="none"&&v(s,c,{vals:g,containerStr:"",cLetter:"z"}),[P]}}}),fH=Ze({"src/traces/carpet/axis_aligned_line.js"(Z,q){"use strict";var v=ca().isArrayOrTypedArray;q.exports=function(x,A,M,e){var t,r,i,a,n,o,s,c,h,m,d,T,l,_=v(M)?"a":"b",w=_==="a"?x.aaxis:x.baxis,S=w.smoothing,E=_==="a"?x.a2i:x.b2j,g=_==="a"?M:e,b=_==="a"?e:M,p=_==="a"?A.a.length:A.b.length,u=_==="a"?A.b.length:A.a.length,y=Math.floor(_==="a"?x.b2j(b):x.a2i(b)),f=_==="a"?function(ue){return x.evalxy([],ue,y)}:function(ue){return x.evalxy([],y,ue)};S&&(i=Math.max(0,Math.min(u-2,y)),a=y-i,r=_==="a"?function(ue,se){return x.dxydi([],ue,i,se,a)}:function(ue,se){return x.dxydj([],i,ue,a,se)});var P=E(g[0]),L=E(g[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=f(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,se,H),E(O,F,P,L,ne,J,$,I,N,H,Ae),d(F,ue,p,B,Q,u,I),M.setClipUrl(F,I._clipPathId,p)})};function m(b,p){var u,y,f,P,L,z,F,B,O;for(u=0;uue&&(y.max=ue),y.len=y.max-y.min}function l(b,p,u){var y=b.getPointAtLength(p),f=b.getPointAtLength(u),P=f.x-y.x,L=f.y-y.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]),y=Math.sqrt(1-u*u);return y/u}function S(b,p,u,y,f,P){var L,z,F,B,O=e.ensureSingle(b,"g","contourbg"),I=O.selectAll("path").data(P==="fill"&&!f?[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+=ne(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+=ne(N,U)+"Z",N=null)}for(F=0;Fg):E=z>f,g=z;var F=m(f,P,L,z);F.pos=y,F.yc=(f+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=o.text[u]),S&&(F.htx=o.hovertext[u]),p.push(F)}else p.push({pos:y,empty:!0})}return o._extremes[h._id]=A.findExtremes(h,v.concat(l,T),{padded:!0}),p.length&&(p[0].t={labels:{open:x(n,"open:")+" ",high:x(n,"high:")+" ",low:x(n,"low:")+" ",close:x(n,"close:")+" "}}),p}function a(n,o,s){var c=s._minDiff;if(!c){var h=n._fullData,m=[];c=1/0;var d;for(d=0;d"+_.labels[z]+v.hoverLabelText(T,F,l.yhoverformat)):(O=x.extendFlat({},S),O.y0=O.y1=B,O.yLabelVal=F,O.yLabel=_.labels[z]+v.hoverLabelText(T,F,l.yhoverformat),O.name="",w.push(O),P[F]=O)}return w}function o(s,c,h,m){var d=s.cd,T=s.ya,l=d[0].trace,_=d[0].t,w=a(s,c,h,m);if(!w)return[];var S=w.index,E=d[S],g=w.index=E.i,b=E.dir;function p(F){return _.labels[F]+v.hoverLabelText(T,l[F][g],l.yhoverformat)}var u=E.hi||l.hoverinfo,y=u.split("+"),f=u==="all",P=f||y.indexOf("y")!==-1,L=f||y.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:i,hoverSplit:n,hoverOnPoints:o}}}),tk=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=[],i,a=M[0].t.bPos||0;if(A===!1)for(i=0;ic?function(l){return l<=0}:function(l){return l>=0};a.c2g=function(l){var _=a.c2l(l)-s;return(T(_)?_:0)+d},a.g2c=function(l){return a.l2c(l+s-d)},a.g2p=function(l){return l*m},a.c2p=function(l){return a.g2p(a.c2g(l))}}}function t(a,n){return n==="degrees"?A(a):a}function r(a,n){return n==="degrees"?M(a):a}function i(a,n){var o=a.type;if(o==="linear"){var s=a.d2c,c=a.c2d;a.d2c=function(h,m){return t(s(h),m)},a.c2d=function(h,m){return c(r(h,m))}}a.makeCalcdata=function(h,m){var d=h[m],T=h._length,l,_,w=function(p){return a.d2c(p,h.thetaunit)};if(d)for(l=new Array(T),_=0;_0?p:1/0},E=A(w,S),g=v.mod(E+1,w.length);return[w[E],w[g]]}function m(_){return Math.abs(_)>1e-10?_:0}function d(_,w,S){w=w||0,S=S||0;for(var E=_.length,g=new Array(E),b=0;b0?1:0}function x(r){var i=r[0],a=r[1];if(!isFinite(i)||!isFinite(a))return[1,0];var n=(i+1)*(i+1)+a*a;return[(i*i+a*a-1)/n,2*a/n]}function A(r,i){var a=i[0],n=i[1];return[a*r.radius+r.cx,-n*r.radius+r.cy]}function M(r,i){return i*r.radius}function e(r,i,a,n){var o=A(r,x([a,i])),s=o[0],c=o[1],h=A(r,x([n,i])),m=h[0],d=h[1];if(i===0)return["M"+s+","+c,"L"+m+","+d].join(" ");var T=M(r,1/Math.abs(i));return["M"+s+","+c,"A"+T+","+T+" 0 0,"+(i<0?1:0)+" "+m+","+d].join(" ")}function t(r,i,a,n){var o=M(r,1/(i+1)),s=A(r,x([i,a])),c=s[0],h=s[1],m=A(r,x([i,n])),d=m[0],T=m[1];if(v(a)!==v(n)){var l=A(r,x([i,0])),_=l[0],w=l[1];return["M"+c+","+h,"A"+o+","+o+" 0 0,"+(0it?(ot=re,tt=re*it,_e=(ce-tt)/X.h/2,ut=[j[0],j[1]],Me=[ee[0]+_e,ee[1]-_e]):(ot=ce/it,tt=ce,_e=(re-ot)/X.w/2,ut=[j[0]+_e,j[1]-_e],Me=[ee[0],ee[1]]),$.xLength2=ot,$.yLength2=tt,$.xDomain2=ut,$.yDomain2=Me;var fe=$.xOffset2=X.l+X.w*ut[0],Fe=$.yOffset2=X.t+X.h*(1-Me[1]),rt=$.radius=ot/ze,st=$.innerRadius=$.getHole(H)*rt,Qe=$.cx=fe-rt*Ae[0],Lt=$.cy=Fe+rt*Ae[3],kt=$.cxx=Qe-fe,qt=$.cyy=Lt-Fe,Zt=oe.side,Sr;Zt==="counterclockwise"?(Sr=Zt,Zt="top"):Zt==="clockwise"&&(Sr=Zt,Zt="bottom"),$.radialAxis=$.mockAxis(he,H,oe,{_id:"x",side:Zt,_trueSide:Sr,domain:[st/X.w,rt/X.w]}),$.angularAxis=$.mockAxis(he,H,ne,{side:"right",domain:[0,Math.PI],autorange:!1}),$.doAutoRange(he,H),$.updateAngularAxis(he,H),$.updateRadialAxis(he,H),$.updateRadialAxisTitle(he,H),$.xaxis=$.mockCartesianAxis(he,H,{_id:"x",domain:ut}),$.yaxis=$.mockCartesianAxis(he,H,{_id:"y",domain:Me});var xr=$.pathSubplot();$.clipPaths.forTraces.select("path").attr("d",xr).attr("transform",t(kt,qt)),J.frontplot.attr("transform",t(fe,Fe)).call(i.setClipUrl,$._hasClipOnAxisFalse?null:$.clipIds.forTraces,$.gd),J.bg.attr("d",xr).attr("transform",t(Qe,Lt)).call(r.fill,H.bgcolor)},U.mockAxis=function(he,H,$,J){var X=M.extendFlat({},$,J);return s(X,H,he),X},U.mockCartesianAxis=function(he,H,$){var J=this,X=J.isSmith,oe=$._id,ne=M.extendFlat({type:"linear"},$);o(ne,he);var j={x:[0,2],y:[1,3]};return ne.setRange=function(){var ee=J.sectorBBox,re=j[oe],ce=J.radialAxis._rl,be=(ce[1]-ce[0])/(1-J.getHole(H));ne.range=[ee[re[0]]*be,ee[re[1]]*be]},ne.isPtWithinRange=oe==="x"&&!X?function(ee){return J.isPtInside(ee)}:function(){return!0},ne.setRange(),ne.setScale(),ne},U.doAutoRange=function(he,H){var $=this,J=$.gd,X=$.radialAxis,oe=$.getRadial(H);c(J,X);var ne=X.range;if(oe.range=ne.slice(),oe._input.range=ne.slice(),X._rl=[X.r2l(ne[0],null,"gregorian"),X.r2l(ne[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($,f([rt.x,0]));return t(st[0]-j,st[1]-ee)}:function(rt){return t(be.l2p(rt.x)+ne,0)},We=ze?function(rt){return L($,rt.x,-1/0,1/0)}:function(rt){return $.pathArc(be.r2p(rt.x)+ne)},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 n.tickText(be,rt,!0,!1)}):n.calcTicks(be),ut=ze?tt:n.clipEnds(be,tt),Me=n.getTickSigns(be)[2];ze&&((be.ticks==="top"&&be.side==="bottom"||be.ticks==="bottom"&&be.side==="top")&&(Me=-Me),be.ticks==="top"&&be.side==="top"&&(ot=-be.ticklen),be.ticks==="bottom"&&be.side==="bottom"&&(ot=be.ticklen)),n.drawTicks(J,be,{vals:tt,layer:X["radial-axis"],path:n.makeTickPath(be,0,Me),transFn:Re,crisp:!1}),n.drawGrid(J,be,{vals:ut,layer:X["radial-grid"],path:We,transFn:M.noop,crisp:!1}),n.drawLabels(J,be,{vals:tt,layer:X["radial-axis"],transFn:Re,labelFns:n.makeLabelFns(be,ot)})}var _e=$.radialAxisAngle=$.vangles?I(ue(O(re.angle),$.vangles)):re.angle,fe=t(j,ee),Fe=fe+e(-_e);se(X["radial-axis"],Ae&&(re.showticklabels||re.ticks),{transform:Fe}),se(X["radial-grid"],Ae&&re.showgrid,{transform:ze?"":fe}),se(X["radial-line"].select("line"),Ae&&re.showline,{x1:ze?-oe:ne,y1:0,x2:oe,y2:0,transform:Fe}).attr("stroke-width",re.linewidth).call(r.stroke,re.linecolor)},U.updateRadialAxisTitle=function(he,H,$){if(!this.isSmith){var J=this,X=J.gd,oe=J.radius,ne=J.cx,j=J.cy,ee=J.getRadial(H),re=J.id+"title",ce=0;if(ee.title){var be=i.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,We=O(Re),it=Math.cos(We),ot=Math.sin(We),tt=ne+oe/2*it+ce*ot,ut=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:ut,"text-anchor":"middle"},transform:{rotate:-Re}})}},U.updateAngularAxis=function(he,H){var $=this,J=$.gd,X=$.layers,oe=$.radius,ne=$.innerRadius,j=$.cx,ee=$.cy,re=$.getAngular(H),ce=$.angularAxis,be=$.isSmith;be||($.fillViewInitialKey("angularaxis.rotation",re.rotation),ce.setGeometry(),ce.setScale());var Ae=be?function(st){var Qe=z($,f([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($,f([0,st.x]));return t(Qe[0],Qe[1])}:function(st){return ze(Ae(st))},We=be?function(st){var Qe=z($,f([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+ne*Lt,ee-ne*kt]+"L"+[j+oe*Lt,ee-oe*kt]},ot=n.makeLabelFns(ce,0),tt=ot.labelStandoff,ut={};ut.xFn=function(st){var Qe=Ae(st);return Math.cos(Qe)*tt},ut.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)},ut.anchorFn=function(st){var Qe=Ae(st),Lt=Math.cos(Qe);return Math.abs(Lt)<.1?"middle":Lt>0?"start":"end"},ut.heightFn=function(st,Qe,Lt){var kt=Ae(st);return-.5*(1+Math.sin(kt))*Lt};var Me=W(re);$.angularTickLayout!==Me&&(X["angular-axis"].selectAll("."+ce._id+"tick").remove(),$.angularTickLayout=Me);var _e=be?[1/0].concat(ce.tickvals||[]).map(function(st){return n.tickText(ce,st,!0,!1)}):n.calcTicks(ce);be&&(_e[0].text="\u221E",_e[0].fontSize*=1.75);var fe;if(H.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;n.drawTicks(J,ce,{vals:_e,layer:X["angular-axis"],path:"M"+Fe*rt+",0h"+Fe*ce.ticklen,transFn:We,crisp:!1}),n.drawGrid(J,ce,{vals:_e,layer:X["angular-grid"],path:it,transFn:M.noop,crisp:!1}),n.drawLabels(J,ce,{vals:_e,layer:X["angular-axis"],repositionOnUpdate:!0,transFn:Re,labelFns:ut})}se(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,H){if(!this.gd._context.staticPlot){var $=!this.isSmith;$&&(this.updateAngularDrag(he),this.updateRadialDrag(he,H,0),this.updateRadialDrag(he,H,1)),this.updateHoverAndMainDrag(he)}},U.updateHoverAndMainDrag=function(he){var H=this,$=H.isSmith,J=H.gd,X=H.layers,oe=he._zoomlayer,ne=p.MINZOOM,j=p.OFFEDGE,ee=H.radius,re=H.innerRadius,ce=H.cx,be=H.cy,Ae=H.cxx,ze=H.cyy,Re=H.sectorInRad,We=H.vangles,it=H.radialAxis,ot=u.clampTiny,tt=u.findXYatLength,ut=u.findEnclosingVertexAngles,Me=p.cornerHalfWidth,_e=p.cornerLen/2,fe,Fe,rt=h.makeDragger(X,"path","maindrag",he.dragmode===!1?"none":"crosshair");v.select(rt).attr("d",H.pathSubplot()).attr("transform",t(ce,be)),rt.onmousemove=function(rr){d.hover(J,rr,H.id),J._fullLayout._lasthover=rt,J._fullLayout._hoversubplot=H.id},rt.onmouseout=function(rr){J._dragging||m.unhover(J,rr)};var st={element:rt,gd:J,subplot:H.id,plotinfo:{id:H.id,xaxis:H.xaxis,yaxis:H.yaxis},xaxes:[H.xaxis],yaxes:[H.yaxis]},Qe,Lt,kt,qt,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 H.pathSector(2*Me);var Tr=_e/rr,la=Qt-Tr,Ua=Qt+Tr,Ba=Math.max(0,Math.min(rr,ee)),Ra=Ba-Me,Qa=Ba+Me;return"M"+Ke(Ra,la)+"A"+[Ra,Ra]+" 0,0,0 "+Ke(Ra,Ua)+"L"+Ke(Qa,Ua)+"A"+[Qa,Qa]+" 0,0,1 "+Ke(Qa,la)+"Z"}function Ee(rr,Qt,Tr){if(rr===0)return H.pathSector(2*Me);var la=Ke(rr,Qt),Ua=Ke(rr,Tr),Ba=ot((la[0]+Ua[0])/2),Ra=ot((la[1]+Ua[1])/2),Qa,za;if(Ba&&Ra){var en=Ra/Ba,kn=-1/en,Jt=tt(Me,en,Ba,Ra);Qa=tt(_e,kn,Jt[0][0],Jt[0][1]),za=tt(_e,kn,Jt[1][0],Jt[1][1])}else{var Nt,Kt;Ra?(Nt=_e,Kt=Me):(Nt=Me,Kt=_e),Qa=[[Ba-Nt,Ra-Kt],[Ba+Nt,Ra-Kt]],za=[[Ba-Nt,Ra+Kt],[Ba+Nt,Ra+Kt]]}return"M"+Qa.join("L")+"L"+za.reverse().join("L")+"Z"}function Ve(){kt=null,qt=null,Zt=H.pathSubplot(),Sr=!1;var rr=J._fullLayout[H.id];xr=x(rr.bgcolor).getLuminance(),jr=h.makeZoombox(oe,xr,ce,be,Zt),jr.attr("fill-rule","evenodd"),wr=h.makeCorners(oe,ce,be),w(J)}function Ce(rr,Qt){return Qt=Math.max(Math.min(Qt,ee),re),rrne?(rr-1&&rr===1&&_(Qt,J,[H.xaxis],[H.yaxis],H.id,st),Tr.indexOf("event")>-1&&d.click(J,Qt,H.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],We){var Qa=u.findPolygonOffset(ee,Re[0],Re[1],We);Qe+=Ae+Qa[0],Lt+=ze+Qa[1]}switch(la){case"zoom":st.clickFn=Gt,$||(We?st.moveFn=yt:st.moveFn=Pe,st.doneFn=Tt,Ve(rr,Qt,Tr));break;case"select":case"lasso":l(rr,Qt,Tr,st,la);break}},m.init(st)},U.updateRadialDrag=function(he,H,$){var J=this,X=J.gd,oe=J.layers,ne=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,We=Re[0],it=Re[1],ot=Re[$],tt=.75*(Re[1]-Re[0])/(1-J.getHole(H))/ne,ut,Me,_e;$?(ut=ee+(ne+Ae)*Math.cos(ze),Me=re-(ne+Ae)*Math.sin(ze),_e="radialdrag"):(ut=ee+(j-Ae)*Math.cos(ze),Me=re-(j-Ae)*Math.sin(ze),_e="radialdrag-inner");var fe=h.makeRectDragger(oe,_e,"crosshair",-Ae,-Ae,be,be),Fe={element:fe,gd:X};he.dragmode===!1&&(Fe.dragmode=!1),se(v.select(fe),ce.visible&&j0!=($?Qe>We: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:ne>=0&&ee>=0?ce=0:ce=Math.min(ne,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:ne<=0&&ee<=0?Ae=0:Ae=Math.max(ne,ee),[ce,be,Ae,ze]}function ue(he,H){var $=function(X){return M.angleDist(he,X)},J=M.findIndexOfMin(H,$);return H[J]}function se(he,H,$){return H?(he.attr("display",null),he.attr($)):he&&he.attr("display","none"),he}}}),ok=Ze({"src/plots/polar/layout_attributes.js"(Z,q){"use strict";var v=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"),i={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(i,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:v.background},radialaxis:i,angularaxis:a,gridshape:{valType:"enumerated",values:["circular","linear"],dflt:"circular",editType:"plot"},uirevision:{valType:"any",editType:"none"},editType:"calc"}}}),AH=Ze({"src/plots/polar/layout_defaults.js"(Z,q){"use strict";var v=ca(),x=Yi(),A=Dl(),M=ng(),e=Hh().getSubplotData,t=Xg(),r=t1(),i=$m(),a=Qm(),n=I2(),o=D_(),s=fS(),c=a1(),h=ok(),m=ak(),d=DT(),T=d.axisNames;function l(w,S,E,g){var b=E("bgcolor");g.bgColor=x.combine(b,g.paper_bgcolor);var p=E("sector");E("hole");var u=e(g.fullData,d.name,g.id),y=g.layoutOut,f;function P(be,Ae){return E(f+"."+be,Ae)}for(var L=0;L")}}q.exports={hoverPoints:x,makeHoverPointText:A}}}),EH=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:SH(),plot:MH(),style:ed().style,styleOnSelect:ed().styleOnSelect,hoverPoints:NT().hoverPoints,selectPoints:c1(),meta:{}}}}),CH=Ze({"lib/scatterpolar.js"(Z,q){"use strict";q.exports=EH()}}),sk=Ze({"src/traces/scatterpolargl/attributes.js"(Z,q){"use strict";var v=Cx(),x=_x(),A=Cs().texttemplateAttrs;q.exports={mode:v.mode,r:v.r,theta:v.theta,r0:v.r0,dr:v.dr,theta0:v.theta0,dtheta:v.dtheta,thetaunit:v.thetaunit,text:v.text,texttemplate:A({editType:"plot"},{keys:["r","theta","text"]}),hovertext:v.hovertext,hovertemplate:v.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:v.hoverinfo,selected:v.selected,unselected:v.unselected}}}),kH=Ze({"src/traces/scatterpolargl/defaults.js"(Z,q){"use strict";var v=ca(),x=Fu(),A=OT().handleRThetaDefaults,M=md(),e=Dd(),t=zd(),r=ev(),i=Tv().PTS_LINESONLY,a=sk();q.exports=function(o,s,c,h){function m(T,l){return v.coerce(o,s,a,T,l)}var d=A(o,s,h,m);if(!d){s.visible=!1;return}m("thetaunit"),m("mode",d=r&&(g.marker.cluster=_.tree),g.marker&&(g.markerSel.positions=g.markerUnsel.positions=g.marker.positions=y),g.line&&y.length>1&&t.extendFlat(g.line,e.linePositions(n,l,y)),g.text&&(t.extendFlat(g.text,{positions:y},e.textPosition(n,l,g.text,g.marker)),t.extendFlat(g.textSel,{positions:y},e.textPosition(n,l,g.text,g.markerSel)),t.extendFlat(g.textUnsel,{positions:y},e.textPosition(n,l,g.text,g.markerUnsel))),g.fill&&!m.fill2d&&(m.fill2d=!0),g.marker&&!m.scatter2d&&(m.scatter2d=!0),g.line&&!m.line2d&&(m.line2d=!0),g.text&&!m.glText&&(m.glText=!0),m.lineOptions.push(g.line),m.fillOptions.push(g.fill),m.markerOptions.push(g.marker),m.markerSelectedOptions.push(g.markerSel),m.markerUnselectedOptions.push(g.markerUnsel),m.textOptions.push(g.text),m.textSelectedOptions.push(g.textSel),m.textUnselectedOptions.push(g.textUnsel),m.selectBatch.push([]),m.unselectBatch.push([]),_.x=f,_.y=P,_.rawx=f,_.rawy=P,_.r=S,_.theta=E,_.positions=y,_._scene=m,_.index=m.count,m.count++}}),A(n,o,s)}},q.exports.reglPrecompiled=i}}),zH=Ze({"src/traces/scatterpolargl/index.js"(Z,q){"use strict";var v=RH();v.plot=DH(),q.exports=v}}),FH=Ze({"lib/scatterpolargl.js"(Z,q){"use strict";q.exports=zH()}}),lk=Ze({"src/traces/barpolar/attributes.js"(Z,q){"use strict";var v=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:v(),selected:M.selected,unselected:M.unselected};function e(){var t=x({},M.marker);return delete t.cornerradius,t}}}),uk=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"}}}}),OH=Ze({"src/traces/barpolar/defaults.js"(Z,q){"use strict";var v=ca(),x=OT().handleRThetaDefaults,A=j2(),M=lk();q.exports=function(t,r,i,a){function n(s,c){return v.coerce(t,r,M,s,c)}var o=x(t,r,a,n);if(!o){r.visible=!1;return}n("thetaunit"),n("base"),n("offset"),n("width"),n("text"),n("hovertext"),n("hovertemplate"),A(t,r,n,i,a),v.coerceSelectionMarkerOpacity(r,n)}}}),BH=Ze({"src/traces/barpolar/layout_defaults.js"(Z,q){"use strict";var v=ca(),x=uk();q.exports=function(A,M,e){var t={},r;function i(o,s){return v.coerce(A[r]||{},M[r],x,o,s)}for(var a=0;a0?(h=s,m=c):(h=c,m=s);var d=e.findEnclosingVertexAngles(h,r.vangles)[0],T=e.findEnclosingVertexAngles(m,r.vangles)[1],l=[d,(h+m)/2,T];return e.pathPolygonAnnulus(n,o,h,m,l,i,a)}:function(n,o,s,c){return A.pathAnnulus(n,o,s,c,i,a)}}}}),UH=Ze({"src/traces/barpolar/hover.js"(Z,q){"use strict";var v=ef(),x=ca(),A=f1().getTraceColor,M=x.fillText,e=NT().makeHoverPointText,t=zT().isPtInsidePolygon;q.exports=function(i,a,n){var o=i.cd,s=o[0].trace,c=i.subplot,h=c.radialAxis,m=c.angularAxis,d=c.vangles,T=d?t:x.isPtInsideSector,l=i.maxHoverDistance,_=m._period||2*Math.PI,w=Math.abs(h.g2p(Math.sqrt(a*a+n*n))),S=Math.atan2(n,a);h.range[0]>h.range[1]&&(S+=Math.PI);var E=function(u){return T(w,S,[u.rp0,u.rp1],[u.thetag0,u.thetag1],d)?l+Math.min(1,Math.abs(u.thetag1-u.thetag0)/_)-1+(u.rp1-w)/(u.rp1-u.rp0)-1:1/0};if(v.getClosest(o,E,i),i.index!==!1){var g=i.index,b=o[g];i.x0=i.x1=b.ct[0],i.y0=i.y1=b.ct[1];var p=x.extendFlat({},b,{r:b.s,theta:b.p});return M(b,s,i),e(p,s,c,i),i.hovertemplate=s.hovertemplate,i.color=A(s,b),i.xLabelVal=i.yLabelVal=void 0,b.s<0&&(i.idealAlign="left"),[i]}}}}),jH=Ze({"src/traces/barpolar/index.js"(Z,q){"use strict";q.exports={moduleType:"trace",name:"barpolar",basePlotModule:FT(),categories:["polar","bar","showLegend"],attributes:lk(),layoutAttributes:uk(),supplyDefaults:OH(),supplyLayoutDefaults:BH(),calc:ck().calc,crossTraceCalc:ck().crossTraceCalc,plot:NH(),colorbar:hp(),formatLabels:BT(),style:Nd().style,styleOnSelect:Nd().styleOnSelect,hoverPoints:UH(),selectPoints:h1(),meta:{}}}}),VH=Ze({"lib/barpolar.js"(Z,q){"use strict";q.exports=jH()}}),fk=Ze({"src/plots/smith/constants.js"(Z,q){"use strict";q.exports={attr:"subplot",name:"smith",axisNames:["realaxis","imaginaryaxis"],axisName2dataArray:{imaginaryaxis:"imag",realaxis:"real"}}}}),hk=Ze({"src/plots/smith/layout_attributes.js"(Z,q){"use strict";var v=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"),i=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:v.background},realaxis:i,imaginaryaxis:a,editType:"calc"}}}),qH=Ze({"src/plots/smith/layout_defaults.js"(Z,q){"use strict";var v=ca(),x=Yi(),A=Dl(),M=ng(),e=Hh().getSubplotData,t=Qm(),r=$m(),i=D_(),a=wv(),n=hk(),o=fk(),s=o.axisNames,c=m(function(d){return v.isTypedArray(d)&&(d=Array.from(d)),d.slice().reverse().map(function(T){return-T}).concat([0]).concat(d)},String);function h(d,T,l,_){var w=l("bgcolor");_.bgColor=x.combine(w,_.paper_bgcolor);var S=e(_.fullData,o.name,_.id),E=_.layoutOut,g;function b(U,W){return l(g+"."+U,W)}for(var p=0;p")}}q.exports={hoverPoints:x,makeHoverPointText:A}}}),KH=Ze({"src/traces/scattersmith/index.js"(Z,q){"use strict";q.exports={moduleType:"trace",name:"scattersmith",basePlotModule:GH(),categories:["smith","symbols","showLegend","scatter-like"],attributes:pk(),supplyDefaults:HH(),colorbar:hp(),formatLabels:WH(),calc:XH(),plot:ZH(),style:ed().style,styleOnSelect:ed().styleOnSelect,hoverPoints:YH().hoverPoints,selectPoints:c1(),meta:{}}}}),JH=Ze({"lib/scattersmith.js"(Z,q){"use strict";q.exports=KH()}}),Tp=Ze({"node_modules/world-calendars/dist/main.js"(Z,q){var v=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={}}v(x.prototype,{instance:function(i,a){i=(i||"gregorian").toLowerCase(),a=a||"";var n=this._localCals[i+"-"+a];if(!n&&this.calendars[i]&&(n=new this.calendars[i](a),this._localCals[i+"-"+a]=n),!n)throw(this.local.invalidCalendar||this.regionalOptions[""].invalidCalendar).replace(/\{0\}/,i);return n},newDate:function(i,a,n,o,s){return o=(i!=null&&i.year?i.calendar():typeof o=="string"?this.instance(o,s):o)||this.instance(),o.newDate(i,a,n)},substituteDigits:function(i){return function(a){return(a+"").replace(/[0-9]/g,function(n){return i[n]})}},substituteChineseDigits:function(i,a){return function(n){for(var o="",s=0;n>0;){var c=n%10;o=(c===0?"":i[c]+a[s])+o,s++,n=Math.floor(n/10)}return o.indexOf(i[1]+a[1])===0&&(o=o.substr(1)),o||i[0]}}});function A(i,a,n,o){if(this._calendar=i,this._year=a,this._month=n,this._day=o,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(i,a){return i=""+i,"000000".substring(0,a-i.length)+i}v(A.prototype,{newDate:function(i,a,n){return this._calendar.newDate(i??this,a,n)},year:function(i){return arguments.length===0?this._year:this.set(i,"y")},month:function(i){return arguments.length===0?this._month:this.set(i,"m")},day:function(i){return arguments.length===0?this._day:this.set(i,"d")},date:function(i,a,n){if(!this._calendar.isValid(i,a,n))throw(r.local.invalidDate||r.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name);return this._year=i,this._month=a,this._day=n,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(i,a){return this._calendar.add(this,i,a)},set:function(i,a){return this._calendar.set(this,i,a)},compareTo:function(i){if(this._calendar.name!==i._calendar.name)throw(r.local.differentCalendars||r.regionalOptions[""].differentCalendars).replace(/\{0\}/,this._calendar.local.name).replace(/\{1\}/,i._calendar.local.name);var a=this._year!==i._year?this._year-i._year:this._month!==i._month?this.monthOfYear()-i.monthOfYear():this._day-i._day;return a===0?0:a<0?-1:1},calendar:function(){return this._calendar},toJD:function(){return this._calendar.toJD(this)},fromJD:function(i){return this._calendar.fromJD(i)},toJSDate:function(){return this._calendar.toJSDate(this)},fromJSDate:function(i){return this._calendar.fromJSDate(i)},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"}v(e.prototype,{_validateLevel:0,newDate:function(i,a,n){return i==null?this.today():(i.year&&(this._validate(i,a,n,r.local.invalidDate||r.regionalOptions[""].invalidDate),n=i.day(),a=i.month(),i=i.year()),new A(this,i,a,n))},today:function(){return this.fromJSDate(new Date)},epoch:function(i){var a=this._validate(i,this.minMonth,this.minDay,r.local.invalidYear||r.regionalOptions[""].invalidYear);return a.year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(i){var a=this._validate(i,this.minMonth,this.minDay,r.local.invalidYear||r.regionalOptions[""].invalidYear);return(a.year()<0?"-":"")+M(Math.abs(a.year()),4)},monthsInYear:function(i){return this._validate(i,this.minMonth,this.minDay,r.local.invalidYear||r.regionalOptions[""].invalidYear),12},monthOfYear:function(i,a){var n=this._validate(i,a,this.minDay,r.local.invalidMonth||r.regionalOptions[""].invalidMonth);return(n.month()+this.monthsInYear(n)-this.firstMonth)%this.monthsInYear(n)+this.minMonth},fromMonthOfYear:function(i,a){var n=(a+this.firstMonth-2*this.minMonth)%this.monthsInYear(i)+this.minMonth;return this._validate(i,n,this.minDay,r.local.invalidMonth||r.regionalOptions[""].invalidMonth),n},daysInYear:function(i){var a=this._validate(i,this.minMonth,this.minDay,r.local.invalidYear||r.regionalOptions[""].invalidYear);return this.leapYear(a)?366:365},dayOfYear:function(i,a,n){var o=this._validate(i,a,n,r.local.invalidDate||r.regionalOptions[""].invalidDate);return o.toJD()-this.newDate(o.year(),this.fromMonthOfYear(o.year(),this.minMonth),this.minDay).toJD()+1},daysInWeek:function(){return 7},dayOfWeek:function(i,a,n){var o=this._validate(i,a,n,r.local.invalidDate||r.regionalOptions[""].invalidDate);return(Math.floor(this.toJD(o))+2)%this.daysInWeek()},extraInfo:function(i,a,n){return this._validate(i,a,n,r.local.invalidDate||r.regionalOptions[""].invalidDate),{}},add:function(i,a,n){return this._validate(i,this.minMonth,this.minDay,r.local.invalidDate||r.regionalOptions[""].invalidDate),this._correctAdd(i,this._add(i,a,n),a,n)},_add:function(i,a,n){if(this._validateLevel++,n==="d"||n==="w"){var o=i.toJD()+a*(n==="w"?this.daysInWeek():1),s=i.calendar().fromJD(o);return this._validateLevel--,[s.year(),s.month(),s.day()]}try{var c=i.year()+(n==="y"?a:0),h=i.monthOfYear()+(n==="m"?a:0),s=i.day(),m=function(l){for(;h_-1+l.minMonth;)c++,h-=_,_=l.monthsInYear(c)};n==="y"?(i.month()!==this.fromMonthOfYear(c,h)&&(h=this.newDate(c,i.month(),this.minDay).monthOfYear()),h=Math.min(h,this.monthsInYear(c)),s=Math.min(s,this.daysInMonth(c,this.fromMonthOfYear(c,h)))):n==="m"&&(m(this),s=Math.min(s,this.daysInMonth(c,this.fromMonthOfYear(c,h))));var d=[c,this.fromMonthOfYear(c,h),s];return this._validateLevel--,d}catch(T){throw this._validateLevel--,T}},_correctAdd:function(i,a,n,o){if(!this.hasYearZero&&(o==="y"||o==="m")&&(a[0]===0||i.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"]}[o],c=n<0?-1:1;a=this._add(i,n*s[0]+c*s[1],s[2])}return i.date(a[0],a[1],a[2])},set:function(i,a,n){this._validate(i,this.minMonth,this.minDay,r.local.invalidDate||r.regionalOptions[""].invalidDate);var o=n==="y"?a:i.year(),s=n==="m"?a:i.month(),c=n==="d"?a:i.day();return(n==="y"||n==="m")&&(c=Math.min(c,this.daysInMonth(o,s))),i.date(o,s,c)},isValid:function(i,a,n){this._validateLevel++;var o=this.hasYearZero||i!==0;if(o){var s=this.newDate(i,a,this.minDay);o=a>=this.minMonth&&a-this.minMonth=this.minDay&&n-this.minDay13.5?13:1),T=s-(d>2.5?4716:4715);return T<=0&&T--,this.newDate(T,d,m)},toJSDate:function(i,a,n){var o=this._validate(i,a,n,r.local.invalidDate||r.regionalOptions[""].invalidDate),s=new Date(o.year(),o.month()-1,o.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(i){return this.newDate(i.getFullYear(),i.getMonth()+1,i.getDate())}});var r=q.exports=new x;r.cdate=A,r.baseCalendar=e,r.calendars.gregorian=t}}),$H=Ze({"node_modules/world-calendars/dist/plus.js"(){var Z=sh(),q=Tp();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(v,x){return typeof v!="string"&&(x=v,v=""),this._calendar.formatDate(v||"",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(v,x,A){if(typeof v!="string"&&(A=x,x=v,v=""),!x)return"";if(x.calendar()!==this)throw q.local.invalidFormat||q.regionalOptions[""].invalidFormat;v=v||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,i=A.monthNames||this.local.monthNames,a=A.calculateWeek||this.local.calculateWeek,n=function(S,E){for(var g=1;w+g1},o=function(S,E,g,b){var p=""+E;if(n(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 i=="function"){l("m");var P=i.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,h=m;for(var f=this.daysInMonth(s,c);h>f;f=this.daysInMonth(s,c))c++,h-=f}return o>-1?this.fromJD(o):this.newDate(s,c,h)},determineDate:function(v,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(i){try{return t.parseDate(M,i,e)}catch{}i=i.toLowerCase();for(var a=(i.match(/^c/)&&A?A.newDate():null)||t.today(),n=/([+-]?[0-9]+)\s*(d|w|m|y)?/g,o=n.exec(i);o;)a.add(parseInt(o[1],10),o[2]||"d"),o=n.exec(i);return a};return x=x?x.newDate():null,v=v==null?x:typeof v=="string"?r(v):typeof v=="number"?isNaN(v)||v===1/0||v===-1/0?x:t.today().add(v,"d"):t.newDate(v),v}})}}),QH=Ze({"node_modules/world-calendars/dist/calendars/chinese.js"(){var Z=Tp(),q=sh(),v=Z.instance();function x(o){this.local=this.regionalOptions[o||""]||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(o,s){if(typeof o=="string"){var c=o.match(M);return c?c[0]:""}var h=this._validateYear(o),m=o.month(),d=""+this.toChineseMonth(h,m);return s&&d.length<2&&(d="0"+d),this.isIntercalaryMonth(h,m)&&(d+="i"),d},monthNames:function(o){if(typeof o=="string"){var s=o.match(e);return s?s[0]:""}var c=this._validateYear(o),h=o.month(),m=this.toChineseMonth(c,h),d=["\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"][m-1];return this.isIntercalaryMonth(c,h)&&(d="\u95F0"+d),d},monthNamesShort:function(o){if(typeof o=="string"){var s=o.match(t);return s?s[0]:""}var c=this._validateYear(o),h=o.month(),m=this.toChineseMonth(c,h),d=["\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D","\u4E03","\u516B","\u4E5D","\u5341","\u5341\u4E00","\u5341\u4E8C"][m-1];return this.isIntercalaryMonth(c,h)&&(d="\u95F0"+d),d},parseMonth:function(o,s){o=this._validateYear(o);var c=parseInt(s),h;if(isNaN(c))s[0]==="\u95F0"&&(h=!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 m=s[s.length-1];h=m==="i"||m==="I"}var d=this.toMonthIndex(o,c,h);return d},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(o,s){if(o.year&&(o=o.year()),typeof o!="number"||o<1888||o>2111)throw s.replace(/\{0\}/,this.local.name);return o},toMonthIndex:function(o,s,c){var h=this.intercalaryMonth(o),m=c&&s!==h;if(m||s<1||s>12)throw Z.local.invalidMonth.replace(/\{0\}/,this.local.name);var d;return h?!c&&s<=h?d=s-1:d=s:d=s-1,d},toChineseMonth:function(o,s){o.year&&(o=o.year(),s=o.month());var c=this.intercalaryMonth(o),h=c?12:11;if(s<0||s>h)throw Z.local.invalidMonth.replace(/\{0\}/,this.local.name);var m;return c?s>13;return c},isIntercalaryMonth:function(o,s){o.year&&(o=o.year(),s=o.month());var c=this.intercalaryMonth(o);return!!c&&c===s},leapYear:function(o){return this.intercalaryMonth(o)!==0},weekOfYear:function(o,s,c){var h=this._validateYear(o,Z.local.invalidyear),m=i[h-i[0]],d=m>>9&4095,T=m>>5&15,l=m&31,_;_=v.newDate(d,T,l),_.add(4-(_.dayOfWeek()||7),"d");var w=this.toJD(o,s,c)-_.toJD();return 1+Math.floor(w/7)},monthsInYear:function(o){return this.leapYear(o)?13:12},daysInMonth:function(o,s){o.year&&(s=o.month(),o=o.year()),o=this._validateYear(o);var c=r[o-r[0]],h=c>>13,m=h?12:11;if(s>m)throw Z.local.invalidMonth.replace(/\{0\}/,this.local.name);var d=c&1<<12-s?30:29;return d},weekDay:function(o,s,c){return(this.dayOfWeek(o,s,c)||7)<6},toJD:function(o,s,c){var h=this._validate(o,d,c,Z.local.invalidDate);o=this._validateYear(h.year()),s=h.month(),c=h.day();var m=this.isIntercalaryMonth(o,s),d=this.toChineseMonth(o,s),T=n(o,d,c,m);return v.toJD(T.year,T.month,T.day)},fromJD:function(o){var s=v.fromJD(o),c=a(s.year(),s.month(),s.day()),h=this.toMonthIndex(c.year,c.month,c.isIntercalary);return this.newDate(c.year,h,c.day)},fromString:function(o){var s=o.match(A),c=this._validateYear(+s[1]),h=+s[2],m=!!s[3],d=this.toMonthIndex(c,h,m),T=+s[4];return this.newDate(c,d,T)},add:function(o,s,c){var h=o.year(),m=o.month(),d=this.isIntercalaryMonth(h,m),T=this.toChineseMonth(h,m),l=Object.getPrototypeOf(x.prototype).add.call(this,o,s,c);if(c==="y"){var _=l.year(),w=l.month(),S=this.isIntercalaryMonth(_,T),E=d&&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],i=[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(o,s,c,h){var m,d;if(typeof o=="object")m=o,d=s||{};else{var T=typeof o=="number"&&o>=1888&&o<=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");m={year:o,month:s,day:c},d=h||{}}var w=i[m.year-i[0]],S=m.year<<9|m.month<<5|m.day;d.year=S>=w?m.year:m.year-1,w=i[d.year-i[0]];var E=w>>9&4095,g=w>>5&15,b=w&31,p,u=new Date(E,g-1,b),y=new Date(m.year,m.month-1,m.day);p=Math.round((y-u)/(24*3600*1e3));var f=r[d.year-r[0]],P;for(P=0;P<13;P++){var L=f&1<<12-P?30:29;if(p>13;return!z||P=1888&&o<=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 h=="object"?(S=!1,d=h):(S=!!h,d=m||{}),T={year:o,month:s,day:c,isIntercalary:S}}var E;E=T.day-1;var g=r[T.year-r[0]],b=g>>13,p;b&&(T.month>b||T.isIntercalary)?p=T.month:p=T.month-1;for(var u=0;u>9&4095,L=f>>5&15,z=f&31,F=new Date(P,L-1,z+E);return d.year=F.getFullYear(),d.month=1+F.getMonth(),d.day=F.getDate(),d}}}),eW=Ze({"node_modules/world-calendars/dist/calendars/coptic.js"(){var Z=Tp(),q=sh();function v(x){this.local=this.regionalOptions[x||""]||this.regionalOptions[""]}v.prototype=new Z.baseCalendar,q(v.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=v}}),tW=Ze({"node_modules/world-calendars/dist/calendars/discworld.js"(){var Z=Tp(),q=sh();function v(A){this.local=this.regionalOptions[A||""]||this.regionalOptions[""]}v.prototype=new Z.baseCalendar,q(v.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=v}}),rW=Ze({"node_modules/world-calendars/dist/calendars/ethiopian.js"(){var Z=Tp(),q=sh();function v(x){this.local=this.regionalOptions[x||""]||this.regionalOptions[""]}v.prototype=new Z.baseCalendar,q(v.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=v}}),aW=Ze({"node_modules/world-calendars/dist/calendars/hebrew.js"(){var Z=Tp(),q=sh();function v(A){this.local=this.regionalOptions[A||""]||this.regionalOptions[""]}v.prototype=new Z.baseCalendar,q(v.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,i=this.jdEpoch+this._delay1(r)+this._delay2(r)+e+1;if(M<7){for(var a=7;a<=this.monthsInYear(A);a++)i+=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=v}}),nW=Ze({"node_modules/world-calendars/dist/calendars/islamic.js"(){var Z=Tp(),q=sh();function v(x){this.local=this.regionalOptions[x||""]||this.regionalOptions[""]}v.prototype=new Z.baseCalendar,q(v.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=v}}),iW=Ze({"node_modules/world-calendars/dist/calendars/julian.js"(){var Z=Tp(),q=sh();function v(x){this.local=this.regionalOptions[x||""]||this.regionalOptions[""]}v.prototype=new Z.baseCalendar,q(v.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),i=r-Math.floor(r<14?1:13),a=e-Math.floor(i>2?4716:4715),n=M-t-Math.floor(30.6001*r);return a<=0&&a--,this.newDate(a,i,n)}}),Z.calendars.julian=v}}),oW=Ze({"node_modules/world-calendars/dist/calendars/mayan.js"(){var Z=Tp(),q=sh();function v(M){this.local=this.regionalOptions[M||""]||this.regionalOptions[""]}v.prototype=new Z.baseCalendar,q(v.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),i=r.toJD(),a=this._toHaab(i),n=this._toTzolkin(i);return{haabMonthName:this.local.haabMonths[a[0]-1],haabMonth:a[0],haabDay:a[1],tzolkinDayName:this.local.tzolkinMonths[n[0]-1],tzolkinDay:n[0],tzolkinTrecena:n[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=v}}),sW=Ze({"node_modules/world-calendars/dist/calendars/nanakshahi.js"(){var Z=Tp(),q=sh();function v(A){this.local=this.regionalOptions[A||""]||this.regionalOptions[""]}v.prototype=new Z.baseCalendar;var x=Z.instance("gregorian");q(v.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 i=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=v}}),lW=Ze({"node_modules/world-calendars/dist/calendars/nepali.js"(){var Z=Tp(),q=sh();function v(x){this.local=this.regionalOptions[x||""]||this.regionalOptions[""]}v.prototype=new Z.baseCalendar,q(v.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,i=A,a=x;this._createMissingCalendarData(x);var n=x-(i>9||i===9&&M>=this.NEPALI_CALENDAR_DATA[a][0]?56:57);for(A!==9&&(r=M,i--);i!==9;)i<=0&&(i=12,a--),r+=this.NEPALI_CALENDAR_DATA[a][i],i--;return A===9?(r+=M-this.NEPALI_CALENDAR_DATA[a][0],r<0&&(r+=t.daysInYear(n))):r+=this.NEPALI_CALENDAR_DATA[a][9]-this.NEPALI_CALENDAR_DATA[a][0],t.newDate(n,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 i=9,a=this.NEPALI_CALENDAR_DATA[r][0],n=this.NEPALI_CALENDAR_DATA[r][i]-a+1;t>n;)i++,i>12&&(i=1,r++),n+=this.NEPALI_CALENDAR_DATA[r][i];var o=this.NEPALI_CALENDAR_DATA[r][i]-(n-t);return this.newDate(r,i,o)},_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=v}}),uW=Ze({"node_modules/world-calendars/dist/calendars/persian.js"(){var Z=Tp(),q=sh();function v(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),i=t-Math.floor(t),a=r-Math.floor(r);return i>a}v.prototype=new Z.baseCalendar,q(v.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 i=1;i0?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),i=A-this.toJD(e,r,1)+1;return this.newDate(e,r,i)}}),Z.calendars.persian=v,Z.calendars.jalali=v}}),cW=Ze({"node_modules/world-calendars/dist/calendars/taiwan.js"(){var Z=Tp(),q=sh(),v=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 v.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 v.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 v.toJD(r,t.month(),t.day())},fromJD:function(A){var M=v.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}}),fW=Ze({"node_modules/world-calendars/dist/calendars/thai.js"(){var Z=Tp(),q=sh(),v=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 v.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 v.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 v.toJD(r,t.month(),t.day())},fromJD:function(A){var M=v.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}}),hW=Ze({"node_modules/world-calendars/dist/calendars/ummalqura.js"(){var Z=Tp(),q=sh();function v(A){this.local=this.regionalOptions[A||""]||this.regionalOptions[""]}v.prototype=new Z.baseCalendar,q(v.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,i=0;it)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,i=t.day()+x[r-1]-1;return i+24e5-.5},fromJD:function(A){for(var M=A-24e5+.5,e=0,t=0;tM);t++)e++;var r=e+15292,i=Math.floor((r-1)/12),a=i+1,n=r-12*i,o=M-x[e-1]+1;return this.newDate(a,n,o)},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=v;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]}}),pW=Ze({"src/components/calendars/calendars.js"(Z,q){"use strict";q.exports=Tp(),$H(),QH(),eW(),tW(),rW(),aW(),nW(),iW(),oW(),sW(),lW(),uW(),cW(),fW(),hW()}}),dW=Ze({"src/components/calendars/index.js"(Z,q){"use strict";var v=pW(),x=ca(),A=Vs(),M=A.EPOCHJD,e=A.ONEDAY,t={valType:"enumerated",values:x.sortObjectKeys(v.calendars),editType:"calc",dflt:"gregorian"},r=function(g,b,p,u){var y={};return y[p]=t,x.coerce(g,b,y,p,u)},i=function(g,b,p,u){for(var y=0;y0){if(++ge>=jZ)return arguments[0]}else ge=0;return le.apply(void 0,arguments)}}var Lb=GZ;var HZ=Lb(Tb),Pb=HZ;var WZ=/\{\n\/\* \[wrapped with (.+)\] \*/,XZ=/,? & /;function ZZ(le){var ge=le.match(WZ);return ge?ge[1].split(XZ):[]}var uL=ZZ;var YZ=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;function KZ(le,ge){var Ye=ge.length;if(!Ye)return le;var Pt=Ye-1;return ge[Pt]=(Ye>1?"& ":"")+ge[Pt],ge=ge.join(Ye>2?", ":" "),le.replace(YZ,`{ /* [wrapped with `+ge+`] */ `)}var cL=KZ;function JZ(le){return function(){return le}}var $0=JZ;var $Z=function(){try{var le=ld(Object,"defineProperty");return le({},"",{}),le}catch{}}(),Q0=$Z;var QZ=Q0?function(le,ge){return Q0(le,"toString",{configurable:!0,enumerable:!1,value:$0(ge),writable:!0})}:Fc,fL=QZ;var eY=Lb(fL),ey=eY;function tY(le,ge){for(var Ye=-1,Pt=le==null?0:le.length;++Ye-1}var Sm=oY;var sY=1,lY=2,uY=8,cY=16,fY=32,hY=64,pY=128,dY=256,vY=512,mY=[["ary",pY],["bind",sY],["bindKey",lY],["curry",uY],["curryRight",cY],["flip",vY],["partial",fY],["partialRight",hY],["rearg",dY]];function gY(le,ge){return Nh(mY,function(Ye){var Pt="_."+Ye[0];ge&Ye[1]&&!Sm(le,Pt)&&le.push(Pt)}),le.sort()}var pL=gY;function yY(le,ge,Ye){var Pt=ge+"";return ey(le,cL(Pt,pL(uL(Pt),Ye)))}var Rb=yY;var _Y=1,xY=2,bY=4,wY=8,dL=32,vL=64;function TY(le,ge,Ye,Pt,vr,Zr,ka,sn,fn,Li){var bi=ge&wY,Fi=bi?ka:void 0,Uo=bi?void 0:ka,ws=bi?Zr:void 0,mo=bi?void 0:Zr;ge|=bi?dL:vL,ge&=~(bi?vL:dL),ge&bY||(ge&=~(_Y|xY));var Ze=[le,ge,vr,ws,Fi,mo,Uo,sn,fn,Li],Ws=Ye.apply(void 0,Ze);return n_(le)&&Pb(Ws,Ze),Ws.placeholder=Pt,Rb(Ws,le,ge)}var Db=TY;function AY(le){var ge=le;return ge.placeholder}var Sd=AY;var SY=9007199254740991,MY=/^(?:0|[1-9]\d*)$/;function EY(le,ge){var Ye=typeof le;return ge=ge??SY,!!ge&&(Ye=="number"||Ye!="symbol"&&MY.test(le))&&le>-1&&le%1==0&&le1&&cu.reverse(),bi&&fn-1&&le%1==0&&le<=aK}var Mm=nK;function iK(le){return le!=null&&Mm(le.length)&&!ap(le)}var jc=iK;function oK(le,ge,Ye){if(!kl(Ye))return!1;var Pt=typeof ge;return(Pt=="number"?jc(Ye)&&np(ge,Ye.length):Pt=="string"&&ge in Ye)?nh(Ye[ge],le):!1}var Oc=oK;function sK(le){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=le.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 YL=FJ;function OJ(le,ge){var Ye=this.__data__,Pt=Cm(Ye,le);return Pt<0?(++this.size,Ye.push([le,ge])):Ye[Pt][1]=ge,this}var KL=OJ;function sy(le){var ge=-1,Ye=le==null?0:le.length;for(this.clear();++ge0&&Ye(sn)?ge>1?oP(sn,ge-1,Ye,Pt,vr):Dp(vr,sn):Pt||(vr[vr.length]=sn)}return vr}var Qu=oP;function s$(le){var ge=le==null?0:le.length;return ge?Qu(le,1):[]}var jb=s$;function l$(le){return ey(Fb(le,void 0,jb),le+"")}var lp=l$;var u$=lp(cy),sP=u$;var c$=Bb(Object.getPrototypeOf,Object),Im=c$;var f$="[object Object]",h$=Function.prototype,p$=Object.prototype,lP=h$.toString,d$=p$.hasOwnProperty,v$=lP.call(Object);function m$(le){if(!Rl(le)||zc(le)!=f$)return!1;var ge=Im(le);if(ge===null)return!0;var Ye=d$.call(ge,"constructor")&&ge.constructor;return typeof Ye=="function"&&Ye instanceof Ye&&lP.call(Ye)==v$}var gv=m$;var g$="[object DOMException]",y$="[object Error]";function _$(le){if(!Rl(le))return!1;var ge=zc(le);return ge==y$||ge==g$||typeof le.message=="string"&&typeof le.name=="string"&&!gv(le)}var fy=_$;var x$=Ho(function(le,ge){try{return _f(le,void 0,ge)}catch(Ye){return fy(Ye)?Ye:new Error(Ye)}}),Vb=x$;var b$="Expected a function";function w$(le,ge){var Ye;if(typeof ge!="function")throw new TypeError(b$);return le=Go(le),function(){return--le>0&&(Ye=ge.apply(this,arguments)),le<=1&&(ge=void 0),Ye}}var qb=w$;var T$=1,A$=32,PA=Ho(function(le,ge,Ye){var Pt=T$;if(Ye.length){var vr=Yp(Ye,Sd(PA));Pt|=A$}return ip(le,Pt,ge,Ye,vr)});PA.placeholder={};var Gb=PA;var S$=lp(function(le,ge){return Nh(ge,function(Ye){Ye=Sh(Ye),op(le,Ye,Gb(le[Ye],le))}),le}),uP=S$;var M$=1,E$=2,C$=32,IA=Ho(function(le,ge,Ye){var Pt=M$|E$;if(Ye.length){var vr=Yp(Ye,Sd(IA));Pt|=C$}return ip(ge,Pt,le,Ye,vr)});IA.placeholder={};var cP=IA;function k$(le,ge,Ye){var Pt=-1,vr=le.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?le:Xf(le,ge,Ye)}var zp=L$;var P$="\\ud800-\\udfff",I$="\\u0300-\\u036f",R$="\\ufe20-\\ufe2f",D$="\\u20d0-\\u20ff",z$=I$+R$+D$,F$="\\ufe0e\\ufe0f",O$="\\u200d",B$=RegExp("["+O$+P$+z$+F$+"]");function N$(le){return B$.test(le)}var Cd=N$;function U$(le){return le.split("")}var fP=U$;var hP="\\ud800-\\udfff",j$="\\u0300-\\u036f",V$="\\ufe20-\\ufe2f",q$="\\u20d0-\\u20ff",G$=j$+V$+q$,H$="\\ufe0e\\ufe0f",W$="["+hP+"]",RA="["+G$+"]",DA="\\ud83c[\\udffb-\\udfff]",X$="(?:"+RA+"|"+DA+")",pP="[^"+hP+"]",dP="(?:\\ud83c[\\udde6-\\uddff]){2}",vP="[\\ud800-\\udbff][\\udc00-\\udfff]",Z$="\\u200d",mP=X$+"?",gP="["+H$+"]?",Y$="(?:"+Z$+"(?:"+[pP,dP,vP].join("|")+")"+gP+mP+")*",K$=gP+mP+Y$,J$="(?:"+[pP+RA+"?",RA,dP,vP,W$].join("|")+")",$$=RegExp(DA+"(?="+DA+")|"+J$+K$,"g");function Q$(le){return le.match($$)||[]}var yP=Q$;function eQ(le){return Cd(le)?yP(le):fP(le)}var Uh=eQ;function tQ(le){return function(ge){ge=Ds(ge);var Ye=Cd(ge)?Uh(ge):void 0,Pt=Ye?Ye[0]:ge.charAt(0),vr=Ye?zp(Ye,1).join(""):ge.slice(1);return Pt[le]()+vr}}var Hb=tQ;var rQ=Hb("toUpperCase"),hy=rQ;function aQ(le){return hy(Ds(le).toLowerCase())}var Wb=aQ;function nQ(le,ge,Ye,Pt){var vr=-1,Zr=le==null?0:le.length;for(Pt&&Zr&&(Ye=le[++vr]);++vr=ge?le:ge)),le}var cd=aee;function nee(le,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(le),ge,Ye)}var GP=nee;function iee(){this.__data__=new km,this.size=0}var HP=iee;function oee(le){var ge=this.__data__,Ye=ge.delete(le);return this.size=ge.size,Ye}var WP=oee;function see(le){return this.__data__.get(le)}var XP=see;function lee(le){return this.__data__.has(le)}var ZP=lee;var uee=200;function cee(le,ge){var Ye=this.__data__;if(Ye instanceof km){var Pt=Ye.__data__;if(!Lm||Pt.lengthsn))return!1;var Li=Zr.get(le),bi=Zr.get(ge);if(Li&&bi)return Li==ge&&bi==le;var Fi=-1,Uo=!0,ws=Ye&cre?new Dm:void 0;for(Zr.set(le,ge),Zr.set(ge,le);++Fi=ge||$p<0||Fi&&Np>=Zr}function Yl(){var Oi=Ly();if(Ws(Oi))return cu(Oi);sn=setTimeout(Yl,Ze(Oi))}function cu(Oi){return sn=void 0,Uo&&Pt?ws(Oi):(Pt=vr=void 0,ka)}function ih(){sn!==void 0&&clearTimeout(sn),Li=0,Pt=fn=vr=sn=void 0}function Eh(){return sn===void 0?ka:cu(Ly())}function Bp(){var Oi=Ly(),$p=Ws(Oi);if(Pt=arguments,vr=this,fn=Oi,$p){if(sn===void 0)return mo(fn);if(Fi)return clearTimeout(sn),sn=setTimeout(Yl,ge),ws(fn)}return sn===void 0&&(sn=setTimeout(Yl,ge)),ka}return Bp.cancel=ih,Bp.flush=Eh,Bp}var _w=Tae;function Aae(le,ge){return le==null||le!==le?ge:le}var $6=Aae;var Q6=Object.prototype,Sae=Q6.hasOwnProperty,Mae=Ho(function(le,ge){le=Object(le);var Ye=-1,Pt=ge.length,vr=Pt>2?ge[2]:void 0;for(vr&&Oc(ge[0],ge[1],vr)&&(Pt=1);++Ye=Nae&&(Zr=Gv,ka=!1,ge=new Dm(ge));e:for(;++vr=0&&le.slice(Ye,vr)==ge}var gI=nne;function ine(le,ge){return Sl(ge,function(Ye){return[Ye,le[Ye]]})}var yI=ine;function one(le){var ge=-1,Ye=Array(le.size);return le.forEach(function(Pt){Ye[++ge]=[Pt,Pt]}),Ye}var _I=one;var sne="[object Map]",lne="[object Set]";function une(le){return function(ge){var Ye=jh(ge);return Ye==sne?Ay(ge):Ye==lne?_I(ge):yI(ge,le(ge))}}var Sw=une;var cne=Sw(du),p_=cne;var fne=Sw(Vc),d_=fne;var hne={"&":"&","<":"<",">":">",'"':""","'":"'"},pne=dy(hne),xI=pne;var bI=/[&<>"']/g,dne=RegExp(bI.source);function vne(le){return le=Ds(le),le&&dne.test(le)?le.replace(bI,xI):le}var Mw=vne;var wI=/[\\^$.*+?()[\]{}|]/g,mne=RegExp(wI.source);function gne(le){return le=Ds(le),le&&mne.test(le)?le.replace(wI,"\\$&"):le}var TI=gne;function yne(le,ge){for(var Ye=-1,Pt=le==null?0:le.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=Ene;var Cne=Math.max;function kne(le,ge,Ye){var Pt=le==null?0:le.length;if(!Pt)return-1;var vr=Ye==null?0:Go(Ye);return vr<0&&(vr=Cne(Pt+vr,0)),Am(le,wo(ge,3),vr)}var Pw=kne;var Lne=Lw(Pw),kI=Lne;function Pne(le,ge,Ye){var Pt;return Ye(le,function(vr,Zr,ka){if(ge(vr,Zr,ka))return Pt=Zr,!1}),Pt}var Iw=Pne;function Ine(le,ge){return Iw(le,wo(ge,3),cp)}var LI=Ine;var Rne=Math.max,Dne=Math.min;function zne(le,ge,Ye){var Pt=le==null?0:le.length;if(!Pt)return-1;var vr=Pt-1;return Ye!==void 0&&(vr=Go(Ye),vr=Ye<0?Rne(Pt+vr,0):Dne(vr,Pt-1)),Am(le,wo(ge,3),vr,!0)}var Rw=zne;var Fne=Lw(Rw),PI=Fne;function One(le,ge){return Iw(le,wo(ge,3),Ry)}var II=One;function Bne(le){return le&&le.length?le[0]:void 0}var v_=Bne;function Nne(le,ge){var Ye=-1,Pt=jc(le)?Array(le.length):[];return Op(le,function(vr,Zr,ka){Pt[++Ye]=ge(vr,Zr,ka)}),Pt}var Dw=Nne;function Une(le,ge){var Ye=Do(le)?Sl:Dw;return Ye(le,wo(ge,3))}var Nm=Une;function jne(le,ge){return Qu(Nm(le,ge),1)}var RI=jne;var Vne=1/0;function qne(le,ge){return Qu(Nm(le,ge),Vne)}var DI=qne;function Gne(le,ge,Ye){return Ye=Ye===void 0?1:Go(Ye),Qu(Nm(le,ge),Ye)}var zI=Gne;var Hne=1/0;function Wne(le){var ge=le==null?0:le.length;return ge?Qu(le,Hne):[]}var FI=Wne;function Xne(le,ge){var Ye=le==null?0:le.length;return Ye?(ge=ge===void 0?1:Go(ge),Qu(le,ge)):[]}var OI=Xne;var Zne=512;function Yne(le){return ip(le,Zne)}var BI=Yne;var Kne=my("floor"),NI=Kne;var Jne="Expected a function",$ne=8,Qne=32,eie=128,tie=256;function rie(le){return lp(function(ge){var Ye=ge.length,Pt=Ye,vr=Ip.prototype.thru;for(le&&ge.reverse();Pt--;){var Zr=ge[Pt];if(typeof Zr!="function")throw new TypeError(Jne);if(vr&&!ka&&J0(Zr)=="wrapper")var ka=new Ip([],!0)}for(Pt=ka?Pt:Ye;++Ptge}var Dy=mie;function gie(le){return function(ge,Ye){return typeof ge=="string"&&typeof Ye=="string"||(ge=Th(ge),Ye=Th(Ye)),le(ge,Ye)}}var jm=gie;var yie=jm(Dy),KI=yie;var _ie=jm(function(le,ge){return le>=ge}),JI=_ie;var xie=Object.prototype,bie=xie.hasOwnProperty;function wie(le,ge){return le!=null&&bie.call(le,ge)}var $I=wie;function Tie(le,ge){return le!=null&&pw(le,ge,$I)}var QI=Tie;var Aie=Math.max,Sie=Math.min;function Mie(le,ge,Ye){return le>=Sie(ge,Ye)&&le-1:!!vr&&Ad(le,ge,Ye)>-1}var rR=Rie;var Die=Math.max;function zie(le,ge,Ye){var Pt=le==null?0:le.length;if(!Pt)return-1;var vr=Ye==null?0:Go(Ye);return vr<0&&(vr=Die(Pt+vr,0)),Ad(le,ge,vr)}var aR=zie;function Fie(le){var ge=le==null?0:le.length;return ge?Xf(le,0,-1):[]}var nR=Fie;var Oie=Math.min;function Bie(le,ge,Ye){for(var Pt=Ye?Iy:Sm,vr=le[0].length,Zr=le.length,ka=Zr,sn=Array(Zr),fn=1/0,Li=[];ka--;){var bi=le[ka];ka&&ge&&(bi=Sl(bi,bf(ge))),fn=Oie(bi.length,fn),sn[ka]=!Ye&&(ge||vr>=120&&bi.length>=120)?new Dm(ka&&bi):void 0}bi=le[0];var Fi=-1,Uo=sn[0];e:for(;++Fi=-zR&&le<=zR}var FR=Roe;function Doe(le){return le===void 0}var OR=Doe;var zoe="[object WeakMap]";function Foe(le){return Rl(le)&&jh(le)==zoe}var BR=Foe;var Ooe="[object WeakSet]";function Boe(le){return Rl(le)&&zc(le)==Ooe}var NR=Boe;var Noe=1;function Uoe(le){return wo(typeof le=="function"?le:up(le,Noe))}var UR=Uoe;var joe=Array.prototype,Voe=joe.join;function qoe(le,ge){return le==null?"":Voe.call(le,ge)}var jR=qoe;var Goe=kd(function(le,ge,Ye){return le+(Ye?"-":"")+ge.toLowerCase()}),VR=Goe;var Hoe=Om(function(le,ge,Ye){op(le,Ye,ge)}),qR=Hoe;function Woe(le,ge,Ye){for(var Pt=Ye+1;Pt--;)if(le[Pt]===ge)return Pt;return Pt}var GR=Woe;var Xoe=Math.max,Zoe=Math.min;function Yoe(le,ge,Ye){var Pt=le==null?0:le.length;if(!Pt)return-1;var vr=Pt;return Ye!==void 0&&(vr=Go(Ye),vr=vr<0?Xoe(Pt+vr,0):Zoe(vr,Pt-1)),ge===ge?GR(le,ge,vr):Am(le,Ib,vr,!0)}var HR=Yoe;var Koe=kd(function(le,ge,Ye){return le+(Ye?" ":"")+ge.toLowerCase()}),WR=Koe;var Joe=Hb("toLowerCase"),XR=Joe;function $oe(le,ge){return le=this.__values__.length,ge=le?void 0:this.__values__[this.__index__++];return{done:le,value:ge}}var fD=Cse;function kse(le,ge){var Ye=le.length;if(Ye)return ge+=ge<0?Ye:0,np(ge,Ye)?le[ge]:void 0}var qw=kse;function Lse(le,ge){return le&&le.length?qw(le,Go(ge)):void 0}var hD=Lse;function Pse(le){return le=Go(le),Ho(function(ge){return qw(ge,le)})}var pD=Pse;function Ise(le,ge){return ge=Rp(ge,le),le=Ow(le,ge),le==null||delete le[Sh(wf(ge))]}var jy=Ise;function Rse(le){return gv(le)?void 0:le}var dD=Rse;var Dse=1,zse=2,Fse=4,Ose=lp(function(le,ge){var Ye={};if(le==null)return Ye;var Pt=!1;ge=Sl(ge,function(Zr){return Zr=Rp(Zr,le),Pt||(Pt=Zr.length>1),Zr}),Ah(le,xy(le),Ye),Pt&&(Ye=up(Ye,Dse|zse|Fse,dD));for(var vr=ge.length;vr--;)jy(Ye,ge[vr]);return Ye}),vD=Ose;function Bse(le,ge,Ye,Pt){if(!kl(le))return le;ge=Rp(ge,le);for(var vr=-1,Zr=ge.length,ka=Zr-1,sn=le;sn!=null&&++vrge||Zr&&ka&&fn&&!sn&&!Li||Pt&&ka&&fn||!Ye&&fn||!vr)return 1;if(!Pt&&!Zr&&!Li&&le=sn)return fn;var Li=Ye[Pt];return fn*(Li=="desc"?-1:1)}}return le.index-ge.index}var _D=Hse;function Wse(le,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(wo));var vr=Dw(le,function(Zr,ka,sn){var fn=Sl(ge,function(Li){return Li(Zr)});return{criteria:fn,index:++Pt,value:Zr}});return yD(vr,function(Zr,ka){return _D(Zr,ka,Ye)})}var Xw=Wse;function Xse(le,ge,Ye,Pt){return le==null?[]:(Do(ge)||(ge=ge==null?[]:[ge]),Ye=Pt?void 0:Ye,Do(Ye)||(Ye=Ye==null?[]:[Ye]),Xw(le,ge,Ye))}var xD=Xse;function Zse(le){return lp(function(ge){return ge=Sl(ge,bf(wo)),Ho(function(Ye){var Pt=this;return le(ge,function(vr){return _f(vr,Pt,Ye)})})})}var Vy=Zse;var Yse=Vy(Sl),bD=Yse;var Kse=Ho,wD=Kse;var Jse=Math.min,$se=wD(function(le,ge){ge=ge.length==1&&Do(ge[0])?Sl(ge[0],bf(wo)):Sl(Qu(ge,1),bf(wo));var Ye=ge.length;return Ho(function(Pt){for(var vr=-1,Zr=Jse(Pt.length,Ye);++vrtle)return Ye;do ge%2&&(Ye+=le),ge=rle(ge/2),ge&&(le+=le);while(ge);return Ye}var m_=ale;var nle=Cy("length"),MD=nle;var CD="\\ud800-\\udfff",ile="\\u0300-\\u036f",ole="\\ufe20-\\ufe2f",sle="\\u20d0-\\u20ff",lle=ile+ole+sle,ule="\\ufe0e\\ufe0f",cle="["+CD+"]",NA="["+lle+"]",UA="\\ud83c[\\udffb-\\udfff]",fle="(?:"+NA+"|"+UA+")",kD="[^"+CD+"]",LD="(?:\\ud83c[\\udde6-\\uddff]){2}",PD="[\\ud800-\\udbff][\\udc00-\\udfff]",hle="\\u200d",ID=fle+"?",RD="["+ule+"]?",ple="(?:"+hle+"(?:"+[kD,LD,PD].join("|")+")"+RD+ID+")*",dle=RD+ID+ple,vle="(?:"+[kD+NA+"?",NA,LD,PD,cle].join("|")+")",ED=RegExp(UA+"(?="+UA+")|"+vle+dle,"g");function mle(le){for(var ge=ED.lastIndex=0;ED.test(le);)++ge;return ge}var DD=mle;function gle(le){return Cd(le)?DD(le):MD(le)}var Pd=gle;var yle=Math.ceil;function _le(le,ge){ge=ge===void 0?" ":ah(ge);var Ye=ge.length;if(Ye<2)return Ye?m_(ge,le):ge;var Pt=m_(ge,yle(le/Pd(ge)));return Cd(ge)?zp(Uh(Pt),0,le).join(""):Pt.slice(0,le)}var qg=_le;var xle=Math.ceil,ble=Math.floor;function wle(le,ge,Ye){le=Ds(le),ge=Go(ge);var Pt=ge?Pd(le):0;if(!ge||Pt>=ge)return le;var vr=(ge-Pt)/2;return qg(ble(vr),Ye)+le+qg(xle(vr),Ye)}var zD=wle;function Tle(le,ge,Ye){le=Ds(le),ge=Go(ge);var Pt=ge?Pd(le):0;return ge&&Pt-1;)sn!==le&&WD.call(sn,fn,1),WD.call(le,fn,1);return le}var qy=Ole;function Ble(le,ge){return le&&le.length&&ge&&ge.length?qy(le,ge):le}var Yw=Ble;var Nle=Ho(Yw),XD=Nle;function Ule(le,ge,Ye){return le&&le.length&&ge&&ge.length?qy(le,ge,wo(Ye,2)):le}var ZD=Ule;function jle(le,ge,Ye){return le&&le.length&&ge&&ge.length?qy(le,ge,void 0,Ye):le}var YD=jle;var Vle=Array.prototype,qle=Vle.splice;function Gle(le,ge){for(var Ye=le?ge.length:0,Pt=Ye-1;Ye--;){var vr=ge[Ye];if(Ye==Pt||vr!==Zr){var Zr=vr;np(vr)?qle.call(le,vr,1):jy(le,vr)}}return le}var Kw=Gle;var Hle=lp(function(le,ge){var Ye=le==null?0:le.length,Pt=cy(le,ge);return Kw(le,Sl(ge,function(vr){return np(vr,Ye)?+vr:vr}).sort(Ww)),Pt}),KD=Hle;var Wle=Math.floor,Xle=Math.random;function Zle(le,ge){return le+Wle(Xle()*(ge-le+1))}var Gy=Zle;var Yle=parseFloat,Kle=Math.min,Jle=Math.random;function $le(le,ge,Ye){if(Ye&&typeof Ye!="boolean"&&Oc(le,ge,Ye)&&(ge=Ye=void 0),Ye===void 0&&(typeof ge=="boolean"?(Ye=ge,ge=void 0):typeof le=="boolean"&&(Ye=le,le=void 0)),le===void 0&&ge===void 0?(le=0,ge=1):(le=sd(le),ge===void 0?(ge=le,le=0):ge=sd(ge)),le>ge){var Pt=le;le=ge,ge=Pt}if(Ye||le%1||ge%1){var vr=Jle();return Kle(le+vr*(ge-le+Yle("1e-"+((vr+"").length-1))),ge)}return Gy(le,ge)}var JD=$le;var Qle=Math.ceil,eue=Math.max;function tue(le,ge,Ye,Pt){for(var vr=-1,Zr=eue(Qle((ge-le)/(Ye||1)),0),ka=Array(Zr);Zr--;)ka[Pt?Zr:++vr]=le,le+=Ye;return ka}var $D=tue;function rue(le){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(le,ge[0],ge[1])?ge=[]:Ye>2&&Oc(ge[0],ge[1],ge[2])&&(ge=[ge[0]]),Xw(le,Qu(ge,1),[])}),Ez=jue;var Vue=4294967295,que=Vue-1,Gue=Math.floor,Hue=Math.min;function Wue(le,ge,Ye,Pt){var vr=0,Zr=le==null?0:le.length;if(Zr===0)return 0;ge=Ye(ge);for(var ka=ge!==ge,sn=ge===null,fn=Rf(ge),Li=ge===void 0;vr>>1;function Yue(le,ge,Ye){var Pt=0,vr=le==null?Pt:le.length;if(typeof ge=="number"&&ge===ge&&vr<=Zue){for(;Pt>>1,ka=le[Zr];ka!==null&&!Rf(ka)&&(Ye?ka<=ge:ka>>0,Ye?(le=Ds(le),le&&(typeof ge=="string"||ge!=null&&!By(ge))&&(ge=ah(ge),!ge&&Cd(le))?zp(Uh(le),0,Ye):le.split(ge,Ye)):[]}var Fz=oce;var sce="Expected a function",lce=Math.max;function uce(le,ge){if(typeof le!="function")throw new TypeError(sce);return ge=ge==null?0:lce(Go(ge),0),Ho(function(Ye){var Pt=Ye[ge],vr=zp(Ye,0,ge);return Pt&&Dp(vr,Pt),_f(le,this,vr)})}var Oz=uce;var cce=kd(function(le,ge,Ye){return le+(Ye?" ":"")+hy(ge)}),Bz=cce;function fce(le,ge,Ye){return le=Ds(le),Ye=Ye==null?0:cd(Go(Ye),0,le.length),ge=ah(ge),le.slice(Ye,Ye+ge.length)==ge}var Nz=fce;function hce(){return{}}var Uz=hce;function pce(){return""}var jz=pce;function dce(){return!0}var Vz=dce;var vce=bm(function(le,ge){return le-ge},0),qz=vce;function mce(le){return le&&le.length?Uy(le,Fc):0}var Gz=mce;function gce(le,ge){return le&&le.length?Uy(le,wo(ge,2)):0}var Hz=gce;function yce(le){var ge=le==null?0:le.length;return ge?Xf(le,1,ge):[]}var Wz=yce;function _ce(le,ge,Ye){return le&&le.length?(ge=Ye||ge===void 0?1:Go(ge),Xf(le,0,ge<0?0:ge)):[]}var Xz=_ce;function xce(le,ge,Ye){var Pt=le==null?0:le.length;return Pt?(ge=Ye||ge===void 0?1:Go(ge),ge=Pt-ge,Xf(le,ge<0?0:ge,Pt)):[]}var Zz=xce;function bce(le,ge){return le&&le.length?Bm(le,wo(ge,3),!1,!0):[]}var Yz=bce;function wce(le,ge){return le&&le.length?Bm(le,wo(ge,3)):[]}var Kz=wce;function Tce(le,ge){return ge(le),le}var Jz=Tce;var $z=Object.prototype,Ace=$z.hasOwnProperty;function Sce(le,ge,Ye,Pt){return le===void 0||nh(le,$z[Ye])&&!Ace.call(Pt,Ye)?ge:le}var qA=Sce;var Mce={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"};function Ece(le){return"\\"+Mce[le]}var Qz=Ece;var Cce=/<%=([\s\S]+?)%>/g,t2=Cce;var kce=/<%-([\s\S]+?)%>/g,e8=kce;var Lce=/<%([\s\S]+?)%>/g,t8=Lce;var Pce={escape:e8,evaluate:t8,interpolate:t2,variable:"",imports:{_:{escape:Mw}}},y_=Pce;var Ice="Invalid `variable` option passed into `_.template`",Rce=/\b__p \+= '';/g,Dce=/\b(__p \+=) '' \+/g,zce=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Fce=/[()=,{}\[\]\/\s]/,Oce=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,r2=/($^)/,Bce=/['\n\r\u2028\u2029\\]/g,Nce=Object.prototype,r8=Nce.hasOwnProperty;function Uce(le,ge,Ye){var Pt=y_.imports._.templateSettings||y_;Ye&&Oc(le,ge,Ye)&&(ge=void 0),le=Ds(le),ge=Em({},ge,Pt,qA);var vr=Em({},ge.imports,Pt.imports,qA),Zr=du(vr),ka=zy(vr,Zr),sn,fn,Li=0,bi=ge.interpolate||r2,Fi="__p += '",Uo=RegExp((ge.escape||r2).source+"|"+bi.source+"|"+(bi===t2?Oce:r2).source+"|"+(ge.evaluate||r2).source+"|$","g"),ws=r8.call(ge,"sourceURL")?"//# sourceURL="+(ge.sourceURL+"").replace(/\s/g," ")+` `:"";le.replace(Uo,function(Ws,Yl,cu,ih,Eh,Bp){return cu||(cu=ih),Fi+=le.slice(Li,Bp).replace(Bce,Qz),Yl&&(sn=!0,Fi+=`' + __e(`+Yl+`) + '`),Eh&&(fn=!0,Fi+=`'; `+Eh+`; __p += '`),cu&&(Fi+=`' + ((__t = (`+cu+`)) == null ? '' : __t) + '`),Li=Bp+Ws.length,Ws}),Fi+=`'; `;var mo=r8.call(ge,"variable")&&ge.variable;if(!mo)Fi=`with (obj) { `+Fi+` } `;else if(Fce.test(mo))throw new Error(Ice);Fi=(fn?Fi.replace(Rce,""):Fi).replace(Dce,"$1").replace(zce,"$1;"),Fi="function("+(mo||"obj")+`) { `+(mo?"":`obj || (obj = {}); `)+"var __t, __p = ''"+(sn?", __e = _.escape":"")+(fn?`, __j = Array.prototype.join; function print() { __p += __j.call(arguments, '') } `:`; `)+Fi+`return __p }`;var Ze=Vb(function(){return Function(Zr,ws+"return "+Fi).apply(void 0,ka)});if(Ze.source=Fi,fy(Ze))throw Ze;return Ze}var a8=Uce;var jce="Expected a function";function Vce(le,ge,Ye){var Pt=!0,vr=!0;if(typeof le!="function")throw new TypeError(jce);return kl(Ye)&&(Pt="leading"in Ye?!!Ye.leading:Pt,vr="trailing"in Ye?!!Ye.trailing:vr),_w(le,ge,{leading:Pt,maxWait:ge,trailing:vr})}var n8=Vce;function qce(le,ge){return ge(le)}var Wv=qce;var Gce=9007199254740991,GA=4294967295,Hce=Math.min;function Wce(le,ge){if(le=Go(le),le<1||le>Gce)return[];var Ye=GA,Pt=Hce(le,GA);ge=Mh(ge),le-=GA;for(var vr=ry(Pt,ge);++Ye-1;);return Ye}var n2=tfe;function rfe(le,ge){for(var Ye=-1,Pt=le.length;++Ye-1;);return Ye}var i2=rfe;function afe(le,ge,Ye){if(le=Ds(le),le&&(Ye||ge===void 0))return bb(le);if(!le||!(ge=ah(ge)))return le;var Pt=Uh(le),vr=Uh(ge),Zr=i2(Pt,vr),ka=n2(Pt,vr)+1;return zp(Pt,Zr,ka).join("")}var p8=afe;function nfe(le,ge,Ye){if(le=Ds(le),le&&(Ye||ge===void 0))return le.slice(0,xb(le)+1);if(!le||!(ge=ah(ge)))return le;var Pt=Uh(le),vr=n2(Pt,Uh(ge))+1;return zp(Pt,0,vr).join("")}var d8=nfe;var ife=/^\s+/;function ofe(le,ge,Ye){if(le=Ds(le),le&&(Ye||ge===void 0))return le.replace(ife,"");if(!le||!(ge=ah(ge)))return le;var Pt=Uh(le),vr=i2(Pt,Uh(ge));return zp(Pt,vr).join("")}var v8=ofe;var sfe=30,lfe="...",ufe=/\w*$/;function cfe(le,ge){var Ye=sfe,Pt=lfe;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}le=Ds(le);var Zr=le.length;if(Cd(le)){var ka=Uh(le);Zr=ka.length}if(Ye>=Zr)return le;var sn=Ye-Pd(Pt);if(sn<1)return Pt;var fn=ka?zp(ka,0,sn).join(""):le.slice(0,sn);if(vr===void 0)return fn+Pt;if(ka&&(sn+=fn.length-sn),By(vr)){if(le.slice(sn).search(vr)){var Li,bi=fn;for(vr.global||(vr=RegExp(vr.source,Ds(ufe.exec(vr))+"g")),vr.lastIndex=0;Li=vr.exec(bi);)var Fi=Li.index;fn=fn.slice(0,Fi===void 0?sn:Fi)}}else if(le.indexOf(ah(vr),sn)!=sn){var Uo=fn.lastIndexOf(vr);Uo>-1&&(fn=fn.slice(0,Uo))}return fn+Pt}var m8=cfe;function ffe(le){return zb(le,1)}var g8=ffe;var hfe={"&":"&","<":"<",">":">",""":'"',"'":"'"},pfe=dy(hfe),y8=pfe;var _8=/&(?:amp|lt|gt|quot|#39);/g,dfe=RegExp(_8.source);function vfe(le){return le=Ds(le),le&&dfe.test(le)?le.replace(_8,y8):le}var x8=vfe;var mfe=1/0,gfe=Rm&&1/zm(new Rm([,-0]))[1]==mfe?function(le){return new Rm(le)}:Y0,b8=gfe;var yfe=200;function _fe(le,ge,Ye){var Pt=-1,vr=Sm,Zr=le.length,ka=!0,sn=[],fn=sn;if(Ye)ka=!1,vr=Iy;else if(Zr>=yfe){var Li=ge?null:b8(le);if(Li)return zm(Li);ka=!1,vr=Gv,fn=new Dm}else fn=ge?[]:sn;e:for(;++Pt1||this.__actions__.length||!(Pt instanceof Bl)||!np(Ye)?this.thru(vr):(Pt=Pt.slice(Ye,+Ye+(ge?1:0)),Pt.__actions__.push({func:Wv,args:[vr],thisArg:void 0}),new Ip(Pt,this.__chain__).thru(function(Zr){return ge&&!Zr.length&&Zr.push(void 0),Zr}))}),F8=Nfe;function Ufe(){return Yb(this)}var O8=Ufe;function jfe(){var le=this.__wrapped__;if(le instanceof Bl){var ge=le;return this.__actions__.length&&(ge=new Bl(this)),ge=ge.reverse(),ge.__actions__.push({func:Wv,args:[g_],thisArg:void 0}),new Ip(ge,this.__chain__)}return this.thru(g_)}var B8=jfe;function Vfe(le,ge,Ye){var Pt=le.length;if(Pt<2)return Pt?Jp(le[0]):[];for(var vr=-1,Zr=Array(Pt);++vr1?le[ge-1]:void 0;return Ye=typeof Ye=="function"?(le.pop(),Ye):void 0,o2(le,Ye)}),H8=Kfe;var ds={chunk:qP,compact:C6,concat:k6,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:aR,initial:nR,intersection:iR,intersectionBy:oR,intersectionWith:sR,join:jR,last:wf,lastIndexOf:HR,nth:hD,pull:XD,pullAll:Yw,pullAllBy:ZD,pullAllWith:YD,pullAt:KD,remove:oz,reverse:g_,slice:Tz,sortedIndex:Cz,sortedIndexBy:kz,sortedIndexOf:Lz,sortedLastIndex:Pz,sortedLastIndexBy:Iz,sortedLastIndexOf:Rz,sortedUniq:Dz,sortedUniqBy:zz,tail:Wz,take:Xz,takeRight:Zz,takeRightWhile:Yz,takeWhile:Kz,union:w8,unionBy:T8,unionWith:A8,uniq:S8,uniqBy:M8,uniqWith:E8,unzip:Wy,unzipWith:o2,without:D8,xor:N8,xorBy:U8,xorWith:j8,zip:V8,zipObject:q8,zipObjectDeep:G8,zipWith:H8};var _c={countBy:Z6,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:rR,invokeMap:pR,keyBy:qR,map:Nm,orderBy:xD,partition:UD,reduce:rz,reduceRight:nz,reject:iz,sample:pz,sampleSize:mz,shuffle:bz,size:wz,some:Mz,sortBy:Ez};var HA={now:Ly};var Df={after:rL,ary:zb,before:qb,bind:Gb,bindKey:cP,curry:K6,curryRight:J6,debounce:_w,defer:oI,delay:sI,flip:BI,memoize:Nb,negate:Hv,once:gD,overArgs:TD,partial:Zw,partialRight:ND,rearg:tz,rest:uz,spread:Oz,throttle:n8,unary:g8,wrap:z8};var js={castArray:jP,clone:T6,cloneDeep:A6,cloneDeepWith:S6,cloneWith:M6,conformsTo:H6,eq:nh,gt:KI,gte:JI,isArguments:dd,isArray:Do,isArrayBuffer:mR,isArrayLike:jc,isArrayLikeObject:Su,isBoolean:gR,isBuffer:Kp,isDate:xR,isElement:bR,isEmpty:wR,isEqual:TR,isEqualWith:AR,isError:fy,isFinite:SR,isFunction:ap,isInteger:Bw,isLength:Mm,isMap:nw,isMatch:MR,isMatchWith:ER,isNaN:CR,isNative:LR,isNil:PR,isNull:IR,isNumber:Nw,isObject:kl,isObjectLike:Rl,isPlainObject:gv,isRegExp:By,isSafeInteger:FR,isSet:iw,isString:Vm,isSymbol:Rf,isTypedArray:Ed,isUndefined:OR,isWeakMap:BR,isWeakSet:NR,lt:ZR,lte:YR,toArray:Vw,toFinite:sd,toInteger:Go,toLength:Cw,toNumber:Th,toPlainObject:xw,toSafeInteger:c8,toString:Ds};var _p={add:Qk,ceil:VP,divide:fI,floor:NI,max:eD,maxBy:tD,mean:rD,meanBy:aD,min:sD,minBy:lD,multiply:uD,round:fz,subtract:qz,sum:Gz,sumBy:Hz};var __={clamp:GP,inRange:tR,random:JD};var dl={assign:OL,assignIn:s_,assignInWith:Em,assignWith:UL,at:sP,create:Y6,defaults:eI,defaultsDeep:iI,entries:p_,entriesIn:d_,extend:s_,extendWith:Em,findKey:LI,findLastKey:II,forIn:VI,forInRight:qI,forOwn:GI,forOwnRight:HI,functions:XI,functionsIn:ZI,get:uy,has:QI,hasIn:Ey,invert:uR,invertBy:fR,invoke:hR,keys:du,keysIn:Vc,mapKeys:KR,mapValues:JR,merge:nD,mergeWith:bw,omit:vD,omitBy:mD,pick:VD,pickBy:Hw,result:cz,set:gz,setWith:yz,toPairs:p_,toPairsIn:d_,transform:h8,unset:k8,update:L8,updateWith:P8,values:Ld,valuesIn:R8};var Id={at:F8,chain:Yb,commit:E6,lodash:_a,next:fD,plant:qD,reverse:B8,tap:Jz,thru:Wv,toIterator:o8,toJSON:Wm,value:Wm,valueOf:Wm,wrapperChain:O8};var ju={camelCase:UP,capitalize:Wb,deburr:Xb,endsWith:gI,escape:Mw,escapeRegExp:TI,kebabCase:VR,lowerCase:WR,lowerFirst:XR,pad:zD,padEnd:FD,padStart:OD,parseInt:BD,repeat:sz,replace:lz,snakeCase:Az,split:Fz,startCase:Bz,startsWith:Nz,template:a8,templateSettings:y_,toLower:s8,toUpper:f8,trim:p8,trimEnd:d8,trimStart:v8,truncate:m8,unescape:x8,upperCase:I8,upperFirst:hy,words:Zb};var ec={attempt:Vb,bindAll:uP,cond:V6,conforms:G6,constant:$0,defaultTo:$6,flow:UI,flowRight:jI,identity:Fc,iteratee:UR,matches:$R,matchesProperty:QR,method:iD,methodOf:oD,mixin:jw,noop:Y0,nthArg:pD,over:bD,overEvery:AD,overSome:SD,property:vw,propertyOf:GD,range:QD,rangeRight:ez,stubArray:yy,stubFalse:ay,stubObject:Uz,stubString:jz,stubTrue:Vz,times:i8,toPath:l8,uniqueId:C8};function Jfe(){var le=new Bl(this.__wrapped__);return le.__actions__=ff(this.__actions__),le.__dir__=this.__dir__,le.__filtered__=this.__filtered__,le.__iteratees__=ff(this.__iteratees__),le.__takeCount__=this.__takeCount__,le.__views__=ff(this.__views__),le}var W8=Jfe;function $fe(){if(this.__filtered__){var le=new Bl(this);le.__dir__=-1,le.__filtered__=!0}else le=this.clone(),le.__dir__*=-1;return le}var X8=$fe;var Qfe=Math.max,ehe=Math.min;function the(le,ge,Ye){for(var Pt=-1,vr=Ye.length;++Pt0||ge<0)?new Bl(Ye):(le<0?Ye=Ye.takeRight(-le):le&&(Ye=Ye.drop(le)),ge!==void 0&&(ge=Go(ge),Ye=ge<0?Ye.dropRight(-ge):Ye.take(ge-le)),Ye)};Bl.prototype.takeRightWhile=function(le){return this.reverse().takeWhile(le).reverse()};Bl.prototype.toArray=function(){return this.take($8)};cp(Bl.prototype,function(le,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__,sn=Pt?[1]:arguments,fn=ka instanceof Bl,Li=sn[0],bi=fn||Do(ka),Fi=function(Yl){var cu=vr.apply(_a,Dp([Yl],sn));return Pt&&Uo?cu[0]:cu};bi&&Ye&&typeof Li=="function"&&Li.length!=1&&(fn=bi=!1);var Uo=this.__chain__,ws=!!this.__actions__.length,mo=Zr&&!Uo,Ze=fn&&!ws;if(!Zr&&bi){ka=Ze?ka:new Bl(this);var Ws=le.apply(ka,sn);return Ws.__actions__.push({func:Wv,args:[Fi],thisArg:void 0}),new Ip(Ws,Uo)}return mo&&Ze?le.apply(this,sn):(Ws=this.thru(Fi),mo?Pt?Ws.value()[0]:Ws.value():Ws)})});Nh(["pop","push","shift","sort","splice","unshift"],function(le){var ge=che[le],Ye=/^(?:push|sort|unshift)$/.test(le)?"tap":"thru",Pt=/^(?:pop|shift)$/.test(le);_a.prototype[le]=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(le,ge){var Ye=_a[ge];if(Ye){var Pt=Ye.name+"";Q8.call(Tm,Pt)||(Tm[Pt]=[]),Tm[Pt].push({name:ge,func:Ye})}});Tm[ty(void 0,she).name]=[{name:"wrapper",func:void 0}];Bl.prototype.clone=W8;Bl.prototype.reverse=X8;Bl.prototype.value=Y8;_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;K8&&(_a.prototype[K8]=Id.toIterator);var Jc=_a;var Rd=uX(rF());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;ghe(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);nF(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);nF(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=oF();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(fn){ge.handle_plotly_restyle(fn)}),ge.el.on("plotly_relayout",function(fn){ge.handle_plotly_relayout(fn)}),ge.el.on("plotly_update",function(fn){ge.handle_plotly_update(fn)}),ge.el.on("plotly_click",function(fn){ge.handle_plotly_click(fn)}),ge.el.on("plotly_hover",function(fn){ge.handle_plotly_hover(fn)}),ge.el.on("plotly_unhover",function(fn){ge.handle_plotly_unhover(fn)}),ge.el.on("plotly_selected",function(fn){ge.handle_plotly_selected(fn)}),ge.el.on("plotly_deselect",function(fn){ge.handle_plotly_deselect(fn)}),ge.el.on("plotly_doubleclick",function(fn){ge.handle_plotly_doubleclick(fn)});var sn=new CustomEvent("plotlywidget-after-render",{detail:{element:ge.el,viewID:ge.viewID}});document.dispatchEvent(sn)})}_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,aF)}getFullLayout(){return Jc.mergeWith({},this.el._fullLayout,this.el.layout,aF)}buildPointsObject(ge){var Ye;if(ge.hasOwnProperty("points")){var Pt=ge.points,vr=Pt.length,Zr=!0;for(let bi=0;bi=0;vr--)Pt.splice(0,0,le[ge[vr]]),le.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]=sn)}else typeof Zr=="object"&&!Array.isArray(Zr)?Ye[Pt]=x_(Zr,{}):Zr!==void 0&&typeof Zr!="function"&&(Ye[Pt]=Zr)}}return Ye}function oF(le,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,sn,fn;for(ka=2;vr===1/0;ka*=2)vr=Math.log(Math.pow(2,ge/ka))/Math.log(Ye)*ka;var Li=vr-Math.floor(vr);for(ka=0;ka=Math.pow(2,ge)?Pt>10?(console.warn("randstr failed uniqueness"),Zr):oF(le,ge,Ye,(Pt||0)+1):Zr}var EHe=()=>{let le;return{initialize(ge){le=new XA(ge.model,phe),le.initialize()},render({el:ge}){let Ye=new ZA(le,ge);return Ye.perform_render(),()=>Ye.remove()}}};export{XA as FigureModel,ZA as FigureView,EHe 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 *) */